1 | initial version |
1:) you got the imread flags wrong
2.) no, it can't read float images from a .tif (.exr would be another thing) you will have to:
image = imread(a, CV_LOAD_IMAGE_ANYDEPTH); // Read the file, keep it 16 bits, if it was so
Mat img_float;
image.convertTo(img_float, CV_32F);
// .. use img_float ..
2 | No.2 Revision |
1:) you got the imread flags wrong
2.) no, it can't read float images from a .tif (.exr would be another thing) you will have to:
image = imread(a, CV_LOAD_IMAGE_ANYDEPTH); // Read the file, keep it 16 bits, if it was so
so originally
image = imread(a, CV_LOAD_IMAGE_ANYDEPTH);
Mat img_float;
image.convertTo(img_float, CV_32F);
// .. use img_float ..
3 | No.3 Revision |
1:) you got the imread flags wrong
2.) no, it can't read float images from a .tif (.exr would be another thing) you will have to:to do it in 2 steps:
// 1. Read the file, keep it 16 bits, if it was so originally
originally:
image = imread(a, CV_LOAD_IMAGE_ANYDEPTH);
// 2. convert the img to float:
Mat img_float;
image.convertTo(img_float, CV_32F);
// .. use img_float ..