30
SHARPENING PROCESS IN SPATIAL DOMAIN by T Sathiyabama K Shunmuga Priya M Sahaya Preetha R Rajalakshmi Dept of Computer Science and Engineering, MS University, Tirunelveli

Sharpening in spatial domain

Embed Size (px)

Citation preview

Sharpening Spatial Filters

Sharpening process in spatial domain

by T Sathiyabama K Shunmuga PriyaM Sahaya PreethaR RajalakshmiDept of Computer Science and Engineering,MS University, Tirunelveli

Definition

The principal objective of Sharpening is to highlight transitions in intensity

To fine detail in an image or to enhance detail that has been blurred, either in error or as an natural effect of a particular method of image acquisition

Image Sharpening is vary and include applications ranging from electronic printing and medical imaging to industrial inspection and autonomous guidance in military systems

10/25/2016 10:58 AM2

Sathya MS University2

The image blurring is accomplished in the spatial domain by pixel averaging in a neighborhood.

Since averaging is analogous to integration.

Sharpening could be accomplished by spatial differentiation.

10/25/2016 10:51 AM3

Foundation

We are interested in the behavior of these derivatives in areas of constant gray level(flat segments), at the onset and end of discontinuities(step and ramp discontinuities), and along gray-level ramps.

These types of discontinuities can be noise points, lines, and edges.

10/25/2016 10:51 AM4

Definition for a first derivativeMust be zero in flat segmentsMust be nonzero at the onset of a gray-level step or rampMust be nonzero along rampsA basic definition of the first-order derivative of a one-dimensional function f(x) is

10/25/2016 10:51 AM5

Definition for a second derivativeMust be zero in flat areasMust be nonzero at the onset and end of a gray-level step or rampMust be zero along ramps of constant slopeWe define a second-order derivative as the difference

10/25/2016 10:51 AM6

First and second-order derivatives in digital form => difference

10/25/2016 10:51 AM7

Sathya MS University7

Gray-level profile

10/25/2016 10:51 AM8660123002222233333000000007755

76543210

Derivative of image profile10/25/2016 10:51 AM90 0 0 1 2 3 2 0 0 2 2 6 3 3 2 2 3 3 0 0 0 0 0 0 7 7 6 5 5 3 0 0 1 1 1-1-2 0 2 0 4-3 0-1 0 1 0-3 0 0 0 0 0-7 0-1-1 0-2

0-1 0 0-2-1 2 2-2 4-7 3-1 1 1-1-3 3 0 0 0 0-7 7-1 0 1-2

firstsecond

Analyze

The 1st-order derivative is nonzero along the entire ramp, while the 2nd-order derivative is nonzero only at the onset and end of the ramp

The response at and around the point is much stronger for the 2nd- than for the 1st-order derivative

10/25/2016 10:51 AM10

2nd derivatives for image Sharpening 2-D 2nd derivatives => Laplacian

10/25/2016 10:51 AM11

=>discrete formulation

Sathya MS University11

Definition of 2nd derivatives in filter mask900 rotationinvariant450 rotationinvariant(include Diagonals)

4------------810/25/2016 10:51 AM12

Implementation

10/25/2016 10:51 AM13If the center coefficient is negativeIf the center coefficient is positive Where f(x,y) is the original image

is Laplacian filtered image

g(x,y) is the sharpen image

Laplacian filtering: example10/25/2016 10:51 AM14

Original image Laplacian filtered image

Implementation

10/25/2016 10:51 AM15

Implementation

10/25/2016 10:51 AM16Filtered = Conv(image,mask)

Implementation

10/25/2016 10:51 AM17filtered = filtered - Min(filtered) filtered = filtered * (255.0/Max(filtered))

Implementation

10/25/2016 10:51 AM18sharpened = image + filtered sharpened = sharpened - Min(sharpened ) sharpened = sharpened * (255.0/Max(sharpened ))

AlgorithmUsing Laplacian filter to original imageAnd then add the image result from step 1 and the original image We will apply two step to be one mask

10/25/2016 10:51 AM19

10/25/2016 10:51 AM20-1-15-1-10000-1-19-1-1-1-1-1-1

Unsharp masking A process to sharpen images consists of subtracting a blurred version of an image from the image itself. This process, called unsharp masking, is expressed as

10/25/2016 10:51 AM21

Where denotes the sharpened image obtained by unsharp masking, an is a blurred version of

High-boost filtering A high-boost filtered image, fhb is defined at any point (x,y) as

10/25/2016 10:51 AM22

This equation is applicable general and does not state explicity how the sharp image is obtained

High-boost filtering and Laplacian If we choose to use the Laplacian, then we know fs(x,y)

10/25/2016 10:51 AM23If the center coefficient is negativeIf the center coefficient is positive-1-1A+4-1-10000-1-1A+8-1-1-1-1-1-1

The Gradient (1st order derivative) First Derivatives in image processing are implemented using the magnitude of the gradient.The gradient of function f(x,y) is

10/25/2016 10:51 AM24

Gradient The magnitude of this vector is given by

-111-1GxGyThis mask is simple, and no isotropic. Its result only horizontal and vertical.10/25/2016 10:51 AM25

Roberts Method The simplest approximations to a first-order derivative that satisfy the conditions stated in that section are

z1z2z3z4z5z6z7z8z9Gx = (z9-z5) and Gy = (z8-z6)10/25/2016 10:51 AM26

Roberts Method These mask are referred to as the Roberts cross-gradient operators.-1001-100110/25/2016 10:51 AM27

Sobels Method Using this equation

-1-2-10001211-21000-12-110/25/2016 10:51 AM28

Gradient: example

defectsoriginal(contact lens)Sobel gradient Enhance defects and eliminate slowly changing background10/25/2016 10:51 AM29

10/25/2016 10:51 AM30