L15post - Previous Lecture: Transition probabilityan...

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

View Full Document Right Arrow Icon
± Previous Lecture: ± Transition probability—an example on matrices ± Contour plot ± Today’s Lecture: ± Working with images ± Announcements: ± Section this week in the UP B7 lab ± Project 4 due 10/22 (Thursday)
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 20, 2009 Lecture 15 4 A picture as a matrix 1458-by-2084 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
Background image of page 2
October 20, 2009 Lecture 15 5 Images can be encoded in different ways ± Common formats include ± JPEG: Joint Photographic Experts Group ± GIF: Graphics Interchange Format ± Data are compressed ± We will work with jpeg files: ± imread : read a .jpg file and convert it to a “normal numeric” array that we can work with ± imwrite : write an array into a .jpg file (compressed data)
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 20, 2009 Lecture 15 6 Grayness: a value 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 4
October 20, 2009 Lecture 15 7 Let’s put a picture in a frame Things to do: 1. Read bwduck.jpg from memory and convert it into an array 2. Show the original picture 3. Assign a gray value (frame color) to the “edge pixels” 4. Show the manipulated picture
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 20, 2009 Lecture 15 8 Reading a jpeg file and displaying the image % Read jpg image and convert to % an array P P = imread (‘bwduck.jpg'); % Show the data in 3-d array P as % an image imshow (P)
Background image of page 6
October 20, 2009 Lecture 15 9 % Frame a grayscale picture P= imread (’bwduck.jpg’); imshow (P) % Change the ”frame” color imshow (P)
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 20, 2009 Lecture 15 10 % Frame a grayscale picture P= imread (’bwduck.jpg’); imshow (P) % Change the ”frame” color width= 50; frameColor= 200; % light gray imshow (P)
Background image of page 8
October 20, 2009 Lecture 15 11 % Frame a grayscale picture P= imread (’bwduck.jpg’); imshow (P) % Change the ”frame” color width= 50; frameColor= 200; % light gray [nr,nc]= size (P); for r= 1:nr for c= 1:nc % At pixel (r,c) end end imshow (P)
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 20, 2009
Background image of page 10
Image of page 11
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.

Page1 / 41

L15post - Previous Lecture: Transition probabilityan...

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

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