imread() imshow OpenEXR example [closed]
Please share the link or give example how to load and show openEXR images in c++
Asked: 2015-09-11 07:31:36 -0600
Seen: 2,865 times
Last updated: Sep 11 '15
unfortunately, there's no sample for this, but you can just imread() it like any other image, too.
this will ofc. only work, if exr support was compiled into opencv , so the 1st thing to do is check for that, either look for HAVE_OPENEXR in cvconfig.h, or do a
cerr << cv::getBuildInformation();
and look for OPENEXR: ON/OFFif it's not in, you'll have to rebuild opencv WITH_OPENEXR=ON
I have build opencv WITH_OPENEXR=ON.
Media I/O: ZLib: build (ver 1.2.7) JPEG: build (ver 62) PNG: build (ver 1.5.12) TIFF: build (ver 42 - 4.0. JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1)
But then I run , I get only black image
`main(){Mat image; const string name ("C:\rgb-d\img.exr"); image = imread(name); // Read the file namedWindow( "window", WINDOW_AUTOSIZE ); // Create a window for display.
sorry, i'm out of ideas.
try
const string name ("C:\\rgb-d\\img.exr");
orconst string name ("C:/rgb-d/img.exr");