Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open CV + Visual Studio 2008 weird Debugging problem

I've recently installed OpenCV2.0 under Visual Studio 2008 professional edition, built the libraries, dll-s and got everything working but when I run the first example program:

#include “highgui.h”
int main( int argc, char** argv ) {
IplImage* img = cvLoadImage( argv[1] );
cvNamedWindow( “Example1”, CV_WINDOW_AUTOSIZE );
cvShowImage( “Example1”, img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( “Example1” );
}

It goes straight into Debug mode with the following exception : Unhandled exception at 0x7855b9f0 in HelloOpenCV.exe: 0xC0000005: Access violation reading location 0x00000000.

It also switches to a "loadsave.cpp" file and it points to the line:

return (IplImage*)cv::imread_(filename, iscolor, cv::LOAD_IMAGE );

At the stack point : > highgui200.dll!cvLoadImage(const char * filename=0x00000000, int iscolor=1) Line 474 + 0x13 bytes C++

I also made a printscreen with the visual studio debugging window link text

I presume it has something to do with misplaced dependencies , problems with the dll-s. If anyone has an idea of what I could do to fix this please answer and I will be forever grateful.

Thanks, Alex

like image 311
Hazerd Avatar asked Jul 30 '26 08:07

Hazerd


1 Answers

Did you specify a valid file in your command-line parameters for argv[1], i.e. the filename of the image to be read?

like image 189
Jacob Avatar answered Jul 31 '26 22:07

Jacob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!