adapthisteq
对比度限制的自适应直方图均衡(Clahe)
Description
Examples
应用对比度限制的自适应直方图均衡(CLAHE)
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)')
Apply CLAHE to Indexed Color Image
读取索引彩色图像到工作区中。
[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')
增强图像中的阴影看起来较暗,亮点看起来更明亮。整体对比度得到改善。
输入参数
我
-灰度图像
2-D数字矩阵
灰度图像,,,,specified as a 2-D numeric matrix.
数据类型:单身的
|double
|int16
|UINT8
|uint16
名称值参数
Specify optional pairs of arguments asname1 = value1,...,namen = valuen
,,,,where姓名
是参数名称和Value
is 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列瓷砖。
numTiles
-瓷砖数量
[8,8]
(默认)|2-element vector of positive integers
矩形上下文区域(瓷砖)的数量adapthisteq
将图像分开,指定为正整数的2元素向量。原始图像分为m
行和n
瓷砖列,值'numTiles'
is[m n]
。两个都m
andn
必须至少2
。The total number of tiles is equal tom*n
。瓷砖的最佳数量取决于输入图像的类型,并且最好通过实验确定。
数据类型:double
夹层
-对比度增强极限
0.01
(默认)|number in the range [0, 1]
对比度增强极限,,,,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
nBins
-用于构建对比度增强转换的直方图箱数量
256
(默认)|正整数
直方图箱的数量用于构建对比度增强转换,该变换指定为正整数。较高的值会以较慢的处理速度成本导致更大的动态范围。
数据类型:double
Range
-Range of output data
'full'
(默认)|'original'
输出图像数据的范围,指定为这些值之一。
Value | Description |
---|---|
'full' |
使用输出类的全部范围(例如[0 255]UINT8 )。 |
'original' |
将范围限制为[min(I(:)) max(I(:))] 。 |
数据类型:char
|细绳
Distribution
-Desired histogram shape
'制服'
(默认)|'rayleigh'
|“指数”
Desired histogram shape, specified as one of the following values:
Value | Description |
---|---|
'制服' |
创建一个平坦的直方图。 |
'rayleigh' |
创建一个钟形直方图。 |
“指数” |
Create a curved histogram. |
'分配'
specifies the distribution thatadapthisteq
用作创建对比度转换功能的基础。您选择的分布应取决于输入图像的类型。例如,当使用瑞利分布时,水下图像看起来更自然。
数据类型:char
|细绳
Α
-分布参数
0.4
(默认)|非负数
分布参数,,,,specified as a nonnegative number.'Α'
is only used when'分配'
is set to'rayleigh'
or“指数”
。
数据类型:double
输出参数
j
- 对比增强图像
2-D矩阵
对比增强图像,作为与输入图像相同数据类型的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™.
版本历史记录
也可以看看
MATLABCommand
您单击了与此MATLAB命令相对应的链接:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。万博1manbetx
Select a Web Site
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
Americas
- América Latina(Español)
- Canada(English)
- United States(English)