-
Notifications
You must be signed in to change notification settings - Fork 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
Normal calculation #57
Comments
First of all, thank you for looking into this so much deep!
Hope we can iterate more on this subject! I would love to find bugs! Nobody has reviewed actual code but only final images. |
Hey, thanks for the response.
I'm currently implementing something similar and using this for inspiration and the normal results seemed off to me, I have not made proper tests tho to verify the (in)correctness. I have gone the other way of calculating dzdx dzdy and getting point's normal in camera aligned coordinate frame and then using something like your commented out compute_incidence() to combine ray_direction with normal_direction to get the reflection angle. I can try to collect some data later to check if there is any issue with the results |
Hey I have few questions considering the normal calculation:
nps_uw_multibeam_sonar/src/gazebo_multibeam_sonar_ray_based.cpp
Lines 786 to 788 in 47dae1f
They are based on a Sobel filter of a depth map where each pixel corresponds to distance measured by particular beam not the z value of the camera coordinate system. If I understand correctly during the normal calculation you basically calculate the crossproduct of [1, 0, dzdu * dudx] and [0, 1, dzdv * dvdy] to get the normal vector. However it seems to me that your z is not actually z but the ray distance that would need to processed through "camera" model to get the z coordinate.
For instance, it seems to me that with such implementation, if the sonar is looking at a parallel plane, each of the rays will return different normal, even though the normal should be same for all and only ray angle should be changing. Please let me know if you can see some holes in my understanding.
nps_uw_multibeam_sonar/src/sonar_calculation_cuda.cu
Lines 206 to 207 in 47dae1f
what is the reason of dropping the actual incidence angle calculation and replacing it with basically with acos of scaled depth? How does this work?
EDIT: Considering 2, I think I understand now that the normal vector is normalized so by doing acos of the z component you can find the angle between a line parallel to the camera axis and the normal, however this does not take into account the angle of the ray at all, right?
The text was updated successfully, but these errors were encountered: