-
Notifications
You must be signed in to change notification settings - Fork 728
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
camera_calibration: Fix all-zero distortion coeffs returned for a rational_polynomial model #433
camera_calibration: Fix all-zero distortion coeffs returned for a rational_polynomial model #433
Conversation
Using an output variable to return values from cv2.calibrateCamera() does not appear to work in OpenCV 4.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some clarity needed + a link to something documenting the bug this is resolving would be great
I have not created an issue regarding this. Should I create one? |
|
I thought you had tracked down this is an OpenCV issue, if it is, you should definitely file a bug with them. |
I took a closer look at the I suppose this could be considered an OpenCV bug, but since the more typical and reliable way of retrieving the output via a return value works, I'm not sure it's worth creating a bug report for this. |
Fair enough. This looks good to me, can you give me a "yes I have tested this sufficiently to my liking to be comfortable merging this" statement? I don't have the hardware at this moment on travel to evalulate. Then merging is OK by me with a second approval from probably @JWhitleyAStuff |
Sure - yes, I would be comfortable merging this. The changes are quite straightforward and the unit tests pass on both my machine and the CI. I also checked the stereo calibration code for similar issues and did not find anything there. |
Ok, did you test this on an actual camera in real life? CI is good, but hardware is great. |
Yep, I have tested and used it on real camera data. Both |
I'm honestly not familiar enough with what's going on in this PR to provide my stamp of approval so I'll leave this one up to @SteveMacenski. Merge at your leisure. |
@JWhitleyAStuff even without being familiar with the thing happening under the hood, I think its clear to show that instead of an implicit-output, its having a hard output and for whatever reason in the Python wrapper for OpenCV that solves this issue (which a little different data representation in numpy) I dont see anything here that changes an algorithm or usage so I'm OK merging it if its been tested to work on hardware such that all the places with the new dimensions are correct |
…ional_polynomial model (ros-perception#433) * Fix empty distortion coeffs returned for a rational_polynomial model Using an output variable to return values from cv2.calibrateCamera() does not appear to work in OpenCV 4.1. * Remove the redundant distCoeffs parameter from cv2.calibrateCamera() * Set the shape of distortion_coefficients correctly in YAML output Fixes ros-perception#278
…ional_polynomial model (#433) * Fix empty distortion coeffs returned for a rational_polynomial model Using an output variable to return values from cv2.calibrateCamera() does not appear to work in OpenCV 4.1. * Remove the redundant distCoeffs parameter from cv2.calibrateCamera() * Set the shape of distortion_coefficients correctly in YAML output Fixes #278
…ional_polynomial model (#433) * Fix empty distortion coeffs returned for a rational_polynomial model Using an output variable to return values from cv2.calibrateCamera() does not appear to work in OpenCV 4.1. * Remove the redundant distCoeffs parameter from cv2.calibrateCamera() * Set the shape of distortion_coefficients correctly in YAML output Fixes #278
Using
--k-coefficients
greater than 3 with cameracalibrator.py currently returns a distortion coefficients array of all zeroes. I suppose this could be related to OpenCV version, which is 4.1.0 on my machine.This is fixed by simply using the return values of
cv2.calibrateCamera()
instead of output variables to retrieve the distortion coefficients output.