0

I want to run the OpenCv Stereo Calib sample. But I have a error message like "0 pairs have been successfully detected. Error: too little pairs to run the calibration "

I created a folder under data folder. It's name is Stereo. And there is a pair of image like 1.jpg and 2.jpg in the stereo folder. When I run the program I have error message mentioned above.

You can see my pictures in the attachment.

What should I do? How can I run this example?

Stereo image pair 1:

enter image description here

Stereo image pair 2:

enter image description here

Sabuncu
  • 5,095
  • 5
  • 55
  • 89
zegufe
  • 1
  • 1

2 Answers2

1

I assume it's your filenames. Check out https://github.com/Itseez/opencv/blob/master/samples/data/stereo_calib.xml on how your input file should look like. Your image pairs should be named something like "left01.jpg", "right01.jpg" or "up01.jpg", "down01.jpg" respectively.

Another thing I could think of is the number of corners you enter, it's not to be confused with the number of squares. So in your sample picture it would be cv::Size(4, 6).

On another note: the images you uploaded here have a very low resolution and it looks like the board is wavy. Both may negatively affect the RMS error.

jodis
  • 158
  • 1
  • 8
  • Thank you for your help @jodis. Now my problem is easier. I want to run OpenCV stereo_calib sample. I don't any changes in code or image or other data. I built the all samples in OpenCV. I can run other samples. For example cpp-example-facedetect and many other samples work correctly. But when I run the cpp-example-stereo_calib, the program display an error message like "0 pairs have been successfully detected. Error: too little pairs to run the calibration". I checked again and I have all necessary data like left and right image and stereo_calib.xml – zegufe Apr 09 '16 at 10:28
  • Well, that means that it runs but it does not detect stereo pairs. Check my edit for another possible cause. That's all I can think of right now. – jodis Apr 10 '16 at 22:07
0

I had the same issue, As the previous poster said; reference the stereo_calib.xml for file names.

I fixed it by simply renaming the files and putting them directly into the same directory as the executable. there seems to be an issue ( at least in windows 10 ) with the way paths get resolved. ( just a guess )

rovr
  • 11
  • 1