Unsharp Masking
   HOME

TheInfoList



OR:

Unsharp masking (USM) is an image sharpening technique, first implemented in darkroom photography, but now commonly used in
digital image processing Digital image processing is the use of a digital computer to process digital images through an algorithm. As a subcategory or field of digital signal processing, digital image processing has many advantages over analog image processing. It allo ...
software. Its name derives from the fact that the technique uses a blurred, or "unsharp", negative image to create a
mask A mask is an object normally worn on the face, typically for protection, disguise, performance, or entertainment and often they have been employed for rituals and rights. Masks have been used since antiquity for both ceremonial and practic ...
of the original image. The unsharp mask is then combined with the original positive image, creating an image that is less blurry than the original. The resulting image, although clearer, may be a less accurate representation of the image's subject. In the context of
signal processing Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as audio signal processing, sound, image processing, images, and scientific measurements. Signal processing techniq ...
, an unsharp mask is generally a
linear Linearity is the property of a mathematical relationship (''function'') that can be graphically represented as a straight line. Linearity is closely related to '' proportionality''. Examples in physics include rectilinear motion, the linear r ...
or
nonlinear In mathematics and science, a nonlinear system is a system in which the change of the output is not proportional to the change of the input. Nonlinear problems are of interest to engineers, biologists, physicists, mathematicians, and many othe ...
filter that amplifies the high-frequency components of a signal.


Photographic darkroom unsharp masking

For the photographic darkroom process, a
large-format Large format refers to any imaging format of or larger. Large format is larger than "medium format", the or size of Hasselblad, Mamiya, Rollei, Kowa, and Pentax cameras (using 120- and 220-roll film), and much larger than the frame o ...
glass plate negative is contact-copied onto a low-contrast film or plate to create a positive image. However, the positive copy is made with the copy material in contact with the back of the original, rather than emulsion-to-emulsion, so it is blurred. After processing this blurred positive is replaced in contact with the back of the original negative. When light is passed through both negative and in-register positive (in an
enlarger An enlarger is a specialized transparency projector used to produce photographic prints from film or glass negatives, or from transparencies. Construction All enlargers consist of a light source, normally an incandescent light bulb shining thou ...
, for example), the positive partially cancels some of the information in the negative. Because the positive has been blurred intentionally, only the low-frequency (blurred) information is cancelled. In addition, the mask effectively reduces the
dynamic range Dynamic range (abbreviated DR, DNR, or DYR) is the ratio between the largest and smallest values that a certain quantity can assume. It is often used in the context of signals, like sound and light. It is measured either as a ratio or as a base-1 ...
of the original negative. Thus, if the resulting enlarged image is recorded on contrasty photographic paper, the partial cancellation emphasizes the high-spatial-frequency information (fine detail) in the original, without loss of highlight or shadow detail. The resulting print appears more acute than one made without the unsharp mask: its
acutance In photography, acutance describes a subjective perception of sharpness that is related to the edge contrast of an image. Acutance is related to the amplitude of the derivative of brightness with respect to space. Due to the nature of the hu ...
is increased. In the photographic procedure, the amount of blurring can be controlled by changing the "softness" or "hardness" (from point source to fully diffuse) of the light source used for the initial unsharp mask exposure, while the strength of the effect can be controlled by changing the contrast and density (i.e., exposure and development) of the unsharp mask. For traditional photography, unsharp masking is usually used on
monochrome A monochrome or monochromatic image, object or palette is composed of one color (or values of one color). Images using only shades of grey are called grayscale (typically digital) or black-and-white (typically analog). In physics, monochrom ...
materials; special panchromatic soft-working black-and-white films have been available for masking photographic colour transparencies. This has been especially useful to control the density range of a transparency intended for photomechanical reproduction.


Digital unsharp masking

The same differencing principle is used in the unsharp-masking tool in many digital-imaging software packages, such as
Adobe Photoshop Adobe Photoshop is a raster graphics editor developed and published by Adobe Inc. for Microsoft Windows, Windows and macOS. It was originally created in 1988 by Thomas Knoll, Thomas and John Knoll. Since then, the software has become the indu ...
and
GIMP GIMP ( ; GNU Image Manipulation Program) is a free and open-source raster graphics editor used for image manipulation (retouching) and image editing, free-form drawing, transcoding between different image file formats, and more specialized task ...
.4.9. Unsharp Mask
esp. 4.9.4. How does an unsharp mask work?, Gimp documentation.
The software applies a
Gaussian blur In image processing, a Gaussian blur (also known as Gaussian smoothing) is the result of blurring an image by a Gaussian function (named after mathematician and scientist Carl Friedrich Gauss). It is a widely used effect in graphics software, ...
to a copy of the original image and then compares it to the original. If the difference is greater than a user-specified threshold setting, the images are (in effect) subtracted. Digital unsharp masking is a flexible and powerful way to increase sharpness, especially in
scanned images An image scanner—often abbreviated to just scanner—is a device that optically scans images, printed text, handwriting or an object and converts it to a digital image. Commonly used in offices are variations of the desktop ''flatbed scanner'' w ...
. Unfortunately, it may create unwanted conspicuous edge effects or increase
image noise Image noise is random variation of brightness or color information in images, and is usually an aspect of electronic noise. It can be produced by the image sensor and circuitry of a Image scanner, scanner or digital camera. Image noise can also ...
. However, these effects can be used creatively, especially if a single
channel Channel, channels, channeling, etc., may refer to: Geography * Channel (geography), in physical geography, a landform consisting of the outline (banks) of the path of a narrow body of water. Australia * Channel Country, region of outback Austral ...
of an
RGB The RGB color model is an additive color model in which the red, green and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three addi ...
or Lab image is sharpened. Undesired effects can be reduced by using a mask—particularly one created by
edge detection Edge detection includes a variety of mathematical methods that aim at identifying edges, curves in a digital image at which the image brightness changes sharply or, more formally, has discontinuities. The same problem of finding discontinuitie ...
—to only apply sharpening to desired regions, sometimes termed "smart sharpen". Typically, digital unsharp masking is controlled via the amount, radius and threshold: * Amount is listed as a percentage and controls the magnitude of each overshoot (how much darker and how much lighter the edge borders become). This can also be thought of as how much contrast is added at the edges. It does not affect the width of the edge rims. * Radius affects the size of the edges to be enhanced or how wide the edge rims become, so a smaller radius enhances smaller-scale detail. Higher radius values can cause halos at the edges, a detectable faint light rim around objects. Fine detail needs a smaller radius. Radius and amount interact; reducing one allows more of the other. * Threshold controls the minimal brightness change that will be sharpened or how far apart adjacent tonal values have to be before the filter does anything. This lack of action is important to prevent smooth areas from becoming speckled. The threshold setting can be used to sharpen more pronounced edges, while leaving subtler edges untouched. Low values should sharpen more because fewer areas are excluded. Higher threshold values exclude areas of lower contrast. Various recommendations exist for starting values of these parameters, and the meaning may differ between implementations. Generally a radius of 0.5 to 2 pixels and an amount of 50–150% is recommended. It is also possible to implement USM manually, by creating a separate layer to act as the mask; this can be used to help understand how USM works or for fine customization. The typical blending formula for unsharp masking is : sharpened = original + (original − blurred) × amount.


Local contrast enhancement

Unsharp masking may also be used with a large radius and a small amount (such as 30–100 pixel radius and 5–20% amountLocal Contrast Enhancement
Cambridge in Color.
), which yields increased local contrast, a technique termed ''local contrast enhancement''.Understanding Local Contrast Enhancement
The Luminous Landscape.
USM can increase either sharpness or (local) contrast because these are both forms of increasing differences between values, increasing slope—sharpness referring to very small-scale (high-frequency) differences, and contrast referring to larger-scale (low-frequency) differences. More powerful techniques for improving tonality are referred to as
tone mapping Tone mapping is a technique used in image processing and computer graphics to map one set of colors to another to approximate the appearance of high-dynamic-range images in a medium that has a more limited dynamic range. Print-outs, CRT or L ...
.


Comparison with deconvolution

For image processing,
deconvolution In mathematics, deconvolution is the operation inverse to convolution. Both operations are used in signal processing and image processing. For example, it may be possible to recover the original signal after a filter (convolution) by using a deco ...
is the process of approximately inverting the process that caused an image to be blurred. Specifically, unsharp masking is a simple linear image operation—a
convolution In mathematics (in particular, functional analysis), convolution is a operation (mathematics), mathematical operation on two function (mathematics), functions ( and ) that produces a third function (f*g) that expresses how the shape of one is ...
by a
kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine learnin ...
that is the
Dirac delta In mathematics, the Dirac delta distribution ( distribution), also known as the unit impulse, is a generalized function or distribution over the real numbers, whose value is zero everywhere except at zero, and whose integral over the entire ...
minus a gaussian blur kernel. Deconvolution, on the other hand, is generally considered an
ill-posed The mathematical term well-posed problem stems from a definition given by 20th-century French mathematician Jacques Hadamard. He believed that mathematical models of physical phenomena should have the properties that: # a solution exists, # the sol ...
inverse problem An inverse problem in science is the process of calculating from a set of observations the causal factors that produced them: for example, calculating an image in X-ray computed tomography, source reconstruction in acoustics, or calculating the ...
that is best solved by nonlinear approaches. While unsharp masking increases the apparent sharpness of an image in ignorance of the manner in which the image was acquired, deconvolution increases the apparent sharpness of an image, but is based on information describing some of the likely origins of the distortions of the light path used in capturing the image; it may therefore sometimes be preferred, where the cost in preparation time and per-image computation time are offset by the increase in image clarity. With deconvolution, "lost" image detail may be approximately recovered, although it generally is impossible to verify that any recovered detail is accurate. Statistically, some level of correspondence between the sharpened images and the actual scenes being imaged can be attained. If the scenes to be captured in the future are similar enough to validated image scenes, then one can assess the degree to which recovered detail may be accurate. The improvement to image quality is often attractive, since the same validation issues are present even for un-enhanced images. For deconvolution to be effective, all variables in the image scene and capturing device need to be modeled, including
aperture In optics, an aperture is a hole or an opening through which light travels. More specifically, the aperture and focal length of an optical system determine the cone angle of a bundle of rays that come to a focus in the image plane. An opt ...
, focal length, distance to subject, lens, and media
refractive indices In optics, the refractive index (or refraction index) of an optical medium is a dimensionless number that gives the indication of the light bending ability of that medium. The refractive index determines how much the path of light is bent, or ...
and geometries. Applying deconvolution successfully to general-purpose camera images is usually not feasible, because the geometries of the scene are not set. However, deconvolution is applied in reality to microscopy and astronomical imaging, where the value of gained sharpness is high, imaging devices and the relative subject positions are both well defined, and optimization of the imaging devices to improve sharpness physically would cost significantly more. In cases where a stable, well-defined aberration is present, such as the lens defect in early
Hubble Space Telescope The Hubble Space Telescope (often referred to as HST or Hubble) is a space telescope that was launched into low Earth orbit in 1990 and remains in operation. It was not the first space telescope, but it is one of the largest and most versa ...
images,
deconvolution In mathematics, deconvolution is the operation inverse to convolution. Both operations are used in signal processing and image processing. For example, it may be possible to recover the original signal after a filter (convolution) by using a deco ...
is an especially effective technique.


Implementation

In the example below, the image is convolved with the following sharpening filter: Sharpen filter \begin \ \ 0 & -1 & \ \ 0 \\ -1 & \ \ 5 & -1 \\ \ \ 0 & -1 & \ \ 0 \end This matrix is obtained using the equation shown above under #Digital unsharp masking, using a uniform kernel with 5 pixels for the "blurred" image, and 5 for the "amount" multiplier: \begin 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end + \left( \begin 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end - \begin 0 & 1 & 0 \\ 1 & 1 & 1 \\ 0 & 1 & 0 \end /5 \right) 5 = \begin \ \ 0 & -1 & \ \ 0 \\ -1 & \ \ 5 & -1 \\ \ \ 0 & -1 & \ \ 0 \end The sharpening effect can be controlled by varying the multiplier. The value of 5 was chosen here to yield a kernel with integer values, but this is not a requirement for the operation. File:SharpenCarExample.png File:SharpenCarExample2.png The second image has been sharpened twice as much as the first.


See also

*
Edge enhancement Edge enhancement is an image processing filter that enhances the edge contrast of an image or video in an attempt to improve its acutance (apparent sharpness). The filter works by identifying sharp edge boundaries in the image, such as the e ...
*
Cornsweet illusion The Cornsweet illusion, also known as the Craik–O'Brien–Cornsweet illusion or the Craik–Cornsweet illusion, is an optical illusion that was described in detail by Tom Cornsweet in the late 1960s. Kenneth Craik and Vivian O'Brien had mad ...


References


General references


Sharpening With a Stiletto
Dan Margulis, February, 1998
Life on the Edge
Dan Margulis, January, 2005


External links

* Excel spreadsheet that calculates a
Unsharp Mask






mirror o
by thom
Aug 1, 2003
The Unsharp Mask: Analog Photoshop
Sample of unsharp masking in the darkroom, before digital {{DEFAULTSORT:Unsharp Masking Image processing