Image Processing Intro2CS – week 6 1. Image Processing Many devices now have cameras on them Lots of image data recorded for computers to process. But.

Slides:



Advertisements
Similar presentations
Video Mosaics CS 294/283 Final Project Steve Martin U.C. Berkeley, Fall 2003.
Advertisements

Point Processing Histograms. Histogram Equalization Histogram equalization is a powerful point processing enhancement technique that seeks to optimize.
Computer Science 111 Fundamentals of Programming I More Digital Image Processing.
Computer vision: models, learning and inference Chapter 13 Image preprocessing and feature extraction.
1 Video Processing Lecture on the image part (8+9) Automatic Perception Volker Krüger Aalborg Media Lab Aalborg University Copenhagen
1Ellen L. Walker ImageJ Java image processing tool from NIH Reads / writes a large variety of images Many image processing operations.
Chapter 4: Image Enhancement
CS324e - Elements of Graphics and Visualization Color Histograms.
Human-Computer Interaction Human-Computer Interaction Segmentation Hanyang University Jong-Il Park.
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Lecture 4 Linear Filters and Convolution
EE 7730 Image Segmentation.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
Segmentation Divide the image into segments. Each segment:
Clustering Color/Intensity
Computer Science 111 Fundamentals of Programming I Introduction to Digital Image Processing.
Presented By : Murad Tukan
Computer Vision Lecture 3: Digital Images
Computer Vision - A Modern Approach Set: Segmentation Slides by D.A. Forsyth Segmentation and Grouping Motivation: not information is evidence Obtain a.
CS448f: Image Processing For Photography and Vision Denoising.
Tal Mor  Create an automatic system that given an image of a room and a color, will color the room walls  Maintaining the original texture.
CS559-Computer Graphics Copyright Stephen Chenney Image File Formats How big is the image? –All files in some way store width and height How is the image.
Image segmentation by clustering in the color space CIS581 Final Project Student: Qifang Xu Advisor: Dr. Longin Jan Latecki.
Chapter 2. Image Analysis. Image Analysis Domains Frequency Domain Spatial Domain.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
© 1999 Rochester Institute of Technology Color. Imaging Science Workshop for Teachers ©Chester F. Carlson Center for Imaging Science at RIT Color Images.
Computer Science 631 Lecture 7: Colorspace, local operations
CSE 185 Introduction to Computer Vision Pattern Recognition 2.
Image Processing Image Histogram Lecture
Digital Image Processing Lecture 4: Image Enhancement: Point Processing Prof. Charlene Tsai.
infinity-project.org Engineering education for today’s classroom 2 Outline How Can We Use Digital Images? A Digital Image is a Matrix Manipulating Images.
Why is computer vision difficult?
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Image Recognition COMP # 18.
Image Processing Part II. 2 Classes of Digital Filters global filters transform each pixel uniformly according to the function regardless of its location.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
Image Manipulation CSC361/661 – Digital Media Spring 2002 Burg/Wong.
Autonomous Robots Vision © Manfred Huber 2014.
Intelligent Vision Systems ENT 496 Image Filtering and Enhancement Hema C.R. Lecture 4.
Lecture # 19 Image Processing II. 2 Classes of Digital Filters Global filters transform each pixel uniformly according to the function regardless of.
Wilf LaLonde ©2012 Comp Filters. Wilf LaLonde ©2012 Comp 4501 A filter is a matrix of weights centered on a specific pixel in an image and.
CS 691B Computational Photography
Digital Image Processing Lecture 4: Image Enhancement: Point Processing January 13, 2004 Prof. Charlene Tsai.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Lecture 1: Images and image filtering CS4670/5670: Intro to Computer Vision Noah Snavely Hybrid Images, Oliva et al.,
Non-linear filtering Example: Median filter Replaces pixel value by median value over neighborhood Generates no new gray levels.
Image Enhancement Band Ratio Linear Contrast Enhancement
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
Another Example: Circle Detection
Spatial Image Enhancement
(Project) by:- ROHAN HIMANSHU ANUP 70282
CS262: Computer Vision Lect 09: SIFT Descriptors
Image enhancement algorithms & techniques Point-wise operations
Digital Data Format and Storage
CSE 455 HW 1 Notes.
DIP 9 65 Original 210 Eye Zoomed.
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Computer Vision Lecture 3: Digital Images
EE/CSE 576 HW 1 Notes.
Fall 2012 Longin Jan Latecki
CIS 350 – 3 Image ENHANCEMENT SPATIAL DOMAIN
9th Lecture - Image Filters
Spatial operations and transformations
Resolution Resolution: 6 x 4.
EE/CSE 576 HW 1 Notes.
Fundamentals of Programming I Introduction to Digital Image Processing
Magnetic Resonance Imaging
Image Filtering with GLSL
ECE/CSE 576 HW 1 Notes.
Spatial operations and transformations
Presentation transcript:

Image Processing Intro2CS – week 6 1

Image Processing Many devices now have cameras on them Lots of image data recorded for computers to process. But how are images processed? How are they encoded? This week we explore some basic operations on images. Some tasks are incredibly complex (face recognition, navigation by video, etc.) 2

Grayscale images Images are divided into pixels Grayscale images have a brightness level associated with each pixel. (in this case from 1…256) 3

Color Images One way to represent color images is using 3 values for the brightness level of Red, Green, Blue colors. 4

Why RGB? The human eye has receptors of 3 different kinds. They each react to different colors. The colors R,G,B can be used to stimulate these receptors almost independently, allowing mixtures to “simulate“ other colors 5

Image Processing in Python We will be using the Pillow library in python. It can read images from files, show them (and do some processing – but we will do that ourselves). Find it here: I am using WinPython (for windows) that comes pre-packaged with Pillow (and many other useful packages) As usual, code show in this lecture, is available on the website. 6

Loading Images 7

Showing Images 8

Example Lena Söderberg, Playboy Centerfold, Nov Image became “standard” test photo for algorithms in image processing. 9

Example 10 data is a list of lists a 2-dimensional list data[row][column] is a tuple with 3 values: (R,G,B)

The Negative of an Image Subtract pixel RGB values from 255: 11

Inverting Rows 12

Inverting Columns What is the difference? 13

Changing Brightness 14 Factor: 2 Factor: 0.5

Bluring the Image We can blur the image by setting each pixel’s value to be the average of its neighbors 15

Bluring 16

Bluring 17 Original env: 3env: 6

Sharpen A trick to make images appear sharp: (In grayscale) Add to each pixel: its value minus average value of its 4 neighbors What happens to a pixel that is Brighter than its neighbors? Darker than its neighbors? The same brightness? 18 -1/4 1

Sharpen 19

Sharpen 20 Original Once Twice

General filters Both blur and sharpen can be seen as replacing each pixel with a linear sum of pixels in its area. Each with different weights: It is possible to generalize their action to a single function (Convolution) with a given filter (2D matrix of weights) 21 -1/4 2 1/9 Sharpen Blur

Laplacian During sharpen we looked at the difference between a pixel and its surroundings If we take the values (that can be negative as well), shift and scale. Notice that extreme values are near “edges” 22 -1/4 1

Histograms We can look at statistics of pixel values in an image. The histogram: for luminosity values , how many pixels have each value? Usually we’ll normalize: what is the percentage of pixels at each value ? 23

Examples 24

Computing the Histogram 25

Plotting the Bar Charts 26

Cumulative distribution For each of the brightness levels 0…255, what percentage of pixels have brightness that is darker or exactly the same? 27

Examples 28

“Balanced” Histograms An image that is properly exposed usually has pixels going all the way from dark to very bright. The “ideal”: an equal amount of pixels for each brightness level Can we shift the brightness levels so that this will happen? 29

Histogram Equalization Create “ideal” histogram Make full use of brightness levels (usually gives nice contrast in images) The idea: A pixel that has p pixels darker than it, is mapped to brightness level 255*p. (pixels of same brightness level are mapped to the same brightness) 30

31

32 Original Equalized New Histogram Cumulative

33 OriginalEqualized New Histogram Cumulative

Extras 34

Clustering It is very useful to be able to “cluster” data: Take data given as vectors, and group parts of it together automatically, implying “similarity”. 35

Clustering An idea: define cluster through representative points. Items belong to cluster if that cluster’s representative is closest. 36

Clustering What is a good partition to clusters? – Find cluster centers such that sum of distances of points to their cluster is minimized. How do we solve this problem? 37

The k-means algorithm Start with k arbitrary cluster representatives. Repeat: – Assign points to clusters (using cluster reps) – Move cluster representative to center of mass of their cluster (average of all coordinates) Guaranteed to converge! 38

39

Applying to images We’ll apply k-means to images. Find clusters of pixel colors Use them to segment the image into pixels that contain “similar things” (as we can judge by color). 40

41

42

43

44

45 Original 2 Clusters 4 Clusters

46 2 Clusters3 Clusters 6 Clusters

47