Ask Your Question
0

imread not working

asked 2015-02-11 08:46:32 -0500

aries gravatar image

I am trying a simple program to read an image and display it. However, imread is not reading the image. I checked on the internet but many told that its because of mixing debug library and release library. How do I know which library i am using? Is it someother issue? please help.

src = imread("colorchart.bmp", CV_LOAD_IMAGE_COLOR); if(! src.data ) // Check for invalid input { cout << "Could not open or find the image" << std::endl ; return -1; } imshow( source_window, src );

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
4

answered 2015-02-11 08:59:15 -0500

berak gravatar image
  • make sure the path is correct, try an absolute one : imread("d:/my/images/colorchart.bmp")
  • make sure, you link debug libs with a debug build (they all should end with 'd'), and release ones for a release build (without d for all of them)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-02-11 08:46:32 -0500

Seen: 2,056 times

Last updated: Feb 11 '15