Class LaplacianOp

java.lang.Object
cloud.opencode.base.image.edge.LaplacianOp

public final class LaplacianOp extends Object
Laplacian Edge Detection Operator Laplacian 边缘检测算子

Applies a 3x3 Laplacian kernel to detect edges by computing the second derivative of image intensity. The kernel [0,1,0, 1,-4,1, 0,1,0] responds strongly to rapid intensity changes in all directions.

应用 3x3 Laplacian 卷积核通过计算图像强度的二阶导数来检测边缘。 卷积核 [0,1,0, 1,-4,1, 0,1,0] 对所有方向的快速强度变化都有强响应。

Features | 主要功能:

  • Second-derivative edge detection using 3x3 Laplacian - 使用 3x3 Laplacian 的二阶导数边缘检测
  • Omnidirectional edge sensitivity - 全方向边缘敏感度
  • Absolute value output clamped to [0, 255] - 取绝对值输出并裁剪到 [0, 255]

Usage Examples | 使用示例:

Raster edges = LaplacianOp.apply(image);

Performance | 性能特性:

  • Time complexity: O(w * h * 9) for 3x3 kernel - 时间复杂度: 3x3 卷积核 O(w * h * 9)
  • Space complexity: O(w * h) - 空间复杂度: 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

    • apply

      public static Raster apply(Raster raster)
      Apply Laplacian edge detection to a Raster. Output is a GRAY_8 raster. 对 Raster 应用 Laplacian 边缘检测。输出 GRAY_8 raster。
      Parameters:
      raster - the source raster | 源 raster
      Returns:
      the edge-detected GRAY_8 raster | 边缘检测后的 GRAY_8 raster
      Throws:
      NullPointerException - if raster is null | 当 raster 为 null 时抛出
      Since:
      opencode-base-image V1.0.4