GreycLab / CImg

The CImg Library is a small and open-source C++ toolkit for image processing
http://cimg.eu
Other
1.46k stars 278 forks source link

get_MAT returns empty Mat #399

Open noblockhit opened 10 months ago

noblockhit commented 10 months ago

I use CImg to load a NEF file, show it (which works perfectly fine) but then when i try to convert it to a mat for further inspection in opencv it silently fails and when i display the cv mat on screen i just get an empty gray window. This is the relevant snippet of code:


   CImg<float> image;
   image.load(img_path.c_str());
   Mat frameIn = image.get_MAT();
   Mat frameOut;
   cv::resize(frameIn, frameOut, cv::Size(), 0.25, 0.25);
   imshow("I", frameOut);

BTW: if i could convert it to an HBITMAP for the win32 application i want to actually display into afterwords could be sufficient using a couple workarounds on my side!

I do the resizing bcs the image is huge but it also doesnt work with showing it directly