Presentation is loading. Please wait.

Presentation is loading. Please wait.

Image Processing Today’s readings For Monday

Similar presentations


Presentation on theme: "Image Processing Today’s readings For Monday"— Presentation transcript:

1 Image Processing Today’s readings For Monday
Images by Pawan Sinha Today’s readings Forsyth & Ponce, chapters For Monday Watt, (handout) Cipolla and Gee (handout) supplemental: Forsyth, chapter 9

2 Announcements HW0 due now
Project 0 is out today. Li will give a help-session in the last 10 minutes of class. If you don’t have a CSE account turn in your account forms right after class! If you want to add go ahead and register in EE400B, SLN 8590 If you don’t have access to 228 talk to me after class today All announcements are posted via the class webpage You may also use the mailing list for questions

3 What’s an image? We can think of an image as a function, f, from R2 to R: gives the intensity of a channel at position typically only defined over a rectangle, with a finite range A color image is just three functions pasted together We can write this as a “vector-valued” function: scanalyze demo

4 Images as functions f(x,y) y x

5 What’s a digital image? scanalyze demo
We usually operate on digital (discrete) images: Sample the space on a regular grid Quantize each sample (round to nearest integer) If our samples are d apart, we can write this as: Digital images (or just “images”) are typically stored in a matrix Different coordinate systems (x,y) vs. (i=row,j=column) Helpful to use macros to convert when coding things up scanalyze demo

6 Image processing An image processing operation defines a new image g in terms of an existing image f. We can transform either the domain or the range of f Range transformation Changes the color of the image Examples: contrast adjustment, RGB to grayscale Domain transformation Changes the shape of the image Example: image warping (

7 Noise Common types of noise:
Salt and pepper noise: random black and white pixels Impulse noise: random white pixels Gaussian noise: variations in intensity drawn from a Gaussian (normal) distribution

8 Reducing Noise Filtering look at the neighborhood N around each pixel
90 Filtering look at the neighborhood N around each pixel replace each pixel with new value as a function of pixels in N The behavior of a filter depends on N and f

9 Mean filtering 90 Replace each pixel with an average of the pixels in the kk box around it 33 case:

10 Mean filtering 90 10 20 30 40 60 90 50 80 Replace each pixel with an average of the pixels in the kk box around it 33 case:

11 What about border pixels?
90 10 20 30 40 60 90 50 80 Some options don’t evaluate—image gets smaller each time a filter is applied pad the image with more rows and columns on the top, bottom, left, and right option 1: copy the border pixels: add [0 0 0] to F in above case option 2: reflect the image about the border: add [0 90 0] to F in above case

12 Effect of filter size What happens if we use a larger mean filter?
55? 77?

13 Weighted average filtering
90 1 Replace each pixel with a weighted average of the pixels in the kk box 33 case: Show filter demo

14 Gaussian filter This filter H is a good approximation to
90 1 2 4 This filter H is a good approximation to Properties of Gaussian more weight to the center good model of blurring in optical systems s corresponds to width of the Gaussian more later...

15 Comparison of mean vs. gaussian filter

16 Linear shift-invariant filters
What happens when a filter is applied to an impulse? helps explain why mean filters can give “blocky” results 1 a b c d e f g h i

17 Cross correlation For a kk filter, the equation becomes (assume k is odd): If we choose the origin of h, F, and G to be the center, we can simplify: This filtering operation is known as a cross-correlation, written For continuous images, cross-correlation is defined as: Similar to convolution: Convolution flips the filter horizontally and vertically before applying it how does convolution with a Gaussian filter differ from cross-correlation?

18 Linear shift-invariant filters
Both cross-correlation and convolution filters have the following properties linear: how about scale? Is the following true? shift-invariant: same operation applied for every x,y in f Any filter with these properties (LSI) may be written as a cross-correlation Is this also true for convolution? Convolution has nice properties in the Fourier Domain we won’t cover this, but see Forsyth Chap. 8.3 for a nice discussion

19 Symmetry in Convolutions
Convolutions have a symmetry property: Try it out: a b c d e f g h i 1 1 a b c d e f g h i

20 Median filter A median filter operates over a kk window by returning the median pixel value in that window What advantage might a median filter have over a mean filter? Can a median filter be implemented by a cross-correlation?

21 Filtering an image corrupted by salt and pepper noise

22 Filtering an image corrupted by Gaussian noise

23 Image Scaling This image is too big to fit on the screen. How
can we reduce it? How to generate a half- sized version?

24 Image sub-sampling 1/8 1/4 Why does this look so crufty?
Throw away every other row and column to create a 1/2 size image Why does this look so crufty? Called nearest-neighbor sampling

25 Even worse for synthetic images

26 Sampling and the Nyquist rate
Aliasing can arise when you sample a continuous signal or image Demo applet occurs when your sampling rate is not high enough to capture the amount of detail in your image formally, the image contains structure at different scales called “frequencies” in the Fourier domain the sampling rate must be high enough to capture the highest frequency in the image To avoid aliasing: sampling rate > 2 * max frequency in the image i.e., need more than two samples per period This minimum sampling rate is called the Nyquist rate

27 Subsampling with Gaussian pre-filtering
Solution: filter the image, then subsample Filter size should double for each ½ size reduction. Why? How can we speed this up?

28 Some times we want many resolutions
Known as a Gaussian Pyramid [Burt and Adelson, 1983] In computer graphics, a mip map [Williams, 1983] A precursor to wavelet transform Gaussian Pyramids have all sorts of applications in computer vision We’ll talk about these later in the course

29 Gaussian pyramid construction
filter mask Repeat Filter Subsample Until minimum resolution reached can specify desired number of levels (e.g., 3-level pyramid) The whole pyramid is only 4/3 the size of the original image!

30 Image resampling So far, we considered only power-of-two subsampling
What about arbitrary scale reduction? How can we increase the size of the image? d = 1 in this example 1 2 3 4 5 Recall how a digital image is formed It is a discrete point-sampling of a continuous function If we could somehow reconstruct the original function, any new image could be generated, at any resolution and scale

31 Image resampling So far, we considered only power-of-two subsampling
What about arbitrary scale reduction? How can we increase the size of the image? d = 1 in this example 1 2 3 4 5 Recall how a digital image is formed It is a discrete point-sampling of a continuous function If we could somehow reconstruct the original function, any new image could be generated, at any resolution and scale

32 Image resampling So what to do if we don’t know Image reconstruction
Answer: guess an approximation Can be done in a principled way: filtering 1 2 3 4 5 2.5 d = 1 in this example Image reconstruction Convert to a continuous function Reconstruct by cross-correlation:

33 bilinear interpolation
Image resampling What does the 2D version of this hat function look like? performs linear interpolation performs bilinear interpolation Better filters give better resampled images Bicubic is common choice fit 3rd degree polynomial surface to pixels in neighborhood can also be implemented by a convolution or cross-correlation

34 Subsampling with bilinear pre-filtering
BL 1/8 BL 1/4 Bilinear 1/2

35 Things to take away from this lecture
An image as a function Digital vs. continuous images Image transformation: range vs. domain Types of noise LSI filters cross-correlation and convolution properties of LSI filters mean, Gaussian, bilinear filters Median filtering Image scaling Image resampling Aliasing Gaussian pyramids


Download ppt "Image Processing Today’s readings For Monday"

Similar presentations


Ads by Google