Ask Your Question

taha's profile - activity

2019-11-02 11:14:36 -0600 received badge  Notable Question (source)
2016-12-14 08:45:32 -0600 received badge  Popular Question (source)
2015-06-12 03:31:47 -0600 received badge  Student (source)
2015-05-27 02:09:21 -0600 asked a question triangulatePoints() function

I don't understand what exactly projPoints1 and projPoints2 are in triangulatePoints() built-in function of calib3d module. Here is the C++ API of triangulatePoints():

void triangulatePoints(InputArray projMatr1, InputArray projMatr2, InputArray projPoints1, InputArray projPoints2, OutputArray points4D)

When a point is detected in left and right images, do we have to use undistortPoints() function of imgproc module in order to obtain collinear points and then send the results to triangulatePoints() as projPoints1 and projPoints2? OR is it the right way to send detected 2D image point (including lens distortions) directly to triangulatePoints()? In OpenCV documentation of triangulatePoints() it just says

projPoints1 – 2xN array of feature points in the first image projPoints2 – 2xN array of feature points in the second image

where N is number of features. MATLAB Computer Vision Toolbox has a similar triangulation function, and before using triangulate function in there, they undistort detected feature coordinates. See this example:

http://www.mathworks.com/help/vision/...

They have a warning in this page:

The triangulate function does not account for lens distortion. You can undistort the images using the undistortImage function before detecting the points. Alternatively, you can undistort the points themselves using the undistortPoints function.

I wonder if it is the same in OpenCV too or not. I would be happiest person in the world if someone can respond.

2015-03-12 08:32:20 -0600 commented question Why do we pass R and P to undistortPoints() fcn (calib3d module)?

I have noticed that they are optional. On the other hand, I already used stereoRectify() fcn and obtained these optional R and P matrices. I did not understand the logic. What is the reason for passing these matrices to undistortPoints()?

2015-03-11 23:19:16 -0600 asked a question Why do we pass R and P to undistortPoints() fcn (calib3d module)?

I have two AVT Manta G125B cameras. I made individual calibrations of the cameras, and then stereo calibration. I am trying to triangulate a point of interest in real-time. I noticed that triangulatePoints() function of calib3d module accepts undistorted image point coordinates as input so I need to use undistortPoints() function to obtain ideal point coordinates. As far as I know, it must be sufficient to pass only cameraMatrix and distCoeffs parameters to undistortPoints. By finding nonlinear least squares solution, undistortPoints() must provide solution. I did not understand why we need to pass R and P (obtained with stereoRectify() fcn) to undistortPoints.

void undistortPoints(InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, InputArray R=noArray(), InputArray P=noArray())