Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undistortPoints, given R has no effect on result #21891

Closed
crackwitz opened this issue Apr 21, 2022 · 2 comments
Closed

undistortPoints, given R has no effect on result #21891

crackwitz opened this issue Apr 21, 2022 · 2 comments

Comments

@crackwitz
Copy link
Contributor

crackwitz commented Apr 21, 2022

Documentation says that R will be applied if given.

> For each observed point coordinate (u,v) the function computes: [...]

Actual behavior: giving a non-identity R appears to have no effect on the result.

The affected function appears to be cvUndistortPointsInternal and the involved variables are: matR (CvMat* parameter), _RR (local CvMat), RR (local C array used in the calculation).

related discussion including reproducer: https://forum.opencv.org/t/why-r-is-not-considered-in-cv2-undistortpoints/8483 and issue

@crackwitz crackwitz changed the title undistortPoints given R but not P, behavior and documentation disagree undistortPoints given R, behavior and documentation disagree Apr 21, 2022
@crackwitz crackwitz changed the title undistortPoints given R, behavior and documentation disagree undistortPoints, given R has no effect on result Apr 21, 2022
@victor1234
Copy link
Contributor

Please provide minimal reproducible example

@crackwitz
Copy link
Contributor Author

Thank you for prompting me to re-examine this. I executed that user's code without checking exactly the function signature. The issue doesn't actually exist.

The function signature is

undistortPoints(src, cameraMatrix, distCoeffs[, dst[, R[, P]]]) -> dst

The user's code accidentally passed R, P in the parameters of dst, R. Using keyword arguments (Python feature), or passing None in place of dst will show the proper behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants