Skip to content

Normal calculation #57

@5p00kk

Description

@5p00kk

Hey I have few questions considering the normal calculation:

  1. Normals are estimated here:
    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.

  1. Also I'm a bit confused about the change here:
    // 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions