Ask Your Question

kazarey's profile - activity

2016-09-23 04:02:38 -0500 received badge  Enthusiast
2016-09-15 06:33:02 -0500 received badge  Editor (source)
2016-09-15 06:09:57 -0500 asked a question Stereo calibration sample doesn't work

I am having trouble trying to calibrate a pair of cameras by the OpenCV sample. I have my code compiled and launched successfully. The .xml file with the list of images is found, and the chessboard on the images is detected. But the execution cannot finish without throwing an exception.

The most irritating part is that I get a new exception every time: I get exceptions at different lines and even at different image pair being processed. The exceptions concern memory access violations. For example, I get the message like this:

Exception thrown at 0x00007FF7B11C413F in stereo_calib.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

at the following lines (according to the call stack:)

133 goodImageList.push_back(imagelist[i * 2]);
151 objectPoints.resize(nimages);
130 cornerSubPix(img, corners, Size(11, 11), Size(-1, -1),

Occasionally I get the following error:

Unhandled exception at 0x00007FFE7156A1C8 in stereo_calib.exe: Microsoft C++ exception: cv::Exception at memory location 0x000000C2B68CA950.

OpenCV Error: Assertion failed (nimages > 0 && nimages == (int) && (!imgPtMat2 || nimages == (int) in cv::collectCalibrationData, file C:\buildslave64\win64_amdocl\master_PackSlave-win64-vc14-shared\opencv\modules\calib3d\src\calibration.cpp, line 3054

having the call stack pointing here:

163 cameraMatrix[0] = initCameraMatrix2D(objectPoints, imagePoints[0], imageSize, 0);

I can't understand the pattern. Each time I have a different number of images processed successfully and each time I get an error at a random line of code.

I wonder if it has something to do with my environment. It is the following: OpenCV 3.1.0, Windows 10, Visual Studio 2015 Update 3, x64.

Could you please hint me what's wrong here?

I have the sample completely copy-pasted; some lines inconsistencies are possible seemingly due to the Visual Studio auto formatting