Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with reading an image using "cv::imread" function in OpenCv

I have got a problem with some basic OpenCV code. Here is my code:

 cv::Mat src;
 src=imread("Calibration.bmp",0);

 if (src.empty())
  cout << "Cannot load image" << " ";
 else
  cout << src.cols << " " << src.rows << " ";

Unfortunatelly cv::imread returns NULL matrix with any kind of input image (I have tried .bmp, .jpg). The filename seems to be working fine (program does not end with error), as using wrong filename generates an error message. I have tried using oldstyle "CvLoadImage" but same result occurred. Does anyone have any idea how to fix this?

like image 923
Marcin Avatar asked Apr 06 '10 11:04

Marcin


1 Answers

Ok, I fixed the problem... Problem arises when you are mixing up release and debug OpenCV libs. I've changed paths and libs names in project properties and "cv::imread" works just fine.

like image 81
Marcin Avatar answered Sep 24 '22 19:09

Marcin