{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS 100 M Lecture 21

# CS 100 M Lecture 21 - 21 Working with Image Files Cont'd...

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

21. Working with Image Files Cont’d Filtering Noise Edge Detection

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

View Full Document
Pictures as Arrays A black and white picture can be encoded as a 2D Array Typical: 0 <= A(i,j) <= 255 (black) (white) Values in between correspond to different levels of grayness.
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 Just a Bunch of Numbers

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

View Full Document
1458-by-2084 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! Note how the “dirty pixels” look out of place
Can We Filter Out the “Noise”?

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

View Full Document
1458-by-2084 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 Idea Assign “typical” neighborhood gray values to “dirty pixels”
Getting Precise “Typical neighborhood gray values” Could use Median Or Mean radius 1 radius 3 We’ll look at “Median Filtering” first…

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

View Full Document
Median Filtering Visit each pixel. Replace its gray value by the median of the gray values in the “neighborhood”.
Using a radius 1 “Neighborhood” 6 7 6 7 6 7 7 6 6 6 7 6 7 0 7 7 6 6 Before After 0 6 6 6 6 7 7 7 7

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

View Full Document
How to Visit Every Pixel m = 9 n = 18 for i=1:m for j=1:n Compute new gray value for pixel (i,j).
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern