Loading...

PPT – Binary Image Analysis PowerPoint presentation | free to download - id: 761840-OTMwN

The Adobe Flash plugin is needed to view this content

Binary Image Analysis

- Thresholding
- Convolution
- Morphology
- http//www.mmorph.com/mxmorph
- 4. Region Properties
- 5. Edge Properties

1. Region Properties2. Edge properties

Region Properties

(No Transcript)

(No Transcript)

(No Transcript)

Object Counting

- How many objects are there in an image?

Define external and Internal Corners

- Slide the masks over image and find

external_match (L,P) and - internal_match (L,P)

Object Counting

Document analysis

- How many letters , words, paragraphs
- in a page?

Connected Components Labeling

Once you have a binary image, you can identify

and then analyze each connected set of

pixels. The connected components operation takes

in a binary image and produces a labeled image

in which each pixel has the integer label of

either the background (0) or a component.

connected components

binary image after morphology

Methods for CC Analysis

- Recursive Tracking
- Parallel Growing (needs parallel hardware)
- Row-by-Row

(No Transcript)

Recursive Labeling

(No Transcript)

Row-by-row labeling algorithm

- First pass Propagate a pixels label to its

neighbors to the right and below it. Whenever

two different labels can propagate to the same

pixel, these labels are recorded as an

equivalence class. - Second pass Perform a translation, assigning to

each pixel the label of its equivalence class. - A union-find data structure is used for

efficient construction and manipulation of

equivalencenclasses represented by tree

structures.

Equivalent Labels

Original Binary Image

0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1 1 1

1 0 0 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 0 0 1 1

1 1 0 0 1 1 1 0 0 0 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1

1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 1 1

1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1

1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1

Equivalent Labels

The Labeling Process

0 0 0 1 1 1 0 0 0 0 2 2 2 2 0 0 0 0 3 0 0 0 1 1 1

1 0 0 0 2 2 2 2 0 0 0 3 3 0 0 0 1 1 1 1 1 0 0 2 2

2 2 0 0 3 3 3 0 0 0 1 1 1 1 1 1 0 2 2 2 2 0 0 3 3

3 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 3 3 3 0 0 0 1 1

1 1 1 1 1 1 1 1 1 0 0 3 3 3 0 0 0 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1

1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1

1 ? 2 1 ? 3

(No Transcript)

(No Transcript)

(No Transcript)

(No Transcript)

Run-Length Data Structure

0 1 2 3 4

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

0 1 2 3 4

row scol ecol label

Binary Image

U N U S E D 0 0 0 1 0 0 3 4 0 1 0 1 0 1

4 4 0 2 0 2 0 2 4 4 0 4 1 4 0

0 1 2 3 4 5 6 7

Rstart Rend

- 2
- 4
- 6
- 0 0
- 7 7

0 1 2 3 4

Row Index

Runs

Run-Length Algorithm

Procedure run_length_classical initialize

Run-Length and Union-Find data structures

count lt- 0 / Pass 1 (by rows) / for each

current row and its previous row

move pointer P along the runs of current row

move pointer Q along the runs of previous row

Case 1 No Overlap

Q

Q

///// /////

////

/// /// /////

P

P

/ new label / count lt- count 1 label(P) lt-

count P lt- P 1

/ check Qs next run / Q lt- Q 1

Case 2 Overlap

Subcase 2 Ps run has a label that is different

from Qs run

Subcase 1 Ps run has no label yet

Q

Q

/////// ///// /////////////

/////// ///// /////////////

P

P

label(P) lt- label(Q) move pointer(s)

union(label(P),label(Q)) move pointer(s)

Pass 2 (by runs)

/ Relabel each run with the name of the

equivalence class of its label / For each run M

label(M) lt- find(label(M))

where union and find refer to the operations of

the Union-Find data structure, which keeps track

of sets of equivalent labels.

Thresholding and connected compmonent labeling

connected components of 1s from thresholded image

Gray level Image

Binary Image

Region Properties-Features

Properties of the regions can be used to

recognize objects.

- geometric properties
- gray-tone properties
- color properties
- texture properties
- shape properties
- motion properties
- relationship properties

Geometric and Shape Properties

- area
- centroid
- perimeter
- perimeter length
- circularity 1

Distances

Moments

Bounding Box and Extremal points

ExEllipse, square, rectangle

Labeling shown as Pseudo-Color

connected components of 1s from thresholded image

connected components of cluster labels

Region Adjacency Graph

A region adjacency graph (RAG) is a graph in

which each node represents a region of the image

and an edge connects two nodes if the regions are

adjacent.

1

1

2

2

3

4

4

3

2. Edge Operators

- a kind of filtering that leads to useful features

Lines and ArcsSegmentation

In some image sets, lines, curves, and circular

arcs are more useful than regions or helpful in

addition to regions.

- Lines and arcs are often used in
- object recognition
- stereo matching
- document analysis

Edge Detection

Basic idea look for a neighborhood with strong

signs of change.

81 82 26 24 82 33 25 25 81 82 26

24

- Problems
- neighborhood size
- how to detect change

Differential Operators

- Differential operators
- attempt to approximate the gradient at a pixel

via masks - threshold the gradient to select the edge pixels

Example Sobel Operator

-1 0 1

1 2 1 Sx -2 0 2

Sy 0 0 0 -1 0 1

-1 -2 -1

- On a pixel of the image I
- let gx be the response to Sx
- let gy be the response to Sy

Then the gradient is ?I gx gy

T

2

2

1/2

And g (gx gy ) is the

gradient magnitude. ? atan2(gy,gx)

is the gradient direction.

Sobel Operator on the Blocks Image

original image gradient

thresholded

magnitude gradient

magnitude

Common Masks for Computing Gradient

- Sobel
- Prewitt
- Roberts

-1 0 1 -2 0 2 -1 0 1

- 2 1
- 0 0 0
- -1 -2 -1

-1 0 1 -1 0 1 -1 0 1

- 1 1
- 0 0 0
- -1 -1 -1

0 1 -1 0

- 0
- 0 -1

Sx

Sy

Zero Crossing Operators

Motivation The zero crossings of the second

derivative of the image

function are more precise than

the peaks of the first derivative.

step edge

smoothed

1st derivative

zero crossing

2nd derivative

How do we estimate the Second Derivative?

- Laplacian Filter ? f ? f / ?x ? f / ?y

2

2

2

2

2

0 1 0 1 -4 1 0 1 0

- Standard mask implementation
- Derivation In 1D, the first derivative
- can be computed with mask -1 0 1
- The 1D second derivative is 1 -2 1
- The Laplacian mask estimates the
- 2D second derivative.

Properties of Derivative Masks

- Coordinates of derivative masks have opposite

signs in order to obtain a high response in

regions of high contrast. - The sum of coordinates of derivative masks is

zero, so that a zero response is obtained on

constant regions. - First derivative masks produce high absolute

values at points of high contrast. - Second derivative masks produce zero-crossings at

points of high contrast.

Marr/Hildreth Operator

- First smooth the image via a Gaussian

convolution. - Apply a Laplacian filter (estimate 2nd

derivative). - Find zero crossings of the Laplacian of the

Gaussian. - This can be done at multiple resolutions.

Haralick Operator

- Fit the gray-tone intensity surface to a

piecewise - cubic polynomial approximation.
- Use the approximation to find zero crossings of

the - second directional derivative in the direction

that - maximizes the first directional derivative.
- The derivatives here are calculated from direct
- mathematical expressions wrt the cubic polynomial.

Canny Edge Detector

- Smooth the image with a Gaussian filter with

spread ?. - Compute gradient magnitude and direction at each

pixel of - the smoothed image.
- Zero out any pixel response ? the two

neighboring pixels - on either side of it, along the direction of

the gradient. - Track high-magnitude contours.
- Keep only pixels along these contours, so weak

little - segments go away.

Canny Examples

Canny ?4

Canny ?1

Canny ?1

Roberts 2X2

Canny on Kidney

Canny Characteristics

- The Canny operator gives single-pixel-wide images

with good continuation between adjacent pixels - It is the most widely used edge operator today

no one has done better since it came out in the

late 80s. Many implementations are available. - It is very sensitive to its parameters, which

need to be adjusted for different application

domains.