pysteps.feature.shitomasi.detection

Contents

pysteps.feature.shitomasi.detection#

pysteps.feature.shitomasi.detection(input_image, max_corners=1000, max_num_features=None, quality_level=0.01, min_distance=10, block_size=5, buffer_mask=5, use_harris=False, k=0.04, verbose=False, **kwargs)#

Interface to the OpenCV Shi-Tomasi features detection method to detect corners in an image.

Corners are used for local tracking methods.

Parameters:
  • input_image (ndarray or MaskedArray) –

    Array of shape (m, n) containing the input image.

    In case of ndarray, invalid values (Nans or infs) are masked, otherwise the mask of the MaskedArray is used. Such mask defines a region where features are not detected.

    The fill value for the masked pixels is taken as the minimum of all valid pixels.

  • max_corners (int, optional) – The maxCorners parameter in the Shi-Tomasi corner detection method. It represents the maximum number of points to be tracked (corners). If set to zero, all detected corners are used.

  • max_num_features (int, optional) – If specified, this argument is substituted for max_corners. Set to None for no restriction. Added for compatibility with the feature detector interface.

  • quality_level (float, optional) – The qualityLevel parameter in the Shi-Tomasi corner detection method. It represents the minimal accepted quality for the image corners.

  • min_distance (int, optional) – The minDistance parameter in the Shi-Tomasi corner detection method. It represents minimum possible Euclidean distance in pixels between corners.

  • block_size (int, optional) – The blockSize parameter in the Shi-Tomasi corner detection method. It represents the window size in pixels used for computing a derivative covariation matrix over each pixel neighbourhood.

  • use_harris (bool, optional) – Whether to use a Harris detector or cornerMinEigenVal.

  • k (float, optional) – Free parameter of the Harris detector.

  • buffer_mask (int, optional) – A mask buffer width in pixels. This extends the input mask (if any) to limit edge effects.

  • verbose (bool, optional) – Print the number of features detected.

Returns:

points – Array of shape (p, 2) indicating the pixel coordinates of p detected corners.

Return type:

ndarray

References

Jianbo Shi and Carlo Tomasi. Good features to track. In Computer Vision and Pattern Recognition, 1994. Proceedings CVPR’94., 1994 IEEE Computer Society Conference on, pages 593–600. IEEE, 1994.