Bug in undistortPoints(...) documentation (Bug #1964)


Added by Federico Perazzi almost 13 years ago. Updated almost 13 years ago.


Status:Cancelled Start date:2012-05-20
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:documentation
Target version:2.4.1
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

The documentation states that points returned in OutputArray dst will be in pixels coordinates but they are actually in normalized image coordinates.

// (u,v) is the input point, (u', v') is the output point
// camera_matrix=[fx 0 cx; 0 fy cy; 0 0 1]
// P=[fx' 0 cx' tx; 0 fy' cy' ty; 0 0 1 tz]
x" = (u - cx)/fx
y" = (v - cy)/fy
(x',y') = undistort(x",y",dist_coeffs)
[X,Y,W]T = R*[x' y' 1]T
x = X/W, y = Y/W

------------------------------------------------------------------
THIS STEP IS NOT PERFORMED INSIDE THIS FUNCTION 
-----------------------------------------------------------------
u' = x*fx' + cx'
v' = y*fy' + cy'

Associated revisions

Revision 159cc29b
Added by Vadim Pisarevsky almost 13 years ago

fixed undistortPoints description (ticket #1964)

History

Updated by Kirill Kornyakov almost 13 years ago

  • Description changed from The documentation states that points returned in @OutputArray dst@ will be in... to The documentation states that points returned in @OutputArray dst@ will be in... More
  • Category set to documentation

Updated by Vadim Pisarevsky almost 13 years ago

Transformation coefficients of the output coordinates: fx', cx', fy', cy' are encoded in P matrix. If it is identity or omitted, the scaling is not performed. If you set P=cameraMatrix, the scaling (i.e. the last step) will be performed.

  • Status changed from Open to Cancelled
  • Target version set to 2.4.1
  • Assignee set to Vadim Pisarevsky

Updated by Federico Perazzi almost 13 years ago

Coefficients are also encoded in the camera matrix that is passed as second argument, so they should be used if not any different projection matrix is passed as last argument. I think this function behavior should be better documented.

Updated by Federico Perazzi almost 13 years ago

Federico Perazzi wrote:

Coefficients are also encoded in the camera matrix that is passed as third argument, so they should be used if not any different projection matrix is passed as last argument. I think this function behavior should be better documented.

Also available in: Atom PDF