L16post - Previous Lecture Working with images Todays Lecture More on manipulating images Noise filtering Edge finding Announcements Project 4 due

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
± Previous Lecture: ± Working with images ± Today’s Lecture: ± More on manipulating images ± “Noise” filtering ± Edge finding ± Announcements: ± Project 4 due tonight at 11pm
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
October 22, 2009 Lecture 16 4 An image as an array: values in [0. .255] 150 149 152 153 152 155 151 150 153 154 153 156 153 151 155 156 155 158 154 153 156 157 156 159 156 154 158 159 158 161 157 156 159 160 159 162 0 = black 255 = white These are integer values Type: uint8
Background image of page 2
October 22, 2009 Lecture 16 6 Vectorized code to create a mirror image A = imread(’LawSchool.jpg’) [nr,nc,np] = size(A); for c= 1:nc B(:,c,1) = A(:,nc+1-c,1) B(:,c,2) = A(:,nc+1-c,2) B(:,c,3) = A(:,nc+1-c,3) end imwrite(B,'LawSchoolMirror.jpg') C a n i m p r o v e ef f c en y b t l z g B e a 3 - d h e s
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
October 22, 2009 Lecture 16 7 Example: produce a negative
Background image of page 4
October 22, 2009 Lecture 16 8 Problem: produce a negative ± “Negative” is what we say, but all color values are positive numbers! ± Think in terms of the extremes, 0 and 255. Then the “negative” just means the opposite side . ± So 0 is the opposite of 255 ; 1 254 ; 5 250 ; 30 225 ; x 255-x
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
October 22, 2009 Lecture 16 9 function newIm = toNegative(im) % newIm is the negative of image data im % im, newIm are 3-d arrays; each component is uint8 [nr,nc,np]= size(im); % dimensions of im newIm= zeros(nr,nc); % initialize newIm newIm= uint8(newIm); % Type for image color values for r= 1:nr for c= 1:nc for p= 1:np newIm(r,c,p)= ___________________; end end end
Background image of page 6
October 22, 2009 Lecture 16 10 function newIm = toNegative(im) % newIm is the negative of image im % im, newIm are 3-d arrays; each component is uint8 [nr,nc,np]= size(im); % dimensions of im newIm= zeros(nr,nc,np); % initialize newIm newIm= uint8(newIm); % Type for image color values for r= 1:nr for c= 1:nc for p= 1:np newIm(r,c,p)= 255 - im(r,c,p); end end end
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
October 22, 2009 Lecture 16 11 150 149 152 153 152 155 151 150 153 154 153 156 153 2 3 156 155 158 154 2 1 157 156 159 156 154 158 159 158 161 157 156 159 160 159 162 Dirt in the image! Note how the “dirty pixels” look out of place
Background image of page 8
October 22, 2009 Lecture 16 12 Clean up “noise” — median filtering
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
October 22, 2009 Lecture 16 13 150 149 152 153 152 155 151 150 153 154 153 156 153 ? ? 156 155 158 154 ? ? 157 156 159 156 154 158 159 158 161 157 156 159 160 159 162 Assign “typical” neighborhood gray values to “dirty pixels” What to do with the dirty pixels?
Background image of page 10
Lecture 16 14 What are “ typical neighborhood gray values”? Median
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/06/2010 for the course CS 9339 taught by Professor Gries during the Fall '09 term at Cornell University (Engineering School).

Page1 / 50

L16post - Previous Lecture Working with images Todays Lecture More on manipulating images Noise filtering Edge finding Announcements Project 4 due

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online