ov_core::Grider_FAST class

Extracts FAST features in a grid pattern.

Contents

As compared to just extracting fast features over the entire image, we want to have as uniform of extractions as possible over the image plane. Thus we split the image into a bunch of small grids, and extract points in each. We then pick enough top points in each grid so that we have the total number of desired points.

Public static functions

static auto compare_response(cv::KeyPoint first, cv::KeyPoint second) -> bool
Compare keypoints based on their response value.
static void perform_griding(const cv::Mat& img, std::vector<cv::KeyPoint>& pts, int num_features, int grid_x, int grid_y, int threshold, bool nonmaxSuppression)
This function will perform grid extraction using FAST.

Function documentation

static bool ov_core::Grider_FAST::compare_response(cv::KeyPoint first, cv::KeyPoint second)

Compare keypoints based on their response value.

Parameters
first First keypoint
second Second keypoint

We want to have the keypoints with the highest values! See: https://stackoverflow.com/a/10910921

static void ov_core::Grider_FAST::perform_griding(const cv::Mat& img, std::vector<cv::KeyPoint>& pts, int num_features, int grid_x, int grid_y, int threshold, bool nonmaxSuppression)

This function will perform grid extraction using FAST.

Parameters
img Image we will do FAST extraction on
pts vector of extracted points we will return
num_features max number of features we want to extract
grid_x size of grid in the x-direction / u-direction
grid_y size of grid in the y-direction / v-direction
threshold FAST threshold paramter (10 is a good value normally)
nonmaxSuppression if FAST should perform non-max suppression (true normally)

Given a specified grid size, this will try to extract fast features from each grid. It will then return the best from each grid in the return vector.