Enhancing Images Ch 5:Shapiro, Ch 3:Gonzales
Gray level Mapping Gray level Mapping
Brightness Transform:
1. Position Dependent
f(i,j)= g(i,j). e(i,j)g:Clean imagee:position dependent noise
2. Position independent
2. Position Independent Gray Level Mappings=T(r)
2. Position Independent Gray Level Mappings=T(r)
2. Gamma Transformations=T(r)
2. Gamma Transformations=T(r)
Gamma Correction of CRTGamma Correction of CRT
Image Enhancement by Gamma Transform: s=c.rɣImage Enhancement by Gamma Transform: s=c.rɣ
Image Enhancement by Gray level mapping: s=c.rɣImage Enhancement by Gray level mapping: s=c.rɣ
Image Enhancement by Contrast StretchingImage Enhancement by Contrast Stretching
Image Enhancement by Gray level mappingImage Enhancement by Gray level mapping
HİSTOGRAM PROCESSİNG:H(rk)=nkrk: kth gray level, nk: number of pixels with gray value rk
HİSTOGRAM PROCESSİNG:H(rk)=nkrk: kth gray level, nk: number of pixels with gray value rk
Histogram Equalization
Goal: Find a transformation which yields a histogram with uniform density
Histogram Equalization
Goal: Find a transformation which yields a histogram with uniform density
?
Algorithm: Histogram Equalization
• Create an array h with L gray values– Initialize with o value
• Find the histogram h(rk)= h(rk)+1
• Find the cumulative histogram
hc(rk)= hc(rk-1)+ hc(rk)
• Set T(rk-1) =round [{(L-1)/NM}. hc(rk-1)]
• Create the equalized image, sk= T(rk)
Histogram EqualizationHistogram Equalization
Equalized HistogramEqualized Histogram
Histogram Specification
Histogram Modification
Histogram of a dark imageHistogram of a dark image
Histogram EqualizationHistogram Equalization
Specified HistogramSpecified Histogram
Local Histogram EqualizationLocal Histogram Equalization
Image Subtraction
Convolution or crosscorrelation
Position Dependent Gray Level MappingUse convolution or correlation: f*h
Position Dependent Gray Level MappingUse convolution or correlation: f*h
Define a mask and correlate it with the imageDefine a mask and correlate it with the image
SMOOTHINGSMOOTHING
Image Enhancement WITH SMOOTINGImage Enhancement WITH SMOOTING
Averaging blurrs the imageAveraging blurrs the image
Image Enhancement WITH AVERAGING AND THRESHOLDING
Image Enhancement WITH AVERAGING AND THRESHOLDING
Restricted Averaging
• Apply averaging to only pixels with brightness value outside a predefined interval.
Mask h(i,j) = 1 For g(m+i,n+j)€ [min, max]
0 otherwise
Q: Study edge strenght smoothing, inverse gradient and rotating mask
Median Filtering
• Find a median value of a given neighborhood.
• Removes sand like noise
0 2 1
2 1 2
3 3 2
0 2 1
2 2 2
3 3 2
0 1 1 2 2 2 2 3 3
Median filtering breaks the straight lines
5 5 5 5 5
5 5 5 5 5
0 0 0 0 0
5 5 5 5 5
5 5 5 5 5
Square filter:0 0 0 5 5 5 5 5 5
Cross filter0 0 0 5 5
Image Enhancement with averaging and median filteringImage Enhancement with averaging and median filtering
EDGE PROFILES EDGE PROFILES
Edges are the pixels where the brightness changes abrubtly.It is a vector variable with magnitude and direction
EDGES, GRADIENT AND LAPLACIAN EDGES, GRADIENT AND LAPLACIAN
SMOOT EDGES, NOISY EDGESSMOOT EDGES, NOISY EDGES
Continuous world
• Gradient
• Δg(x,y) = ∂g/ ∂x + ∂g/ ∂y
• Magnitude: |Δg(x,y) | = √ (∂g/ ∂x)2 + (∂g/ ∂y) 2
• Phase : Ψ = arg (∂g/ ∂x , ∂g/ ∂y) radians
Discrete world
• Use difference in various directions• Δi g(i,j) = g(i,j) - g(i+1,j)• or• Δj g(i,j) = g(i,j) - g(i,j+1)• or• Δij g(i,j) = g(i,j)- g(i+1,j+1)• or• |Δ g(i,j) | = |g(i,j)- g(i+1,j+1) | + |g(i,j+1)- g(i+1,j) |
GRADIENT EDGE MASKSApproximation in discrete grid
GRADIENT EDGE MASKSApproximation in discrete grid
GRADIENT EDGE MASKSGRADIENT EDGE MASKS
GRADİENT MASKSGRADİENT MASKS
GRADİENT MASKSGRADİENT MASKS
GRADİENT MASKSGRADİENT MASKS
GRADİENT MASKSGRADİENT MASKS
Edge DetectionEdge Detection
Edge DetectionEdge Detection
GRADIENT OPERATIONSGRADIENT OPERATIONS
EDGES, GRADIENT AND LAPLACIAN EDGES, GRADIENT AND LAPLACIAN
Edg Detection with LaplacianEdg Detection with Laplacian
L.O.G LAPLACIAN of GAUSSIAN EDGE MASKSL.O.G LAPLACIAN of GAUSSIAN EDGE MASKS
Laplacian OperatorLaplacian Operator
EDGE DETECTION by L.O.GEDGE DETECTION by L.O.G
Image Enhancement WITH LAPLACIAN AND SOBELImage Enhancement WITH LAPLACIAN AND SOBEL
Image Enhancement (cont.)Image Enhancement (cont.)
Edge Detection with High BoostEdge Detection with High Boost
Image Enhancement with LaplacianImage Enhancement with Laplacian
Marr Hildreth Theory
• L.L HVS constructs primal sketch based on edges, lines and blobs
• Therefore L.o.G filters are mathematical representation of HVS at low level
Vector Spaces
• Space of vectors, closed under addition and scalar multiplication
Image Averaging as Vector addition
Scaler product, dot product, norm
Orthogonal Images, Distance,Basis
Roberts Basis: 2x2 Orthogonal
Frei-Chen Basis: 3x3 orthogonal
Cauchy Schwartz InequalityU+V≤U+V
Schwartz Inequality
Quotient: Angle Between two images
Fourier AnalysisFourier Analysis
Fourier Transform Pair
• Given image I(x,y), its fourier transform is
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Fourier Transform of an Image is a complex matrix
Let F =[F(u,v)]
F = ΦMM I(x,y) ΦNN I(x,y)= Φ*MM F Φ*MM
Where
ΦJJ (k,l)= [ΦJJ (k,l) ] and
ΦJJ (k,l) = (1/J) exp(2Πjkl/J) for k,l= 0,…,J-1
Fourier Transform
Properties
• Convolution Given the FT pair of an image
• I(x,y) F(u,v)
• I(x,y)* m(x,y) F(u,v). H(u,v) and
• I(x,y) m(x,y) F(u,v)* H(u,v)
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Design of H(u,v)
Low Pass filter
H(u,v) = 1 if |u,v |< r
0 o.w.
High pass filter
H(u,v) = 1 if |u,v |> r
0 o.w
Band pass filter
H(u,v) = 1 if r1<|u,v |< r2
0 o.w
Fourier Transform-High Pas Filtering
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Spatial Laplacian Masks and its Fourier Transform
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain
Image Enhancement in theFrequency Domain