lecture # 19 image processing ii
DESCRIPTION
Lecture # 19 Image Processing II. Image Processing II. 2 Classes of Digital Filters. Global filters transform each pixel uniformly according to the function regardless of its location in the image Local filters transform a pixel depending upon its relation to surrounding ones. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/1.jpg)
Lecture # 19
Image Processing II
![Page 2: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/2.jpg)
Image Processing IIImage Processing II
![Page 3: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/3.jpg)
2 Classes of Digital Filters
• Global filters transform each pixel uniformly according to the function regardless of its location in the image
• Local filters transform a pixel depending upon its relation to surrounding ones
![Page 4: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/4.jpg)
Global Filters: REVIEW
• Brightness and Contrast control
• Histogram thresholding
• Histogram stretching or equalization
• Color corrections
• Inversions
![Page 5: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/5.jpg)
Local FiltersLocal Filters
Blurring
• Sharpening
• Unsharp Masking
• Edge and line detection
• Noise filters
![Page 6: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/6.jpg)
Blurring AlgorithmBlurring Algorithm
For (every pixel in column x)
{ For (every pixel in row y of column x){
average image[x,y] with it’s neighbors;
}
}
![Page 7: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/7.jpg)
Blurring
• Average each pixel with its neighbors by :
multiplying each pixel and its neighbors by 1:
=
- add multiplied pixels and divide by 9
- store result in a new array• The new array contains a blurred image.
1 1 1
1 1 1
1 1 1
![Page 8: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/8.jpg)
Gaussian Blur
Multiply neighbors by less than middle
![Page 9: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/9.jpg)
Blur Demo
•Photoshop
–Filter->Blur->Blur
–Filter->Blur->Gaussian Blur
![Page 10: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/10.jpg)
Local FiltersLocal Filters
• Blurring SharpeningUnsharp Masking
• Edge and line detection
• Noise filters
![Page 11: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/11.jpg)
• Subtract neighboring pixels by :
multiplying each pixel and its neighbors by:
=
- add multiplied pixels
- store result in a new array• The new array contains a sharpened image.
Sharpening
0 -1 0
0 0
-1-1
-1
+5
![Page 12: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/12.jpg)
Unsharp Masking
• Unsharp masking also sharpens an image• The Algorithm:
1. call the original (unblurred) image A
2. blur the image (call it B)
3. subtract B from the unblurred image (let C = A-B)
4. Multiply C by some number, k (k > 1)
5. Sharpened Image = A + kC
![Page 13: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/13.jpg)
Sharpen/Unsharp mask
• Photoshop– Filter->Sharpen->Sharpen– Filter->Sharpen->Unsharp mask
![Page 14: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/14.jpg)
Local FiltersLocal Filters
• Blurring
• Sharpening
• Unsharp MaskingEdge and line detection
• Noise filters
![Page 15: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/15.jpg)
Edge and Line Detection
• Multiply each pixel and its neighbors by
the following corresponding patterns (numbers)
- add results
- clip to 255
- result =
“Edge” image
-1 0
+1-1
-1 0
0
+1
+1
-1 -1 -1
00
+1 +1
0
+1 Gets Gets
Vertical Edges Horizontal Edges
![Page 16: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/16.jpg)
Edge Detection• edge detection is often used to recognized objects of
interest in the image
![Page 17: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/17.jpg)
Edge Detection
• Photoshop– Filter->Stylize->Find Edges
![Page 18: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/18.jpg)
Local FiltersLocal Filters
• Blurring
• Sharpening
• Unsharp Masking
• Edge and line detectionNoise filters
![Page 19: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/19.jpg)
Noise Filters• A median filter takes away “salt & pepper” noise
(speckles)
![Page 20: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/20.jpg)
Noise Filter
• Photoshop– Filter->Noise->Median Filter
![Page 21: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/21.jpg)
Kernel Filtering
1 1 1
1 1 1
1 1 1
Blur
0 -1 0
0 0
-1-1
-1
+5
Sharpen-1 0
+1-1
-1 0
0
+1
+1
-1 -1 -1
00
+1 +1
0
+1
Edges
Apply same algorithm at every pixel using different kernel values
![Page 22: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/22.jpg)
ImageImageEditingEditing
![Page 23: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/23.jpg)
Image Editing
Selection Tools
• Painting Tools
• Cut & Paste
• Cloning
• Layers and Blending
![Page 24: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/24.jpg)
Selection Tools
• Lasso Tool- manually draw outline (free hand)
- manually outline (line segments)
- magnetic lasso (semi-automated)
• Magic Wand
DEMOS
ToolBar
![Page 25: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/25.jpg)
Image Editing
• Selection ToolsPainting Tools
• Cut & Paste
• Cloning
• Layers and Blending
![Page 26: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/26.jpg)
Painting Tools
• Airbrush Tool
• Paint Bucket Tool• Paintbrush Tool
• Pencil Tool
DEMOS
![Page 27: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/27.jpg)
Image Editing
• Selection Tools
• Painting ToolsCut & Paste
• Cloning
• Layers and Blending
![Page 28: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/28.jpg)
Cut & Paste
• Word Processors
- cut & paste strings of characters (1D arrays)
• Image Editing
- cut & paste pixels (2D arrays)
- replace old pixels with new pixels
![Page 29: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/29.jpg)
Image Editing
• Selection Tools
• Painting Tools
• Cut & PasteCloning
• Layers and Blending
![Page 30: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/30.jpg)
Cloning• Copy pixels from
one part of an image
- to another part of an image ... Interactively DEMO
![Page 31: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/31.jpg)
Image Editing
• Selection Tools
• Painting Tools
• Cut & Paste
• CloningLayers and Blending
![Page 32: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/32.jpg)
Can create arbitrary number of layers for
- animation
- special effects in movies
- morphing
Layers and Blending
Layer 1
Layer 2
Layer n
![Page 33: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/33.jpg)
• The idea: Blended image
= .3 x + .7 x
is a weighted combination (sum) of
two or more other images.
Blending
![Page 34: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/34.jpg)
Example Blend
.3 x +.7 x
= Bearastronaut
![Page 35: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/35.jpg)
• The idea: Create another image
where the value of pixels is the
weighting term for a blend operation:
Masking
![Page 36: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/36.jpg)
Summary
• Digital Images and pixels• Digitize a picture by
– Sampling– Quantization
• Color Models– RGB, CMYK, and HSB
• Storage Formats– .gif, .jpg, .png, .bmp
![Page 37: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/37.jpg)
Summary
• Global Filters– Contrast & Brightness Control– Thresholding– Histogram stretching & equalization– Color corrections– Inversion
![Page 38: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/38.jpg)
Summary
• Local filters– Blurring– Sharpening– Unsharp Masking– Edge and line detection– Noise filters
![Page 39: Lecture # 19 Image Processing II](https://reader035.vdocument.in/reader035/viewer/2022062519/5681516d550346895dbf9d12/html5/thumbnails/39.jpg)
Summary
• Image Editing– Selection Tools– Painting Tools– Cut & Paste– Cloning– Layers and Blending