-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Camera Intrinsics & compute ray direction in camera frame #22
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
Conversation
|
|
||
| TEST(GpuConfidenceTest, ConfidenceMultipleValuesGPU_AllTypes) { | ||
| using test_float = float; | ||
| constexpr float rtol = 1e-6F; |
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.
My compiler has been complaining about this unused variable for a while lol
| float near; | ||
| float far; |
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.
These variables are not used in the current implementation, though we can always add them back later if needed
93536ee to
1e3da46
Compare
1e77c73 to
b58ca50
Compare
| return norms | ||
|
|
||
|
|
||
| def get_camera_rays( |
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.
Nice, I see that you took their code and made it into a GT function here
| .def_ro("cx", &Intrinsics::cx) | ||
| .def_ro("cy", &Intrinsics::cy) | ||
| .def("get_ray_direction", &Intrinsics::get_ray_direction, | ||
| "Get the direction of the ray going through pixel (px, py) in camera frame", |
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.
What is this (px, py) convention? is this the same as (i,j)?
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.
I suppose it does not matter, as long as we know that camera looks at bottom left as origin and Y is upwards while X is rightwards, it should be fine.
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.
Yup, (px, py) is essentially the 2D coordinate in the pixel space
arijit-dasgupta
left a comment
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.
Nice! this has become a lot simpler now that we're not storing the origin point.
b58ca50 to
d26d491
Compare
|
Update: Rebased after resolving conflicts. I'm going to merge this PR as-is once the CI passes to keep us moving forward and will work on pixel coordinate iterator & the other improvements in followups. |
(Part of MET-48)
Summary of Changes
This PR complete the camera
Intrinsicsand defines two functions for it:get_ray_direction: given a pixel coordinate(px, py), returns the direction of the ray in camera frameget_ray_directions: returns a 2D array of all ray directions in the camera frame. If a range is specified, then this method only compute a subset of the rays.Depends on how we implement the kernel at the end, we may not need both functions, but let's still have them here now just in case...
Test Plans
On Python side, you can find a basic correctness testing in
test_camera.py, which checks the value of ourIntrinsics::get_ray_directionagainst the ground truth fucntion refactored fromrun_fmb.pyDue to the complexity of binding
Array2D<Vec3D, device>to Python, I'm leaving the testing of the batchedget_ray_directionsto C++ side, wheretest_camera.cuonly performs a basic sanity check to ensure that the adjacent rays are pointing toward different direction (and of course, that the function runs without error).As always, you can run the tests with
pixi run test