CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.

Slides:



Advertisements
Similar presentations
November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Advertisements

Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
Spatial Filtering (Chapter 3)
CS & CS Multimedia Processing Lecture 2. Intensity Transformation and Spatial Filtering Spring 2009.
Chapter 3 Image Enhancement in the Spatial Domain.
CS 4487/9587 Algorithms for Image Analysis
Digital Image Processing
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Lecture 4 Linear Filters and Convolution
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
Image processing. Image operations Operations on an image –Linear filtering –Non-linear filtering –Transformations –Noise removal –Segmentation.
CS 376b Introduction to Computer Vision 03 / 26 / 2008 Instructor: Michael Eckmann.
MSU CSE 803 Stockman Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute.
CS 376b Introduction to Computer Vision 02 / 27 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 02 / 18 / 2008 Instructor: Michael Eckmann.
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
CS443: Digital Imaging and Multimedia Filters Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University Spring 2008 Ahmed Elgammal Dept.
CS 376b Introduction to Computer Vision 02 / 25 / 2008 Instructor: Michael Eckmann.
Image Enhancement.
CS 376b Introduction to Computer Vision 04 / 14 / 2008 Instructor: Michael Eckmann.
1 Image filtering Images by Pawan SinhaPawan Sinha.
1 Images and Transformations Images by Pawan SinhaPawan Sinha.
CS 376b Introduction to Computer Vision 03 / 04 / 2008 Instructor: Michael Eckmann.
1 Image filtering Hybrid Images, Oliva et al.,
MSU CSE 803 Linear Operations Using Masks Masks are patterns used to define the weights used in averaging the neighbors of a pixel to compute some result.
Linear Filtering About modifying pixels based on neighborhood. Local methods simplest. Linear means linear combination of neighbors. Linear methods simplest.
Most slides from Steve Seitz
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
CS 376b Introduction to Computer Vision 02 / 22 / 2008 Instructor: Michael Eckmann.
HCI/ComS 575X: Computational Perception Instructor: Alexander Stoytchev
Filtering and Enhancing Images. Major operations 1. Matching an image neighborhood with a pattern or mask 2. Convolution (FIR filtering)
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
AdeptSight Image Processing Tools Lee Haney January 21, 2010.
CS 376b Introduction to Computer Vision 03 / 21 / 2008 Instructor: Michael Eckmann.
Convolution and Filtering
Course 2 Image Filtering. Image filtering is often required prior any other vision processes to remove image noise, overcome image corruption and change.
CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.
CS 376b Introduction to Computer Vision 02 / 11 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 03 / 18 / 2008 Instructor: Michael Eckmann.
CS 691B Computational Photography
CS 376b Introduction to Computer Vision 02 / 15 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 02 / 12 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 03 / 17 / 2008 Instructor: Michael Eckmann.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
CSE 185 Introduction to Computer Vision Image Filtering: Spatial Domain.
Sliding Window Filters Longin Jan Latecki October 9, 2002.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Enhancement in the Spatial Domain.
HCI/ComS 575X: Computational Perception Instructor: Alexander Stoytchev
Miguel Tavares Coimbra
Filtering – Part I Gokberk Cinbis Department of Computer Engineering
Histogram Histogram is a graph that shows frequency of anything. Histograms usually have bars that represent frequency of occuring of data. Histogram has.
Image filtering Hybrid Images, Oliva et al.,
Image filtering Images by Pawan Sinha.
HCI / CprE / ComS 575: Computational Perception
Image filtering Images by Pawan Sinha.
Histogram Probability distribution of the different grays in an image.
Image filtering Images by Pawan Sinha.
Digital Image Processing Week IV
Most slides from Steve Seitz
Image filtering Images by Pawan Sinha.
Image filtering
Image filtering
Linear Operations Using Masks
Intensity Transformation
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Most slides from Steve Seitz
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Presentation transcript:

CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann

Michael Eckmann - Skidmore College - CS 376b - Spring 2008 Today’s Topics Comments/Questions Enhancing images (Chap. 5)‏ –greylevel mapping functions –histogram equalization –removal of salt and pepper noise in binary and grey scale images –averaging (smoothing) filters –cross-correlation –convolution

Michael Eckmann - Skidmore College - CS Spring 2008 Enhancing Images When to enhance an image –if an image contains unwanted (for whatever reason) variation of some data we wish to extract e.g., reduce noise, enhance contrast, enhance contours/edges A pixel in our output image can depend on –a local neighborhood of pixels in the input image –global information about the input image

Michael Eckmann - Skidmore College - CS Spring 2008 Enhancing Images Grey-level mapping –specify a function whose domain is the input image intensities and whose range is the output image intensities –sometimes called contrast stretching –example of some mapping functions on the board and in the gimp point operator –Out[x,y] = f(In[x,y])‏ output pixel value depends only on the input pixel value (not a neighborhood) but f can depend on global parameters

Michael Eckmann - Skidmore College - CS Spring 2008 Enhancing Images Histogram equalization –the idea is, given an input image and its histogram, we want to create an output image with an approximately uniform histogram and use all the available grey levels in the output image –the transformation should be single-valued and monotonically increasing Compute probabilities of each of the input grey values cumulative distribution function (cdf) which is a function on each grey value and whose value is the sum of all probabilities <= that grey value multiply the cdf by L-1, where L is the # of grey values in output image round the value to an integer

Michael Eckmann - Skidmore College - CS Spring 2008 Enhancing Images Examples on the board of computing: probabilities of each of the input grey values cumulative distribution function (cdf) which is a function whose domain is each grey value and value of the function is the sum of all probabilities <= that grey value multiply the cdf by L-1, where L is the # of grey values in output image round the value to an integer Let's look on the web for examples of original and histogram equalized images.

Michael Eckmann - Skidmore College - CS Spring 2008 Enhancing Images Removal of salt-and-pepper noise from binary images –can match a 3x3 mask of all 1's except center is 0 –and if match (including the 0's – not like morphology), then set the 0 pixel to 1 –also match a 3x3 mask of all 0's except center is 1 –and if match (including the 0's – not like morphology), then set the 1 pixel to 0 removal of salt-and-pepper noise from greyscale images is typically done with a median filter –consider a neighborhood around each pixel, –sort the grey values and choose the median value (the one that appears in the middle of the sorted list)‏ –e.g. a 5x5 neighborhood will have 25 pixels, the median is the 13 th highest value

Michael Eckmann - Skidmore College - CS Spring 2008 Enhancing Images Contrast the median filter with an averaging filter (often called a smoothing filter)‏ A smoothing filter computes a new value of a pixel by the following –given a mask of values, multiply each value in the mask by the corresponding pixel value in the image and add them up –then divide by the total of the grey values in the mask A box filter is a simple smoothing filter which uses an equally weighted rectangular neighborhood. A gaussian filter is a smoothing filter that gives most weight to center pixel and gradually tapers off the weight the further from the center. example of a few masks on the board

Michael Eckmann - Skidmore College - CS Spring 2008 Cross-correlation The process described on the last slide is similar to cross-correlation of an image and a mask. Cross-correlation involves aligning the origin of the mask with a pixel in question and multiplying the corresponding mask pixel values with the pixels in the original image and summing them all up. This summed up value is the value of the new pixel. No divide takes place. Typical masks though will either sum up to 0 or 1. A smoothing mask will sum up to 1. A derivative mask will sum up to 0. examples on the board of square masks with these properties let's review figures 5.11 (and consider using [-1,+1], 5.12, and 5.13

Michael Eckmann - Skidmore College - CS Spring 2008 Derivative and Smoothing masks Derivative masks –values have opposite signs in order to obtain a high response in signal regions of high contrast –sum of values is 0, so a 0 results from constant regions –first derivative masks produce high abs values at points of high contrast –second derivative masks produce zero-crossings at points of high contrast Smoothing masks –values are positive and sum to 1, so resulting value is same as input in constant regions

Michael Eckmann - Skidmore College - CS Spring 2008 Convolution –is similar to cross-correlation except the upper-left value in the mask is multiplied by the lower-right value in the image neighborhood and so on until the lower-right value in the mask is multiplied by the upper-left value in the image. –think of the mask being flipped along the horizontal axis and then again along the vertical axis AND THEN doing cross-correlation with the flipped mask picture on the board (and take a look at handout)‏ If the mask is symmetrical both vertically and horizontally, then cross- correlation and convolution yield the same result. The two terms are often confused and sometimes used interchangeably (incorrectly.)‏

Michael Eckmann - Skidmore College - CS Spring 2008 Considerations resulting value of output image pixels can be much larger than the input image pixels due to the summation, it is also possible for the output image pixels to yield negative values if the mask contains negatives --- so the type of the new image needs to be considered as possibly being different than the input image type what to do at borders of the image when cross-correlating or convolving and image and a mask and the mask overlaps (doesn't have corresponding pixels for one or more mask values.)‏ –no processing -> make all the border pixels 0 in output image; copy the border pixels from input to output; make the output image smaller; reduce the size of the mask at the border locations; reflected indexing; circular indexing note: this list comes from “Digital Image Processing” by Nick Efford.

Michael Eckmann - Skidmore College - CS Spring 2008 Computational considerations consider the computation involved in convolution or cross-correlation –if mask is size n x n, then for each pixel in the input image, we do n 2 multiplies and n 2 -1 additions. if a mask is separable into two vectors that, when we take the cross product of them, we get the original mask (example on the board) then we can reduce the computational complexity by first convolving or correlating the image with the column vector and then the resulting image can be convolved or correlated with the row vector to get the output image (which would be the same as convolving or correlating the nxn mask with the original image). –how many multiplies and additions now?

Michael Eckmann - Skidmore College - CS Spring 2008 Computational considerations if a mask is separable into two vectors that, when we take the cross product of them, we get the original mask (example on the board) then we can reduce the computational complexity by first convolving or correlating the image with the column vector and then the resulting image can be convolved or correlated with the row vector to get the output image (which would be the same as convolving or correlating the nxn mask with the original image). –how many multiplies and additions now? –(2n multiplies and 2(n-1) additions) per pixel

Michael Eckmann - Skidmore College - CS Spring 2008 Standard Masks prewitt masks sobel masks roberts masks