CITS 4402 Computer Vision

Similar documents
Biomedical Image Analysis. Mathematical Morphology

Introduction. Computer Vision & Digital Image Processing. Preview. Basic Concepts from Set Theory

Topic 6 Representation and Description

Mathematical Morphology and Distance Transforms. Robin Strand

EE 584 MACHINE VISION

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

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

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

EE795: Computer Vision and Intelligent Systems

09/11/2017. Morphological image processing. Morphological image processing. Morphological image processing. Morphological image processing (binary)

Lecture: Segmentation I FMAN30: Medical Image Analysis. Anders Heyden

Processing of binary images

Lecture 7: Morphological Image Processing

morphology on binary images

Morphological Image Processing

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

Robert Collins CSE486, Penn State. Lecture 2: Intensity Surfaces and Gradients

Morphological Image Processing

International Journal of Advance Engineering and Research Development. Applications of Set Theory in Digital Image Processing

Digital Image Processing COSC 6380/4393

Segmentation

Morphological Image Processing

Edges and Binary Images

Visualizing Images. Lecture 2: Intensity Surfaces and Gradients. Images as Surfaces. Bridging the Gap. Examples. Examples

Segmentation

Image Analysis Lecture Segmentation. Idar Dyrdal

Types of image feature and segmentation

From Pixels to Blobs

CS534 Introduction to Computer Vision Binary Image Analysis. Ahmed Elgammal Dept. of Computer Science Rutgers University

EECS490: Digital Image Processing. Lecture #17

Introduction to Medical Imaging (5XSA0)

Chapter 9 Morphological Image Processing

Lecture 9: Hough Transform and Thresholding base Segmentation

Problem definition Image acquisition Image segmentation Connected component analysis. Machine vision systems - 1

Connected components - 1

Image Analysis Image Segmentation (Basic Methods)

Robert Collins CSE598G. Intro to Template Matching and the Lucas-Kanade Method

Region-based Segmentation

Morphological Image Processing

Robot vision review. Martin Jagersand

Morphological Compound Operations-Opening and CLosing

Binary Image Analysis. Binary Image Analysis. What kinds of operations? Results of analysis. Useful Operations. Example: red blood cell image

Bioimage Informatics

Topic 4 Image Segmentation

Digital Image Processing. Prof. P.K. Biswas. Department of Electronics & Electrical Communication Engineering

Detection of Edges Using Mathematical Morphological Operators

EXAM SOLUTIONS. Image Processing and Computer Vision Course 2D1421 Monday, 13 th of March 2006,

Part 3: Image Processing

CSE 152 Lecture 7. Intro Computer Vision

ECG782: Multidimensional Digital Signal Processing

ECG782: Multidimensional Digital Signal Processing

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Image Processing Fundamentals. Nicolas Vazquez Principal Software Engineer National Instruments

EECS490: Digital Image Processing. Lecture #22

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

Digital Image Processing Fundamentals

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

Machine vision. Summary # 5: Morphological operations

Image segmentation. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

Lecture 7: Most Common Edge Detectors

OCR For Handwritten Marathi Script

11/10/2011 small set, B, to probe the image under study for each SE, define origo & pixels in SE

CoE4TN4 Image Processing

Morphological Image Processing

Classification. Vladimir Curic. Centre for Image Analysis Swedish University of Agricultural Sciences Uppsala University

COMPUTER AND ROBOT VISION

PPKE-ITK. Lecture

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

Basic Algorithms for Digital Image Analysis: a course

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

Computer Vision & Digital Image Processing. Image segmentation: thresholding

Babu Madhav Institute of Information Technology Years Integrated M.Sc.(IT)(Semester - 7)

Digital Image Processing

Announcements. Binary Image Processing. Binary System Summary. Histogram-based Segmentation. How do we select a Threshold?

CS 5540 Spring 2013 Assignment 3, v1.0 Due: Apr. 24th 11:59PM

Topological structure of images

Morphological Image Processing GUI using MATLAB

11. Gray-Scale Morphology. Computer Engineering, i Sejong University. Dongil Han

CSE 152 Lecture 7` Intro Computer Vision

Image Segmentation. Selim Aksoy. Bilkent University

INTRODUCTION TO IMAGE PROCESSING (COMPUTER VISION)

Introduction to grayscale image processing by mathematical morphology

Image Segmentation. Selim Aksoy. Bilkent University

Lecture 4 Image Enhancement in Spatial Domain

Application of fuzzy set theory in image analysis. Nataša Sladoje Centre for Image Analysis

Topological structure of images

Discovering Visual Hierarchy through Unsupervised Learning Haider Razvi

RESTORATION OF DEGRADED DOCUMENTS USING IMAGE BINARIZATION TECHNIQUE

Lecture 8 Object Descriptors

Hierarchical Representation of 2-D Shapes using Convex Polygons: a Contour-Based Approach

An adaptive container code character segmentation algorithm Yajie Zhu1, a, Chenglong Liang2, b

Analysis of Binary Images

Interpolation is a basic tool used extensively in tasks such as zooming, shrinking, rotating, and geometric corrections.

1 Background and Introduction 2. 2 Assessment 2

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

Image Segmentation Techniques for Object-Based Coding

Segmentation and Grouping

Schools of thoughts on texture

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

6. Object Identification L AK S H M O U. E D U

Transcription:

CITS 4402 Computer Vision A/Prof Ajmal Mian Adj/A/Prof Mehdi Ravanbakhsh, CEO at Mapizy (www.mapizy.com) and InFarm (www.infarm.io) Lecture 02 Binary Image Analysis

Objectives Revision of image formation Binary image analysis Otsu s thresholding Morphological operations Grayscale image analysis (basics for now) Industry project

Lecture 01 Image Formation

Lecture 01 Sampling and Quantization

Lecture 01 Continuous Image Projected onto a Sensor Array

Lecture 01 Representing Image as a Matrix

Lecture 01 Computer Vision: Make Sense of Numbers 255 255 240 255 255 248 232 255 252 247 238 239 255 255 255 255

Frequency How Many Grey Levels? Each pixel represented by one byte 256 discrete intensity values can be encoded 0 indicates perfect black 255 indicates perfect white Each value represents a shade of gray, called a grey-level Image histogram represents how many times each grey-level appears in the image Grey-Levels

Binarization Reduce number of grey levels to two (foreground and background) Objects segmented from background Textual images or document images Much `information' can be lost by binarization Binary images are often simpler to process than grayscale images These arguments need to be traded of before choosing between binary and gray scale image processing approaches

Binarization Binary images are usually the result of a thresholding process. T constant -> global thresholding T depends on local property p(x,y) -> local thresholding Possible principles for thresholding Manual (interactive / trial and error) x fraction for black and white and use histogram distribution-based (typically: two peaks in histogram; find `valley' between two `hills )

Why is Thresholding Difficult?

Otsu Thresholding The aim is to find a threshold that minimizes the intra-class variance (i.e. minimum variation in the foreground + minimum variation in the background) Question: How? Answer: Exhaustive search. Within-class variance = foreground variance + background variance Minimizing the within-class variance is the same as maximizing the between-class variance N. Otsu, A threshold selection method from gray-level histograms," IEEE Trans. on Systems, Man, & Cybernetics, 9(1), 62-66, 1979.

Algorithm: Otsu Thresholding

Otsu s Results

In Matlab I = imread('coins.png'); level = graythresh(i); BW = im2bw(i,level); imshow(bw) Its easy in Matlab, but you don t know what is happening inside For further reading visit: http://www.labbookpages.co.uk/software/imgproc/otsuthreshold.html

Local Thresholding

Local vs Global Methods Global Thresholding methods are: Fast Give good results when illumination over a page is uniform Fail when there are local changes in illumination Local Thresholding methods are: Slow Adapt to local changes in illumination Perform well for both uniform and non-uniform illumination

Analysing Binary Images How many objects are in this image?

Connected Component Analysis Scan the image row by row When a foreground pixel is encountered, assign it a label: If the left neighbour pixel belongs to the background, a new label is assigned to the current foreground pixel If the left neighbour pixel belongs to the foreground, its label is copied to the current pixel If the upper neighbour pixel belongs to the foreground, merge the label of the current pixel and that of the upper neighbour

Connected Component Analysis

Connected Component Analysis 4- or 8- Neighbourhood 4-neighbourhood 8-neighbourhood

Connected Component Analysis

Features of Connected Components Shape features Area Bounding box Boundary length Compactness Features may or may not have invariance properties Translation invariance Rotation invariance Scale invariance

Features of Connected Components Area Count number of pixels For an arbitrarily fine resolution, the area is translation and rotation invariant. Discretization effects may cause considerable variations.

Features of Connected Components Bounding Box Easy to compute Invariance?

Features of Connected Components Boundary Length The boundary length (perimeter) is defined as the number of pixels which constitute the boundary of a shape.

Features of Connected Components Compactness compactness = area / boundary length 2

Analysing Binary Images How many objects are in this image?

Morphological Image Processing View binary images as 2-dimensional sets Basic set-theory concepts you are familiar with: element, subset, union, intersection, disjoint sets, complement, difference

Morphological Image Processing Additional Basic Concepts

Morphological Image Processing Dilation Dilation of A by B: B is called the structuring element

Morphological Image Processing Dilation

Morphological Image Processing Erosion Erosion of A by B:

Morphological Image Processing Erosion Image containing squares of sizes 1, 3, 5, 7, 9, and 15 pixels on the side Erosion using a 13x13 structuring element Dilation using the same 13x13 structuring element

Morphological Image Processing Opening Opening of A by B: Smoothens outlines Breaks narrow bridges, removes protrusions

Morphological Image Processing Closing Closing of A by B: Smoothens outlines Fuses narrow breaks, eliminates holes, fills gaps in contour

Morphological Image Processing Opening and Closing

Morphological Image Processing Boundary Extraction Boundary extraction using morphological operators

Analysing Binary Images How many objects are in this image?

Analysing Binary Images Opening How many objects are in this image?

Analysing Binary Images Closing How many objects are in this image?

The Distance Transform Finding Thickness of Objects Region 4-neighbourhood 8-neighbourhood

The Distance Transform Algorithm Two-Pass Algorithm: The distance transform can be computed by performing a series of local operations while scanning the image twice. For any p let B(p) (`before') be the set of pixels (4- or 8-) adjacent to p that precede p when scanning in standard order: If p has coordinates (x, y), B contains (x, y 1) and (x 1, y), and if we use 8- adjacency it also contains (x 1, y 1) and (x + 1, y 1). Let A(p) (`after') be the remaining (4- or 8-) neighbours of p.

The Distance Transform Algorithm First scan (standard order) Second scan (reverse order)

The Distance Transform Step 1 Step 2 4-neighbourhood 8-neighbourhood

The Distance Transform Euclidean distance (L2 norm) sqrt((x1 y1)^2+ (x2-y2)^2 +... ) City block distance (L1 norm) x1 y1 + x2-y2 + Original Image L 2 distance transform L 1 distance transform

Application: Separation of overlapping objects

Application: Separation of overlapping objects

Grayscale Image Analysis Generally, we can get more information from a grayscale image The bulk of computer vision techniques process grayscale images We will only touch upon the basics today Recall that a grayscale image is a matrix of integers in the range (0-255)

Images as Surfaces The same image represented as a surface on the right Brightness corresponds to height on the surface

Image as Surfaces

How does an edge look like?

What would a line look like?

What would a line look like?

And the ground

A feature

How does this help us?

The concept of terrain Uphill / downhill Contour lines Steepness of slope Peaks / valleys (local extrema)

Terrain Concepts Mathematical Notions Tangent plane Normal vector Curvature Gradient vectors (vectors of partial derivatives) will help compute all these

Example of 1-D Gradient

1-D Gradient

1-D Gradient

1-D Gradient

Gradients are informative

Images are 2-D Let us define 2-D Gradients

2-D Gradients Plotted as vectors Gradient at each pixel points uphill The gradient indicates the direction of steepest ascent The gradient is zero at the peak

2-D Gradients

2-D Gradients We can do these calculations for all points

2-D Gradient Example on a Real Image Notice how the contours of the cameraman have been detected

Importance of road junctions Application in car navigation, traffic management, intelligent transportation systems etc.

Carried out in three steps: Clipping island area where islands are present Morphological opening, closing and Gaussian smoothing Thresholding Clipped island area Pre-processed image Segmentation result

Summary Conversion of a grayscale image to binary (global vs local thresholds) Connected component analysis Morphological image processing Distance Transform Grayscale image analysis with gradients Industry project

Acknowledgements Material presented in this lecture is taken from different sources including previous lectures prepared at UWA, textbooks of image processing and computer vision, online resources and Robert Collins lectures (Penn State University)