imread() imshow OpenEXR example [closed]

asked 2015-09-11 07:31:36 -0600

Dezintegrator gravatar image

Please share the link or give example how to load and show openEXR images in c++

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-23 08:30:34.145195

Comments

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/OFF

if it's not in, you'll have to rebuild opencv WITH_OPENEXR=ON

berak gravatar imageberak ( 2015-09-11 07:44:57 -0600 )edit

I have build opencv WITH_OPENEXR=ON.

cerr << cv::getBuildInformation():

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.

if(!image.empty()){
    imshow("window", image);
}

waitKey(0);} // Wait for a keystroke in the window`
Dezintegrator gravatar imageDezintegrator ( 2015-09-11 08:15:57 -0600 )edit

sorry, i'm out of ideas.

berak gravatar imageberak ( 2015-09-11 08:40:37 -0600 )edit
1

try const string name ("C:\\rgb-d\\img.exr"); or const string name ("C:/rgb-d/img.exr");

sturkmen gravatar imagesturkmen ( 2015-09-11 09:08:09 -0600 )edit