主要内容

imsharpen

Sharpen image using unsharp masking

Description

example

B= imsharpen(A)sharpens the grayscale or truecolor (RGB) input imageAby using theunsharp masking方法。

example

B= imsharpen(A,Name,Value)使用名称值对来控制取消扫描屏蔽的方面。

Examples

collapse all

将图像读入工作区并显示它。

a = imread('hestain.png'); imshow(a) title('Original Image');

Figure contains an axes object. The axes object with title Original Image contains an object of type image.

Sharpen the image using theimsharpenfunction and display it.

b = imsharpen(a);图,imshow(b)标题('Sharpened Image');

Figure contains an axes object. The axes object with title Sharpened Image contains an object of type image.

将图像读入工作区并显示它。

a = imread('rice.png'); imshow(a), title('Original Image');

Figure contains an axes object. The axes object with title Original Image contains an object of type image.

Sharpen image, specifying theradius数量parameters.

b = imsharpen(a,'半径',2,'Amount',1);图,imshow(b)标题('Sharpened Image');

Figure contains an axes object. The axes object with title Sharpened Image contains an object of type image.

Input Arguments

collapse all

Image to be sharpened, specified as a grayscale or RGB image.

IfAis a truecolor (RGB) image, thenimsharpenconverts 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,Valuearguments.Nameis the argument name and价值是相应的价值。Namemust appear inside quotes. You can specify several name and value pair arguments in any order asname1,value1,...,namen,valuen.

Example:'半径',1.5

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

锐化效果的强度,指定为数字标量。更高的值导致锐化像素的对比度的更大增加。此参数的典型值在范围内[0 2], although values greater than2被允许。此参数的非常大的值可以在输出图像中产生不期望的影响。

Example:'Amount',1.2

Data Types:single|double|int8|INT16|int32|int64|uint8|uint16|uint32|uint64

像素被视为边缘像素所需的最小对比度,指定为范围的标量[01]。较高的值(更接近1)允许仅在高对比度区域(例如强边)的高度区域锐化,同时留下低对比度区域不受影响。较低的值(更接近0),另外允许在图像的相对更平滑的区域中锐化。该参数可用于避免输出图像中的锐化噪声。

Example:'Threshold',0.7

Data Types:single|double|int8|INT16|int32|int64|uint8|uint16|uint32|uint64

Output Arguments

collapse all

尖锐的形象,返回a numeric array of the same size and class as the input imageA.

More About

collapse all

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.

在R2013A介绍