Class ShiTomasiOp

java.lang.Object
cloud.opencode.base.image.feature.ShiTomasiOp

public final class ShiTomasiOp extends Object
Shi-Tomasi Corner Detector (Good Features To Track) Shi-Tomasi 角点检测器(良好跟踪特征)

Implements the Shi-Tomasi corner detection algorithm, which improves upon Harris by using the minimum eigenvalue of the structure tensor as the corner response. This provides more stable and intuitive corner detection.

实现 Shi-Tomasi 角点检测算法,通过使用结构张量的最小特征值作为角点响应来改进 Harris 算法。 这提供了更稳定和直观的角点检测。

Features | 主要功能:

  • Shi-Tomasi corner detection using minimum eigenvalue - 使用最小特征值的 Shi-Tomasi 角点检测
  • Quality level filtering relative to strongest corner - 相对于最强角点的质量级别过滤
  • Top-N corner selection with non-maximum suppression - 带非极大值抑制的 Top-N 角点选择

Usage Examples | 使用示例:

// Detect with custom parameters
List<double[]> corners = ShiTomasiOp.detect(image, 50, 0.01);
for (double[] corner : corners) {
    System.out.printf("Corner at (%d, %d) quality=%.4f%n",
        (int) corner[0], (int) corner[1], corner[2]);
}

// Detect with defaults (maxCorners=100, qualityLevel=0.01)
List<double[]> corners = ShiTomasiOp.detect(image);

Performance | 性能特性:

  • Time complexity: O(w * h * k) where k is kernel size - 时间复杂度: O(w * h * k),k 为卷积核大小
  • Space complexity: O(w * h) for gradient and eigenvalue arrays - 空间复杂度: O(w * h) 用于梯度和特征值数组

Security | 安全性:

  • Thread-safe: Yes (stateless) - 线程安全: 是(无状态)
  • Null-safe: No - 空值安全: 否
Since:
JDK 25, opencode-base-image V2.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • detect

      public static List<double[]> detect(BufferedImage image, int maxCorners, double qualityLevel)
      Detect Shi-Tomasi corners (Good Features To Track) with custom parameters. 使用自定义参数检测 Shi-Tomasi 角点(良好跟踪特征)。

      The quality level is relative to the maximum corner response. Only corners with response >= qualityLevel * maxResponse are retained.

      质量级别相对于最大角点响应。只保留响应值 >= qualityLevel * maxResponse 的角点。

      Parameters:
      image - the source image | 源图像
      maxCorners - maximum number of corners to return | 返回的最大角点数
      qualityLevel - minimum quality level (0.0-1.0), relative to strongest corner | 最小质量级别(0.0-1.0),相对于最强角点
      Returns:
      list of [x, y, minEigenvalue] for each detected corner, sorted by response descending | 每个检测到的角点的 [x, y, minEigenvalue] 列表,按响应值降序排列
      Throws:
      ImageOperationException - if image is null, maxCorners not positive, or qualityLevel not in [0, 1] | 当图像为 null、maxCorners 不为正数或 qualityLevel 不在 [0, 1] 范围内时抛出
    • detect

      public static List<double[]> detect(BufferedImage image)
      Detect Shi-Tomasi corners with default parameters (maxCorners=100, qualityLevel=0.01). 使用默认参数检测 Shi-Tomasi 角点(maxCorners=100,qualityLevel=0.01)。
      Parameters:
      image - the source image | 源图像
      Returns:
      list of [x, y, minEigenvalue] for each detected corner | 每个检测到的角点的 [x, y, minEigenvalue] 列表
      Throws:
      ImageOperationException - if image is null | 当图像为 null 时抛出