Ask Your Question

Revision history [back]

You right, you have to configure your cameras.

  1. Just to be sure your're okay with the calibration basis, see this tutorial.
  2. After that, calibrate your camera with stereoCalibrate function. See the sample in cpp/stereo_calib.cpp and eventually the book chapter associated. If you want to see the point cloud associated with the disparity maps, see the sample cpp/stereo_match.cpp (or python2/stereo_match.py)
  3. To select points on the image, see the [SetMouseCallback](http://docs.opencv.org/modules/highgui/doc/user_interface.html?highlight=setmousecallback#void setMouseCallback(const string& winname, MouseCallback onMouse, void* userdata) function, and some samples, like cpp/filldemo.cpp or cpp/LKdemo.cpp
  4. Reproject these points in 3D with triangulatePoints function.
  5. Compute distances (euclidean I assume) between 3D points...

For the expected precision, it's related to your calibration process (remember, you must calibrate your cameras when they are attached together!), the size of your object to measure, and the resolution available. Don't expected to obtain millimeter accuracy if your pixels are bigger than that...

I you need a real interface for your users, look at the QT functionalities with OpenCV.