The program I use reads some bitmaps and expects 32FC1 images.
I'm trying to create these images
cv::Mat M1(255, 255, CV_32FC1, cv::Scalar(0,0,0)); cv::imwrite( "my_bitmap.bmp", M1 );
but when I check the depth it is always CV_8U
How can I create files so that they contain the correct information?
Update : it doesn't matter if I use another file extension - for example. tif or png
I read it - using the code already implemented - with cvLoadImage .
I'm trying to CREATE files that existing code can use - which checks the type of image.
I cannot convert files to existing code. Existing code does not attempt to read a random type of image and convert it to the desired type, but checks that the files are of the correct type.
I found out - thanks for the answers that cv :: imwrite only writes images of integer type.
Is there any other way - either using OpenCV, or something else - to record images so that in the end I get CV_32F?
Refresh again: Code for reading image ... if in cv :: Mat:
cv::Mat x = cv::imread(x_files, CV_LOAD_IMAGE_ANYDEPTH|CV_LOAD_IMAGE_ANYCOLOR);
Existing Code:
IplImage *I = cvLoadImage(x_files.c_str(), CV_LOAD_IMAGE_ANYDEPTH|CV_LOAD_IMAGE_ANYCOLOR);