CSC508 Convolution Operators. CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the.

Slides:



Advertisements
Similar presentations
3-D Computer Vision CSc83020 / Ioannis Stamos  Revisit filtering (Gaussian and Median)  Introduction to edge detection 3-D Computater Vision CSc
Advertisements

CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 4 – Digital Image Representation Klara Nahrstedt Spring 2009.
Spatial Filtering (Chapter 3)
Topic 6 - Image Filtering - I DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Edges and Contours– Chapter 7
Regional Processing Convolutional filters. Smoothing  Convolution can be used to achieve a variety of effects depending on the kernel.  Smoothing, or.
EDGE DETECTION ARCHANA IYER AADHAR AUTHENTICATION.
Computer vision: models, learning and inference Chapter 13 Image preprocessing and feature extraction.
Sliding Window Filters and Edge Detection Longin Jan Latecki Computer Graphics and Image Processing CIS 601 – Fall 2004.
Computer Vision Lecture 16: Texture
EDGE DETECTION.
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Lecture 4 Edge Detection
Lecture 4 Linear Filters and Convolution
6/9/2015Digital Image Processing1. 2 Example Histogram.
Image Filtering CS485/685 Computer Vision Prof. George Bebis.
Edge detection. Edge Detection in Images Finding the contour of objects in a scene.
CS 376b Introduction to Computer Vision 04 / 11 / 2008 Instructor: Michael Eckmann.
EE663 Image Processing Edge Detection 2 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
7. Neighbourhood operations A single pixel considered in isolation conveys information on the intensity and colour at a single location in an image, but.
CS 376b Introduction to Computer Vision 02 / 27 / 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.
Introduction to Computer Vision CS / ECE 181B Thursday, April 22, 2004  Edge detection (HO #5)  HW#3 due, next week  No office hours today.
1 Image filtering
Filters and Edges. Zebra convolved with Leopard.
Lecture 2: Image filtering
Computer Vision P. Schrater Spring 2003
Edges and Contours– Chapter 7. Visual perception We don’t need to see all the color detail to recognize the scene content of an image That is, some data.
Image processing Lecture 4.
Multimedia Systems & Interfaces Karrie G. Karahalios Spring 2007.
CS 376b Introduction to Computer Vision 02 / 26 / 2008 Instructor: Michael Eckmann.
Neighborhood Operations
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
Spatial Filtering: Basics
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Image Processing Edge detection Filtering: Noise suppresion.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection From Sandlot ScienceSandlot Science.
CSC508 What You Should Be Doing Code, code, code –Programming Gaussian Convolution Sobel Edge Operator.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
October 7, 2014Computer Vision Lecture 9: Edge Detection II 1 Laplacian Filters Idea: Smooth the image, Smooth the image, compute the second derivative.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Edges.
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 15/16 – TP7 Spatial Filters Miguel Tavares Coimbra.
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
CSE 6367 Computer Vision Image Operations and Filtering “You cannot teach a man anything, you can only help him find it within himself.” ― Galileo GalileiGalileo.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Instructor: Mircea Nicolescu Lecture 5 CS 485 / 685 Computer Vision.
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
September 26, 2013Computer Vision Lecture 8: Edge Detection II 1Gradient In the one-dimensional case, a step edge corresponds to a local peak in the first.
Sliding Window Filters Longin Jan Latecki October 9, 2002.
1 Edge Operators a kind of filtering that leads to useful features.
Filters– Chapter 6. Filter Difference between a Filter and a Point Operation is that a Filter utilizes a neighborhood of pixels from the input image to.
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
Miguel Tavares Coimbra
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Linear Filters and Edges Chapters 7 and 8
Fourier Transform: Real-World Images
Edge Detection CS 678 Spring 2018.
Edge Detection The purpose of Edge Detection is to find jumps in the brightness function (of an image) and mark them.
Jeremy Bolton, PhD Assistant Teaching Professor
Computer Vision Lecture 9: Edge Detection II
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Computer Vision Lecture 16: Texture II
a kind of filtering that leads to useful features
a kind of filtering that leads to useful features
Intensity Transformation
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Presentation transcript:

CSC508 Convolution Operators

CSC508 Convolution Arguably the most fundamental operation of computer vision It’s a neighborhood operator –Similar to the median and outlier processes we discussed last week Utilizes a pattern of weights defined over the neighborhood –Also known as A filter A kernel

CSC508 Convolution Mathematically defined as The resultant image The input image neighborhood The kernel or filter u x v The size of the kernel H is convolved with F yielding R

CSC508 Convolution But what does it really mean? –It’s a “multiply/accumulate” operation i j Kernel Image

CSC508 Consider 1-Dimensional Input

CSC508 A 1-Dimensional Kernel

CSC508 Convolution in 1-Dimension

CSC508 1-Dimension Output

CSC508 Convolution We “slide” the kernel over the entire image –In two dimensions we just slide the kernel top to bottom and left to right Eventually it gets centered over every pixel –Note, we typically do this operation so that all pixels are handled in parallel (simultaneously) –It’s a fairly “expensive” operation What about the edges of the image? –Various techniques can be employed

CSC508 Convolution at the Edges Just ignore the edges –Initialize the resultant image to 0 (or something else) Use only the parts of the kernel that are within the image Enlarge the input image on all sides by reflection

CSC508 Enlarging by Reflection Original image Assume a 3x3 kernel A larger kernel requires additional reflection

CSC508 Why Reflect? Why not just pad with 0 (or some other value)? We’ll see later when we look at edge detection

CSC508 Some Interesting Kernels Neighborhood averaging –A simple blurring function –Note that the results of the convolution may go out of range –Solution is to normalize the kernel –Various techniques Divide each kernel by the sum of all values Divide the result by the sum of all values

CSC508 Neighborhood Averaging

CSC508 Some Interesting Kernels Emboss –Not really useful for computer vision but interesting none the less –Why don’t we need to normalize this kernel? –But, we do need to make sure the output does not go below 0 (since a kernel value is negative)

CSC508 Emboss

CSC508 Some Interesting Kernels Laplacian –A simple gradient detection mask –What is the range of the result? [ ] Need to do something about this (clamp or scale)

CSC508 Laplacian

CSC508 Some Interesting Kernels You can set the kernel weights to any values you want –Anything that will give you the desired effect –Selecting “meaningful” weights is an art

CSC508 Gaussian Kernel (Filter) The Gaussian filter is a smoothing or blurring filter Width is the number of pixels covered by the filter Sigma is the standard deviation of the Gaussian curve in pixels

Coding the Gaussian Use odd number of rows and columns in the kernel (e.g. 3x3, 5x5, 7x7…) Loop over every location in the kernel matrix –Translate integer indices from [0..width-1] to floating point [– width/2..+width/2] –This makes the floating point coordinate of the central value (0.0, 0.0) Perform the calculation given with the translated loop indices as the x and y values When done, normalize the kernel coefficients by dividing each coefficient by the sum of all coefficients CSC508

Gaussian Filter Sigma 1.0, Filter Width 7

CSC508 Gaussian Filter Sigma 1.6, Filter Width 7

CSC508 Gaussian Filter Sigma 1.6, Filter Width 15

CSC508 Gaussian is Separable Two 1D Gaussians produces the same results a one 2D Gaussian –First convolve the original image horizontally –Then convolve the horizontal results vertically –This speeds things up dramatically Reduces the total number of multiplies and additions

CSC508 Gaussian Filter – 1D

CSC508 Gaussian Filter – 1D Sigma 1.6, Filter Width 15

CSC508 Gaussian Filter Why would we want to blur an image? It will help us to extract gradient features (edges)

CSC508 Edge Detection What is an edge? –An intensity gradient –That is, a change of intensity within a localized region of the image (a neighborhood) The edge

CSC508 Edge Detection Is there an edge here? There is definitely a gradient but no edge –At least not over a small neighborhood

CSC508 Edge Detection Edges are described by magnitude which is related to the intensity on either side of the edge Weaker edge Strong edge

CSC508 Edge Detection Edges are described by orientation (direction) –Orientation is determined by the angle of the gradient and the intensity on either side of the gradient

CSC508 Edge Detection Various techniques –Differential operator Sobel –Templates Nevatia-Babu –Procedural Marr-Hildreth (Laplacian-Gaussian) Canny

CSC508 Sobel Edge Operator Starts with two convolution kernels Perform two convolutions on the original image resulting in two intermediate images

CSC508 Sobel Edge Operator From the two convolved images you can now compute edge magnitude and direction –The magnitude will have to be scaled to Unscaled values will be both + and - –The direction is typically scaled to a small number of bins i.e or 0..16

CSC508 Sobel Edge Operator Input Magnitude Encoded Direction If we were to zoom in on the corners we’d see other edge orientations present This edge is not missing, it’s just the same color as the background

CSC508 Nevatia-Babu Template Operator Six edge-oriented convolution kernels (templates) deg 30-deg60-deg 90-deg120-deg 150-deg

CSC508 Nevatia-Babu Template Operator Convolve each image pixel with all six kernels Select the mask that produces the maximum output –Assign the magnitude to the output of the maximal mask –Assign the direction to the orientation of the maximal mask –Direction is further modified by the sign of the maximal mask As you might imagine, this is a very time consuming operation

CSC508 Things To Do Programming homework assignment –Gaussian Convolution Reflect the edges of the image Implement as both a 2D convolution and 2 1D convolutions “prove” that they are equivalent through code demonstrations –Sobel Edge Operator You may write in any programming language you choose Deliverables: –Zipped images in – the source code to with the subject CSC508 PROGRAM 2 Due beginning of class in two weeks –(late assignments will be penalized 10%) –I will post test images Reading for Next Week –Still in chapter 8 –We’ll talk about Non-maximal edge suppression Edge following Hysteresis –We’ll experiment with two edge detection algorithms Marr-Hildreth (Laplacian-Gaussian/Difference of Gaussians) Canny (Differential)