Ask Your Question

flag to load float 32-bit image

asked 2020-04-17 03:37:54 -0500

NL37 gravatar image


I am trying to read a float 32-bit image in c++. For that, i use the following code :

cv::Mat Dark_Image = cv::imread("/home/jetson/Documents/flat_fiel_correction/Dark_image.tif", cv::IMREAD_ANYDEPTH);

The image is loaded in 8-bit, and not in 32-bits .. The flag doesn't work. Any idea ..?

Thank you !

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-04-17 06:58:39 -0500

Horst gravatar image

Did you try to use the flag "IMREAD_UNCHANGED" (-1) ??

edit flag offensive delete link more



Yes, I've tried. And it is always encoded in uchar

NL37 gravatar imageNL37 ( 2020-04-17 07:06:30 -0500 )edit

Hmm, have you checked the original depth of the image? Via right click in image properties (windows) or terminal $ identify /imagepath (ubuntu)?

Horst gravatar imageHorst ( 2020-04-17 09:33:49 -0500 )edit

Question Tools

1 follower


Asked: 2020-04-17 03:37:54 -0500

Seen: 428 times

Last updated: Apr 17 '20