-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add more callibration parameters to the pinhole camera model #31
Conversation
cv-pinhole/src/radial.rs
Outdated
for &camera_r in &test_values { | ||
let corrected = distortion.calibrate(camera_r); | ||
let reprojected = distortion.uncalibrate(corrected); | ||
assert_eq!(camera_r, reprojected); |
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.
The inverse being exact happens to work on my machine, but may not be stable across architectures. I should replace this with a fuzzy comparison.
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.
Take a look at this crate: https://docs.rs/approx/0.4.0/approx/.
If you don't mind, I actually would like this to go into the integration tests folder (tests
folder) for better visibility since this doesn't test anything internal to the crate. I like to do that so people can see examples of usage there.
cv-pinhole/src/radial.rs
Outdated
@@ -0,0 +1,161 @@ | |||
//! Radial distortion model | |||
|
|||
use num_traits::Float; |
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.
To get around the check failure on this line, just use Float::method(f)
. Basically, use the Float
trait method using the static method syntax instead of the f.method()
syntax, which will prevent any unused import errors. This happens because when std
is enabled it uses those primitive methods rather than the ones on Float
.
@mpizenberg is currently in the process of updating everything to the latest nalgebra with const generics. Once that is merged, I will work on getting this PR ready. If you have any tips on what still needs to be done, just let me know. |
I did attempt to rebase this on current |
Note that it is a dev-dependency only used for testing, so it should not cause trouble outside of development of the crate itself, i.e. cross-platform support should not be an issue.
Computing reference results is only necessary because test-cases are automatically generated using |
Ahh, my bad, I assumed that |
No description provided.