To assign orientation to corners, we use the intensity centroid. We assume that the corner is offset from the intensity centroid and this vector is used to assign orientation to a keypoint.
To compute the coordinates of the centroid, we use moments. Moments are calculated as follows:
The coordinates of the centroid can be calculated as follows:
We construct a vector OC from the keypoint's center, O, to the centroid, C. The orientation of the patch is obtained as follows:
Here, atan2 is the quadrant-aware version ...