Edges and Binary Images

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

Edges and Binary Image Analysis April 12 th, 2018

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

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

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

Review of Filtering. Filtering in frequency domain

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

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

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

Edge Detection CSC 767

DIGITAL IMAGE PROCESSING

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

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

Edge and corner detection

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

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

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

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

CS5670: Computer Vision

Prof. Feng Liu. Winter /15/2019

Does everyone have an override code?

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

Image gradients and edges

Lecture 7: Most Common Edge Detectors

Image Analysis. Edge Detection

Edge Detection. EE/CSE 576 Linda Shapiro

CS4670: Computer Vision Noah Snavely

Image gradients and edges April 11 th, 2017

Image gradients and edges April 10 th, 2018

Image Analysis. Edge Detection

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

Image gradients and edges

Digital Image Processing COSC 6380/4393

Filtering in frequency domain

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

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

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

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

Lecture 4: Finding lines: from detection to model fitting

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

Straight Lines and Hough

Anno accademico 2006/2007. Davide Migliore

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

Lecture 6: Edge Detection

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

Topic 4 Image Segmentation

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

Edge Detection Lecture 03 Computer Vision

Local Image preprocessing (cont d)

EE795: Computer Vision and Intelligent Systems

Texture Representation + Image Pyramids

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

Comparison between Various Edge Detection Methods on Satellite Image

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

Boundaries and Sketches

Image Processing

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

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

EE 584 MACHINE VISION

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

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

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

Detection of Edges Using Mathematical Morphological Operators

Digital Image Processing. Image Enhancement - Filtering

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

Practical Image and Video Processing Using MATLAB

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

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

Filtering Images. Contents

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

Biomedical Image Analysis. Point, Edge and Line Detection

EN1610 Image Understanding Lab # 3: Edges

Image Analysis Lecture Segmentation. Idar Dyrdal

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

Other Linear Filters CS 211A

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

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

Morphological Image Processing

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

SIFT: SCALE INVARIANT FEATURE TRANSFORM SURF: SPEEDED UP ROBUST FEATURES BASHAR ALSADIK EOS DEPT. TOPMAP M13 3D GEOINFORMATION FROM IMAGES 2014

Neighborhood operations

Filtering and Edge Detection. Computer Vision I. CSE252A Lecture 10. Announcement

Feature Matching and Robust Fitting

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

Introduction to Medical Imaging (5XSA0)

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

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

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

Motion illusion, rotating snakes

CS 4495 Computer Vision A. Bobick. CS 4495 Computer Vision. Features 2 SIFT descriptor. Aaron Bobick School of Interactive Computing

Concepts in. Edge Detection

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

Announcements. Edges. Last Lecture. Gradients: Numerical Derivatives f(x) Edge Detection, Lines. Intro Computer Vision. CSE 152 Lecture 10

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

Local Image Features

From Pixels to Blobs

COMPUTER AND ROBOT VISION

ME/CS 132: Introduction to Vision-based Robot Navigation! Low-level Image Processing" Larry Matthies"

CAP 5415 Computer Vision Fall 2012

ECG782: Multidimensional Digital Signal Processing

Transcription:

CS 699: Intro to Computer Vision Edges and Binary Images Prof. Adriana Kovashka University of Pittsburgh September 5, 205

Plan for today Edge detection Binary image analysis

Homework Due on 9/22, :59pm Review slides from 9/03 regarding how to do Part IV There are different ways to compute image gradients Office hours for 9/7 will be at am-2pm on 9/8

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 Main idea: look for strong gradients, post-process

Origin of Edges surface normal discontinuity depth discontinuity surface color discontinuity illumination discontinuity Edges are caused by a variety of factors Source: S. Seitz

What causes an edge? Reflectance change: appearance information, texture Depth discontinuity: object boundary Cast shadows Change in surface orientation: shape

Edges/gradients and invariance

Closeup of edges Source: D. Hoiem

Closeup of edges Source: D. Hoiem

Characterizing edges An edge is a place of rapid change in the image intensity function image intensity function (along horizontal scanline) first derivative edges correspond to extrema of derivative Source: L. Lazebnik

Intensity profile Intensity Gradient Source: D. Hoiem

With a little Gaussian noise Gradient Source: D. Hoiem

Effects of noise Consider a single row or column of the image Plotting intensity as a function of position gives a signal Where is the edge? Source: S. Seitz

Effects of noise Difference filters respond strongly to noise Image noise results in pixels that look very different from their neighbors Generally, the larger the noise the stronger the response What can we do about it? Source: D. Forsyth

Solution: smooth first f g f * g d dx ( f g) d dx To find edges, look for peaks in ( f g) Source: S. Seitz

Derivative theorem of convolution Differentiation is convolution, and convolution is associative: d d ( f g) f g dx dx This saves us one operation: f d dx g f d dx g Source: S. Seitz

Derivative of Gaussian filter * [ 0 -] = Is this filter separable? Source: D. Hoiem

Tradeoff between smoothing and localization pixel 3 pixels 7 pixels Smoothed derivative removes noise, but blurs edge. Also finds edges at different scales. Source: D. Forsyth

Designing an edge detector Criteria for a good edge detector: Good detection: find all real edges, ignoring noise or other artifacts Good localization detect edges as close as possible to the true edges return one point only for each true edge point Cues of edge detection Differences in color, intensity, or texture across the boundary Continuity and closure High-level knowledge Source: L. Fei-Fei

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

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)

Original image

Gradient magnitude image

Thresholding gradient with a lower threshold

Thresholding gradient with a higher threshold

Canny edge detector This is probably the most widely used edge detector in computer vision Theoretical model: step-edges corrupted by additive Gaussian noise Canny has shown that the first derivative of the Gaussian closely approximates the operator that optimizes the product of signal-to-noise ratio and localization J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-74, 986. Source: L. Fei-Fei

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 Source: D. Lowe, L. Fei-Fei

Example input image ( Lena )

Derivative of Gaussian filter x-direction y-direction Source: L. Lazebnik

Compute Gradients (DoG) X-Derivative of Gaussian Y-Derivative of Gaussian Gradient Magnitude Source: D. Hoiem

Get Orientation at Each Pixel Threshold at minimum level Get orientation theta = atan2(-gy, gx) Source: D. Hoiem

The Canny edge detector norm of the gradient

The Canny edge detector thresholding

The Canny edge detector How to turn these thick regions of the gradient into curves? thresholding

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

Bilinear Interpolation http://en.wikipedia.org/wiki/bilinear_interpolation

The Canny edge detector Problem: pixels along this edge didn t survive the thresholding thinning (non-maximum suppression)

Hysteresis thresholding Use a high threshold to start edge curves, and a low threshold to continue them. Source: S. Seitz

Hysteresis thresholding original image high threshold (strong edges) low threshold (weak edges) hysteresis threshold Source: L. Fei-Fei

Hysteresis thresholding original image high threshold (strong edges) low threshold (weak edges) hysteresis threshold Source: L. Fei-Fei

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 Source: D. Lowe, L. Fei-Fei

Effect of (Gaussian kernel spread/size) original Canny with Canny with The choice of depends on desired behavior large detects large scale edges small detects fine features Source: S. Seitz

Low-level edges vs. perceived contours Background Texture Shadows

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/ Source: L. Lazebnik

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

Learn from humans which combination of features is most indicative of a good contour? [D. Martin et al. PAMI 2004] Human-marked segment boundaries

pb Boundary Detector Figure from Fowlkes

Brightness Color Texture Combined Human

Results Pb (0.88) Human (0.95) Source: D. Hoiem

Results Pb Global Pb (0.88) Pb Human Human (0.96) Source: D. Hoiem

Pb (0.63) Human (0.95) Source: D. Hoiem

Pb (0.35) Human (0.90) For more: http://www.eecs.berkeley.edu/research/projects /CS/vision/bsds/bench/html/08082-color.html

Plan for today Edge detection Binary image analysis

Binary images

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

Two pixel values Binary images Foreground and background Mark region(s) of interest

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

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 - = Looking for pixels that differ significantly from the empty background. fg_pix = find(diff > t);

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);

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.

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

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

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

Dilation Expands connected components Grow features Fill holes Before dilation After dilation

Erosion Erode connected components Shrink features Remove bridges, branches, noise Before erosion After erosion

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

Dilation vs. Erosion At each position: Dilation: if current pixel is foreground, OR the structuring element with the input image.

Example for Dilation (D) Input image 0 0 0 0 Structuring Element g( x) f ( x) SE Output Image Adapted from T. Moeslund

Example for Dilation Input image 0 0 0 0 Structuring Element Output Image

Example for Dilation Input image 0 0 0 0 Structuring Element Output Image 0

Example for Dilation Input image 0 0 0 0 Structuring Element Output Image 0 0

Example for Dilation Input image 0 0 0 0 Structuring Element Output Image 0

Example for Dilation Input image 0 0 0 0 Structuring Element Output Image 0

Example for Dilation Input image 0 0 0 0 Structuring Element Output Image 0

Example for Dilation Input image 0 0 0 0 Structuring Element Output Image 0

Example for Dilation Input image 0 0 0 0 Structuring Element Output Image 0 Note that the object gets bigger and holes are filled. >> help imdilate

2D example for dilation Source: Shapiro and Stockman

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.

Example for Erosion (D) Input image 0 0 0 0 Structuring Element g( x) f _ ( x) OSE Output Image 0

Example for Erosion (D) Input image 0 0 0 0 Structuring Element g( x) f _ ( x) OSE Output Image 0 0

Example for Erosion Input image 0 0 0 0 Structuring Element Output Image 0 0 0

Example for Erosion Input image 0 0 0 0 Structuring Element Output Image 0 0 0 0

Example for Erosion Input image 0 0 0 0 Structuring Element Output Image 0 0 0 0 0

Example for Erosion Input image 0 0 0 0 Structuring Element Output Image 0 0 0 0 0

Example for Erosion Input image 0 0 0 0 Structuring Element Output Image 0 0 0 0 0 0

Example for Erosion Input image 0 0 0 0 Structuring Element Output Image 0 0 0 0 0 0 0

Example for Erosion Input image 0 0 0 0 Structuring Element Output Image 0 0 0 0 0 0 0 0

Example for Erosion Input image 0 0 0 0 Structuring Element Output Image 0 0 0 0 0 0 0 0 Note that the object gets smaller >> help imerode

2D example for erosion Source: Shapiro and Stockman

Erode, then dilate Opening Remove small objects, keep original shape Before opening After opening

Dilate, then erode Closing Fill holes, but keep original shape Before closing After closing Applet: http://bigwww.epfl.ch/demo/jmorpho/start.php

Summary Can use filters to process and describe local neighborhood Derivatives to locate gradients Convolution properties will influence efficiency Edge detection processes the image gradient to find curves Clean up thresholding outputs with binary image morphology operations Adapted from K. Grauman

Next time Computing image features: Detecting and describing keypoints