Search code examples
c++opencvubuntustereo-3dcalibration

How to use calibration.cpp of opencv in sample (ubuntu opencv 2.4.12)


I don't know how to use calibration.cpp in opencv2.4.12 sample in ubuntu.

I tried to write command line

./calibrayion -w 6 -h 4 -pt chessboard -o camera.yml -op -oe stereo_calibl.xml

Result:

Could not initialize video (0) capture

stereo_calib.xml content

   "left01.jpg"
   "right01.jpg"
   "left02.jpg"
   "right02.jpg"
   "left03.jpg"
   "right03.jpg"
   "left04.jpg"
   "right04.jpg"
       ...
   "left11.jpg"
   "right11.jpg"
   "left12.jpg"
   "right12.jpg"

Solution

  • It seems your xml file is formatted incorrectly, and the program tried to open a camera capture. Consider https://github.com/Itseez/opencv/blob/master/samples/cpp/calibration.cpp for information about expected format, it also provides instructions on how to generate valid xml.