Edges and Binary Image Analysis April 12 th, 2018

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

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

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

Edges and Binary Images

Image gradients and edges

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

Edge Detection CSC 767

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

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

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

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

Image gradients and edges April 11 th, 2017

Image gradients and edges April 10 th, 2018

Review of Filtering. Filtering in frequency domain

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

Prof. Feng Liu. Winter /15/2019

Image gradients and edges

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

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

EE 584 MACHINE VISION

Anno accademico 2006/2007. Davide Migliore

Edge and corner detection

CS5670: Computer Vision

CS4670: Computer Vision Noah Snavely

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

DIGITAL IMAGE PROCESSING

Image Analysis. Edge Detection

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

Topic 4 Image Segmentation

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

Image Analysis. Edge Detection

EE795: Computer Vision and Intelligent Systems

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

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

Local Image preprocessing (cont d)

Digital Image Processing COSC 6380/4393

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

Raghuraman Gopalan Center for Automation Research University of Maryland, College Park

Does everyone have an override code?

Low-level Vision Processing Algorithms Speaker: Ito, Dang Supporter: Ishii, Toyama and Y. Murakami

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

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

Lecture 7: Most Common Edge Detectors

Comparison between Various Edge Detection Methods on Satellite Image

Morphological Image Processing

Lecture 4: Finding lines: from detection to model fitting

Lecture 6: Edge Detection

Image Processing

Practical Image and Video Processing Using MATLAB

Local Image Features

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

Robust Zero Watermarking for Still and Similar Images Using a Learning Based Contour Detection

Local Image Features

Boundaries and Sketches

Detection of Edges Using Mathematical Morphological Operators

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

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

Digital Image Processing. Image Enhancement - Filtering

Edge Detection Lecture 03 Computer Vision

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

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

Part-based and local feature models for generic object recognition

Feature descriptors. Alain Pagani Prof. Didier Stricker. Computer Vision: Object and People Tracking

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

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

Filtering in frequency domain

Segmentation. Separate image into coherent regions

Straight Lines and Hough

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

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

Line, edge, blob and corner detection

Filtering Applications & Edge Detection. GV12/3072 Image Processing.

Image Analysis Lecture Segmentation. Idar Dyrdal

Introduction to Medical Imaging (5XSA0)

Local features: detection and description May 12 th, 2015

Morphological Image Processing

Filtering Images. Contents

Motion illusion, rotating snakes

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

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

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

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

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

Computer Vision I - Basics of Image Processing Part 2

Linear Operations Using Masks

Bias-Variance Trade-off (cont d) + Image Representations

COMPUTER AND ROBOT VISION

Other Linear Filters CS 211A

Morphological Image Processing

Concepts in. Edge Detection

Filtering and Enhancing Images

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

Window based detectors

3 October, 2013 MVA ENS Cachan. Lecture 2: Logistic regression & intro to MIL Iasonas Kokkinos

Texture April 14 th, 2015

Segmentation and Grouping April 19 th, 2018

Biomedical Image Analysis. Mathematical Morphology

CAP 5415 Computer Vision Fall 2012

Mathematical Morphology and Distance Transforms. Robin Strand

2D Image Processing Feature Descriptors

Transcription:

4/2/208 Edges and Binary Image Analysis April 2 th, 208 Yong Jae Lee UC Davis Previously Filters allow local image neighborhood to influence our description and features Smoothing to reduce noise Derivatives to locate contrast, gradient Seam carving application: use image gradients to measure interestingness or energy remove 8-connected seams so as to preserve image s energy 2 Review: Partial derivatives of an image f ( x, y) x f ( x, y) y - -? or - Which shows changes with respect to x? (showing filters for correlation) 3

4/2/208 0 f ( x, y) y - 255 0 (showing filters for correlation) 4 0 255 f ( x, y) x - - 255 0 (showing filters for correlation) -255 5 Today Edge detection and matching process the image gradient to find curves/contours comparing contours Binary image analysis blobs and regions 6 2

4/2/208 Edge detection Goal: map image from 2d array of pixels to a set of curves or line segments or contours. Why? Figure from J. Shotton et al., PAMI 2007 Figure from D. Lowe Main idea: look for strong gradients, post-process 7 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 8 Thresholding 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) 9 3

4/2/208 Original image 0 Gradient magnitude image Thresholding gradient with a lower threshold 2 4

4/2/208 Thresholding gradient with a higher threshold 3 Canny edge detector Filter image with derivative of Gaussian Find magnitude and orientation of gradient Non-maximum suppression: Thin 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 4 Slide credit:david Lowe, Fei Fei Li The Canny edge detector Slide credit: Steve Seitz original image (Lena) 5 5

4/2/208 The Canny edge detector gradient magnitude 6 Compute Gradients X-Derivative of Gaussian Y-Derivative of Gaussian Gradient Magnitude Slide credit: Svetlana Lazebnik 7 The Canny edge detector gradient magnitude 8 6

4/2/208 The Canny edge detector thresholding 9 The Canny edge detector How to turn these thick regions of the gradient into curves? thresholding 20 Non-maximum suppression Check if pixel is local maximum along gradient direction Select single max across width of the edge Requires checking interpolated pixels p and r 2 7

4/2/208 The Canny edge detector Problem: pixels along this edge didn t survive the thresholding thinning (non-maximum suppression) 22 Hysteresis thresholding Use a high threshold to start edge curves, and a low threshold to continue them. 23 Slide credit: Steve Seitz Hysteresis thresholding original image high threshold (strong edges) Slide credit: Fei Fei Li low threshold (weak edges) hysteresis threshold 24 8

4/2/208 Hysteresis thresholding http://users.ecs.soton.ac.uk/msn/book/ne w_demo/thresholding/ 25 Recap: Canny edge detector Filter image with derivative of Gaussian Find magnitude and orientation of gradient Non-maximum suppression: Thin 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 26 Slide credit:david Lowe, Fei Fei Li Low-level edges vs. perceived contours Background Texture Shadows 27 9

4/2/208 Low-level edges vs. perceived contours image human segmentation gradient magnitude Berkeley segmentation database: http://www.eecs.berkeley.edu/research/projects/cs/vision/grouping/segbench/ 28 Slide credit: Svetlana Lazebnik Learn from humans which combination of features is most indicative of a good contour? [D. Martin et al. PAMI 2004] Human-marked segment boundaries 29 pb boundary detector Martin, Fowlkes, Malik 2004: Learning to Detection Natural Boundaries http://www.eecs.berkeley.edu/research/projects/c S/vision/grouping/papers/mfm-pami-boundary.pdf Figure from Fowlkes 30 0

4/2/208 pb Boundary Detector 3 Figure from Fowlkes [D. Martin et al. PAMI 2004] 32 State-of-the-Art in Contour Detection Canny+opt thresholds Canny Prewitt, Sobel, Roberts Human agreement pb Source: Jitendra Malik: http://www.cs.berkeley.edu/~malik/malik-talks-ptrs.html 33

4/2/208 Holistically-Nested Edge Detection (Xie, Tu ICCV 205). holistic image training and prediction 2. multi-scale and multi-level feature learning 3. Deeply-supervised fully-convolutional network 34 State-of-the-Art in Contour Detection HED pb 35 Today Edge detection and matching process the image gradient to find curves/contours comparing contours Binary image analysis blobs and regions 36 2

4/2/208 Figure from Belongie et al. 37 Chamfer distance Average distance to nearest feature/edge I T Set of edge points in image Set of edge points on (shifted) template (t) d I Minimum distance between point t and some point in I 38 Chamfer distance 39 3

4/2/208 Chamfer distance Average distance to nearest feature How is the measure different than just filtering with a mask having the shape points? How expensive is a naïve implementation? Edge image 40 Distance transform Image features (2D) Distance Transform 0 2 3 4 3 2 0 2 3 3 2 0 2 3 2 0 0 0 2 0 2 2 0 2 3 4 2 3 2 3 2 2 0 0 2 2 5 4 4 3 2 0 Distance Transform is a function D( ) that for each image pixel p assigns a non-negative number D(p) corresponding to distance from p to the nearest feature in the image I Slide credit: Yuri Boykov 4 Distance transform original edges distance transform Value at (x,y) tells how far that position is from the nearest edge point (or other binary image structure) >> help bwdist 42 4

4/2/208 Distance transform (D) // 0 if j is in P, infinity otherwise Image features (edges) 0 0 0 0 0 0 Distance transform Slide adapted from Dan Huttonlocher 43 Distance Transform (2D) Slide credit: Dan Huttonlocher 44 Chamfer distance Average distance to nearest feature Edge image Distance transform image 45 5

4/2/208 Chamfer distance Edge image Fig from D. Gavrila, DAGM 999 Distance transform image 46 Chamfer distance: properties Sensitive to scale and rotation Tolerant of small shape changes, clutter Need large number of template shapes Inexpensive way to match shapes 47 Today Edge detection and matching process the image gradient to find curves/contours comparing contours Binary image analysis blobs and regions 48 6

4/2/208 Binary images 49 Binary image analysis: basic steps Convert the image into binary form Thresholding Clean up the thresholded image Morphological operators Extract separate blobs Connected components Describe the blobs with region properties 50 Binary images Two pixel values Foreground and background Mark region(s) of interest 5 7

4/2/208 Thresholding Grayscale -> binary mask Useful if object of interest s intensity distribution is distinct from background Example http://homepages.inf.ed.ac.uk/rbf/cvonline/local_copies/fitzgibbon/ simplebinary.html 52 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); Slide adapted from Kristen Grauman Looking for pixels where gradient is strong. 53 Thresholding Given a grayscale image or an intermediate matrix threshold to create a binary output. Example: background subtraction - = Looking for pixels that differ significantly from the empty background. fg_pix = find(diff > t); 54 8

4/2/208 Thresholding Given a grayscale image or an intermediate matrix threshold to create a binary output. Example: intensity-based detection Looking for dark pixels fg_pix = find(im < 65); 55 Thresholding Given a grayscale image or an intermediate matrix threshold to create a binary output. Example: color-based detection fg_pix = find(hue > t & hue < t2); Looking for pixels within a certain hue range. 56 A nice case: bimodal intensity histograms Ideal histogram, light object on dark background Actual observed histogram with noise Images: http://homepages.inf.ed.ac.uk/rbf/cvonline/local_copies/owens/lect2/node3.html 57 9

4/2/208 Not so nice cases Slide credit: Shapiro and Stockman 58 Issues What to do with noisy binary outputs? Holes Extra small fragments How to demarcate multiple regions of interest? Count objects Compute further features per object 59 Morphological operators Change the shape of the foreground regions via intersection/union operations between a scanning structuring element and binary image Useful to clean up result from thresholding Basic operators are: Dilation Erosion 60 20

4/2/208 Dilation Expands connected components Grow features Fill holes Before dilation After dilation 6 Erosion Erode connected components Shrink features Remove bridges, branches, noise Before erosion After erosion 62 Structuring elements Masks of varying shapes and sizes used to perform morphology, for example: Scan mask across foreground pixels to transform the binary image >> help strel 63 2

4/2/208 Dilation vs. Erosion At each position: Dilation: if current pixel is, then set all the output pixels corresponding to structuring element to. 64 Example for Dilation 0 0 0 0 Structuring Element 65 Slide credit: Adapted by Kristen Grauman from T. Moeslund Example for Dilation 0 0 0 0 Structuring Element 66 22

4/2/208 Example for Dilation 0 0 0 0 Structuring Element 0 67 Example for Dilation 0 0 0 0 Structuring Element 0 0 68 Example for Dilation 0 0 0 0 Structuring Element 0 69 23

4/2/208 Example for Dilation 0 0 0 0 Structuring Element 0 70 Example for Dilation 0 0 0 0 Structuring Element 0 7 Example for Dilation 0 0 0 0 Structuring Element 0 72 24

4/2/208 Example for Dilation 0 0 0 0 Structuring Element 0 Note that the object gets bigger and holes are filled. 73 >> help imdilate 2D example for dilation Slide credit: Shapiro & Stockman 74 Dilation vs. Erosion At each position: Dilation: if current pixel is, then set all the output pixels corresponding to structuring element to. Erosion: if every pixel under the structuring element is, then set the output pixel corresponding to the current pixel to. 75 25

4/2/208 Example for Erosion (D) 0 0 0 0 Structuring Element 0 76 Example for Erosion (D) 0 0 0 0 Structuring Element 0 0 77 Example for Erosion 0 0 0 0 Structuring Element 0 0 0 78 26

4/2/208 Example for Erosion 0 0 0 0 Structuring Element 0 0 0 0 79 Example for Erosion 0 0 0 0 Structuring Element 0 0 0 0 0 80 Example for Erosion 0 0 0 0 Structuring Element 0 0 0 0 0 8 27

4/2/208 Example for Erosion 0 0 0 0 Structuring Element 0 0 0 0 0 0 82 Example for Erosion 0 0 0 0 Structuring Element 0 0 0 0 0 0 0 83 Example for Erosion 0 0 0 0 Structuring Element 0 0 0 0 0 0 0 0 84 28

4/2/208 Example for Erosion 0 0 0 0 Structuring Element 0 0 0 0 0 0 0 0 Note that the object gets smaller >> help imerode 85 2D example for erosion Slide credit: Shapiro & Stockman 86 Opening Erode, then dilate Remove small objects, keep original shape Before opening After opening 87 29

4/2/208 Closing Dilate, then erode Fill holes, but keep original shape Before closing After closing Applet: http://bigwww.epfl.ch/demo/jmorpho/start.php 88 Issues What to do with noisy binary outputs? Holes Extra small fragments How to demarcate multiple regions of interest? Count objects Compute further features per object 89 Connected components Identify distinct regions of connected pixels >> L = bwlabel(bw,conn) 90 30

4/2/208 Connectedness Defining which pixels are considered neighbors 4-connected 8-connected Slide credit: Chaitanya Chandra 9 Connected components 92 Slide credit: Pinar Duygulu 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) A=200 A2=70 93 3

4/2/208 Binary image analysis: basic steps (recap) Convert the image into binary form Thresholding Clean up the thresholded image Morphological operators Extract separate blobs Connected components Describe the blobs with region properties 94 Matlab L = bwlabel (BW,8); STATS = regionprops(l,properties) ; 'Area' 'Centroid' 'BoundingBox' 'Orientation, IM2 = imerode(im,se); IM2 = imdilate(im,se); IM2 = imclose(im, SE); IM2 = imopen(im, SE); 95 Slide adapted from Kristen Grauman Example using binary image analysis: segmentation of a liver Slide credit: Li Shen 96 32

4/2/208 Binary images Pros Can be fast to compute, easy to store Simple processing techniques available Lead to some useful compact shape descriptors Cons Hard to get clean silhouettes Noise common in realistic scenarios Can be too coarse of a representation 97 Operations, tools Summary Derivative filters Smoothing, morphology Thresholding Connected components Matching filters Histograms Features, representations Edges, gradients Blobs/regions Local patterns Textures (next) Color distributions 98 Coming up Texture Read Szeliski 0.5 99 33

4/2/208 Questions? See you Tuesday! 00 34