[ ] Review. Edges and Binary Images. Edge detection. Derivative of Gaussian filter. Image gradient. Tuesday, Sept 16

Similar documents
Previously. Edge detection. Today. Thresholding. Gradients -> edges 2/1/2011. Edges and Binary Image Analysis

Edges and Binary Image Analysis April 12 th, 2018

Edges and Binary Image Analysis. Thurs Jan 26 Kristen Grauman UT Austin. Today. Edge detection and matching

Edges and Binary Images

Edge and Texture. CS 554 Computer Vision Pinar Duygulu Bilkent University

Image gradients and edges

CS 4495 Computer Vision. Linear Filtering 2: Templates, Edges. Aaron Bobick. School of Interactive Computing. Templates/Edges

Edge Detection CSC 767

Edge detection. Goal: Identify sudden. an image. Ideal: artist s line drawing. object-level knowledge)

Edge detection. Winter in Kraków photographed by Marcin Ryczek

Edge detection. Winter in Kraków photographed by Marcin Ryczek

Prof. Feng Liu. Winter /15/2019

Image gradients and edges April 11 th, 2017

Image gradients and edges April 10 th, 2018

Review of Filtering. Filtering in frequency domain

Anno accademico 2006/2007. Davide Migliore

EE795: Computer Vision and Intelligent Systems

Edge Detection. CSC320: Introduction to Visual Computing Michael Guerzhoy. René Magritte, Decalcomania. Many slides from Derek Hoiem, Robert Collins

CS5670: Computer Vision

Lecture 6: Edge Detection

Image gradients and edges

Image Analysis. Edge Detection

Edge and corner detection

EE 584 MACHINE VISION

Edge Detection. Computer Vision Shiv Ram Dubey, IIIT Sri City

What is an edge? Paint. Depth discontinuity. Material change. Texture boundary

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

Morphological Image Processing

Solution: filter the image, then subsample F 1 F 2. subsample blur subsample. blur

Edge Detection. Today s reading. Cipolla & Gee on edge detection (available online) From Sandlot Science

CS 2770: Computer Vision. Edges and Segments. Prof. Adriana Kovashka University of Pittsburgh February 21, 2017

Image Analysis. Edge Detection

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

Topic 4 Image Segmentation

DIGITAL IMAGE PROCESSING

CS4670: Computer Vision Noah Snavely

Edge Detection. CSE 576 Ali Farhadi. Many slides from Steve Seitz and Larry Zitnick

Announcements. Edge Detection. An Isotropic Gaussian. Filters are templates. Assignment 2 on tracking due this Friday Midterm: Tuesday, May 3.

Digital Image Processing COSC 6380/4393

Detection of Edges Using Mathematical Morphological Operators

Lecture 7: Most Common Edge Detectors

EN1610 Image Understanding Lab # 3: Edges

CS534: Introduction to Computer Vision Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

2%34 #5 +,,% ! # %& ()% #% +,,%. & /%0%)( 1 ! # %& % %()# +(& ,.+/ +&0%//#/ &

Comparison between Various Edge Detection Methods on Satellite Image

Computer Vision I. Announcement. Corners. Edges. Numerical Derivatives f(x) Edge and Corner Detection. CSE252A Lecture 11

Local Image preprocessing (cont d)

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

Digital Image Processing. Image Enhancement - Filtering

What Are Edges? Lecture 5: Gradients and Edge Detection. Boundaries of objects. Boundaries of Lighting. Types of Edges (1D Profiles)

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

Edge Detection (with a sidelight introduction to linear, associative operators). Images

Biomedical Image Analysis. Mathematical Morphology

EECS490: Digital Image Processing. Lecture #19

Edge detection. Convert a 2D image into a set of curves. Extracts salient features of the scene More compact than pixels

Lecture: Edge Detection

Straight Lines and Hough

ECG782: Multidimensional Digital Signal Processing

ECG782: Multidimensional Digital Signal Processing

SECTION 5 IMAGE PROCESSING 2

Processing of binary images

Perception. Autonomous Mobile Robots. Sensors Vision Uncertainties, Line extraction from laser scans. Autonomous Systems Lab. Zürich.

Practical Image and Video Processing Using MATLAB

Morphological Image Processing

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Morphological Image Processing

Filtering Images. Contents

Other Linear Filters CS 211A

Computer Vision I - Basics of Image Processing Part 2

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Image Processing: Final Exam November 10, :30 10:30

Morphological Image Processing

Lab 2. Hanz Cuevas Velásquez, Bob Fisher Advanced Vision School of Informatics, University of Edinburgh Week 3, 2018

Binary Image Processing. Introduction to Computer Vision CSE 152 Lecture 5

What will we learn? What is mathematical morphology? What is mathematical morphology? Fundamental concepts and operations

Edges, interpolation, templates. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Image Processing

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

Filtering and Enhancing Images

Edge detection. Stefano Ferrari. Università degli Studi di Milano Elaborazione delle immagini (Image processing I)

Keywords: Thresholding, Morphological operations, Image filtering, Adaptive histogram equalization, Ceramic tile.

Computer Vision. Recap: Smoothing with a Gaussian. Recap: Effect of σ on derivatives. Computer Science Tripos Part II. Dr Christopher Town

Edge Detection. CS664 Computer Vision. 3. Edges. Several Causes of Edges. Detecting Edges. Finite Differences. The Gradient

Region & edge based Segmentation

An Algorithm for Blurred Thermal image edge enhancement for security by image processing technique

Line, edge, blob and corner detection

CS443: Digital Imaging and Multimedia Binary Image Analysis. Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University

Neighborhood operations

EDGE BASED REGION GROWING

Edge Detection Lecture 03 Computer Vision

COMPUTER AND ROBOT VISION

Edge Detection. EE/CSE 576 Linda Shapiro

Introduction to Medical Imaging (5XSA0)

Filtering in frequency domain

Morphological Image Algorithms

Ulrik Söderström 16 Feb Image Processing. Segmentation

CS4442/9542b Artificial Intelligence II prof. Olga Veksler

Image Analysis Lecture Segmentation. Idar Dyrdal

Table 1. Different types of Defects on Tiles

Transcription:

Review Edges and Binary Images Tuesday, Sept 6 Thought question: how could we compute a temporal gradient from video data? What filter is likely to have produced this image output? original filtered output Edge detection Goal: map image from 2d array of pixels to a set of curves or line segments or contours. Why? 5 x 5 median filter Figure from J. Shotton et al., PAMI 2007 Main idea: look for strong gradients, post-process 25 x 25 median filter 50 x 50 median filter Image gradient The gradient of an image: The gradient points in the direction of most rapid change in intensity The gradient direction (orientation of edge normal) is given by: The edge strength is given by the gradient magnitude Derivative of Gaussian filter ( I g) h = I ( g h) [ ] 0.0030 0.033 0.029 0.033 0.0030 0.033 0.0596 0.0983 0.0596 0.033 0.029 0.0983 0.62 0.0983 0.029 0.033 0.0596 0.0983 0.0596 0.033 0.0030 0.033 0.029 0.033 0.0030 We can smooth and take the derivative with one filter, that is, with one convolution pass. [ ] Slide credit S. Seitz

Laplacian of Gaussian Consider 2D edge detection filters Laplacian of Gaussian derivative of Gaussian Laplacian of Gaussian operator is the Laplacian operator: Where is the edge? Zero-crossings of bottom graph Gradients -> edges Primary edge detection steps:. Smoothing: suppress noise 2. Edge enhancement: filter for contrast 3. Edge localization Determine which local maxima from filter output are actually edges vs. noise Threshold, Thin Effect of σ on Gaussian smoothing Recall: parameter σ is the scale / width / spread of the Gaussian kernel, and controls the amount of smoothing. Effect of σ on derivatives So, what scale to choose? It depends what we re looking for. Often we may want to analyze at multiple scales. σ = pixel σ = 3 pixels The apparent structures differ depending on Gaussian s scale parameter. Larger values: larger scale edges detected Smaller values: finer features detected Too fine of a scale can t see the forest for the trees. Too coarse of a scale can t tell the maple grain from the cherry.

Thresholding Original image Choose a threshold value t Set any pixels less than t to zero (off) Set any pixels greater than or equal to t to one (on) Gradient magnitude image Thresholding gradient with a lower threshold Thresholding gradient with a higher threshold Canny edge detector Filter image with derivative of Gaussian Find magnitude and orientation of gradient Non-maximum suppression: Thin multi-pixel wide ridges down to single pixel width Linking and thresholding (hysteresis): Define two thresholds: low and high Use the high threshold to start edge curves and the low threshold to continue them MATLAB: edge(image, canny ); >>help edge Source: D. Lowe, L. Fei-Fei

The Canny edge detector The Canny edge detector original image (Lena) norm of the gradient Source: S. Seitz The Canny edge detector The Canny edge detector How to turn these thick regions of the gradient into curves? thresholding thresholding Non-maximum suppression The Canny edge detector Check if pixel is local maximum along gradient direction, select single max across width of the edge requires checking interpolated pixels p and r thinning (non-maximum suppression) Problem: pixels along this edge didn t survive the thresholding

Hysteresis thresholding Check that maximum value of gradient value is sufficiently large drop-outs? use hysteresis use a high threshold to start edge curves and a low threshold to continue them. Hysteresis thresholding original image Source: S. Seitz high threshold (strong edges) low threshold (weak edges) hysteresis threshold Source: L. Fei-Fei Object boundaries vs. edges Edge detection is just the beginning image human segmentation gradient magnitude Background Texture Shadows Berkeley segmentation database: http://www.eecs.berkeley.edu/research/projects/cs/vision/grouping/segbench/ Source: L. Lazebnik Possible to learn from humans which combination of features is most indicative of a good contour? What features are responsible for perceived edges? [D. Martin et al. PAMI 2004] Human-marked segment boundaries Feature profiles (oriented energy, brightness, color, and texture gradients) along the patch s horizontal diameter [D. Martin et al. PAMI 2004]

Binary images [D. Martin et al. PAMI 2004] Binary images Two pixel values Foreground and background Mark region(s) of interest Thresholding Given a grayscale image or an intermediate matrix threshold to create a binary output. Example: edge detection Gradient magnitude fg_pix = find(gradient_mag > t); Looking for pixels where gradient is strong. Thresholding Given a grayscale image or an intermediate matrix threshold to create a binary output. Example: background subtraction Thresholding Given a grayscale image or an intermediate matrix threshold to create a binary output. Example: intensity-based detection - = Looking for pixels that differ significantly from the empty background. Looking for dark pixels fg_pix = find(im < 65); fg_pix = find(diff > t);

Thresholding Given a grayscale image or an intermediate matrix threshold to create a binary output. Example: color-based detection Issues How to demarcate multiple regions of interest? Count objects Compute further features per object fg_pix = find(hue > t & hue < t2); Looking for pixels within a certain hue range. What to do with noisy binary outputs? Holes Extra small fragments Connected components Identify distinct regions of connected pixels Connectedness Defining which pixels are considered neighbors 4-connected 8-connected Shapiro and Stockman Connected components Sequential connected components We ll consider a sequential algorithm that requires only 2 passes over the image. Input: binary image Output: label image, where pixels are numbered per their component [Note, in this example, foreground is denoted with black.] Slide from J. Neira

Sequential connected components Region properties Given connected components, can compute simple features per blob, such as: Area (num pixels in the region) Centroid (average x and y position of pixels in the region) Bounding box (min and max coordinates) How could such features be useful? A=200 A2=70 Issues How to demarcate multiple regions of interest? Count objects Compute further features per object What to do with noisy binary outputs? Holes Extra small fragments Morphological operators Change the shape of the foreground regions/ objects. Useful to clean up result from thresholding Basic operators are: Dilation Erosion Dilation Expands connected components Grow features Fill holes Erosion Erode connected components Shrink features Remove bridges, branches, noise Before dilation After dilation Before erosion After erosion

Structuring elements Masks of varying shapes and sizes used to perform morphology, for example: Dilation vs. Erosion At each position: Dilation: if current pixel is foreground, OR the structuring element with the input image. Scan mask across foreground pixels to transform the binary image >> help strel Example for Dilation (D) 0 0 0 0 g( x) = f ( x) SE Example for Dilation 0 0 0 0 Adapted from T. Moeslund Example for Dilation Example for Dilation 0 0 0 0 0 0 0 0 0 0 0

Example for Dilation Example for Dilation 0 0 0 0 0 0 0 0 0 0 Example for Dilation Example for Dilation 0 0 0 0 0 0 0 0 0 0 Example for Dilation 0 0 0 0 Dilation vs. Erosion At each position: Dilation: if current pixel is foreground, OR the structuring element with the input image. Erosion: if every pixel under the structuring element s nonzero entries is foreground, OR the current pixel with S. 0 Note that the object gets bigger and holes are filled. >> help imdilate

Example for Erosion (D) Example for Erosion (D) 0 0 0 0 0 0 0 0 g( x) = _ f ( x) OSE g( x) = _ f ( x) OSE 0 0 0 Example for Erosion Example for Erosion 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Example for Erosion Example for Erosion 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Example for Erosion Example for Erosion 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Example for Erosion Example for Erosion 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Note that the object gets smaller >> help imerode Opening Erode, then dilate Remove small objects, keep original shape Closing Dilate, then erode Fill holes, but keep original shape Before opening After opening Before closing After closing

Morphology operators on grayscale images Dilation and erosion typically performed on binary images. If image is grayscale: for dilation take the neighborhood max, for erosion take the min. Matlab N = hist(y,m) L = bwlabel (BW,N); STATS = regionprops(l,properties) ; 'Area' 'Centroid' 'BoundingBox' 'Orientation, IM2 = imerode(im,se); IM2 = imdilate(im,se); IM2 = imclose(im, SE); IM2 = imopen(im, SE); original dilated eroded Example using binary image analysis: segmentation of a liver Example using binary image analysis: Bg subtraction + blob detection Slide credit: Li Shen Example using binary image analysis: Bg subtraction + blob detection University of Southern California http://iris.usc.edu/~icohen/projects/vace/detection.htm Summary Filters allow local image neighborhood to influence our description and features Smoothing to reduce noise Derivatives to locate contrast, gradient Templates, matched filters to find designated pattern. Edge detection processes the image gradient to find curves, or chains of edgels. Binary image analysis useful to manipulate regions of interest Connected components Morphological operators

Operations, tools Summary Derivative filters Smoothing, morphology Thresholding Connected components Matched filters Histograms Next Texture: read F&P Ch 9, Sections 9., 9.3 Features, representations Edges, gradients Blobs/regions Color distributions Local patterns Textures (next)