Function mola::vision::goodFeaturesToTrack

Function Documentation

std::vector<mrpt::math::TPoint2Df> mola::vision::goodFeaturesToTrack(const mrpt::img::CImage &img, const GoodFeaturesParams &params = {})

Shi-Tomasi (or Harris) corner detector.

Algorithm:

  1. Compute Sobel gradients Ix, Iy.

  2. Compute structure tensor entries Ix², IxIy, Iy² via box-filter (block_size).

  3. Score = min eigenvalue of tensor (Shi-Tomasi) or det−k·trace² (Harris).

  4. Non-maximum suppression in a (min_distance×min_distance) window.

  5. Threshold by quality_level * max_score.

  6. Sort by score descending, return top max_corners.

Input: grayscale CH_GRAY D8U image. Output: pixel coordinates as TPoint2Df (col=x, row=y), sorted by score.

Adapted from: lightweight_vio (MIT License), goodFeaturesToTrack logic.