imsharpen
Sharpen image using unsharp masking
Description
sharpens the grayscale or truecolor (RGB) input imageB
= imsharpen(A
)A
by using theunsharp masking方法。
使用名称值对来控制取消扫描屏蔽的方面。B
= imsharpen(A
,Name,Value
)
Examples
Sharpen Image
将图像读入工作区并显示它。
a = imread('hestain.png'); imshow(a) title('Original Image');
Sharpen the image using theimsharpen
function and display it.
b = imsharpen(a);图,imshow(b)标题('Sharpened Image');
Control the Amount of Sharpening at the Edges
将图像读入工作区并显示它。
a = imread('rice.png'); imshow(a), title('Original Image');
Sharpen image, specifying theradius
和数量
parameters.
b = imsharpen(a,'半径',2,'Amount',1);图,imshow(b)标题('Sharpened Image');
Input Arguments
A
—Image to be sharpened
grayscale image|RGB image
Image to be sharpened, specified as a grayscale or RGB image.
IfA
is a truecolor (RGB) image, thenimsharpen
converts the image to theL*a*b*color space, applies sharpening to theL*channel only, and then converts the image back to the RGB color space before returning it as the output imageB
.
Data Types:single
|double
|int8
|INT16
|int32
|uint8
|uint16
|uint32
Name-Value Arguments
Specify optional comma-separated pairs ofName,Value
arguments.Name
is the argument name and价值
是相应的价值。Name
must appear inside quotes. You can specify several name and value pair arguments in any order asname1,value1,...,namen,valuen
.
'半径',1.5
半径
—Standard deviation of the Gaussian lowpass filter
1
(default) |positive number
Standard deviation of the Gaussian lowpass filter, specified as a positive number. This value controls the size of the region around the edge pixels that is affected by sharpening. A large value sharpens wider regions around the edges, whereas a small value sharpens narrower regions around edges.
Example:'半径',1.5
Data Types:single
|double
|int8
|INT16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
Amount
—Strength of the sharpening effect
0.8
(default) |数字标量
锐化效果的强度,指定为数字标量。更高的值导致锐化像素的对比度的更大增加。此参数的典型值在范围内[0 2]
, although values greater than2
被允许。此参数的非常大的值可以在输出图像中产生不期望的影响。
Example:'Amount',1.2
Data Types:single
|double
|int8
|INT16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
Threshold
—Minimum contrast required for a pixel to be considered an edge pixel
0
(default) |scalar in the range [0 1]
像素被视为边缘像素所需的最小对比度,指定为范围的标量[01]。较高的值(更接近1)允许仅在高对比度区域(例如强边)的高度区域锐化,同时留下低对比度区域不受影响。较低的值(更接近0),另外允许在图像的相对更平滑的区域中锐化。该参数可用于避免输出图像中的锐化噪声。
Example:'Threshold',0.7
Data Types:single
|double
|int8
|INT16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
Output Arguments
B
— Sharpened image
numeric array
尖锐的形象,返回a numeric array of the same size and class as the input imageA
.
More About
Sharpening
Sharpness is actually the contrast between different colors. A quick transition from black to white looks sharp. A gradual transition from black to gray to white looks blurry. Sharpening images increases the contrast along the edges where different colors meet.
Unsharp masking
The unsharp masking technique comes from a publishing industry process in which an image is sharpened by subtracting a blurred (unsharp) version of the image from itself. Do not be confused by the name of this filter: an unsharp filter is an operator used to sharpen an image.
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América拉丁(Español)
- Canada(English)
- United States(English)
欧洲
- Belgium(English)
- 丹麦(English)
- Deutschland(德意志)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)