SlideShare a Scribd company logo
1 of 170
Course No.: CSC 447
Lect.: 3 h
Lab. : 2 h
Marks: 65 final
10 Y. work
25 Lab
Exam hours: 3 h
By Prof. Dr. :
Taymoor Nazmy
īŦImage processing applications,
īŦPicture modeling,
īŦEnhancement in spatial domain,
īŦEnhancement in frequency domain,
īŦRestoration,
īŦSegmentation,
īŦScene analysis,
1-Applications of image processing
in remote sensing.
īŦ2- Image processing using NN.
3- Techniques of images retrieval.
4- Registration of medical images.
īŦ5- Image synthesize.
īŦ.
īŦ6- Image processing using pde.
īŦ7- Methods of texture analysis.
īŦ8- Reconstruction techniques.
9- Image processing using parallel
algorithm.
īŦ10- Multiresolution processing
īŦ11- Open.
īŦ12- Open
īŦThe text book
īŦDigital Image Processing
īŦUsing Matlab
īŦRafael C. Gonzalez
īŦUniversity of Tennessee
īŦRichard E. Woods
Title
LAB. ASS.
No.
Read , view, and display an image file1-
Zooming and Shrinking Images by Pixel Replication.2-
Image Enhancement Using Intensity Transformations.3-
â€ĸHistogram equalization & log. transformation.4-
â€ĸArithmetic operations & logic operation5-
Noise Generators & Noise Reduction.6-
Spatial filtering (smoothing & sharpening)7-
Two-Dimensional Fast Fourier Transfor.8-
Lowpass Filtering9-
Convert gray level image to color10-
FFT, and Hough transform11-
Image
Acquisition
Preprocessing Segmentation
Representation &
Description
Recognition &
Interpretation
Problem
Domain
Knowledge
Base
Result
Ultrasound Image īŦProfiles of a
fetus at 4
months, the
face is about
4cm long
īŦUltra sound
image is
another
imaging
modality
īŦThe fetal arm
with the major
arteries
(radial and
ulnar) clearly
delineated.
īŦSection through Visible
Human Male - head,
including cerebellum,
cerebral cortex,
brainstem, nasal passages
(from Head subset)
īŦThis is an example of the
“visible human project”
sponsored by NIH
Image processing using Matlab tool box
Example of Matlab functions â€Ļ
īŦInput / Output
>>imread
>>imwrite
Image Display
>>imshow
īŦOthers
>>axis
>>colorbar
>>colormap
>>fft, fft2
Image Storage Formats
ī‚§ To store an image, the image is represented in a two-
dimensional matrix, in which each value corresponds
to the data associated with one image pixel.
ī‚§ When storing an image, information about each pixel,
the value of each colour channel in each pixel, has to
be stored.
ī‚§ Additional information may be associated to the
image as a whole, such as height and width, depth, or
the name of the person who created the image.
ī‚§ The most popular image storing formats include
PostScript, GIF (Graphics Interchange Format),
JPEG, TIFF (Tagged Image File Format), BMP
(Bitmap), etc.
Chapter 2
Image Formation in the Eye
17100
15 x
ī€Ŋ
mmx 55.2ī€Ŋ
–Calculation of retinal image of an object
â€ĸThe eye has a sensor plane (100 million pixels)
The eyes have a USB2 data rate!
250,000 neurons in the optic nerve
variable voltage output on EACH nerve
17.5 million neural samples per second
12.8 bits per sample
224 Mbps, per eye (a 1/2 G bps system!).
Compression using lateral inhibition
between the retinal neurons
CCD KAF-3200E from Kodak.
(2184 x 1472 pixels,
Pixel size 6.8 microns2)
Image Sensor:Charge-Coupled Device (CCD)
w Used for convert a continuous
image into a digital image
w Contains an array of light sensors
wConverts photon into electric charges
accumulated in each sensor unit
Typical IP System
DIP Corrections
and/or
Enhancements
A/D
Scene Sensor A/D Media
D/A
D/A
Display
Digital Image Acquisition
An color image
Fundamentals of Digital Images
f(x,y)
x
y
w An image: a multidimensional function of spatial coordinates.
w Spatial coordinate: (x, y) for 2D case such as photograph,
(x, y, z) for 3D case such as CT scan images
(x, y, t) for movies.
w The function f may represent intensity (for monochrome images)
or color (for color images).
Origin
Representing digital image
īƒē
īƒē
īƒē
īƒē
īƒģ
īƒš
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒĢ
īƒŠ
ī€­ī€­ī€­ī€­
ī€­
ī€­
ī€Ŋ
)1,1(...)1,1()0,1(
............
)1,1(......)0,1(
)1,0(...)1,0()0,0(
),(
MNfNfNf
Mff
Mfff
yxf
Digital Image Picture Elements
(Pixels)
The value of f at (x,y) īƒ  the intensity (brightness) of
the image at that point.
Image Types
Intensity image or monochrome image
each pixel corresponds to light intensity
normally represented in gray scale (gray
level).
īƒē
īƒē
īƒē
īƒē
īƒē
īƒš
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒŠ
39871532
22132515
372669
28161010
Gray scale values
īƒē
īƒē
īƒē
īƒē
īƒē
īƒš
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒŠ
39871532
22132515
372669
28161010
īƒē
īƒē
īƒē
īƒē
īƒē
īƒš
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒŠ
39656554
42475421
67965432
43567065
īƒē
īƒē
īƒē
īƒē
īƒē
īƒš
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒŠ
99876532
92438585
67969060
78567099
Image Types
Color image or RGB image:
each pixel contains a vector
representing red, green and
blue components.
RGB components
Color image:
For example, 24-bit image or 24 bits per
pixel. There are 16,777,216 (224) possible
colors.
In other words, 8 bits for R(Red), 8 bits
for G(Green), 8 bits for B(Blue).
Since each value is in the range 0-255,
this format supports 256 x 256 x 256.
Image Types
Binary image or black and white image
Each pixel contains one bit :
1 represent white
0 represents black
īƒē
īƒē
īƒē
īƒē
īƒē
īƒš
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒŠ
1111
1111
0000
0000
Binary data
Image Types
Index image
Each pixel contains index number
pointing to a color in a color table
īƒē
īƒē
īƒē
īƒē
īƒš
īƒĒ
īƒĒ
īƒĒ
īƒĒ
īƒŠ
256
746
941
Index value
Index
No.
Red
component
Green
component
Blue
component
1 0.1 0.5 0.3
2 1.0 0.0 0.0
3 0.0 1.0 0.0
4 0.5 0.5 0.5
5 0.2 0.8 0.9
â€Ļ â€Ļ â€Ļ â€Ļ
Color Table
Image Sampling
Image sampling: discretize an image in the spatial domain
Spatial resolution / image resolution:
pixel size or number of pixels
Sampling & Quantization
â€ĸ The spatial and amplitude digitization of f(x,y) is
called:
â€ĸ - image sampling when it refers to spatial coordinates
(x,y) and
â€ĸ - gray-level quantization when it refers to the amplitude.
The digitization process requires decisions about: values
for N,M (where N x M: the image array) and
the number of discrete gray levels allowed for each
pixel.
Sampling and Quantization
Example for image sampling
Example for image resample
Effect of Quantization Levels
16 levels 8 levels
2 levels4 levels
Sampling & Quantization
â€ĸ Different versions (images) of the same
object can be generated through:
– Varying N, M numbers
– Varying k (number of bits)
– Varying both
Isopreference curves (in the NK plane)
â€ĸ Isopreference curves (in the NK plane)
– Each point: image having values of N and k
equal to the coordinates of this point
– Points lying on an isopreference curve
correspond to images of equal subjective
quality.
Examples for images with different details
Isopreference Curves
Sampling & Quantization
â€ĸ Conclusions:
– Quality of images increases as N & k increase
– Sometimes, for fixed N, the quality improved
by decreasing k (increased contrast)
– For images with large amounts of detail, few
gray levels are needed
Some Basic Relationship Between Pixels
(x,y) (x+1,y)(x-1,y)
(x,y-1)
(x,y+1)
(x+1,y-1)(x-1,y-1)
(x-1,y+1) (x+1,y+1)
y
x
(0,0)
Definition: f(x,y): digital image, Pixels: q, p
S: Subset of pixels of f(x,y).
Neighbors of a Pixel
p (x+1,y)(x-1,y)
(x,y-1)
(x,y+1)
4-neighbors of p:
N4(p) =
(xī€­1,y)
(x+1,y)
(x,yī€­1)
(x,y+1)
Neighborhood relation is used to tell adjacent pixels. It is
useful for analyzing regions.
Note: q īƒŽī€ N4(p) implies p īƒŽī€ N4(q)
4-neighborhood relation considers only vertical and
horizontal neighbors.
p (x+1,y)(x-1,y)
(x,y-1)
(x,y+1)
(x+1,y-1)(x-1,y-1)
(x-1,y+1) (x+1,y+1)
Neighbors of a Pixel (cont.)
8-neighbors of p:
(xī€­1,yī€­1)
(x,yī€­1)
(x+1,yī€­1)
(xī€­1,y)
(x+1,y)
(xī€­1,y+1)
(x,y+1)
(x+1,y+1)
N8(p) =
8-neighborhood relation considers all neighbor pixels.
p
(x+1,y-1)(x-1,y-1)
(x-1,y+1) (x+1,y+1)
Diagonal neighbors of p:
ND(p)=
(xī€­1,yī€­1)
(x+1,yī€­1)
(xī€­1,y+1)
(x+1,y+1)
Neighbors of a Pixel (cont.)
Diagonal -neighborhood relation considers only diagonal
neighbor pixels.
Connectivity
â€ĸ Two pixels are connected if:
– They are neighbors (i.e. adjacent in some sense
e.g. N4(p), N8(p), â€Ļ)
– Their gray levels satisfy a specified criterion of
similarity (e.g. equality, â€Ļ)
â€ĸ V is the set of gray-level values used to
define adjacency (e.g. V = {1} for
adjacency of pixels of value 1)
Adjacency
â€ĸ We consider three types of adjacency:
– 4-adjacency: two pixels p and q with values
from V are 4-adjacent if q is in the set N4(p)
– 8-adjacency : p & q are 8- adjacent if q is in the
set N8(p)
Adjacency
â€ĸ The third type of adjacency:
â€ĸ -m-adjacency: p & q with values from V are m-
adjacent if:
- q is in N4(p) or
- q is in ND(p) and the set N4(p)īƒ‡N4(q) has
no pixels with values from V
Two image subsets S1 and S2 are adjacent if some pixel in
S1 is adjacent to some pixel in S2
S1
S2
Adjacency
â€ĸ Mixed adjacency is a modification of 8-
adjacency and is used to eliminate the
multiple path connections that often arise
when 8-adjacency is used.
100
010
110
100
010
110
100
010
110
Path
A path from pixel p at (x,y) to pixel q at (s, t) is
a sequence of distinct pixels:
(x0, y0), (x1, y1), (x2, y2),â€Ļ, (xn, yn)
such that
(x0,y0) = (x,y) and (xn, yn) = (s,t)
and
(xi, yi) is adjacent to (xi-1, yi-1), i = 1,â€Ļ,n
p
q
We can define type of path: 4-path, 8-path or m-path
depending on type of adjacency.
Distance
For pixel p, q, and z with coordinates (x,y), (s,t) and (u,v),
D is a distance function or metric if
w D (p, q) ī‚ŗī€ 0 (D (p, q) = 0 if and only if p = q)
D (p, q) = D (q, p)
D (p, z) ī‚Ŗī€ ī€ D (p, q) + D (q, z)
Euclidean distance:
22
)()(),( tysxqpDe ī€­+ī€­ī€Ŋ
Distance (cont.)
D4 - distance (city-block distance) is defined as
tysxqpD ī€­+ī€­ī€Ŋ),(4
1 2
10
1 2
1
2
2
2
2
2
2
Pixels with D4(p) = 1 is 4-neighbors of p.
Pixels with D4 (p) = 2 is not 4-diagonl of p.
Distance (cont.)
D8 - distance (chessboard distance) is defined as
),max(),(8 tysxqpD ī€­ī€­ī€Ŋ
1
2
10
1
2
1
2
2
2
2
2
2
Pixels with D8 (p) = 1 is 8-neighbors of p.
22
2
2
2
222
1
1
1
1
Our objectives of studying this topic:
1- To know how to read the transformations
charts & histograms,
2- To evaluate the image quality,
3- To understand the principals of IP techniques.
4- To be able to develop IP algorithms,
Most IP techniques depend on the concepts used in this
chapter.
Spatial Domain Methods
īŦProcedures that operate directly on the
aggregate of pixels composing an
image
īŦ
īŦA neighborhood about (x,y) is defined
by using a square (or rectangular)
subimage area centered at (x,y).
)],([),( yxfTyxg ī€Ŋ
f(x,y) g(x,y)
Spatial Domain Methods
īŦWhen the neighborhood is 1 x 1 then g
depends only on the value of f at (x,y) and T
becomes a gray-level transformation (or
mapping) function:
īŦs=T(r)
Where: r denotes the pixel intensity before
processing.
ī‚Ąs denotes the pixel intensity after
processing.
Image Enhancement in the Spatial Domain
Contrast Stretching: the values
for r below m are expanded
into wide range of s.
Thresholding: produce binary
image from gray level one.
Some Simple Intensity Transformations
Linear:
Negative,
Identity
Logarithmic:
Log, Inverse
Log
Power-Law: nth
power, nth root
1-Image Negatives
īŦAre obtained by using the
transformation function s=T(r).
[0,L-1] the range of gray levels
S= L-1-r
Image Enhancement in the
Spatial Domain
2-
Image Enhancement in the Spatial Domain
3-
Image Enhancement in the Spatial Domain
ī§=c=1: identity
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
īŦ- 1-Contrast Stretching transformation:
The locations of (r1,s1) and (r2,s2) control the shape of the
transformation function.
If r1= s1 and r2= s2 the transformation is a linear function
and produces no changes.
ī‚ĄIf r1=r2, s1=0 and s2=L-1, the
transformation becomes a thresholding
function that creates a binary image.
ī‚ĄIntermediate values of (r1,s1) and (r2,s2)
produce various degrees of spread in the gray
levels of the output image, thus affecting its
contrast.
ī‚ĄGenerally, r1≤r2 and s1≤s2 is assumed.
2- Gray-Level Slicing Transformation
īŦTo highlight a specific range of gray
levels in an image (e.g. to enhance
certain features).
One way is to display a
high value for all gray
levels in the range of
interest and a low value
for all other gray levels
(binary image).
Gray-Level Slicing
ī‚ĄThe second approach is to brighten the
desired range of gray levels but preserve the
background and gray-level tonalities in the
image:
Gray-Level Slicing
Histogram Processing
â€ĸThe histogram of a digital image with gray levels
from 0 to L-1 is a discrete function where:
Âģrk is the kth gray level
–nk is the # pixels in the image with that gray
level
–n is the total number of pixels in the image
k = 0, 1, 2, â€Ļ, L-1
â€ĸNormalized histogram: p(rk) = nk / n
â€ĸsum of all components = 1
īŦHistogram Is Invariant Under Certain
Image Operations
ī‚ĄRotation, scaling, flip
Rotate Clockwise
Scale
Flip
Histogram for an image with total n pixels
Histogram stretching:
For an image f(x,y) with gray level r at x,y this value can be transformed
to another gray level value s in the new image g(x,y), using the following
equ.:
g(x,y) = [(r- rmin) / ( rmax- rmin)] * [Max-Min] +Min
Where: rmax is the largest gray level in the image f(x,y).
rmin is the smallest gray level in the image f(x,y).
Max, Min correspond to the maximum and minimum
gray level values possible for the image g(x,y), (0-255).
Histogram shrinking :
g(x,y) = [( Max - Min ) / (rmax-rmin)] * [r – rmin] + Min
Where: Max, Min correspond to the maximum and minimum
desired gray level in the compressed (shrink) histogram.
Histogram Processing
â€ĸHistograms are the basis for numerous
spatial domain processing techniques, in
addition it is providing useful image
statistics.
â€ĸTypes of processing:
Histogram equalization
Histogram matching (specification)
Local enhancement
To get a histogram equalization:
-Ex: if the gray levels for an image is given by k = 0, 1, 2, 3 and
number of pixels corresponding to these gray levels are 10,7,8,2
(histogram values), and the maximum k can be 7 (3bits/pixel).
-1- The sum of these values are 10, 17 , 25, 27.
-2- Normalize these values by dividing by the total number of
pixels, 27, we get 10/27, 17/27, 25/27, 27/27.
-3- Multiply these values by the maximum gray level value
available , 7, and then round the result to the closest integer. So, we
get the equalized values to be, 3,4, 6, 7 .
-4- The final step is done by putting all pixels in the original
image with k = 0, 1, 2, 3 to be with the new gray level distribution, 3,
4, 6 ,7.
.The global mean and variance are measured over an entire
image and are useful for overall intensity ad contrast
adjustments.The more powerful use of these parameters is in
local enhancement.
Let (x,y) be the coordinates of a pixel in an image, and let
Sx,y
denote a neighborhood (subimage) of specified size, centered
at (x,y). The mean value of mSx,y of the pixels Sx,y can be
computed using the equ.;
Use of histogram statistics for image enhancement
Where rs,t is the gray level at coordinates (s,t) in
the neighborhood, and p(rs,t) is the neighborhood
normalized histogram component corresponding to
that value of gray level.
The local mean is a measure of average gray level
in neighborhood Sx,y , and the variance is a
measure of contrast in that neighborhood.
- =
(absolute difference)
Image subtraction
Image Enhancement in the
Spatial Domain
Image Averaging
A noisy image:
),(),(),( yxnyxfyxg +ī€Ŋ
Averaging M different noisy images:
īƒĨī€Ŋ
ī€Ŋ
M
i
i yxg
M
yxg
1
),(
1
),(
Image Averaging
As M increases, the variability of the pixel
values at each location decreases.
This means that g(x,y) approaches f(x,y) as the
number of noisy images used in the averaging
process increases.
Registering of the images is necessary to
avoid blurring in the output image.
Image Enhancement in the
Spatial Domain
Basic of spatial filtering
Template, Window, and Mask Operation
Question: How to compute the 3x3 average values at every pixels?
4
4
67
6
1
9
2
2
2
7
5
2
26
4
4
5
212
1
3
3
4
2
9
5
7
7
Solution: Imagine that we have
a 3x3 window that can be placed
everywhere on the image
Masking Window
4.3
Template, Window, and Mask Operation (cont.)
Step 1: Move the window to the first location where we want to
compute the average value and then select only pixels
inside the window.
4
4
67
6
1
9
2
2
2
7
5
2
26
4
4
5
212
1
3
3
4
2
9
5
7
7
Step 2: Compute
the average value
Sub image p
Original image
4 1
9
2
2
3
2
9
7
Output image
Step 3: Place the
result at the pixel
in the output image
Step 4: Move the
window to the next
location and go to Step 2
Template, Window, and Mask Operation (cont.)
The 3x3 averaging method is one example of the mask
operation or one of the Spatial filters .
w The mask operation has the corresponding mask (sometimes
called window or template).
wThe mask of size m x n contains coefficients to be multiplied
w with pixel values.
w(-1,1) w(-1,1)
w(1,1)
w(0,0)
w(1,0)
w(0,1)
w(-1,-1)
w(0,-1)
w(1,-1)
Mask coefficients
1 1
1
1
1
1
1
1
1
9
1
Example : moving averaging
The mask of the 3x3 moving average
filter has all coefficients = 1/9
s
Template, Window, and Mask Operation (cont.)
The mask operation at each point is performed by:
1. Move the reference point (center) of mask to the
location to be computed
2. Compute sum of products between mask coefficients
and pixels in subimage under the mask.
Ex: For a 3*3 mask the response R of the linear filter at a
point (x,y) in the image is:
R = w(-1,-1) f( x-1,y-1)+ w(-1,0) f(x-1,y) +
w(-1,1) f(x-1,y+1) +
w(0,-1) f(x,y-1) + w(0,0) f(x,y) + w(0,1) f(x,y+1)
+ w(1,-1) f(x+1,y-1)+ w(1,0) f(x+1,y) +
w(1,1)f(x+1,y+1)
Template, Window, and Mask Operation (cont.)
Examples of the masks
Sobel operators
0 1
1
0
0
1
-1
-2
-1
-2 -1
1
0
2
0
-1
0
1
1 1
1
1
1
1
1
1
1
9
1
3x3 moving average filter
3x3 sharpening filter
-1 -1
-1
8
-1
-1
-1
-1
-1
a)Original
image,
b,c,d,e, f
,smoothed
images
with
square
averaging
filter
Masks of
size
N=3,5,9,15
c d
e f
a b
A low pass filter (kernal) would
blur the original
â€ĸAll positive values in a filter indicate a blurring operation
â€ĸThe larger the kernal, the higher the blur
â€ĸThe flatter the kernal, the higher the blur
1 1 1
1 1 1
1 1 1
1 1 1
1 2 1
1 1 1
1 1 1
1 4 1
1 1 1
Less blur
1/9 1/121/10
Nonlinear smoothing filters
(Order-Statistics filters)
They are nonlinear spatial filters whose
response is based on ordering the pixels
contained in the image area encompassed by the
filter, and then replacing the value of the center
pixel with the value determine by the ranking
(ordering) result.
Median , max, and min filters are examples of
order filters.However, median filter is the most
useful order-statistics filter.
Sharpening Filters
īŦTo highlight fine detail or to enhance
blurred detail.
ī‚Ąsmoothing ~ integration => summation
ī‚Ąsharpening ~ differentiation => differences
īŦCategories of sharpening filters:
ī‚ĄDerivative operators
īŦ- High-boost filtering
Derivatives
Derivatives
â€ĸ First derivative
â€ĸ for one dimensional digital function is defined in term of
differences such as:
â€ĸ Second derivative
ī‚ ī€ 
ī‚ļf
ī‚ļx
ī€Ŋ f (x +1) ī€­ f (x)
ī‚ļ2
f
ī‚ļx2
ī€Ŋ f (x +1) + f (x ī€­1) ī€­2 f (x)
Digital Function Derivatives
īŦFirst derivative:
ī‚Ą0 in constant gray segments
ī‚ĄNon-zero at the onset of steps or ramps
ī‚ĄNon-zero along ramps
īŦSecond derivative:
ī‚Ą0 in constant gray segments
ī‚ĄNon-zero at the onset and end of steps or ramps
ī‚Ą0 along ramps of constant slope.
Observations
īŦ1st order derivatives produce thicker edges in an
image,
īŦ2nd order derivatives have stronger response to fine
detail,
īŦ1st order derivatives have stronger response to a
gray level step,
īŦ2nd order derivatives produce a double response at
step changes in gray level,
īŦ2nd order derivatives have stronger response to a line
than to a step and to a point than to a line.
Roberts
operators
Perwitt First derivative
Filter mask of size 3*3
in x and y directions
Sobel first derivative
Filter mask of size 3*3
in x and y directions
Roberts
operators
Sobel
operators
Combining
Spatial
Enhancement
Methods
2-D, 2nd Order Derivatives
for Image Enhancement
īŦLaplacian (linear operator):
īŦDiscrete version:
ī‚ ī€ 
īƒ‘2
f ī€Ŋ
ī‚ļ2
f
ī‚ļx2
+
ī‚ļ2
f
ī‚ļy2
ī‚ļ2
f
ī‚ļ2
x2
ī€Ŋ f (x + 1, y) + f (x ī€­1, y) ī€­ 2 f (x, y)
ī‚ļ2
f
ī‚ļ2
y2
ī€Ŋ f (x, y + 1) + f (x, y ī€­1) ī€­ 2 f (x, y)
Laplacian Enhancement
Laplacian Spatial Filtering
â€ĸ The sum of the coefficients is 0, indicating
that when the filter is passing over regions
of almost stable gray levels, the output of
the mask is 0 or very small.
â€ĸ Some scaling and/or clipping is involved (to
compensate for possible negative gray levels
after filtering).
Laplacian
īŦDigital implementation:
īŦTwo definitions of Laplacian: one is the negative of the other
īŦAccordingly, to recover background features:
īŦ: if the center coefficient of the Laplacian mask is negative
II: if the center coefficient of the Laplacian mask is positive.
īƒ‘2
f ī€Ŋ[f (x +1,y)+ f (xī€­1,y)+ f (x,y +1)+ f (x,yī€­1)]ī€­4 f (x,y)
g(x,y) ī€Ŋ{ f ( x,y)+īƒ‘2 f ( x,y)( II )
f ( x,y)ī€­īƒ‘2 f ( x,y)( I )
Simplification
īŦFilter and recover original part in one step:
g(x,y)ī€Ŋ f(x,y)ī€­[f(x+1,y)+ f(xī€­1,y)+ f(x,y+1)+ f(x,yī€­1)]+4f(x,y)
g(x,y) ī€Ŋ5f (x,y)ī€­[ f (x +1,y)+ f (x ī€­1,y)+ f (x,y +1)+ f (x,y ī€­1)]
Image Enhancement in the Spatial Domain
A high pass filter (kernal) would
sharpen the original
â€ĸ Negative values in a filter surrounding a center positive value
indicate a sharpening operation
â€ĸ The larger the negative values, the higher the sharpening
â€ĸ “Noise” is also sharpened when sharpening an image
More sharpening
0 -1 0
-1 5 -1
0 -1 0
1 -2 1
-2 5 -2
1 -2 1
īŦHighpass filtered image = Original – lowpass filtered image.
īŦwhere fs(x,y) denotes the sharpened image obtained by
unsharp mask process.
īŦHigh-boost filter is generalization of unsharp masking, If A is an
multiplication factor, then high-boost filter is given by:
fhb(x,y) = (A-1) f(x,y)+ fs(x,y)
= (A-1) · original + original – lowpass
= (A-1) ¡ original + highpass
ī‚ ī€ 
fs(x,y) ī€Ŋ f (x,y) ī€­ f (x,y)
))(,(2),(
))(,(2),(
{
IyxfyxAf
IIyxfyxAfhbf
ī€­īƒ‘
īƒ‘+
ī€Ŋ
I: if the center coefficient of the Laplacian mask is negative
II: if the center coefficient of the Laplacian mask is positive.
fhb(x,y) = (A-1) f(x,y)+ fs(x,y)
If we use Laplacian as an image sharper, then one
Can replace fs(x,y) by g(x,y)(for Laplacian)
High-boost Filtering
īŦA=1 : standard highpass result
īŦA>1 : the high-boost image looks more like
the original with a degree of edge
enhancement, depending on the value of
A.
-1 -1
-1
A+8
-1
-1
-1
-1
-1
-1 0
0
A+4
-1
-1
0
-1
0
Image Enhancement in the Spatial Domain
Steps in processing an image
“noise cleanup”
ex. median filtering
Determining content of image
(ex. histograms)
Image Sharpening and Blurrring
(ex. Convolution, Unsharp Masking, etc)
Adjust
Brightness/Contrast/Tonal
Range
(ex. histogram manipulations)
Capture
(digitize)
image
Output
(print/displa
y)
image

More Related Content

What's hot

Deep-Learning Based Stereo Super-Resolution
Deep-Learning Based Stereo Super-ResolutionDeep-Learning Based Stereo Super-Resolution
Deep-Learning Based Stereo Super-ResolutionNAVER Engineering
 
IT6005 digital image processing question bank
IT6005   digital image processing question bankIT6005   digital image processing question bank
IT6005 digital image processing question bankGayathri Krishnamoorthy
 
Image processing1 introduction
Image processing1 introductionImage processing1 introduction
Image processing1 introductionPreeti Gupta
 
Comparing the Performance of Different Ultrasonic Image Enhancement Technique...
Comparing the Performance of Different Ultrasonic Image Enhancement Technique...Comparing the Performance of Different Ultrasonic Image Enhancement Technique...
Comparing the Performance of Different Ultrasonic Image Enhancement Technique...Md. Shohel Rana
 
Filter for Removal of Impulse Noise By Using Fuzzy Logic
Filter for Removal of Impulse Noise By Using Fuzzy LogicFilter for Removal of Impulse Noise By Using Fuzzy Logic
Filter for Removal of Impulse Noise By Using Fuzzy LogicCSCJournals
 
Digital image processing ppt
Digital image processing pptDigital image processing ppt
Digital image processing pptkhanam22
 
A (very brief) Introduction to Image Processing and 3D Printing with ImageJ
A (very brief) Introduction to Image Processing and 3D Printing with ImageJA (very brief) Introduction to Image Processing and 3D Printing with ImageJ
A (very brief) Introduction to Image Processing and 3D Printing with ImageJPaul Mignone, Ph.D
 
CBIR Final project1
CBIR Final project1CBIR Final project1
CBIR Final project1YASWANTH KALEPU
 
Image Processing Basics
Image Processing BasicsImage Processing Basics
Image Processing BasicsA B Shinde
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsasodariyabhavesh
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filteringSanyam Agarwal
 
Image Acquisition
Image AcquisitionImage Acquisition
Image Acquisitionshail288
 

What's hot (20)

Deep-Learning Based Stereo Super-Resolution
Deep-Learning Based Stereo Super-ResolutionDeep-Learning Based Stereo Super-Resolution
Deep-Learning Based Stereo Super-Resolution
 
F0533134
F0533134F0533134
F0533134
 
Mathematical tools in dip
Mathematical tools in dipMathematical tools in dip
Mathematical tools in dip
 
IT6005 digital image processing question bank
IT6005   digital image processing question bankIT6005   digital image processing question bank
IT6005 digital image processing question bank
 
Image processing1 introduction
Image processing1 introductionImage processing1 introduction
Image processing1 introduction
 
Comparing the Performance of Different Ultrasonic Image Enhancement Technique...
Comparing the Performance of Different Ultrasonic Image Enhancement Technique...Comparing the Performance of Different Ultrasonic Image Enhancement Technique...
Comparing the Performance of Different Ultrasonic Image Enhancement Technique...
 
Basic image processing techniques
Basic image processing techniquesBasic image processing techniques
Basic image processing techniques
 
Filter for Removal of Impulse Noise By Using Fuzzy Logic
Filter for Removal of Impulse Noise By Using Fuzzy LogicFilter for Removal of Impulse Noise By Using Fuzzy Logic
Filter for Removal of Impulse Noise By Using Fuzzy Logic
 
Digital image processing ppt
Digital image processing pptDigital image processing ppt
Digital image processing ppt
 
A (very brief) Introduction to Image Processing and 3D Printing with ImageJ
A (very brief) Introduction to Image Processing and 3D Printing with ImageJA (very brief) Introduction to Image Processing and 3D Printing with ImageJ
A (very brief) Introduction to Image Processing and 3D Printing with ImageJ
 
CBIR Final project1
CBIR Final project1CBIR Final project1
CBIR Final project1
 
Image processing
Image processingImage processing
Image processing
 
Image Processing Basics
Image Processing BasicsImage Processing Basics
Image Processing Basics
 
Chapter01 (2)
Chapter01 (2)Chapter01 (2)
Chapter01 (2)
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woods
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Image Acquisition
Image AcquisitionImage Acquisition
Image Acquisition
 
M.sc.iii sem digital image processing unit iv
M.sc.iii sem digital image processing unit ivM.sc.iii sem digital image processing unit iv
M.sc.iii sem digital image processing unit iv
 
Image processing Presentation
Image processing PresentationImage processing Presentation
Image processing Presentation
 

Similar to Image processing 1-lectures

Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfnagwaAboElenein
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and RepresentationAmnaakhaan
 
quantization and sampling presentation ppt
quantization and sampling presentation pptquantization and sampling presentation ppt
quantization and sampling presentation pptKNaveenKumarECE
 
chap2.ppt is the presentation of image of eye.
chap2.ppt is the presentation of image of eye.chap2.ppt is the presentation of image of eye.
chap2.ppt is the presentation of image of eye.YogeshRotela
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIPbabak danyal
 
Digital Image Fundamentals 1.ppt
Digital Image Fundamentals 1.pptDigital Image Fundamentals 1.ppt
Digital Image Fundamentals 1.pptMrsSDivyaBME
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - IIHemantha Kulathilake
 
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...Shahbaz Alam
 
Chapter-1.pptx
Chapter-1.pptxChapter-1.pptx
Chapter-1.pptxSMohiuddin1
 
Image Texture Analysis
Image Texture AnalysisImage Texture Analysis
Image Texture Analysislalitxp
 
A Novel and Robust Wavelet based Super Resolution Reconstruction of Low Resol...
A Novel and Robust Wavelet based Super Resolution Reconstruction of Low Resol...A Novel and Robust Wavelet based Super Resolution Reconstruction of Low Resol...
A Novel and Robust Wavelet based Super Resolution Reconstruction of Low Resol...CSCJournals
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 
Image enhancement
Image enhancementImage enhancement
Image enhancementKuppusamy P
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsMostafa G. M. Mostafa
 
Digital image processing fundamental explanation
Digital image processing fundamental explanationDigital image processing fundamental explanation
Digital image processing fundamental explanationTirusew1
 

Similar to Image processing 1-lectures (20)

Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
 
quantization and sampling presentation ppt
quantization and sampling presentation pptquantization and sampling presentation ppt
quantization and sampling presentation ppt
 
chap2.ppt is the presentation of image of eye.
chap2.ppt is the presentation of image of eye.chap2.ppt is the presentation of image of eye.
chap2.ppt is the presentation of image of eye.
 
chap2.ppt
chap2.pptchap2.ppt
chap2.ppt
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIP
 
Digital Image Fundamentals 1.ppt
Digital Image Fundamentals 1.pptDigital Image Fundamentals 1.ppt
Digital Image Fundamentals 1.ppt
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - II
 
2. IP Fundamentals.pdf
2. IP Fundamentals.pdf2. IP Fundamentals.pdf
2. IP Fundamentals.pdf
 
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
A Comparative Study of Histogram Equalization Based Image Enhancement Techniq...
 
Chapter-1.pptx
Chapter-1.pptxChapter-1.pptx
Chapter-1.pptx
 
Image Texture Analysis
Image Texture AnalysisImage Texture Analysis
Image Texture Analysis
 
A Novel and Robust Wavelet based Super Resolution Reconstruction of Low Resol...
A Novel and Robust Wavelet based Super Resolution Reconstruction of Low Resol...A Novel and Robust Wavelet based Super Resolution Reconstruction of Low Resol...
A Novel and Robust Wavelet based Super Resolution Reconstruction of Low Resol...
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
Dip mcq1
Dip mcq1Dip mcq1
Dip mcq1
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image Fundamentals
 
DIP.ppt
DIP.pptDIP.ppt
DIP.ppt
 
Digital image processing fundamental explanation
Digital image processing fundamental explanationDigital image processing fundamental explanation
Digital image processing fundamental explanation
 
Seema dip
Seema dipSeema dip
Seema dip
 

More from Taymoor Nazmy

Cognitive systems
Cognitive  systemsCognitive  systems
Cognitive systemsTaymoor Nazmy
 
Cognitive systems
Cognitive  systemsCognitive  systems
Cognitive systemsTaymoor Nazmy
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicTaymoor Nazmy
 
Artificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchArtificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchTaymoor Nazmy
 
Artificial intelligent Lec 1-ai-introduction-
Artificial intelligent Lec 1-ai-introduction-Artificial intelligent Lec 1-ai-introduction-
Artificial intelligent Lec 1-ai-introduction-Taymoor Nazmy
 
Image processing 2
Image processing 2Image processing 2
Image processing 2Taymoor Nazmy
 
Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Taymoor Nazmy
 
Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Taymoor Nazmy
 
Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-Taymoor Nazmy
 
Software Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-iSoftware Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-iTaymoor Nazmy
 
Software Engineering Lec 4-requirments
Software Engineering Lec 4-requirmentsSoftware Engineering Lec 4-requirments
Software Engineering Lec 4-requirmentsTaymoor Nazmy
 
Software Engineering Lec 3-project managment
Software Engineering Lec 3-project managmentSoftware Engineering Lec 3-project managment
Software Engineering Lec 3-project managmentTaymoor Nazmy
 
Software Engineering Lec 2
Software Engineering Lec 2Software Engineering Lec 2
Software Engineering Lec 2Taymoor Nazmy
 
Software Engineering Lec 1-introduction
Software Engineering Lec 1-introductionSoftware Engineering Lec 1-introduction
Software Engineering Lec 1-introductionTaymoor Nazmy
 
presentation skill
presentation skillpresentation skill
presentation skillTaymoor Nazmy
 

More from Taymoor Nazmy (20)

Cognitive systems
Cognitive  systemsCognitive  systems
Cognitive systems
 
Cognitive systems
Cognitive  systemsCognitive  systems
Cognitive systems
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logic
 
Artificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchArtificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-search
 
Lec 2-agents
Lec 2-agentsLec 2-agents
Lec 2-agents
 
Artificial intelligent Lec 1-ai-introduction-
Artificial intelligent Lec 1-ai-introduction-Artificial intelligent Lec 1-ai-introduction-
Artificial intelligent Lec 1-ai-introduction-
 
Image processing 2
Image processing 2Image processing 2
Image processing 2
 
Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--
 
Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Software Engineering Lec 8-design-
Software Engineering Lec 8-design-
 
Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-Software Engineering Lec 7-uml-
Software Engineering Lec 7-uml-
 
Software Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-iSoftware Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-i
 
Software Engineering Lec 4-requirments
Software Engineering Lec 4-requirmentsSoftware Engineering Lec 4-requirments
Software Engineering Lec 4-requirments
 
Software Engineering Lec 3-project managment
Software Engineering Lec 3-project managmentSoftware Engineering Lec 3-project managment
Software Engineering Lec 3-project managment
 
Software Engineering Lec 2
Software Engineering Lec 2Software Engineering Lec 2
Software Engineering Lec 2
 
Software Engineering Lec 1-introduction
Software Engineering Lec 1-introductionSoftware Engineering Lec 1-introduction
Software Engineering Lec 1-introduction
 
Lec 6-
Lec 6-Lec 6-
Lec 6-
 
presentation skill
presentation skillpresentation skill
presentation skill
 
Lec 4
Lec 4Lec 4
Lec 4
 
Lec 3
Lec 3Lec 3
Lec 3
 
Lec 2
Lec 2Lec 2
Lec 2
 

Recently uploaded

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
CÃŗdigo Creativo y Arte de Software | Unidad 1
CÃŗdigo Creativo y Arte de Software | Unidad 1CÃŗdigo Creativo y Arte de Software | Unidad 1
CÃŗdigo Creativo y Arte de Software | Unidad 1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Image processing 1-lectures

  • 1. Course No.: CSC 447 Lect.: 3 h Lab. : 2 h Marks: 65 final 10 Y. work 25 Lab Exam hours: 3 h By Prof. Dr. : Taymoor Nazmy
  • 2. īŦImage processing applications, īŦPicture modeling, īŦEnhancement in spatial domain, īŦEnhancement in frequency domain, īŦRestoration, īŦSegmentation, īŦScene analysis,
  • 3. 1-Applications of image processing in remote sensing. īŦ2- Image processing using NN. 3- Techniques of images retrieval. 4- Registration of medical images. īŦ5- Image synthesize. īŦ.
  • 4. īŦ6- Image processing using pde. īŦ7- Methods of texture analysis. īŦ8- Reconstruction techniques. 9- Image processing using parallel algorithm. īŦ10- Multiresolution processing īŦ11- Open. īŦ12- Open
  • 5. īŦThe text book īŦDigital Image Processing īŦUsing Matlab īŦRafael C. Gonzalez īŦUniversity of Tennessee īŦRichard E. Woods
  • 6. Title LAB. ASS. No. Read , view, and display an image file1- Zooming and Shrinking Images by Pixel Replication.2- Image Enhancement Using Intensity Transformations.3- â€ĸHistogram equalization & log. transformation.4- â€ĸArithmetic operations & logic operation5-
  • 7. Noise Generators & Noise Reduction.6- Spatial filtering (smoothing & sharpening)7- Two-Dimensional Fast Fourier Transfor.8- Lowpass Filtering9- Convert gray level image to color10- FFT, and Hough transform11-
  • 8.
  • 9.
  • 10.
  • 11. Image Acquisition Preprocessing Segmentation Representation & Description Recognition & Interpretation Problem Domain Knowledge Base Result
  • 12.
  • 13.
  • 14.
  • 15. Ultrasound Image īŦProfiles of a fetus at 4 months, the face is about 4cm long īŦUltra sound image is another imaging modality īŦThe fetal arm with the major arteries (radial and ulnar) clearly delineated.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. īŦSection through Visible Human Male - head, including cerebellum, cerebral cortex, brainstem, nasal passages (from Head subset) īŦThis is an example of the “visible human project” sponsored by NIH
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38. Image processing using Matlab tool box
  • 39.
  • 40. Example of Matlab functions â€Ļ īŦInput / Output >>imread >>imwrite Image Display >>imshow īŦOthers >>axis >>colorbar >>colormap >>fft, fft2
  • 41. Image Storage Formats ī‚§ To store an image, the image is represented in a two- dimensional matrix, in which each value corresponds to the data associated with one image pixel. ī‚§ When storing an image, information about each pixel, the value of each colour channel in each pixel, has to be stored. ī‚§ Additional information may be associated to the image as a whole, such as height and width, depth, or the name of the person who created the image. ī‚§ The most popular image storing formats include PostScript, GIF (Graphics Interchange Format), JPEG, TIFF (Tagged Image File Format), BMP (Bitmap), etc.
  • 43. Image Formation in the Eye 17100 15 x ī€Ŋ mmx 55.2ī€Ŋ –Calculation of retinal image of an object â€ĸThe eye has a sensor plane (100 million pixels)
  • 44. The eyes have a USB2 data rate! 250,000 neurons in the optic nerve variable voltage output on EACH nerve 17.5 million neural samples per second 12.8 bits per sample 224 Mbps, per eye (a 1/2 G bps system!). Compression using lateral inhibition between the retinal neurons
  • 45. CCD KAF-3200E from Kodak. (2184 x 1472 pixels, Pixel size 6.8 microns2) Image Sensor:Charge-Coupled Device (CCD) w Used for convert a continuous image into a digital image w Contains an array of light sensors wConverts photon into electric charges accumulated in each sensor unit
  • 46. Typical IP System DIP Corrections and/or Enhancements A/D Scene Sensor A/D Media D/A D/A Display
  • 48. An color image Fundamentals of Digital Images f(x,y) x y w An image: a multidimensional function of spatial coordinates. w Spatial coordinate: (x, y) for 2D case such as photograph, (x, y, z) for 3D case such as CT scan images (x, y, t) for movies. w The function f may represent intensity (for monochrome images) or color (for color images). Origin
  • 50. Image Types Intensity image or monochrome image each pixel corresponds to light intensity normally represented in gray scale (gray level). īƒē īƒē īƒē īƒē īƒē īƒš īƒĒ īƒĒ īƒĒ īƒĒ īƒĒ īƒŠ 39871532 22132515 372669 28161010 Gray scale values
  • 52. Color image: For example, 24-bit image or 24 bits per pixel. There are 16,777,216 (224) possible colors. In other words, 8 bits for R(Red), 8 bits for G(Green), 8 bits for B(Blue). Since each value is in the range 0-255, this format supports 256 x 256 x 256.
  • 53. Image Types Binary image or black and white image Each pixel contains one bit : 1 represent white 0 represents black īƒē īƒē īƒē īƒē īƒē īƒš īƒĒ īƒĒ īƒĒ īƒĒ īƒĒ īƒŠ 1111 1111 0000 0000 Binary data
  • 54. Image Types Index image Each pixel contains index number pointing to a color in a color table īƒē īƒē īƒē īƒē īƒš īƒĒ īƒĒ īƒĒ īƒĒ īƒŠ 256 746 941 Index value Index No. Red component Green component Blue component 1 0.1 0.5 0.3 2 1.0 0.0 0.0 3 0.0 1.0 0.0 4 0.5 0.5 0.5 5 0.2 0.8 0.9 â€Ļ â€Ļ â€Ļ â€Ļ Color Table
  • 55. Image Sampling Image sampling: discretize an image in the spatial domain Spatial resolution / image resolution: pixel size or number of pixels
  • 56. Sampling & Quantization â€ĸ The spatial and amplitude digitization of f(x,y) is called: â€ĸ - image sampling when it refers to spatial coordinates (x,y) and â€ĸ - gray-level quantization when it refers to the amplitude. The digitization process requires decisions about: values for N,M (where N x M: the image array) and the number of discrete gray levels allowed for each pixel.
  • 58. Example for image sampling
  • 59. Example for image resample
  • 60. Effect of Quantization Levels 16 levels 8 levels 2 levels4 levels
  • 61.
  • 62. Sampling & Quantization â€ĸ Different versions (images) of the same object can be generated through: – Varying N, M numbers – Varying k (number of bits) – Varying both
  • 63. Isopreference curves (in the NK plane) â€ĸ Isopreference curves (in the NK plane) – Each point: image having values of N and k equal to the coordinates of this point – Points lying on an isopreference curve correspond to images of equal subjective quality.
  • 64. Examples for images with different details
  • 66. Sampling & Quantization â€ĸ Conclusions: – Quality of images increases as N & k increase – Sometimes, for fixed N, the quality improved by decreasing k (increased contrast) – For images with large amounts of detail, few gray levels are needed
  • 67.
  • 68.
  • 69. Some Basic Relationship Between Pixels (x,y) (x+1,y)(x-1,y) (x,y-1) (x,y+1) (x+1,y-1)(x-1,y-1) (x-1,y+1) (x+1,y+1) y x (0,0) Definition: f(x,y): digital image, Pixels: q, p S: Subset of pixels of f(x,y).
  • 70. Neighbors of a Pixel p (x+1,y)(x-1,y) (x,y-1) (x,y+1) 4-neighbors of p: N4(p) = (xī€­1,y) (x+1,y) (x,yī€­1) (x,y+1) Neighborhood relation is used to tell adjacent pixels. It is useful for analyzing regions. Note: q īƒŽī€ N4(p) implies p īƒŽī€ N4(q) 4-neighborhood relation considers only vertical and horizontal neighbors.
  • 71. p (x+1,y)(x-1,y) (x,y-1) (x,y+1) (x+1,y-1)(x-1,y-1) (x-1,y+1) (x+1,y+1) Neighbors of a Pixel (cont.) 8-neighbors of p: (xī€­1,yī€­1) (x,yī€­1) (x+1,yī€­1) (xī€­1,y) (x+1,y) (xī€­1,y+1) (x,y+1) (x+1,y+1) N8(p) = 8-neighborhood relation considers all neighbor pixels.
  • 72. p (x+1,y-1)(x-1,y-1) (x-1,y+1) (x+1,y+1) Diagonal neighbors of p: ND(p)= (xī€­1,yī€­1) (x+1,yī€­1) (xī€­1,y+1) (x+1,y+1) Neighbors of a Pixel (cont.) Diagonal -neighborhood relation considers only diagonal neighbor pixels.
  • 73. Connectivity â€ĸ Two pixels are connected if: – They are neighbors (i.e. adjacent in some sense e.g. N4(p), N8(p), â€Ļ) – Their gray levels satisfy a specified criterion of similarity (e.g. equality, â€Ļ) â€ĸ V is the set of gray-level values used to define adjacency (e.g. V = {1} for adjacency of pixels of value 1)
  • 74. Adjacency â€ĸ We consider three types of adjacency: – 4-adjacency: two pixels p and q with values from V are 4-adjacent if q is in the set N4(p) – 8-adjacency : p & q are 8- adjacent if q is in the set N8(p)
  • 75. Adjacency â€ĸ The third type of adjacency: â€ĸ -m-adjacency: p & q with values from V are m- adjacent if: - q is in N4(p) or - q is in ND(p) and the set N4(p)īƒ‡N4(q) has no pixels with values from V Two image subsets S1 and S2 are adjacent if some pixel in S1 is adjacent to some pixel in S2 S1 S2
  • 76. Adjacency â€ĸ Mixed adjacency is a modification of 8- adjacency and is used to eliminate the multiple path connections that often arise when 8-adjacency is used. 100 010 110 100 010 110 100 010 110
  • 77. Path A path from pixel p at (x,y) to pixel q at (s, t) is a sequence of distinct pixels: (x0, y0), (x1, y1), (x2, y2),â€Ļ, (xn, yn) such that (x0,y0) = (x,y) and (xn, yn) = (s,t) and (xi, yi) is adjacent to (xi-1, yi-1), i = 1,â€Ļ,n p q We can define type of path: 4-path, 8-path or m-path depending on type of adjacency.
  • 78. Distance For pixel p, q, and z with coordinates (x,y), (s,t) and (u,v), D is a distance function or metric if w D (p, q) ī‚ŗī€ 0 (D (p, q) = 0 if and only if p = q) D (p, q) = D (q, p) D (p, z) ī‚Ŗī€ ī€ D (p, q) + D (q, z) Euclidean distance: 22 )()(),( tysxqpDe ī€­+ī€­ī€Ŋ
  • 79. Distance (cont.) D4 - distance (city-block distance) is defined as tysxqpD ī€­+ī€­ī€Ŋ),(4 1 2 10 1 2 1 2 2 2 2 2 2 Pixels with D4(p) = 1 is 4-neighbors of p. Pixels with D4 (p) = 2 is not 4-diagonl of p.
  • 80. Distance (cont.) D8 - distance (chessboard distance) is defined as ),max(),(8 tysxqpD ī€­ī€­ī€Ŋ 1 2 10 1 2 1 2 2 2 2 2 2 Pixels with D8 (p) = 1 is 8-neighbors of p. 22 2 2 2 222 1 1 1 1
  • 81.
  • 82.
  • 83. Our objectives of studying this topic: 1- To know how to read the transformations charts & histograms, 2- To evaluate the image quality, 3- To understand the principals of IP techniques. 4- To be able to develop IP algorithms, Most IP techniques depend on the concepts used in this chapter.
  • 84. Spatial Domain Methods īŦProcedures that operate directly on the aggregate of pixels composing an image īŦ īŦA neighborhood about (x,y) is defined by using a square (or rectangular) subimage area centered at (x,y). )],([),( yxfTyxg ī€Ŋ
  • 86. Spatial Domain Methods īŦWhen the neighborhood is 1 x 1 then g depends only on the value of f at (x,y) and T becomes a gray-level transformation (or mapping) function: īŦs=T(r) Where: r denotes the pixel intensity before processing. ī‚Ąs denotes the pixel intensity after processing.
  • 87. Image Enhancement in the Spatial Domain Contrast Stretching: the values for r below m are expanded into wide range of s. Thresholding: produce binary image from gray level one.
  • 88. Some Simple Intensity Transformations Linear: Negative, Identity Logarithmic: Log, Inverse Log Power-Law: nth power, nth root
  • 89. 1-Image Negatives īŦAre obtained by using the transformation function s=T(r). [0,L-1] the range of gray levels S= L-1-r
  • 90. Image Enhancement in the Spatial Domain
  • 91. 2-
  • 92.
  • 93. Image Enhancement in the Spatial Domain
  • 94. 3-
  • 95. Image Enhancement in the Spatial Domain ī§=c=1: identity
  • 96. Image Enhancement in the Spatial Domain
  • 97. Piecewise-Linear Transformation Functions īŦ- 1-Contrast Stretching transformation: The locations of (r1,s1) and (r2,s2) control the shape of the transformation function. If r1= s1 and r2= s2 the transformation is a linear function and produces no changes.
  • 98. ī‚ĄIf r1=r2, s1=0 and s2=L-1, the transformation becomes a thresholding function that creates a binary image. ī‚ĄIntermediate values of (r1,s1) and (r2,s2) produce various degrees of spread in the gray levels of the output image, thus affecting its contrast. ī‚ĄGenerally, r1≤r2 and s1≤s2 is assumed.
  • 99.
  • 100. 2- Gray-Level Slicing Transformation īŦTo highlight a specific range of gray levels in an image (e.g. to enhance certain features). One way is to display a high value for all gray levels in the range of interest and a low value for all other gray levels (binary image).
  • 101. Gray-Level Slicing ī‚ĄThe second approach is to brighten the desired range of gray levels but preserve the background and gray-level tonalities in the image:
  • 103.
  • 104. Histogram Processing â€ĸThe histogram of a digital image with gray levels from 0 to L-1 is a discrete function where: Âģrk is the kth gray level –nk is the # pixels in the image with that gray level –n is the total number of pixels in the image k = 0, 1, 2, â€Ļ, L-1 â€ĸNormalized histogram: p(rk) = nk / n â€ĸsum of all components = 1
  • 105. īŦHistogram Is Invariant Under Certain Image Operations ī‚ĄRotation, scaling, flip Rotate Clockwise Scale Flip
  • 106.
  • 107. Histogram for an image with total n pixels
  • 108. Histogram stretching: For an image f(x,y) with gray level r at x,y this value can be transformed to another gray level value s in the new image g(x,y), using the following equ.: g(x,y) = [(r- rmin) / ( rmax- rmin)] * [Max-Min] +Min Where: rmax is the largest gray level in the image f(x,y). rmin is the smallest gray level in the image f(x,y). Max, Min correspond to the maximum and minimum gray level values possible for the image g(x,y), (0-255). Histogram shrinking : g(x,y) = [( Max - Min ) / (rmax-rmin)] * [r – rmin] + Min Where: Max, Min correspond to the maximum and minimum desired gray level in the compressed (shrink) histogram.
  • 109. Histogram Processing â€ĸHistograms are the basis for numerous spatial domain processing techniques, in addition it is providing useful image statistics. â€ĸTypes of processing: Histogram equalization Histogram matching (specification) Local enhancement
  • 110.
  • 111. To get a histogram equalization: -Ex: if the gray levels for an image is given by k = 0, 1, 2, 3 and number of pixels corresponding to these gray levels are 10,7,8,2 (histogram values), and the maximum k can be 7 (3bits/pixel). -1- The sum of these values are 10, 17 , 25, 27. -2- Normalize these values by dividing by the total number of pixels, 27, we get 10/27, 17/27, 25/27, 27/27. -3- Multiply these values by the maximum gray level value available , 7, and then round the result to the closest integer. So, we get the equalized values to be, 3,4, 6, 7 . -4- The final step is done by putting all pixels in the original image with k = 0, 1, 2, 3 to be with the new gray level distribution, 3, 4, 6 ,7.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116. .The global mean and variance are measured over an entire image and are useful for overall intensity ad contrast adjustments.The more powerful use of these parameters is in local enhancement. Let (x,y) be the coordinates of a pixel in an image, and let Sx,y denote a neighborhood (subimage) of specified size, centered at (x,y). The mean value of mSx,y of the pixels Sx,y can be computed using the equ.; Use of histogram statistics for image enhancement
  • 117. Where rs,t is the gray level at coordinates (s,t) in the neighborhood, and p(rs,t) is the neighborhood normalized histogram component corresponding to that value of gray level. The local mean is a measure of average gray level in neighborhood Sx,y , and the variance is a measure of contrast in that neighborhood.
  • 118.
  • 119.
  • 120.
  • 121.
  • 122.
  • 123.
  • 125. Image Enhancement in the Spatial Domain
  • 126. Image Averaging A noisy image: ),(),(),( yxnyxfyxg +ī€Ŋ Averaging M different noisy images: īƒĨī€Ŋ ī€Ŋ M i i yxg M yxg 1 ),( 1 ),(
  • 127. Image Averaging As M increases, the variability of the pixel values at each location decreases. This means that g(x,y) approaches f(x,y) as the number of noisy images used in the averaging process increases. Registering of the images is necessary to avoid blurring in the output image.
  • 128. Image Enhancement in the Spatial Domain
  • 129. Basic of spatial filtering Template, Window, and Mask Operation Question: How to compute the 3x3 average values at every pixels? 4 4 67 6 1 9 2 2 2 7 5 2 26 4 4 5 212 1 3 3 4 2 9 5 7 7 Solution: Imagine that we have a 3x3 window that can be placed everywhere on the image Masking Window
  • 130. 4.3 Template, Window, and Mask Operation (cont.) Step 1: Move the window to the first location where we want to compute the average value and then select only pixels inside the window. 4 4 67 6 1 9 2 2 2 7 5 2 26 4 4 5 212 1 3 3 4 2 9 5 7 7 Step 2: Compute the average value Sub image p Original image 4 1 9 2 2 3 2 9 7 Output image Step 3: Place the result at the pixel in the output image Step 4: Move the window to the next location and go to Step 2
  • 131. Template, Window, and Mask Operation (cont.) The 3x3 averaging method is one example of the mask operation or one of the Spatial filters . w The mask operation has the corresponding mask (sometimes called window or template). wThe mask of size m x n contains coefficients to be multiplied w with pixel values. w(-1,1) w(-1,1) w(1,1) w(0,0) w(1,0) w(0,1) w(-1,-1) w(0,-1) w(1,-1) Mask coefficients 1 1 1 1 1 1 1 1 1 9 1 Example : moving averaging The mask of the 3x3 moving average filter has all coefficients = 1/9
  • 132. s
  • 133. Template, Window, and Mask Operation (cont.) The mask operation at each point is performed by: 1. Move the reference point (center) of mask to the location to be computed 2. Compute sum of products between mask coefficients and pixels in subimage under the mask. Ex: For a 3*3 mask the response R of the linear filter at a point (x,y) in the image is: R = w(-1,-1) f( x-1,y-1)+ w(-1,0) f(x-1,y) + w(-1,1) f(x-1,y+1) + w(0,-1) f(x,y-1) + w(0,0) f(x,y) + w(0,1) f(x,y+1) + w(1,-1) f(x+1,y-1)+ w(1,0) f(x+1,y) + w(1,1)f(x+1,y+1)
  • 134. Template, Window, and Mask Operation (cont.) Examples of the masks Sobel operators 0 1 1 0 0 1 -1 -2 -1 -2 -1 1 0 2 0 -1 0 1 1 1 1 1 1 1 1 1 1 9 1 3x3 moving average filter 3x3 sharpening filter -1 -1 -1 8 -1 -1 -1 -1 -1
  • 135.
  • 136.
  • 137.
  • 138.
  • 140. A low pass filter (kernal) would blur the original â€ĸAll positive values in a filter indicate a blurring operation â€ĸThe larger the kernal, the higher the blur â€ĸThe flatter the kernal, the higher the blur 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 4 1 1 1 1 Less blur 1/9 1/121/10
  • 141. Nonlinear smoothing filters (Order-Statistics filters) They are nonlinear spatial filters whose response is based on ordering the pixels contained in the image area encompassed by the filter, and then replacing the value of the center pixel with the value determine by the ranking (ordering) result. Median , max, and min filters are examples of order filters.However, median filter is the most useful order-statistics filter.
  • 142.
  • 143.
  • 144. Sharpening Filters īŦTo highlight fine detail or to enhance blurred detail. ī‚Ąsmoothing ~ integration => summation ī‚Ąsharpening ~ differentiation => differences īŦCategories of sharpening filters: ī‚ĄDerivative operators īŦ- High-boost filtering
  • 146. Derivatives â€ĸ First derivative â€ĸ for one dimensional digital function is defined in term of differences such as: â€ĸ Second derivative ī‚ ī€  ī‚ļf ī‚ļx ī€Ŋ f (x +1) ī€­ f (x) ī‚ļ2 f ī‚ļx2 ī€Ŋ f (x +1) + f (x ī€­1) ī€­2 f (x)
  • 147.
  • 148. Digital Function Derivatives īŦFirst derivative: ī‚Ą0 in constant gray segments ī‚ĄNon-zero at the onset of steps or ramps ī‚ĄNon-zero along ramps īŦSecond derivative: ī‚Ą0 in constant gray segments ī‚ĄNon-zero at the onset and end of steps or ramps ī‚Ą0 along ramps of constant slope.
  • 149. Observations īŦ1st order derivatives produce thicker edges in an image, īŦ2nd order derivatives have stronger response to fine detail, īŦ1st order derivatives have stronger response to a gray level step, īŦ2nd order derivatives produce a double response at step changes in gray level, īŦ2nd order derivatives have stronger response to a line than to a step and to a point than to a line.
  • 150.
  • 152. Perwitt First derivative Filter mask of size 3*3 in x and y directions
  • 153. Sobel first derivative Filter mask of size 3*3 in x and y directions
  • 155.
  • 157.
  • 158. 2-D, 2nd Order Derivatives for Image Enhancement īŦLaplacian (linear operator): īŦDiscrete version: ī‚ ī€  īƒ‘2 f ī€Ŋ ī‚ļ2 f ī‚ļx2 + ī‚ļ2 f ī‚ļy2 ī‚ļ2 f ī‚ļ2 x2 ī€Ŋ f (x + 1, y) + f (x ī€­1, y) ī€­ 2 f (x, y) ī‚ļ2 f ī‚ļ2 y2 ī€Ŋ f (x, y + 1) + f (x, y ī€­1) ī€­ 2 f (x, y)
  • 160. Laplacian Spatial Filtering â€ĸ The sum of the coefficients is 0, indicating that when the filter is passing over regions of almost stable gray levels, the output of the mask is 0 or very small. â€ĸ Some scaling and/or clipping is involved (to compensate for possible negative gray levels after filtering).
  • 161. Laplacian īŦDigital implementation: īŦTwo definitions of Laplacian: one is the negative of the other īŦAccordingly, to recover background features: īŦ: if the center coefficient of the Laplacian mask is negative II: if the center coefficient of the Laplacian mask is positive. īƒ‘2 f ī€Ŋ[f (x +1,y)+ f (xī€­1,y)+ f (x,y +1)+ f (x,yī€­1)]ī€­4 f (x,y) g(x,y) ī€Ŋ{ f ( x,y)+īƒ‘2 f ( x,y)( II ) f ( x,y)ī€­īƒ‘2 f ( x,y)( I )
  • 162.
  • 163. Simplification īŦFilter and recover original part in one step: g(x,y)ī€Ŋ f(x,y)ī€­[f(x+1,y)+ f(xī€­1,y)+ f(x,y+1)+ f(x,yī€­1)]+4f(x,y) g(x,y) ī€Ŋ5f (x,y)ī€­[ f (x +1,y)+ f (x ī€­1,y)+ f (x,y +1)+ f (x,y ī€­1)]
  • 164. Image Enhancement in the Spatial Domain
  • 165. A high pass filter (kernal) would sharpen the original â€ĸ Negative values in a filter surrounding a center positive value indicate a sharpening operation â€ĸ The larger the negative values, the higher the sharpening â€ĸ “Noise” is also sharpened when sharpening an image More sharpening 0 -1 0 -1 5 -1 0 -1 0 1 -2 1 -2 5 -2 1 -2 1
  • 166. īŦHighpass filtered image = Original – lowpass filtered image. īŦwhere fs(x,y) denotes the sharpened image obtained by unsharp mask process. īŦHigh-boost filter is generalization of unsharp masking, If A is an multiplication factor, then high-boost filter is given by: fhb(x,y) = (A-1) f(x,y)+ fs(x,y) = (A-1) ¡ original + original – lowpass = (A-1) ¡ original + highpass ī‚ ī€  fs(x,y) ī€Ŋ f (x,y) ī€­ f (x,y)
  • 167. ))(,(2),( ))(,(2),( { IyxfyxAf IIyxfyxAfhbf ī€­īƒ‘ īƒ‘+ ī€Ŋ I: if the center coefficient of the Laplacian mask is negative II: if the center coefficient of the Laplacian mask is positive. fhb(x,y) = (A-1) f(x,y)+ fs(x,y) If we use Laplacian as an image sharper, then one Can replace fs(x,y) by g(x,y)(for Laplacian)
  • 168. High-boost Filtering īŦA=1 : standard highpass result īŦA>1 : the high-boost image looks more like the original with a degree of edge enhancement, depending on the value of A. -1 -1 -1 A+8 -1 -1 -1 -1 -1 -1 0 0 A+4 -1 -1 0 -1 0
  • 169. Image Enhancement in the Spatial Domain
  • 170. Steps in processing an image “noise cleanup” ex. median filtering Determining content of image (ex. histograms) Image Sharpening and Blurrring (ex. Convolution, Unsharp Masking, etc) Adjust Brightness/Contrast/Tonal Range (ex. histogram manipulations) Capture (digitize) image Output (print/displa y) image