main Content

adapthisteq

对比度限制的自适应直方图均衡(Clahe)

Description

例子

j= Adapthisteq(增强灰度图像的对比度通过使用对比度限制的自适应直方图均衡(Clahe)转换值[1]

j= Adapthisteq(,,,,姓名,,,,Valueuses name-value pairs to control aspects of the contrast enhancement.

Examples

collapse all

Apply CLAHE to an image and display the results.

i = imread('tire.tif');j= Adapthisteq(我,,,,'clipLimit',0.02,'分配',,,,'rayleigh');imshowpair(i,j,'剪辑');title('Original Image (left) and Contrast Enhanced Image (right)'

图包含一个轴对象。带有标题原始图像(左)和对比度增强图像(右)的轴对象包含一个类型图像的对象。

读取索引彩色图像到工作区中。

[x,map] = imread('shadow.tif');

Convert the indexed image into a truecolor (RGB) image, then convert the RGB image into the L*a*b* color space.

rgb = ind2RGB(x,map);LAB = RGB2LAB(RGB);

比例值达到预期的范围adapthisteq功能,[0 1]。

L = LAB(:,:,1)/100;

Perform CLAHE on the L channel. Scale the result to get back to the range used by the L*a*b* color space.

L = adapthisteq(L,'numTiles',[8 8],“剪裁”,0.005);实验室(:,::,1)= l*100;

Convert the resulting image back into the RGB color space.

j = lab2rgb(lab);

显示原始图像和处理的图像。

figure imshowpair(RGB,J,'剪辑')title('Original (left) and Contrast Enhanced (right) Image'

图包含一个轴对象。带有标题原始(左)和对比度增强(右)图像的轴对象包含类型图像的对象。

增强图像中的阴影看起来较暗,亮点看起来更明亮。整体对比度得到改善。

输入参数

collapse all

灰度图像,,,,specified as a 2-D numeric matrix.

数据类型:单身的|double|int16|UINT8|uint16

名称值参数

Specify optional pairs of arguments asname1 = value1,...,namen = valuen,,,,where姓名是参数名称和Valueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

在R2021a之前,请使用逗号分隔每个名称和值,并附上姓名用引号。

Example:“ numtiles”,[8 16]将图像分为8行和16列瓷砖。

矩形上下文区域(瓷砖)的数量adapthisteq将图像分开,指定为正整数的2元素向量。原始图像分为m行和n瓷砖列,值'numTiles'is[m n]。两个都mandn必须至少2。The total number of tiles is equal tom*n。瓷砖的最佳数量取决于输入图像的类型,并且最好通过实验确定。

数据类型:double

对比度增强极限,,,,specified as a number in the range [0, 1]. Higher limits result in more contrast.

“剪裁”is a contrast factor that prevents oversaturation of the image specifically in homogeneous areas. These areas are characterized by a high peak in the histogram of the particular image tile due to many pixels falling inside the same gray level range. Without the clip limit, the adaptive histogram equalization technique could produce results that, in some cases, are worse than the original image.

数据类型:double

直方图箱的数量用于构建对比度增强转换,该变换指定为正整数。较高的值会以较慢的处理速度成本导致更大的动态范围。

数据类型:double

输出图像数据的范围,指定为这些值之一。

Value Description
'full' 使用输出类的全部范围(例如[0 255]UINT8)。
'original' 将范围限制为[min(I(:)) max(I(:))]

数据类型:char|细绳

Desired histogram shape, specified as one of the following values:

Value Description
'制服' 创建一个平坦的直方图。
'rayleigh' 创建一个钟形直方图。
“指数” Create a curved histogram.

'分配'specifies the distribution thatadapthisteq用作创建对比度转换功能的基础。您选择的分布应取决于输入图像的类型。例如,当使用瑞利分布时,水下图像看起来更自然。

数据类型:char|细绳

分布参数,,,,specified as a nonnegative number.'Α'is only used when'分配'is set to'rayleigh'or“指数”

数据类型:double

输出参数

collapse all

对比增强图像,作为与输入图像相同数据类型的2D矩阵返回

Algorithms

CLAHE operates on small regions in the image, called瓷砖,而不是整个图像。adapthisteq分别计算每个图块的对比度变换函数。每个图块的对比度都得到了增强,因此输出区域的直方图大致与由该直方图匹配。'Distribution'价值。然后使用双线性插值合并相邻的瓷砖,以消除人为诱导的边界。对比度,尤其是在均匀地区,可以限制以避免放大图像中可能存在的任何噪声。

References

[1] Zuiderveld, Karel. “Contrast Limited Adaptive Histograph Equalization.”图形宝石IV。San Diego: Academic Press Professional, 1994. 474–485.

扩展功能

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU代码生成
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

版本历史记录

我ntroduced before R2006a

也可以看看