SlideShare a Scribd company logo
EE516:
Introduction to
Digital
Signal
Processing
ProjectTopic: Digital Camera Basic Model Simulation
Haowei Jiang (UB# - 5016 6365)
Srihari Ravichandar (UB# - 5016 8085)
1
Part 1:
FACE DETECTION
2
FACE
DETECTION:
We studied how the face detection works. For this purpose we shall
analyze theViola-JonesAlgorithm which is used extensively for face
detection.
TheViola JonesAlgorithm uses the Haar-like features, which are
shown below:
3
FACE
DETECTION:
There are some regularities for all human faces.These regularities
can be exploited to detect the human face.
When the haar-like features are applied onto the image, we just
calculate the sum of all the values of pixel covered by the feature.
Value = Sum(Pixels in black area) – Sum(Pixels in white area)
Each haar-like feature can be used to extract a given feature of the
face, such as the nose, eyes etc.,
4
FACE
DETECTION:
Integral
Image
To simplify the computation, an integral image of the original image
is created. It is an image where any pixel value is equal to the sum of
all the pixel values to the left of it and above it.
Original Image Integral Image
5
1 1 3
4 2 0
1 2 1
1 2 5
5 7 9
6 6 7
FACE
DETECTION:
Learning
Algorithm
It is cumbersome to evaluate every single feature for a small
window, so the object detection tool uses a learning algorithm
calledAdaBoost to select the best features, eliminating all the
redundant features.
These features are called weak classifiers. i.e., they have at least a
50% accuracy in detecting a facial feature.The output of weak
classifier is either a 0 or 1.
An example of redundant haar-like features is shown below.
6
These weak classifiers are given appropriate weights and summed
up. It the output of the above calculation crosses a certain
threshold, then the given part of the image has a face.
This is still computationally inefficient.Therefore, we perform
something called as cascading. In cascading, a group of 10 haar like
features compose a classifier.
If the first classifier is unable to detect a face, that region is
immediately discarded.
Input Maybe Maybe …..
Discard Discard
FACE
DETECTION:
Cascading
Stage 1:
Is input a face?
Stage 2:
Is input a face?
7
Output of face
detection
8
Input to the face detection Output after face detection
Part 2:
Filter Design
Subparts:
Noise Addition
Analysis of Different types of filters using:
In-built functions
Manual coding of filters
9
Filter Design:
Noise
Addition
We study the effects of most common types of noise in the images
such as Gaussian noise, Salt and Pepper Noise etc.The effect of such
noise is illustrated below.
Gaussian noise is an additive noise which follows a zero-mean
Gaussian distribution model. Each pixel is a sum of the actual pixel
value and a random noise value.
10
Filter Design :
Noise
Addition
Another type of noise is the salt and pepper noise.This noise is
caused by errors in data transmission.The corrupted bits are either
set to maximum value or minimum value, thus giving an appearance
of white and black spots (like salt and pepper).
Image without noise: Image with Salt and Pepper noise
11
Filter Design :
MEAN FILTER
MEAN FILTER:
We use mean filter to reduce the Gaussian noise in the image. We
compare the average filter in matlab and our design.
We take a small square set of pixels(3x3,5x5 or 7x7) to compute the
mean of those pixel values. The centermost value is replaced by the
mean value.
This operation is repeated throughout the image. This process
smoothens the noise, but also reduces the contrast.
12
Filter Design:
Mean Filter
1 4 0 1 3 1
2 2 4 2 2 3
1 0 1 0 1 0
1 2 1 0 2 2
2 5 3 1 2 5
1 1 4 2 3 0
 Get average:
round(1+4+0+2+2+4+1+0+1)/9=2
1 4 0 1 3 1
2 2 2 2 1 3
1 2 1 1 1 0
1 2 1 1 1 2
2 2 2 2 2 5
1 1 4 2 3 0
6X6
6X6 13
14
Filter Design:
Mean Filter
The only drawback of the mean filter is the image is blurred. This is because,
all the pixel values are closer to each other, which means that the contrast of
the image has reduced. This effect increases as we increase the size of the
template from 3x3 –> 5x5 –> 7x7, because the mean is calculated for lot more
pixels with a 7x7 template than a 3x3 template.
15
Filter Design:
Median Filter
MEDIAN FILTER
To reduce the effects of salt and pepper noise, we use median filter.
It is a non-linear filter which is effective at removing noise while
preserving the edges.
The median filter takes a square set of pixels, calculates the median
of all the values in that square and replaces the centermost value
with the median.
16
Filter Design:
Median Filter
1 4 0 1 3 1
2 2 4 2 2 3
1 0 1 0 1 0
1 2 1 0 2 2
2 5 3 1 2 5
1 1 4 2 3 0
Sort the values in ascending order: 0,0,1,1,1,2,2,4,4
Median value 1 4 0 1 3 1
2 1 1 1 1 3
1 1 1 1 2 0
1 1 1 1 1 2
2 2 2 2 2 5
1 1 4 2 3 0
17
18
Part3:
FilterOptimization
19
20
21
Filter
Optimization
 As shown in the Fig x.x, we find some noise left on the boundary
and we could see that the larger size filter we use, more defects
we have.
 Why?
 When we do the convolution close to the boundary, we only
replace the center value with the outcome but keep the rest
unchanged. Demo1(HTML)
How to eliminate it?
22
Filter
Optimization
 Step1:
 Extending border values outside with values at boundary
Demo2(HTML)
 Step2:
 Original image size: N x N;
 Apply the 3 x 3 template, after extension, the size is N+2 x N+2
 Apply the 5 x 5 template, after extension, the size is N+4 x N+4
 Apply the 7 x 7 template, after extension, the size is N+6 x N+6
 Or if we want to extend to a larger size, we could just extend the
current dimension by 2
 Step3:
 After Mean/Median filtering, we ONLY want the center N x N part of
the extended matrix, or we would still have noise in the boundary!
23
24
25
Part 4:
Color Enhancement
26
Color
Enhancement
 The idea is to improve the color contrast in image!
 Contrast is the difference in luminance or color that makes an
object distinguishable.
 One typical way to achieve is: Histogram Equalization
27
Color
Enhancement-
Histogram
Equalization
 What is Histogram in image?
 An image histogram is a type of histogram that acts as a graphical
representation of the tonal distribution in a digital image. It plots
the number of pixels for each tonal value.
 The histogram plots the number of pixels in the image (vertical
axis) with a particular brightness value (horizontal axis).
28
Color
Enhancement-
Histogram
Equalization
 What is Histogram Equalization?
 is a method in image processing of contrast adjustment
 Through this adjustment, the intensities can be better distributed
on the histogram.This allows for areas of lower local contrast to
gain a higher contrast. Histogram equalization accomplishes this
by effectively spreading out the most frequent intensity values.
 Statistically, to form a uniform distribution, following
 where k ∈ [a,b], F is the cumulative distribution function
29
Color
Enhancement-
Histogram
Equalization
 Example:
30
Color
Enhancement-
Histogram
Equalization
 Processing flow:
 1. Find numbers of occurrence of each pixel value
 For example A=
1 4 2
5 1 3
1 2 4
 We could see there 5 different value, so there will be 5 bins in the
histogram.
 Consider pixel value 1 occurs 3 times
 Same: pixel value 2 occurs 2 times
 pixel value 3 occurs 1 time
 pixel value 4 occurs 2 times
 pixel value 5 occurs 1 times
31
Color
Enhancement-
Histogram
Equalization
 Processing flow:
 2. Find the probability of each occurrence time of each pixel
value
 The probability of pixel value 1’s occurrence = occurrence time /
total number of pixels in matrix =3/9
 Same: pixel value 2 probability = 2/9
 pixel value 3 probability = 1/9
 pixel value 4 probability = 2/9
 pixel value 5 probability =1/9
32
Color
Enhancement-
Histogram
Equalization
 Processing flow:
 3. Find the cumulative histogram of each pixel
 The cumulative histogram of 1 is 3
 Same:The cumulative histogram of 2 is 5
 The cumulative histogram of 3 is 6
 The cumulative histogram of 4 is 8
 The cumulative histogram of 5 is 9
33
Color
Enhancement-
Histogram
Equalization
 Processing flow:
 4. Find the cumulative distribution probability of each pixel
 The CDF of 1 is 3/9
 Same:The CDF of 2 is 5/9
 The CDF of 3 is 6/9
 The CDF of 4 is 8/9
 The CDF of 5 is 9/9
34
Color
Enhancement-
Histogram
Equalization
 Processing flow:
 5. Multiply the CDF of each pixel with bin number and round off
 The CDF of 1 is 3/9 * 5 = 1.67 = 2
 Same:The CDF of 2 is 5/9 * 5 = 2.78 = 3
 The CDF of 3 is 6/9 * 5 = 3.3 = 3
 The CDF of 4 is 8/9 * 5 = 4.4 = 4
 The CDF of 5 is 9/9 * 5 = 5
35
Color
Enhancement-
Histogram
Equalization
 Processing flow:
 6. Replace each final value
 A=
1 4 2
5 1 3
1 2 4
 A_new=
2 4 3
5 2 3
2 2 4
36
37
38
39
40
41
42
Part 5:
Contrast Enhancement
43
Contrast
Enhancement
 Followed paper:
44
Contrast
Enhancement
 It proposed two problem that are hardly considered in typical
image enhancement:
 1. color shifting
 2. human visual system
 Processing H (Hue) S (Saturation) V (luminanceValue) component
in image instead of RGB
 HSV color: color information encapsulated about a color are more
familiar to humans.
 Algorithms: Hue preserved (no change in colors or the image will
get distorted) with human visual system considered
45
Contrast
Enhancement
 Processing Flow:
 1. Load color image
 2. Read RGB value for each pixel
 3. Convert RGB color space to HSV color space demo3
 4. Apply wavelet transform toV component demo4
 5. Apply the Reverse-S-ShapeTransform to the approximate
coefficient of V component demo5
 6. ReconstructV by inverse wavelet transform demo6
 7. Apply the saturation enhancement (histogram equalization)
 8. Convert HSV color space to RGB color space
 9. Store the color image
46
47
Contrast
Enhancement-
 Performance Examination:
 Contrast & Luminance
 Where σout, Īout are the variance
and average of the luminance
value of the output image and
σin, Īin are those of the input
image.
C L
Old man -0.3894 -0.0337
NOT GOOD
THOUGH
48
 Discussion:
 Although it failed,What we learn and get improved are:
 1. Several algorithms including: HSV to RGB color space
transform,ThresholdAutomatic Adaption and Reverse S
shape transform
 2. Basic 2D wavelet decompose and reconstruct
 3. coding ability
 4. Paper analysis ability
49
The End THE END
50
Contrast
Enhancement
 What is color shifting?
 Color shifting can be described as a visual effect in which the
colors of various objects (particularly bright or out of place objects)
shift and change their appearance through a repeated cycling of
varying colors in a strange and fluid motion across their surface.
 For example, moss on a rock could physically shift from green to
red to blue to any other color and then back to green again in the
visual style of a smooth and seamless animated loop.
 https://www.youtube.com/watch?v=q-GgpxdNrc4
51
Filter
Optimization
demo1
1 4 0 1 3 1
2 2 4 2 2 3
1 0 1 0 1 0
1 2 1 0 2 2
2 5 3 1 2 5
1 1 4 2 3 0
 Get average:
round(1+4+0+2+2+4+1+0+1)/9=2
1 4 0 1 3 1
2 2 2 2 1 3
1 2 1 1 1 0
1 2 1 1 1 2
2 2 2 2 2 5
1 1 4 2 3 0
Noise still in
the boundary
6X6
6X6 52
Filter
Optimization
-Demo2
 Get average:
round(1+1+4+1+1+4+2+2+2)/9=2
Noise
eliminated
1 1 4 0 1 3 1 1
1 1 4 0 1 3 1 1
2 2 2 4 2 2 3 3
1 1 0 1 0 1 0 0
1 1 2 1 0 2 2 2
2 2 5 3 1 2 5 5
1 1 1 4 2 3 0 0
1 1 1 4 2 3 0 0
8X8
1 1 4 0 1 3 1 1
1 2 2 2 2 2 2 1
2 2 2 2 2 1 2 3
1 1 2 1 1 1 2 0
1 2 2 1 1 1 2 2
2 2 2 2 2 2 2 5
1 2 2 3 3 2 2 0
1 1 1 4 2 3 0 0
8X8
53
Contrast
Enhancement
-Demo3
 RGB color space to HSV color space
 MAX is the maximal value in R, G, B of all the pixels in the
image, and MIN is the minimal one.
54
Contrast
Enhancement
-Demo3
 RGB color space to HSV color space
 1.Get MAX, MIN in each pixel
8 6
5 4
4 9
1 8
1 2
3 4
Red
Green
Blue
1 2
1 4
8 9
5 8
MAX
MIN
55
Contrast
Enhancement
-Demo3
 RGB color space to HSV color space
 1.Calculate H component
8 6
5 4
4 9
1 8
1 2
3 4
Red
Green
Blue
1 2
1 4
8 9
5 8
MAX
MIN
MAX=R & G>B, we use:
60 ×
4 − 1
8 − 1
+ 0 = 25.71
25.71 ÷ 360 = 0.0714
Normalize by 360 (degree):
56
Contrast
Enhancement
-Demo3
 RGB color space to HSV color space
 2.Calculate S component
8 6
5 4
4 9
1 8
1 2
3 4
Red
Green
Blue
1 2
1 4
8 9
5 8
MAX
MIN
we use:
1 −
1
8
= 0.875
57
Contrast
Enhancement
-Demo3
 RGB color space to HSV color space
 3.CalculateV component
8 6
5 4
4 9
1 8
1 2
3 4
Red
Green
Blue
1 2
1 4
8 9
5 8
MAX
MIN
we use:
= 8
Normalize by max(V):
8 ÷ 9 = 0.89
58
Contrast
Enhancement
-Demo3
 RGB color space to HSV color space
 4.Function in Matlab
we use: rgb2hsv, where h, s, v is normalized after processing
H: 0-1 (0-360);
S: 0-1;
V: 0-1 (0-max(V));
59
Contrast
Enhancement
-Demo4
 The haar 2D Discrete wavelet transform
 1. Decompose
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
3.5 -0.5
-2 0
A1 D1
D2 D3
where:
A1-approximate coefficient=(p1+p2+p3+p4)/4
D1-Vertical Detail coefficient=(p1+p3-p2-p4)/4
D2-Horizon Detail coefficient=(p1+p2-p3-p4)/4
D3-Diagonal Detail coefficient=(p1+p4-p2-p3)/4
P(2x2)
60
Contrast
Enhancement
-Demo5
 Reverse S shape transform
 1.Get threshold – using Automatic Adaption
 Step1: Assign two constants m0 and M0, which satisfy 0<=
m0 < M0 <= 255, and M0- m0 > 150. For instance, m0=
30, M0 = 200.
Step2. Compute m1 and M1, satisfy that there are just 5%
of approximate coefficients (Aj) are less than m1 and 5%
of Aj larger than M1.
 Coding part: we first get the pixel number of 5% of total matrix
number, then we pre-set a M1 (m1) use if sentence, compare all the
pixels value with M1, if it is larger (smaller) than M1, the total number
+1 so we have to change M1 (m1) until it reach 5% of total matrix
number.

Step3. Set m = min (m0, m1), M = max (M0, M1).
 To ensure at least 90% Approximate coefficients A1 will be converted!
61
Contrast
Enhancement
-Demo5
 Reverse S shape transform
 2. Apply transformation
 1. Compute R for each approximate coefficient in the range of
[m, M], where
 K1 should be assigned a value that is less than min(I)
 K2 should be assigned a value that is larger than max(I)
 2. Normalize R by
 3. Convert approximate coefficient by
62
Contrast
Enhancement
-Demo6
 The haar 2D Discrete wavelet transform
 2. Reconstruct
10 -2
-5 0
1 2
3 4
A1 D1
D2 D3where:
p1=A1+D1+D2+D3
p2=A1+D2-D1-D3
P3=A1+D1-D2-D3
P4=A1+D3-D1-D2
P(2x2)
63

More Related Content

What's hot

Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainMadhu Bala
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filtersA B Shinde
 
Remote Sensing Lec 10
Remote Sensing Lec 10Remote Sensing Lec 10
Remote Sensing Lec 10polylsgiedx
 
05 histogram processing DIP
05 histogram processing DIP05 histogram processing DIP
05 histogram processing DIPbabak danyal
 
Contrast limited adaptive histogram equalization
Contrast limited adaptive histogram equalizationContrast limited adaptive histogram equalization
Contrast limited adaptive histogram equalizationEr. Nancy
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processingkiruthiammu
 
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATIONCOLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATIONecij
 
Spatial enhancement
Spatial enhancement Spatial enhancement
Spatial enhancement abinarkt
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processingAnuj Arora
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit NotesAAKANKSHA JAIN
 
Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalization11mr11mahesh
 
Implement the morphological operations: Dilation, Erosion, Opening and Closing
Implement the morphological operations: Dilation, Erosion, Opening and ClosingImplement the morphological operations: Dilation, Erosion, Opening and Closing
Implement the morphological operations: Dilation, Erosion, Opening and ClosingNational Cheng Kung University
 
New approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmNew approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmeSAT Publishing House
 

What's hot (20)

Image Recontruction
Image RecontructionImage Recontruction
Image Recontruction
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filters
 
Remote Sensing Lec 10
Remote Sensing Lec 10Remote Sensing Lec 10
Remote Sensing Lec 10
 
Histogram Equalization
Histogram EqualizationHistogram Equalization
Histogram Equalization
 
gaussian filter seminar ppt
gaussian filter seminar pptgaussian filter seminar ppt
gaussian filter seminar ppt
 
05 histogram processing DIP
05 histogram processing DIP05 histogram processing DIP
05 histogram processing DIP
 
rs and gis
rs and gisrs and gis
rs and gis
 
Contrast limited adaptive histogram equalization
Contrast limited adaptive histogram equalizationContrast limited adaptive histogram equalization
Contrast limited adaptive histogram equalization
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
 
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATIONCOLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
COLOUR IMAGE ENHANCEMENT BASED ON HISTOGRAM EQUALIZATION
 
Spatial enhancement
Spatial enhancement Spatial enhancement
Spatial enhancement
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalization
 
Implement the morphological operations: Dilation, Erosion, Opening and Closing
Implement the morphological operations: Dilation, Erosion, Opening and ClosingImplement the morphological operations: Dilation, Erosion, Opening and Closing
Implement the morphological operations: Dilation, Erosion, Opening and Closing
 
New approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmNew approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithm
 
Color Models
Color ModelsColor Models
Color Models
 

Viewers also liked

Ten day bali excursion
Ten day bali excursionTen day bali excursion
Ten day bali excursionJero Wijaya
 
Oman yesterday
Oman yesterdayOman yesterday
Oman yesterdayMian Waqas
 
На уроках географії
На уроках географіїНа уроках географії
На уроках географіїartischenkonatalia
 
Guðrún Aðalbjörg Sigurðardóttir
Guðrún Aðalbjörg SigurðardóttirGuðrún Aðalbjörg Sigurðardóttir
Guðrún Aðalbjörg SigurðardóttirGu
 
Towards a Reference Genome for Switchgrass (Panicum virgatum) - Schmutz jeremy
Towards a Reference Genome for Switchgrass (Panicum virgatum) - Schmutz jeremyTowards a Reference Genome for Switchgrass (Panicum virgatum) - Schmutz jeremy
Towards a Reference Genome for Switchgrass (Panicum virgatum) - Schmutz jeremyShaojun Xie
 
Title Card Appearance
Title Card Appearance Title Card Appearance
Title Card Appearance DIDI1998sdf
 

Viewers also liked (10)

Maria informatica
Maria informaticaMaria informatica
Maria informatica
 
Presentation1
Presentation1Presentation1
Presentation1
 
Ten day bali excursion
Ten day bali excursionTen day bali excursion
Ten day bali excursion
 
Oman yesterday
Oman yesterdayOman yesterday
Oman yesterday
 
На уроках географії
На уроках географіїНа уроках географії
На уроках географії
 
Guðrún Aðalbjörg Sigurðardóttir
Guðrún Aðalbjörg SigurðardóttirGuðrún Aðalbjörg Sigurðardóttir
Guðrún Aðalbjörg Sigurðardóttir
 
Towards a Reference Genome for Switchgrass (Panicum virgatum) - Schmutz jeremy
Towards a Reference Genome for Switchgrass (Panicum virgatum) - Schmutz jeremyTowards a Reference Genome for Switchgrass (Panicum virgatum) - Schmutz jeremy
Towards a Reference Genome for Switchgrass (Panicum virgatum) - Schmutz jeremy
 
Resume
ResumeResume
Resume
 
Non Federal Match
Non Federal MatchNon Federal Match
Non Federal Match
 
Title Card Appearance
Title Card Appearance Title Card Appearance
Title Card Appearance
 

Similar to DSP presentation_latest

Image processing sw & hw
Image processing sw & hwImage processing sw & hw
Image processing sw & hwamalalhait
 
Digital image processing Tool presentation
Digital image processing Tool presentationDigital image processing Tool presentation
Digital image processing Tool presentationdikshabehl5392
 
Introduction To Digital image Processing
Introduction To Digital image ProcessingIntroduction To Digital image Processing
Introduction To Digital image ProcessingMohamedFathy132015
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptxwdwd10
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.pptSKILL2021
 
Spatial domain filtering.ppt
Spatial domain filtering.pptSpatial domain filtering.ppt
Spatial domain filtering.pptssuser4bbfb1
 
High Density Salt and Pepper Impulse Noise Removal
High Density Salt and Pepper Impulse Noise RemovalHigh Density Salt and Pepper Impulse Noise Removal
High Density Salt and Pepper Impulse Noise RemovalIDES Editor
 
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...IOSR Journals
 
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...IOSR Journals
 
JonathanWestlake_ComputerVision_Project1
JonathanWestlake_ComputerVision_Project1JonathanWestlake_ComputerVision_Project1
JonathanWestlake_ComputerVision_Project1Jonathan Westlake
 
Digital Image processing
Digital Image processingDigital Image processing
Digital Image processingAmir Hossain
 
06 cie552 image_manipulation
06 cie552 image_manipulation06 cie552 image_manipulation
06 cie552 image_manipulationElsayed Hemayed
 
AKS: Image Enhancement Software
AKS: Image Enhancement SoftwareAKS: Image Enhancement Software
AKS: Image Enhancement SoftwareAbhimanyu Singh
 
Color Detection & Segmentation based Invisible Claok
Color Detection & Segmentation based Invisible ClaokColor Detection & Segmentation based Invisible Claok
Color Detection & Segmentation based Invisible ClaokAviral Chaurasia
 

Similar to DSP presentation_latest (20)

Image processing sw & hw
Image processing sw & hwImage processing sw & hw
Image processing sw & hw
 
Digital image processing Tool presentation
Digital image processing Tool presentationDigital image processing Tool presentation
Digital image processing Tool presentation
 
Introduction To Digital image Processing
Introduction To Digital image ProcessingIntroduction To Digital image Processing
Introduction To Digital image Processing
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptx
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
Spatial domain filtering.ppt
Spatial domain filtering.pptSpatial domain filtering.ppt
Spatial domain filtering.ppt
 
High Density Salt and Pepper Impulse Noise Removal
High Density Salt and Pepper Impulse Noise RemovalHigh Density Salt and Pepper Impulse Noise Removal
High Density Salt and Pepper Impulse Noise Removal
 
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
 
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
Restoration of Images Corrupted by High Density Salt & Pepper Noise through A...
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
Aw044306308
Aw044306308Aw044306308
Aw044306308
 
Himadeep
HimadeepHimadeep
Himadeep
 
JonathanWestlake_ComputerVision_Project1
JonathanWestlake_ComputerVision_Project1JonathanWestlake_ComputerVision_Project1
JonathanWestlake_ComputerVision_Project1
 
Digital Image processing
Digital Image processingDigital Image processing
Digital Image processing
 
ResearchPaper_Final
ResearchPaper_FinalResearchPaper_Final
ResearchPaper_Final
 
06 cie552 image_manipulation
06 cie552 image_manipulation06 cie552 image_manipulation
06 cie552 image_manipulation
 
AKS: Image Enhancement Software
AKS: Image Enhancement SoftwareAKS: Image Enhancement Software
AKS: Image Enhancement Software
 
Color Detection & Segmentation based Invisible Claok
Color Detection & Segmentation based Invisible ClaokColor Detection & Segmentation based Invisible Claok
Color Detection & Segmentation based Invisible Claok
 

More from Haowei Jiang

Mini proj ii sdn video communication
Mini proj ii   sdn video communicationMini proj ii   sdn video communication
Mini proj ii sdn video communicationHaowei Jiang
 
Mini proj i question and solution design
Mini proj i question and solution designMini proj i question and solution design
Mini proj i question and solution designHaowei Jiang
 
Wearable design presentation
Wearable design presentationWearable design presentation
Wearable design presentationHaowei Jiang
 
Two stage op amp design on cadence
Two stage op amp design on cadenceTwo stage op amp design on cadence
Two stage op amp design on cadenceHaowei Jiang
 
Frequency Spectrum Displayer
Frequency Spectrum DisplayerFrequency Spectrum Displayer
Frequency Spectrum DisplayerHaowei Jiang
 

More from Haowei Jiang (7)

Dcsd final report
Dcsd final reportDcsd final report
Dcsd final report
 
Mini proj ii sdn video communication
Mini proj ii   sdn video communicationMini proj ii   sdn video communication
Mini proj ii sdn video communication
 
Mini proj i question and solution design
Mini proj i question and solution designMini proj i question and solution design
Mini proj i question and solution design
 
Wearable design presentation
Wearable design presentationWearable design presentation
Wearable design presentation
 
Wearable design
Wearable designWearable design
Wearable design
 
Two stage op amp design on cadence
Two stage op amp design on cadenceTwo stage op amp design on cadence
Two stage op amp design on cadence
 
Frequency Spectrum Displayer
Frequency Spectrum DisplayerFrequency Spectrum Displayer
Frequency Spectrum Displayer
 

DSP presentation_latest

  • 1. EE516: Introduction to Digital Signal Processing ProjectTopic: Digital Camera Basic Model Simulation Haowei Jiang (UB# - 5016 6365) Srihari Ravichandar (UB# - 5016 8085) 1
  • 3. FACE DETECTION: We studied how the face detection works. For this purpose we shall analyze theViola-JonesAlgorithm which is used extensively for face detection. TheViola JonesAlgorithm uses the Haar-like features, which are shown below: 3
  • 4. FACE DETECTION: There are some regularities for all human faces.These regularities can be exploited to detect the human face. When the haar-like features are applied onto the image, we just calculate the sum of all the values of pixel covered by the feature. Value = Sum(Pixels in black area) – Sum(Pixels in white area) Each haar-like feature can be used to extract a given feature of the face, such as the nose, eyes etc., 4
  • 5. FACE DETECTION: Integral Image To simplify the computation, an integral image of the original image is created. It is an image where any pixel value is equal to the sum of all the pixel values to the left of it and above it. Original Image Integral Image 5 1 1 3 4 2 0 1 2 1 1 2 5 5 7 9 6 6 7
  • 6. FACE DETECTION: Learning Algorithm It is cumbersome to evaluate every single feature for a small window, so the object detection tool uses a learning algorithm calledAdaBoost to select the best features, eliminating all the redundant features. These features are called weak classifiers. i.e., they have at least a 50% accuracy in detecting a facial feature.The output of weak classifier is either a 0 or 1. An example of redundant haar-like features is shown below. 6
  • 7. These weak classifiers are given appropriate weights and summed up. It the output of the above calculation crosses a certain threshold, then the given part of the image has a face. This is still computationally inefficient.Therefore, we perform something called as cascading. In cascading, a group of 10 haar like features compose a classifier. If the first classifier is unable to detect a face, that region is immediately discarded. Input Maybe Maybe ….. Discard Discard FACE DETECTION: Cascading Stage 1: Is input a face? Stage 2: Is input a face? 7
  • 8. Output of face detection 8 Input to the face detection Output after face detection
  • 9. Part 2: Filter Design Subparts: Noise Addition Analysis of Different types of filters using: In-built functions Manual coding of filters 9
  • 10. Filter Design: Noise Addition We study the effects of most common types of noise in the images such as Gaussian noise, Salt and Pepper Noise etc.The effect of such noise is illustrated below. Gaussian noise is an additive noise which follows a zero-mean Gaussian distribution model. Each pixel is a sum of the actual pixel value and a random noise value. 10
  • 11. Filter Design : Noise Addition Another type of noise is the salt and pepper noise.This noise is caused by errors in data transmission.The corrupted bits are either set to maximum value or minimum value, thus giving an appearance of white and black spots (like salt and pepper). Image without noise: Image with Salt and Pepper noise 11
  • 12. Filter Design : MEAN FILTER MEAN FILTER: We use mean filter to reduce the Gaussian noise in the image. We compare the average filter in matlab and our design. We take a small square set of pixels(3x3,5x5 or 7x7) to compute the mean of those pixel values. The centermost value is replaced by the mean value. This operation is repeated throughout the image. This process smoothens the noise, but also reduces the contrast. 12
  • 13. Filter Design: Mean Filter 1 4 0 1 3 1 2 2 4 2 2 3 1 0 1 0 1 0 1 2 1 0 2 2 2 5 3 1 2 5 1 1 4 2 3 0  Get average: round(1+4+0+2+2+4+1+0+1)/9=2 1 4 0 1 3 1 2 2 2 2 1 3 1 2 1 1 1 0 1 2 1 1 1 2 2 2 2 2 2 5 1 1 4 2 3 0 6X6 6X6 13
  • 14. 14
  • 15. Filter Design: Mean Filter The only drawback of the mean filter is the image is blurred. This is because, all the pixel values are closer to each other, which means that the contrast of the image has reduced. This effect increases as we increase the size of the template from 3x3 –> 5x5 –> 7x7, because the mean is calculated for lot more pixels with a 7x7 template than a 3x3 template. 15
  • 16. Filter Design: Median Filter MEDIAN FILTER To reduce the effects of salt and pepper noise, we use median filter. It is a non-linear filter which is effective at removing noise while preserving the edges. The median filter takes a square set of pixels, calculates the median of all the values in that square and replaces the centermost value with the median. 16
  • 17. Filter Design: Median Filter 1 4 0 1 3 1 2 2 4 2 2 3 1 0 1 0 1 0 1 2 1 0 2 2 2 5 3 1 2 5 1 1 4 2 3 0 Sort the values in ascending order: 0,0,1,1,1,2,2,4,4 Median value 1 4 0 1 3 1 2 1 1 1 1 3 1 1 1 1 2 0 1 1 1 1 1 2 2 2 2 2 2 5 1 1 4 2 3 0 17
  • 18. 18
  • 20. 20
  • 21. 21
  • 22. Filter Optimization  As shown in the Fig x.x, we find some noise left on the boundary and we could see that the larger size filter we use, more defects we have.  Why?  When we do the convolution close to the boundary, we only replace the center value with the outcome but keep the rest unchanged. Demo1(HTML) How to eliminate it? 22
  • 23. Filter Optimization  Step1:  Extending border values outside with values at boundary Demo2(HTML)  Step2:  Original image size: N x N;  Apply the 3 x 3 template, after extension, the size is N+2 x N+2  Apply the 5 x 5 template, after extension, the size is N+4 x N+4  Apply the 7 x 7 template, after extension, the size is N+6 x N+6  Or if we want to extend to a larger size, we could just extend the current dimension by 2  Step3:  After Mean/Median filtering, we ONLY want the center N x N part of the extended matrix, or we would still have noise in the boundary! 23
  • 24. 24
  • 25. 25
  • 27. Color Enhancement  The idea is to improve the color contrast in image!  Contrast is the difference in luminance or color that makes an object distinguishable.  One typical way to achieve is: Histogram Equalization 27
  • 28. Color Enhancement- Histogram Equalization  What is Histogram in image?  An image histogram is a type of histogram that acts as a graphical representation of the tonal distribution in a digital image. It plots the number of pixels for each tonal value.  The histogram plots the number of pixels in the image (vertical axis) with a particular brightness value (horizontal axis). 28
  • 29. Color Enhancement- Histogram Equalization  What is Histogram Equalization?  is a method in image processing of contrast adjustment  Through this adjustment, the intensities can be better distributed on the histogram.This allows for areas of lower local contrast to gain a higher contrast. Histogram equalization accomplishes this by effectively spreading out the most frequent intensity values.  Statistically, to form a uniform distribution, following  where k ∈ [a,b], F is the cumulative distribution function 29
  • 31. Color Enhancement- Histogram Equalization  Processing flow:  1. Find numbers of occurrence of each pixel value  For example A= 1 4 2 5 1 3 1 2 4  We could see there 5 different value, so there will be 5 bins in the histogram.  Consider pixel value 1 occurs 3 times  Same: pixel value 2 occurs 2 times  pixel value 3 occurs 1 time  pixel value 4 occurs 2 times  pixel value 5 occurs 1 times 31
  • 32. Color Enhancement- Histogram Equalization  Processing flow:  2. Find the probability of each occurrence time of each pixel value  The probability of pixel value 1’s occurrence = occurrence time / total number of pixels in matrix =3/9  Same: pixel value 2 probability = 2/9  pixel value 3 probability = 1/9  pixel value 4 probability = 2/9  pixel value 5 probability =1/9 32
  • 33. Color Enhancement- Histogram Equalization  Processing flow:  3. Find the cumulative histogram of each pixel  The cumulative histogram of 1 is 3  Same:The cumulative histogram of 2 is 5  The cumulative histogram of 3 is 6  The cumulative histogram of 4 is 8  The cumulative histogram of 5 is 9 33
  • 34. Color Enhancement- Histogram Equalization  Processing flow:  4. Find the cumulative distribution probability of each pixel  The CDF of 1 is 3/9  Same:The CDF of 2 is 5/9  The CDF of 3 is 6/9  The CDF of 4 is 8/9  The CDF of 5 is 9/9 34
  • 35. Color Enhancement- Histogram Equalization  Processing flow:  5. Multiply the CDF of each pixel with bin number and round off  The CDF of 1 is 3/9 * 5 = 1.67 = 2  Same:The CDF of 2 is 5/9 * 5 = 2.78 = 3  The CDF of 3 is 6/9 * 5 = 3.3 = 3  The CDF of 4 is 8/9 * 5 = 4.4 = 4  The CDF of 5 is 9/9 * 5 = 5 35
  • 36. Color Enhancement- Histogram Equalization  Processing flow:  6. Replace each final value  A= 1 4 2 5 1 3 1 2 4  A_new= 2 4 3 5 2 3 2 2 4 36
  • 37. 37
  • 38. 38
  • 39. 39
  • 40. 40
  • 41. 41
  • 42. 42
  • 45. Contrast Enhancement  It proposed two problem that are hardly considered in typical image enhancement:  1. color shifting  2. human visual system  Processing H (Hue) S (Saturation) V (luminanceValue) component in image instead of RGB  HSV color: color information encapsulated about a color are more familiar to humans.  Algorithms: Hue preserved (no change in colors or the image will get distorted) with human visual system considered 45
  • 46. Contrast Enhancement  Processing Flow:  1. Load color image  2. Read RGB value for each pixel  3. Convert RGB color space to HSV color space demo3  4. Apply wavelet transform toV component demo4  5. Apply the Reverse-S-ShapeTransform to the approximate coefficient of V component demo5  6. ReconstructV by inverse wavelet transform demo6  7. Apply the saturation enhancement (histogram equalization)  8. Convert HSV color space to RGB color space  9. Store the color image 46
  • 47. 47
  • 48. Contrast Enhancement-  Performance Examination:  Contrast & Luminance  Where σout, Īout are the variance and average of the luminance value of the output image and σin, Īin are those of the input image. C L Old man -0.3894 -0.0337 NOT GOOD THOUGH 48
  • 49.  Discussion:  Although it failed,What we learn and get improved are:  1. Several algorithms including: HSV to RGB color space transform,ThresholdAutomatic Adaption and Reverse S shape transform  2. Basic 2D wavelet decompose and reconstruct  3. coding ability  4. Paper analysis ability 49
  • 50. The End THE END 50
  • 51. Contrast Enhancement  What is color shifting?  Color shifting can be described as a visual effect in which the colors of various objects (particularly bright or out of place objects) shift and change their appearance through a repeated cycling of varying colors in a strange and fluid motion across their surface.  For example, moss on a rock could physically shift from green to red to blue to any other color and then back to green again in the visual style of a smooth and seamless animated loop.  https://www.youtube.com/watch?v=q-GgpxdNrc4 51
  • 52. Filter Optimization demo1 1 4 0 1 3 1 2 2 4 2 2 3 1 0 1 0 1 0 1 2 1 0 2 2 2 5 3 1 2 5 1 1 4 2 3 0  Get average: round(1+4+0+2+2+4+1+0+1)/9=2 1 4 0 1 3 1 2 2 2 2 1 3 1 2 1 1 1 0 1 2 1 1 1 2 2 2 2 2 2 5 1 1 4 2 3 0 Noise still in the boundary 6X6 6X6 52
  • 53. Filter Optimization -Demo2  Get average: round(1+1+4+1+1+4+2+2+2)/9=2 Noise eliminated 1 1 4 0 1 3 1 1 1 1 4 0 1 3 1 1 2 2 2 4 2 2 3 3 1 1 0 1 0 1 0 0 1 1 2 1 0 2 2 2 2 2 5 3 1 2 5 5 1 1 1 4 2 3 0 0 1 1 1 4 2 3 0 0 8X8 1 1 4 0 1 3 1 1 1 2 2 2 2 2 2 1 2 2 2 2 2 1 2 3 1 1 2 1 1 1 2 0 1 2 2 1 1 1 2 2 2 2 2 2 2 2 2 5 1 2 2 3 3 2 2 0 1 1 1 4 2 3 0 0 8X8 53
  • 54. Contrast Enhancement -Demo3  RGB color space to HSV color space  MAX is the maximal value in R, G, B of all the pixels in the image, and MIN is the minimal one. 54
  • 55. Contrast Enhancement -Demo3  RGB color space to HSV color space  1.Get MAX, MIN in each pixel 8 6 5 4 4 9 1 8 1 2 3 4 Red Green Blue 1 2 1 4 8 9 5 8 MAX MIN 55
  • 56. Contrast Enhancement -Demo3  RGB color space to HSV color space  1.Calculate H component 8 6 5 4 4 9 1 8 1 2 3 4 Red Green Blue 1 2 1 4 8 9 5 8 MAX MIN MAX=R & G>B, we use: 60 × 4 − 1 8 − 1 + 0 = 25.71 25.71 ÷ 360 = 0.0714 Normalize by 360 (degree): 56
  • 57. Contrast Enhancement -Demo3  RGB color space to HSV color space  2.Calculate S component 8 6 5 4 4 9 1 8 1 2 3 4 Red Green Blue 1 2 1 4 8 9 5 8 MAX MIN we use: 1 − 1 8 = 0.875 57
  • 58. Contrast Enhancement -Demo3  RGB color space to HSV color space  3.CalculateV component 8 6 5 4 4 9 1 8 1 2 3 4 Red Green Blue 1 2 1 4 8 9 5 8 MAX MIN we use: = 8 Normalize by max(V): 8 ÷ 9 = 0.89 58
  • 59. Contrast Enhancement -Demo3  RGB color space to HSV color space  4.Function in Matlab we use: rgb2hsv, where h, s, v is normalized after processing H: 0-1 (0-360); S: 0-1; V: 0-1 (0-max(V)); 59
  • 60. Contrast Enhancement -Demo4  The haar 2D Discrete wavelet transform  1. Decompose 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3.5 -0.5 -2 0 A1 D1 D2 D3 where: A1-approximate coefficient=(p1+p2+p3+p4)/4 D1-Vertical Detail coefficient=(p1+p3-p2-p4)/4 D2-Horizon Detail coefficient=(p1+p2-p3-p4)/4 D3-Diagonal Detail coefficient=(p1+p4-p2-p3)/4 P(2x2) 60
  • 61. Contrast Enhancement -Demo5  Reverse S shape transform  1.Get threshold – using Automatic Adaption  Step1: Assign two constants m0 and M0, which satisfy 0<= m0 < M0 <= 255, and M0- m0 > 150. For instance, m0= 30, M0 = 200. Step2. Compute m1 and M1, satisfy that there are just 5% of approximate coefficients (Aj) are less than m1 and 5% of Aj larger than M1.  Coding part: we first get the pixel number of 5% of total matrix number, then we pre-set a M1 (m1) use if sentence, compare all the pixels value with M1, if it is larger (smaller) than M1, the total number +1 so we have to change M1 (m1) until it reach 5% of total matrix number.  Step3. Set m = min (m0, m1), M = max (M0, M1).  To ensure at least 90% Approximate coefficients A1 will be converted! 61
  • 62. Contrast Enhancement -Demo5  Reverse S shape transform  2. Apply transformation  1. Compute R for each approximate coefficient in the range of [m, M], where  K1 should be assigned a value that is less than min(I)  K2 should be assigned a value that is larger than max(I)  2. Normalize R by  3. Convert approximate coefficient by 62
  • 63. Contrast Enhancement -Demo6  The haar 2D Discrete wavelet transform  2. Reconstruct 10 -2 -5 0 1 2 3 4 A1 D1 D2 D3where: p1=A1+D1+D2+D3 p2=A1+D2-D1-D3 P3=A1+D1-D2-D3 P4=A1+D3-D1-D2 P(2x2) 63