How to use the MultiCameraCalibration Class to calibrate two stereo cameras?

asked 2017-07-22 14:38:35 -0500

Currently, I am trying to implement a depth estimation algorithm similar to that of MatLAB's implementation: Depth Estimation with MatLAB.

Right now, I am trying to calibrate the 2 stereo cameras using the MultiCameraCalibration class by referring to the OpenCV tutorial:OpenCV Multiple Camera Calibration.

I have a few questions:

  1. Do you have to calibrate each camera individually, before running the multiCameraCalibration class methods?
  2. "to calibrate the extrinsic parameters, one pattern need to be viewed by multiple cameras (at least two) at the same time.", does this mean I have to take a picture with both cameras opened at the same time or am I supposed to take a picture from each camera from a single position?
  3. How do I use imagelist_creator, currently I see it as a .cpp file from my samples folder, how do I run it as a command? Furthermore, I have also referred to this link: Calibrating Camera with Square Chessboard , and it stated one must first navigate to the bin folder, and then run it, however the imagelist_creator instance is not included in that folder.
edit retag flag offensive close merge delete


I just discovered the existence of a "ccalib-example-multi_cameras_calibration.exe", can I simply run this and calibrate my camera? Furthermore I still can't locate an executable for imaglist_creator...

Leopard gravatar imageLeopard ( 2017-07-22 15:34:26 -0500 )edit

I don't think there is an imagelist_creator . You have a file example here

LBerger gravatar imageLBerger ( 2017-07-22 15:49:51 -0500 )edit

actually I just copied the contents of the imagelist_creator.cpp into an empty c++ project and compiled it to create an executable, however I am facing a problem in which none of the images are being added to the list...

Leopard gravatar imageLeopard ( 2017-07-22 16:16:30 -0500 )edit

You need only those line to create an image list :

  FileStorage fs(outputname, FileStorage::WRITE);
  fs << "images" << "[";
  for(int i = 2; i < ac; i++){
    fs << string(av[i]);
  fs << "]";
LBerger gravatar imageLBerger ( 2017-07-22 16:25:25 -0500 )edit

In the command line if I type the command:

Project.exe imagelist.yaml *.jpg, instead of iterating through all the jpg files in the directory it simply just outputs *.jpg as the only file name present in the image list.

Leopard gravatar imageLeopard ( 2017-07-22 16:35:40 -0500 )edit