Class ClaheOp
java.lang.Object
cloud.opencode.base.image.histogram.ClaheOp
Contrast Limited Adaptive Histogram Equalization (CLAHE)
对比度限制自适应直方图均衡化 (CLAHE)
CLAHE divides the image into tiles, performs contrast-limited histogram equalization on each tile, and uses bilinear interpolation between tiles to eliminate boundary artifacts.
CLAHE 将图像分割为多个块,对每个块执行对比度限制的直方图均衡化, 并在块之间使用双线性插值消除边界伪影。
Features | 主要功能:
- Adaptive local contrast enhancement - 自适应局部对比度增强
- Clip limit prevents noise amplification - 裁剪限制防止噪声放大
- Bilinear interpolation for smooth transitions - 双线性插值实现平滑过渡
- Configurable tile grid size and clip limit - 可配置的块网格大小和裁剪限制
Usage Examples | 使用示例:
// Default parameters (clipLimit=2.0, tileGridSize=8)
Raster result = ClaheOp.apply(raster);
// Custom parameters
Raster result2 = ClaheOp.apply(raster, 3.0, 16);
Performance | 性能特性:
- Time complexity: O(w * h) - 时间复杂度: O(w * h)
- Space complexity: O(w * h + tileGridSize^2 * 256) - 空间复杂度: O(w * h + tileGridSize^2 * 256)
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 Summary
Modifier and TypeMethodDescriptionstatic RasterApply CLAHE with default parameters (clipLimit=2.0, tileGridSize=8) to aRaster.static RasterApply CLAHE with specified parameters to aRaster.static RasterApply CLAHE with specified parameters and optional output buffer to aRaster.static RasterApply CLAHE with default parameters and optional output buffer.
-
Method Details
-
apply
Apply CLAHE with default parameters (clipLimit=2.0, tileGridSize=8) to aRaster. 使用默认参数对Raster应用 CLAHE。- Parameters:
raster- the source raster | 源 raster- Returns:
- the CLAHE-enhanced
GRAY_8raster | CLAHE 增强后的GRAY_8raster - Throws:
NullPointerException- if raster is null | 当 raster 为 null 时抛出- Since:
- opencode-base-image V1.0.4
-
apply
Apply CLAHE with default parameters and optional output buffer. 使用默认参数并指定输出缓冲对Raster应用 CLAHE。- Parameters:
raster- the source raster | 源 rasterdst- optional outputGRAY_8raster; may be null | 可选GRAY_8输出 raster,可为 null- Returns:
- the CLAHE-enhanced
GRAY_8raster | CLAHE 增强后的GRAY_8raster - Throws:
NullPointerException- if raster is null | 当 raster 为 null 时抛出- Since:
- opencode-base-image V1.0.4
-
apply
- Parameters:
raster- the source raster | 源 rasterclipLimit- the contrast clip limit (must be positive) | 对比度裁剪限制(必须为正数)tileGridSize- the number of tiles in each dimension (must be positive) | 每个维度的块数(必须为正数)- Returns:
- the CLAHE-enhanced
GRAY_8raster | CLAHE 增强后的GRAY_8raster - Throws:
NullPointerException- if raster is null | 当 raster 为 null 时抛出ImageOperationException- if clipLimit or tileGridSize is invalid | 当参数无效时抛出- Since:
- opencode-base-image V1.0.4
-
apply
Apply CLAHE with specified parameters and optional output buffer to aRaster. 使用指定参数并指定输出缓冲对Raster应用 CLAHE。- Parameters:
raster- the source raster | 源 rasterclipLimit- the contrast clip limit (must be positive) | 对比度裁剪限制(必须为正数)tileGridSize- the number of tiles in each dimension (must be positive) | 每个维度的块数(必须为正数)dst- optional outputGRAY_8raster; may be null | 可选GRAY_8输出 raster,可为 null- Returns:
- the CLAHE-enhanced
GRAY_8raster | CLAHE 增强后的GRAY_8raster - Throws:
NullPointerException- if raster is null | 当 raster 为 null 时抛出ImageOperationException- if clipLimit or tileGridSize is invalid | 当参数无效时抛出- Since:
- opencode-base-image V1.0.4
-