digital image processing - hci.iwr.uni-heidelberg.de · 1.image enhancement grey level...
TRANSCRIPT
![Page 1: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/1.jpg)
Digital Image ProcessingPraktikum Introduction to Computer Vision
![Page 2: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/2.jpg)
1.Image enhancementGrey level transformations
• Apply a transformation or function T(r) on every pixel r of the image separately and update it with result value s.
© 2008 R. C. Gonzalez & R. E. Woods
![Page 3: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/3.jpg)
1.Image enhancementGrey level transformations
• Common function: • Log function
• s = c.log(1+r)
• c : normalizing constant to keep the value [0-255]
• Has no parameter.
• Alternative form with parameters α :• s = c.log(1+(eα -1)r)
© 2008 R. C. Gonzalez & R. E. Woods
![Page 4: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/4.jpg)
1.Image enhancementGrey level transformations
• Common function: • Power-law function
• s = c. rϒ
• c : normalizing constant to keep the value [0-255]
• One parameter ϒ (gamma)
© 2008 R. C. Gonzalez & R. E. Woods
![Page 5: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/5.jpg)
• Contrast stretching.
• Intensity Slicing.
1.Image enhancementGrey level transformations
© 2008 R. C. Gonzalez & R. E. Woods
![Page 6: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/6.jpg)
Exercise 1
• Create an OpenCV program that takes an image (spine.jpg for example) and applies a gray transformation • Log transformation (with parameter α).
• Power-law transformation (with parameter ϒ )
• Another transformation of your choice.
![Page 7: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/7.jpg)
• A Histogram is a distribution of gray-level in an image.• It can be seen as Probability Distribution Function PDF of
a pixel value in the image.
1.Image enhancementHistogram Equalization
![Page 8: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/8.jpg)
• Probability Density Function PDF
1.Image enhancementHistogram Equalization
© 2007 R. Alan Peters
![Page 9: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/9.jpg)
• Cumulative Distribution Function CDF
1.Image enhancementHistogram Equalization
© 2007 R. Alan Peters
![Page 10: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/10.jpg)
• Histogram equalization T(r) :
• Continues :
• Discrete :
1.Image enhancementHistogram Equalization
![Page 11: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/11.jpg)
1.Image enhancementHistogram Equalization
© 2007 R. Alan Peters
![Page 12: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/12.jpg)
1.Image enhancementHistogram Equalization
© 2007 R. Alan Peters
![Page 13: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/13.jpg)
1.Image enhancementHistogram Equalization
© 2007 R. Alan Peters
![Page 14: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/14.jpg)
Exercise 02-a
• Open the image spine.jpg and plot its histogram and CDF.
• Apply histogram equalization using OpenCV and show the result.
• Implement Histogram matching and then use it to match the histogram of this image to another image of your choice with a nice histogram.
![Page 15: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/15.jpg)
Exercise 02-b
• Open the image rocks.jpg and plot the histogram and CDF of each color channel.
• Apply histogram equalization using OpenCV on each color channel separately and then combine them and show the result image.
• A smarter way to do color image histogram equalization : take the average of the 3 histograms of color channel. Then use histogram matching to match each color channel to the average histogram you computed. Combine the channels and show the result. Compare it to the previous result.
![Page 16: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/16.jpg)
Image Filtering
• Convolution with filter kernels
![Page 17: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/17.jpg)
Image Filtering
• Convolution with filter kernels
![Page 18: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/18.jpg)
Unsharp Mask
![Page 19: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/19.jpg)
Exercise 3
• unsharp masking Kernel• Give a 3 × 3 mask for performing unsharp masking in a
single pass through an image. Demostrate it works with an example.
• Threshold median filter :• A threshold operation is applied to the median filter
such that the filter is only activated if the data within the filter window contain a grayscale level above some threshold value.
![Page 20: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/20.jpg)
Correlation
• Cross correlation between two images :
![Page 21: Digital Image Processing - hci.iwr.uni-heidelberg.de · 1.Image enhancement Grey level transformations •Apply a transformation or function T(r) on every pixel r of the image separately](https://reader031.vdocuments.net/reader031/viewer/2022022117/5cb14aa788c99386208b5a32/html5/thumbnails/21.jpg)
Exercise 04: find my dog
• Write an openCV function that computes the correlation between a template image and every patch of same size in the target image.
• Use this to find the location of the patch (dog.jpg) in the image (findMyDog.jpg).
• Don’t use the built in openCV functions for template matching (even though you can look at the tutorials to see how they are used).