Skip to contents

goodFeaturesToTrack finds the most prominent corners in an image or in a specified region of the image.

Usage

goodFeaturesToTrack(
  image,
  max_corners,
  quality_level,
  min_distance,
  mask = NULL,
  block_size = 3,
  gradient_size = 3,
  use_harris = FALSE,
  k = 0.04
)

Arguments

image

An 8-bit (8U) single-channel (GRAY) binary Image object.

max_corners

The maximum number of corners to return. max_corners <= 0 implies that no limit on the maximum is set and all detected corners are returned.

quality_level

The minimal accepted quality of the image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (if use_harris = FALSE) or the Harris function response (if use_harris = TRUE). The corners with a quality measure lower than the product are rejected. For example, if the best corner has a quality measure of 1500, and quality_level = 0.01, then all the corners with a quality measure lower than 15 are rejected.

min_distance

The minimum possible Euclidean distance between the returned corners.

mask

A single-channel (GRAY) 8-bit (8U) Image object with the same dimensions as image. This can be used to mask out pixels that should not be considered when searching for corners (pixels set to 0 in the mask will be ignored during the search).

block_size

Size of an average block for computing a derivative covariation matrix over each pixel neighborhood (default: 3).

gradient_size

Aperture parameter for the Sobel operator used for derivatives computation (default: 3).

use_harris

A logical indicating whether the corners should be detected using the Harris method or the eigenvalue method (default: FALSE).

k

The free parameter of the Harris detector (ignored if use_harris = FALSE.

Value

A matrix with 2 columns corresponding to the x and y coordinates of the detected points.

References

Shi, J., & Tomasi. (1994). Good features to track. 1994 Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, 593–600. https://doi.org/10.1109/CVPR.1994.323794

See also

Author

Simon Garnier, garnier@njit.edu

Examples

balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
balloon_gray <- changeColorSpace(balloon, "GRAY")
corners <- goodFeaturesToTrack(balloon_gray, 100, 0.01, 10)