-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Hey I have few questions considering the normal calculation:
- Normals are estimated here:
nps_uw_multibeam_sonar/src/gazebo_multibeam_sonar_ray_based.cpp
Lines 786 to 788 in 47dae1f
images.at(0) = n1; // for green channel images.at(1) = n2; // for red channel images.at(2) = 1.0/this->focal_length_*depth; // for blue channel
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.
- Also I'm a bit confused about the change here:
nps_uw_multibeam_sonar/src/sonar_calculation_cuda.cu
Lines 206 to 207 in 47dae1f
// incidence angle (taking that of normal_image) float incidence = acos(normal[2]); // compute_incidence(ray_azimuthAngle, ray_elevationAngle, normal);
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?