Open 5p00kk opened 6 months ago
First of all, thank you for looking into this so much deep!
what do you mean by z value? I did want the distance measured by each rays. And I also wanted the ray to return different normal for the parallel plane case. I wanted normals so that I can calculate the angle between the ray emitting direction and the surface normal. Something like how much is it tilted (the incident angle) to calculate reflection loss.
I think as the normal
is already calculated in consideration of the angle of the ray?
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:
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.
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?