Image Processing - PowerPoint PPT Presentation

About This Presentation
Title:

Image Processing

Description:

Content Smoothing Image Morphology Some Applications of Image Morphology Flood Fill Resize Image Pyramids ... etc. Binary Image Representation Basic Set ... – PowerPoint PPT presentation

Number of Views:94
Avg rating:3.0/5.0
Slides: 88
Provided by: 6649732
Category:

less

Transcript and Presenter's Notes

Title: Image Processing


1
Image Processing
  • ??????

2
Content
  • Smoothing
  • Image Morphology
  • Some Applications of Image Morphology
  • Flood Fill
  • Resize
  • Image Pyramids
  • Threshold

3
Image Processing
  • Smoothing

4
Smoothing
  • Smoothing is also called blurring
  • Why smoothing?
  • reduce noise and camera artifact
  • reduce the resolution of an image in a principled
    way

5
Smoothing
smoothtype CV_BLUR_NO_SCALE CV_BLUR
CV_GAUSSIAN CV_MEDIAN CV_BILATERAL
void cvSmooth( const CvArr src, CvArr
dst, int smoothtypeCV_GAUSSIAN, int
param13, int param20, double param30,
double param40 )
Depending on smoothtype
6
Smoothing
7
Smoothing
8
Example cvSmooth
Original
BLUR
GAUSSIAN
param17 param27
param17 param27
MEDIAN
BILATERAL
param17 param350.0 Param43.5
param17
9
Exercise
Download Test Program
10
Image Processing
  • Image Morphology

11
Morphological Operations
  • Morphological operations come from the word
    morphing in Biology which means changing a
    shape.

12
Morphological Operations
  • Originated from set operations
  • Can be used to manipulate object shapes such as
    thinning, thickening, filling, etc.

13
Binary Image Representation
14
Basic Set Operations
15
Translation and Reflection Operations
Translation
Reflection
16
Logical Operations
17
Basic Morphological Operations
  • Dilation
  • Enlarge a region
  • Erosion
  • Shrink a region
  • Opening
  • Get rid of small portions of region that jut out
    from the boundary into the background region
  • Closing
  • Close up internal holes in a region and eliminate
    bays along the boundary

18
Basic Morphological Operations
  • Defined based on a structure element

?
19
Structure Elements
20
Dilation
A Object to be dilated B Structuring element
21
Dilation
22
Dilation
23
Erosion
A Object to be eroded B Structuring element
24
Erosion
25
Erosion
26
Example Application of Dilation and Erosion
Remove small objects such as noise
27
Duality Between Dilation and Erosion
Pf)
28
Opening
29
Opening
Combination of all parts of A that can completely
contain B
30
Example Opening
31
Example Opening
32
Closing
33
Closing
34
Example Closing
35
Example Closing
36
Opening vs. Closing
  • Duality
  • Properties of Opening
  • Properties of Closing

Idempotent property cant change any more
37
Example Application of Morphological Operations
Finger print enhancement
38
Example Application of Morphological Operations
Finger print enhancement
39
Image Processing
  • Some Applications of Image Morphology

40
Hit-or-Miss Transformation
? Xc
41
Hit-or-Miss Transformation
Ac contains pattern Xc
A contains pattern X
42
Hit-or-Miss Transformation
43
Hit-or-Miss Transformation
44
Boundary Extraction
A shrinks a little bit
45
Boundary Extraction
46
Boundary Extraction
Original image
Boundary
47
Region Filling
Make the filler inside A
Enlarge the filler a little bit
48
Region Filling
Results of region filling
Original image
49
Extraction of Connected Components
Make the extractor part of A
Enlarge the extractor a little bit
50
Extraction of Connected Components
51
Morphological Operations for Gray Images
52
Dilation and Erosion by OpenCV
void cvDilate( const CvArr A, CvArr C,
IplConvKernel B0, int iterations1 )
A Source image. C Destination image. B
Structuring element used for erosion. If it
is NULL, a 33 rectangular structuring element
is used. iterations Number of times erosion
is applied.
void cvErode( const CvArr A, CvArr C,
IplConvKernel B0, int iterations1 )
53
Making Your Own Kernel
IplConvKernel cvCreateStructuringElementEx(
int nCols, int nRows, int anchorX, int
anchorY, int shape, int values )
54
More General Morphology
A Source image. C Destination image. temp
Temporary image, required in some cases. B
Structuring element. operation Type of
morphological operation. iterations Number of
times erosion is applied.
void cvMorphologyEx( const CvArr A, CvArr
C, CvArr temp, IplConvKernel B, int
operation, int iterations )
55
More General Morphology
A Source image. C Destination image. temp
Temporary image, required in some cases. B
Structuring element. operation Type of
morphological operation. iterations Number of
times erosion is applied.
void cvMorphologyEx( const CvArr A, CvArr
C, CvArr temp, IplConvKernel B, int
operation, int iterations )
56
More General Morphology
CV_MOP_OPEN C open(A,B) dilate(erode(A,B),B
) CV_MOP_CLOSE C close(A,B)
erode(dilate(A,B),B) CV_MOP_GRADIENT C
morph_grad(A,B) dilate(A,B) -
erode(A,B) CV_MOP_TOPHAT C tophat(A,B) A -
erode(A,B) CV_MOP_BLACKHAT C blackhat(A,B)
dilate(A,B) - A
57
Exercise
Download Test Program
58
Image Processing
  • Flood Fill

59
Flood Fill
60
Flood Fill
  • Used to mark or isolate portions of an image for
    further processing or analysis
  • Used to derive, from an input image, masks that
    can be used for subsequent routines to speed or
    restrict processing to only those pixels
    indicated by the mask.
  • Some routines support mask

61
Flood Fill
void cvFloodFill( IplImage img, CvPoint
seedPoint, CvScalar newVal, CvScalar loDiff
cvScalarAll(0), CvScalar upDiff
cvScalarAll(0), CvConnectedComp comp NULL,
int flags 4, CvArr mask NULL )
62
Flood Fill
Download Test Program
63
Image Processing
  • Resize

64
Resize
void cvResize( const CvArr src, CvArr dst,
int interpolationCV_INTER_LINEAR )
65
Image Processing
  • Image Pyramids

66
Image Pyramids
Represent N?N image as a pyramid of 1?1, 2?2,
4?4, 2k?2k images (assuming N 2k)
67
Image Pyramids
  • Represent the image using a collection of images
  • Called a pyramid because the resolution of the
    images decreases
  • Most common pyramid Gaussian pyramid
  • At each level, generate the next level by
    blurring the image with a Gaussian, then
    downsampling
  • For reconstruction Laplacian pyramid needed

68
Gaussian Pyramid
At each level, generate the next level by
blurring the image with a Gaussian, then
downsampling
69
Problems on Gaussian Pyramid
  • It is redundant
  • Each level contains all of the low-frequencies
    that are available at the lower levels.

70
Laplacian Pyramid

-
Detail
71
The Detail
The image represents everything in the
high-resolution image that cannot be represented
in a low-resolution image
72
Gaussian Pyramid Lapacian Pyramid
Gaussian Pyramid
Laplacian Pyramid
73
Image Compression
74
PyrDown
void cvPyrDown( const CvArr src, CvArr
dst, int filterCV_GAUSSIAN_5x5 )
The function performs the downsampling step of
the Gaussian pyramid decomposition. First it
convolves the source image with the specified
filter and then downsamples the image by
rejecting even rows and columns.
75
PyrUp
void cvPyrUp( const CvArr src, CvArr dst,
int filterCV_GAUSSIAN_5x5 )
The function cvPyrUp performs up-sampling step of
Gaussian pyramid decomposition. First it
upsamples the source image by injecting even zero
rows and columns and then convolves result with
the specified filter multiplied by 4 for
interpolation. So the destination image is four
times larger than the source image.
76
Image Segmentation
77
Image Segmentation
78
Pyramid Image Segmentation
void cvPyrSegmentation( IplImage src,
IplImage dst, CvMemStorage storage,
CvSeq comp, int level, double threshold1,
double threshold2 )
79
Pyramid Image Segmentation
Download Test Program
80
Image Processing
  • Threshold

81
Threshold
double cvThreshold( CvArr src, CvArr dst,
double threshold, double max_value, int
threshold_type )
82
Threshold
double cvThreshold( CvArr src, CvArr dst,
double threshold, double max_value, int
threshold_type )
CV_THRESH_OTSU
83
Threshold
double cvThreshold( CvArr src, CvArr dst,
double threshold, double max_value, int
threshold_type )
84
Threshold
CV_THRESHOLD_BINARY CV_THRESHOLD_OTSU
CV_THRESHOLD_BINARY
threshold100
85
Adaptive Threshold
void cvAdaptiveThreshold( CvArr src, CvArr
dst, double max_val, int adaptive_method
CV_ADAPTIVE_THRESH_MEAN_C int threshold_type
CV_THRESH_BINARY, int block_size 3, double
param1 5 )
86
Adaptive Threshold
CV_ADAPTIVE_THRESH_MEAN_C
CV_THRESHOLD_BINARY
threshold5
87
Threshold Adaptive Threshold
Download Test Program
Write a Comment
User Comments (0)
About PowerShow.com