mathematics of binary morphology and applications in vision

209
MATHEMATICS OF MATHEMATICS OF BINARY BINARY MORPHOLOGY MORPHOLOGY and and APPLICATIONS IN APPLICATIONS IN Vision Vision

Upload: jonas-clifton-berry

Post on 11-Jan-2016

235 views

Category:

Documents


1 download

TRANSCRIPT

MATHEMATICS OF MATHEMATICS OF BINARY BINARY

MORPHOLOGY MORPHOLOGY and and

APPLICATIONS IN APPLICATIONS IN VisionVision

In general; what is “Morphology”?

• The science of form and structure– the science of form, that of the outer form, inner structure, and

development of living organisms and their parts

– about changing/counting regions/shapes

• Among other applications it is used to pre- or post-process images– via filtering, thinning and pruning

• Smooth region edges– create line drawing of face

• Force shapes onto region edges– curve into a square • Count regions (granules)

– number of black regions

• Estimate size of regions– area calculations

What is Morphology in computer vision ?

1. Morphology generally concerned with shape and properties of objects.

2. Used for segmentation and feature extraction.

3. Segmentation = used for cleaning binary objects.

4. Two basic operations1. erosion (opening)2. dilation (closing)

Morphological operations and algebras

1. Different definitions in the textbooks

2. Different implementations in the image processing programs.

3. The original definition, based on set theory, is made by J. Serra in 1982.

4. Defined for binary images - binary operations (boolean, set-theoretical)

5. Can be used on grayscale images - multiple-valued logic operations

Morphological operations on a PC

• Various but slightly different implementations in

• Scion

• Paint Shop Pro

• Adope Photoshop

• Corel Photopaint

• mmTry them, it is a lot of fun

Mathematical Morphology

- Set-theoretic representation for binary

shapes

Binary Morphology• Morphological operators are used to prepare

binary (thresholded) images for object segmentation/recognition– Binary images often suffer from noise (specifically salt-

and-pepper noise)

– Binary regions also suffer from noise (isolated black pixels in a white region). Can also have cracks, picket fence occlusions, etc.

• Dilation and erosion are two binary morphological operations that can assist with these problems.

Goals of morphological operations:

1. Simplifies image data2. Preserves essential shape characteristics3. Eliminates noise4. Permits the underlying shape to be identified

and optimally reconstructed from their distorted, noisy forms

What is the mathematical morphology ?

1. An approach for processing digital image based on its shape

2. A mathematical tool for investigating geometric structure in image

The language of morphology is set theory.

Mathematical morphology is extension to set theory.

Importance of Shape in Processing and Analysis

Shape is a prime carrier of information in machine vision

For instance, the following directly correlate with shape:identification of objectsobject featuresassembly defects

Binary Morphology

Shape Operators Shapes are usually combined by means of :

X X X Xc2 1 1 2\

X2X1

• Set Difference based on Set intersection (occluded objects):

X X1 2X1 X2

• Set Union (overlapping objects):

Set difference

X2X1

Set intersection

Morphological Operations based on Morphological Operations based on combining base operationscombining base operations

The primary morphological operations are dilation and erosion

More complicated morphological operators can be designed by means of combining erosions and dilations

Let us illustrate them and explain how to combine

We will use combinations of union, complement, intersection, erosion, dilation, translation...

Libraries of Structuring Libraries of Structuring ElementsElements

• Application specific structuring elements created by the user

X

B

No necessarily compactnor filled

A special set :the structuring element

-2 -1 0 1 2

-2 -1 0 1 2

Origin at center in this case, but not necessarily centered nor symmetric

NotationNotation

x

y

3*3 structuring element, see next slide how it works

DilationDilation

Dilation : x = (x1,x2) such that if we center B on them, then the so translated B intersects X.

X

B

difference

Explanation of DilationExplanation of Dilation

dilation

Notation for Dilation Notation for Dilation

Dilation : x = (x1,x2) such that if we center B on them, then the so translated B intersects X.

How to formulate this definition ?

1) Literal translation

2) Better : from Minkowski’s sum of sets

Mathematical definition of dilation

Another Mathematical definition of dilation uses the concept of Minkowski’s sum

BB is ingeneral not the same as B

The Concept The Concept of Minkowski Sumof Minkowski Sum

Minkowski’s Sum Minkowski’s Sum

Definition of Minkowski’s sum of sets S and B :

l

l

Minkowski’s Minkowski’s Sum Sum

Another View at Dilation Another View at Dilation

Dilation :

l

Dilation

DilationDilation

Comparison of Dilation and Comparison of Dilation and Minkowski sum Minkowski sum

Dilation :Dilation :

Minkowski sum Minkowski sum

Bx =

x and b are points

It is like dilation but we are not going around , we go only to top and to right

Dilation and Minkowski Set

Dilation and Minkowski Set are denoted by + or by No unified notation

l

Dilation is Dilation is notnot the Minkowski’s sum the Minkowski’s sum

Minkowski’s Minkowski’s Sum Sum

l

l

bbbb l

Dilation is Dilation is notnot the Minkowski’s sum the Minkowski’s sum

DilationDilation

DilationDilation

BB is not the same as B

Dilation with other structuring elementsDilation with other structuring elements

Dilation with other structuring elements

Dilation vs SE • Erosion shrinks• Dilation expands binary regions

• Can be used to fill in gaps or cracks in binary images

• If the point at the origin of the structuring element is set in the underlying image, then all the points that are set in the SE are also set in the image

•Basically, its like OR’ing the SE into the image

structuring Element ( SE )

Dilation fills holes

• Fills in holes.

• Smoothes object boundaries.

• Adds an extra outer ring of pixels onto object boundary, ie, object becomes slightly larger.

Main Applications of Dilation

Dilation example

Possible problems with Morphological Operators

• Erosion and dilation clean image but leave objects either smaller or larger than their original size.

• Opening and closing perform same functions as erosion and dilation but object size remains the same.

More Erode and Dilate Examples

Input Image

Dilated

Eroded

Made in Paint Shop Pro

Dilation explained pixed by pixel

••

••

•••

••

••

••B

A BA

Denotes origin of B i.e. its (0,0)

Denotes origin of A i.e. its (0,0)

Dilation explained by shape of A

••

••

•••

••

••

••B

A BA

Shape of A repeated without shift

Shape of A repeated with shift

Properties of Dilation

• 1. fills in valleys between spiky regions

• 2. increases geometrical area of object

• 3. sets background pixels adjacent to object's contour to object's value

• 4. smoothes small negative grey level regions

Dilation does the following:

objects are light (white in binary)

Image Structuring Element Result

Structuring Element for DilationStructuring Element for Dilation

Length 5Length 6

Image Structuring Element Result

Structuring Element for DilationStructuring Element for Dilation

Image Structuring Element Result

Structuring Element for DilationStructuring Element for Dilation

Single point in Image replaced with this in the Result

Image Structuring Element Result

Structuring Element for DilationStructuring Element for Dilation

Definition of Dilation: Mathematically

Dilation is the operation that combines two sets using vector addition of set elements.

Let A and B are subsets in 2-D space. A: image undergoing analysis, B: Structuring element, denotes dilation

},{ 2 BbAasomeforbacZcBA

Dilation versus translation

Let A be a Subset of and . The translation of A by x is defined as:

The dilation of A by B can be computed as the union of translation of A by the elements of B

2Z2Zx

},{)( 2 AasomeforxacZcA x

Aa

aBb

b BABA

)()(

x is a vector

Dilation versus translation, illustrated

••

••

••

•••

••

••

)0,0(A )1,0(A

BA

•• B

Shift vector (0,0)

Shift vector (0,1)

Element (0,0)

Dilation using Union Formula

xB)(

BA

A

Aa

aBb

b BABA

)()(

Center of the circle

This circle will create one point

This circle will create no point

Example of Dilation with various sizes of structuring

elements

Pablo Picasso, Pass with the Cape, 1960

StructuringElement

Mathematical Properties of Dilation

Commutative

Associative

Extensivity

Dilation is increasing

BAABif ,0

DBDAimpliesBA

ABBA

CBACBA )()( Illustrated in next slide

Illustration of Extensitivity of Dilation

••

••

••

••

B

ABA

••

BAABif ,0

Here 0 does not belong to B and A is not included in A B

Replaced with

More Properties of Dilation

Translation Invariance

Linearity

Containment

Decomposition of structuring element

xx BABA )()(

)()()( CBCACBA

)()()( CBCACBA

)()()( CABACBA

Dilation

1. The dilation operator takes two pieces of data as input

1. A binary image, which is to be dilated

2. A structuring element (or kernel), which determines the behavior of the morphological operation

2. Suppose that X is the set of Euclidean coordinates of the input image, and K is the set of coordinates of the structuring element

3. Let Kx denote the translation of K so that its origin is at x.

4. The DILATION of X by K is simply the set of all points x such that the intersection of Kx with X is non-empty

DilationExample: Suppose that the structuring element is a 3x3 square with the origin at its center

{ (-1,-1), (0,-1), (1,-1), (-1,0), (0,0), (1,0), ( 1,1), (0,1), (1,1) }

111

111

111

X =

K =

Dilation

Example: Suppose that the structuring element is a 3x3 square with the origin at its center

Note: Foreground pixels are represented by a color and background pixels are empty

Dilation

output

Structuring elementInput

Dilation

output

Dilation

output

Dilation

Dilation

ErosionErosion

Erosion : x = (x1,x2) such that if we center B on them, then the so translated B is contained in X.

Example of ErosionExample of Erosion

difference

erosion

Notation for ErosionNotation for Erosion

2) Better : from Minkowski’s substraction of sets

Erosion : x = (x1,x2) such that if we center B on them, then the so translated B is contained in X.

How to formulate this definition ?

1) Literal translation

ErosionErosion

Minkowski’s substraction

BINARY MORPHOLOGY Notation for ErosionNotation for Erosion

ErosionErosion

Minkowski’s substraction of sets

Erosion with other structuring elementsErosion with other structuring elements

Did not belong to X

Erosion with other structuring elements

When the new SE is included in old SE then a larger area is created

Common structuring elements Common structuring elements shapesshapes

= origin

x

y

Note that here :

circledisk

segments 1 pixel wide

points

Problem in BINARY MORPHOLOGY Problem in BINARY MORPHOLOGY using Minkowski Sum using Minkowski Sum

First we calculate the operation in parentheses to obtain a diamond

PROBLEM BINARY MORPHOLOGY

next we calculate the external operation to obtain a hexagon

Problem :

ANOTHER EXAMPLE OF EROSIONANOTHER EXAMPLE OF EROSION

d/2

d

<d/2

Where d is a diameter

Implementation of dilation: Implementation of dilation: very low computational costvery low computational cost

0

1 (or >0)

Logical or

0

1

Implementation of erosion:erosion: very low computational cost

Logical and

More on Erosion

Erosion1. (Minkowski subtraction)

2. The contraction of a binary region (aka, region shrinking)

3. Use a structuring element on binary image data to produce a new binary image

4. Structuring elements (SE) are simply patterns that are matched in the image

5. It is useful to explain operation of erosion and dilation in different ways.

Typical Uses of Erosion

1. Removes isolated noisy pixels.

2. Smoothes object boundary.

3. Removes the outer layer of object pixels, ie, object becomes slightly smaller.

Properties of Erosion:

• Erosion removes spiky edges– objects are light (white in binary)

– decreases geometrical area of object

– sets contour pixels of object to background value

– smoothes small positive grey level regions

Erosion Example

Erosion explained pixel by pixel

••••

••

B

A BA

• •••

Structuring Element in Erosion Example

Image Structuring Element Result

How It Works?

• During erosion, a pixel is turned on at the image pixel under the structuring element origin only when the pixels of the structuring element match the pixels in the image

• Both ON and OFF pixels should match.

• This example erodes regions horizontally from the right.

Image Structuring Element Result

Structuring Element in Erosion Structuring Element in Erosion ExampleExample

Image Structuring Element Result

Structuring Element in Erosion Structuring Element in Erosion ExampleExample

Image Structuring Element Result

Structuring Element in Erosion Structuring Element in Erosion ExampleExample

Image Structuring Element Result

Structuring Element in Erosion Structuring Element in Erosion ExampleExample

Image Structuring Element Result

Structuring Element in Erosion Structuring Element in Erosion ExampleExample

Image Structuring Element Result

Structuring Element in Erosion Structuring Element in Erosion ExampleExample

Mathematical Definition of Erosion

1. Erosion is the morphological dual to dilation.

2. It combines two sets using the vector subtraction of set elements.

3. Let denotes the erosion of A by BBA

){

}..,{2

2

BbeveryforAbxZx

baxtsAaanexistBbeveryforZxBA

Erosion in terms of other operations:

Erosion can also be defined in terms of translation

In terms of intersection

))({ 2 ABZxBA x

Bb

bABA

)(

Observe that vector here is negative

Reminder - this was A

••••

Erosion illustrated in terms of intersection and negative translation

••••

••

BA

• •••

••••)1,0(1A )0,0(A

Observe negative translation

Because of negative shift the origin is here

Erosion formula and intuitive example

xB)(

A

BA

))({ 2 ABZxBA x

Center of B is here and adds a point

Center here will not add a point to the Result

Pablo Picasso, Pass with the Cape, 1960

Structuring

Element

Example of Erosions Example of Erosions with various sizes of with various sizes of structuring elementsstructuring elements

Properties of Erosion

Erosion is not commutative!

Extensivity

Erosion is dereasing

Chain rule

ABBA

ABABif ,0

)...)(...()...( 11 kk BBABBA

CABAimpliesCBBCBAimpliesCA ,

The chain rule is as sharp operator in Cube Calculus used in logic synthesis. There are more similarities of these algebras

Properties of Erosion Translation Invariance

Linearity

Containment

Decomposition of structuring element

)()()( CBCACBA

)()()( CBCACBA

)()()( CABACBA

xxxx BABABABA )(,)(

Duality Relationship between erosion and dilationDuality Relationship between erosion and dilation

Dilation and Erosion transformation bear a marked similarity, in that what one does to image foreground and the other does for the image background.

, the reflection of B, is defined as

Erosion and Dilation Duality Theorem

2ZBB

},{ bxBbsomeforxB

BABA cc )(

Observe negative value which is mirror image reflection of B

Similar but not identical to De Morgan rule in Boolean Algebra

Erosion as Dual of Dilation

• Erosion is the dual of dilation

– i.e. eroding foreground pixels is equivalent to dilating the background pixels.

• Easily visualized on binary image• Template created with known origin

• Template stepped over entire image– similar to correlation

• Dilation– if origin == 1 -> template unioned

– resultant image is large than original

• Erosion– only if whole template matches image

– origin = 1, result is smaller than original

1 *1 1

Duality Relationship between erosion and dilation

Another look at duality

One more view at Erosion with One more view at Erosion with examplesexamples

1. To compute the erosion of a binary input image by the structuring element

2. For each foreground pixel superimpose the structuring element

3. If for every pixel in the structuring element, the corresponding pixel in the image underneath is a foreground pixel, then the input pixel is left as it is

4. Otherwise, if any of the corresponding pixels in the image are background, however, the input pixel is set to background value

Erosion

Erosion example with dilation and negation

We want to calculate this

We dilate with negation

Erosion

.. And we negate the result

We obtain the same thing as from definition

Morphological Operations in terms of more general neighborhoods

This exists in Matlab

Erode and Dilate in terms of more general neighborhoods

Yet another loook at Duality Relationship Yet another loook at Duality Relationship between erosion and dilationbetween erosion and dilation

Edge detection or Binary Contour

Boundary Extraction

Erode and Binary Contour in Matlab

Erosion can be used to find contour

Dilation can be also used for it - think how?

Edge detectionDilate - original This subtraction is set

theoretical

Now you need to invert the image

There are more methods for edge detection

Opening & Closing

1. Opening and Closing are two important operators from mathematical morphology

2. They are both derived from the fundamental operations of erosion and dilation

3. They are normally applied to binary images

Open and CloseClose = Dilate next ErodeOpen = Erode next Dilate

OpenClose

Original image dilated

eroded

dilated

eroded

OPENING OPENING

Opening :

OPENING OPENING

Supresses :• small islands• ithsmus (narrow unions)• narrow caps

difference

also

OPENING OPENING

Opening with other structuring elementsOpening with other structuring elements

Open• An erosion followed by a dilation

• It serves to eliminate noise

• Does not significantly change an object’s size

Comparison of Opening and Erosion

1. Opening is defined as an erosion followed by a dilation using the same structuring element

2. The basic effect of an opening is similar to erosion

3. Tends to remove some of the foreground pixels from the edges of regions of foreground pixels

4. Less destructive than erosion

5. The exact operation is determined by a structuring element.

Opening Example

Original• What combination of

erosion and dilation gives:– cleaned binary image

– object is the same size as in original

Opening Example Cont

• Erode original image.

• Dilate eroded image.

• Smooths object boundaries, eliminates noise (isolated pixels) and maintains object size.

DilateOriginal Erode

One more example of Opening1. Erosion can be used to eliminate small clumps of

undesirable foreground pixels, e.g. “salt noise”

2. However, it affects all regions of foreground pixels indiscriminately

3. Opening gets around this by performing both an erosion and a dilation on the image

CLOSING CLOSING

Closing :

EXAMPLE OF CLOSING EXAMPLE OF CLOSING

Supresses :• small lakes (holes)• channels (narrow separations)• narrow bays

also

BINARY MORPHOLOGY Closing previous image with other Closing previous image with other structuring elementsstructuring elements

With bigger rectangle like this

With smaller cross like this

Application : shape smoothing and noise filteringApplication : shape smoothing and noise filtering

Papilary lines recognition

Application : Application : segmentation of microstructures (Matlab Help)segmentation of microstructures (Matlab Help)

original

negated

threshold

disk radius 6

closing

opening

and withthreshold

PROPERTIES IN BINARY MORPHOLOGY PROPERTIES IN BINARY MORPHOLOGY

Properties

• all of them are increasing :

• opening and closing are idempotent :

• dilation and closing are extensive operations• erosion and opening are anti-extensive operations:

EXTENSIVE VERSUS ANTI-EXTENSIVE EXTENSIVE VERSUS ANTI-EXTENSIVE OPERATIONS OPERATIONS

DUALITIES OF MORPHOLOGICAL OPERATORS DUALITIES OF MORPHOLOGICAL OPERATORS

• duality of erosion-dilation, opening-closing,...

Decomposition of structuring elements Decomposition of structuring elements

operations with big structuring elements can be doneby a succession of operations with small s.e’s

Hit-or-miss :

HIT-OR-MISSHIT-OR-MISS

“Hit” part(white)

“Miss” part(black)

Bi-phase structuring element

Looks for pixel configurations :

HIT or MISS FOR ISOLATED POINTSHIT or MISS FOR ISOLATED POINTS

doesn’t matter

background

foreground

ISOLATED POINTS ISOLATED POINTS

isolated points at4 connectivity

More examples on

Closing

Close • Dilation followed by erosion

• Serves to close up cracks in objects and holes due to pepper noise

• Does not significantly change object size

More examples of Closing

Original• What combination of

erosion and dilation gives:– cleaned binary image

– object is the same size as in original

More examples of Closing cont

• Dilate original image.

• Erode dilated image.

• Smooths object boundaries, eliminates noise (holes) and maintains object size.

ErodeDilateOriginal

Closing as dual to Opening

1. Closing, like its dual operator opening, is derived from the fundamental operations of erosion and dilation.

2. Normally applied to binary images

3. Tends to enlarge the boundaries of foreground regions

4. Less destructive of the original boundary shape

5. The exact operation is determined by a structuring element.

Closing is opening in revers

• Closing is opening performed in reverse.

• It is defined simply as a dilation followed by an erosion using the same

One more example of Closing

Mathematical Definitions of Opening and Closing

Opening and closing are iteratively applied dilation and erosion

Opening

Closing

BBABA )(

BBABA )(

Relation of Opening and Closing

xB

BA

ABBABA )(

}{ ABx

xx

BBA

Difference is only in corners

Opening and Closing are Opening and Closing are idempotentidempotent

Their reapplication has not further effects to the previously transformed result

BBABA )(

BBABA )(

Properties of Opening and Closing Translation invariance

Antiextensivity of opening

Extensivity of closing

Duality

BABA x )( BABA x )(

ABA

BAA

BABA cc )(

Pablo Picasso, Pass with the Cape, 1960

StructuringElement

Example of Openings Example of Openings with various sizes of with various sizes of structuring elementsstructuring elements

Example of Closing

StructuringElement

Example of Closings Example of Closings with various sizes of with various sizes of structuring elementsstructuring elements

Thinning Thinning and Thickeningand Thickening

Thinning :

Thinning and ThickeningThinning and Thickening

Thickenning :

Depending on the structuring elements (actually, seriesof them), very different results can be achieved :

• Prunning• Skeletons• Zone of influence• Convex hull• ...

Prunning at 4 connectivity : remove end points by a sequence of thinnings

Prunning at 4 connectivityPrunning at 4 connectivity

1 iteration =

This point is removed with dark green neighbors

IDEMPOTENCE shown as a result of thinning IDEMPOTENCE shown as a result of thinning

1st iteration

2nd iteration 3rd iteration: idempotence

doesn’t matter

background

foreground

Other thinning operationsOther thinning operations

Contours of binary regions :

USING EROSION TO FIND CONTOURSUSING EROSION TO FIND CONTOURS

difference erosion

Contour found with larger mask

CONTOURS with different connectivity patternsCONTOURS with different connectivity patterns

4-connectivity

8-connectivitycontour

8-connectivity

4-connectivitycontour

Important for perimeter computation.

ii. Convex hull : union of thickenings, each up to idempotence

Use of thickening: Use of thickening: Convex hullConvex hull

Original shaper

Thickening with first mask

Union of four thickenings

Example of using convex hull

iii. Skeleton :iii. Skeleton :

Maximal disk : disk centered at x, Dx, such that Dx X and no other Dy contains it .

Skeleton : union of centers of maximal disks.

PROBLEMS with skeletonsPROBLEMS with skeletons

Problems :

• Instability : infinitessimal variations in the border of X cause large deviations of the skeleton

• not necessarily connex even though X connex

• good approximations provided by thinning with special series of structuring elements

Example of iterative thinning with 8 masks

1stiteration

result of1st iteration

2nd iteration reachesidempotence

Example of iterative thinning with 8 masks

Thinning Thinning with thickeningwith thickening 20 iterations

of thinning color white

40 iterationsThickening color whiteSome sort of

region clustering

BINARY MORPHOLOGY

Application : skeletonization for OCR by graph matching

Skeletonization for OCR Skeletonization for OCR

skeletonization vectorization

Application : skeletonization for OCR by graph matching

skeletonizationskeletonization

and 3 rotations

Hit-or-Miss

Calculation of Geodesic zones of Calculation of Geodesic zones of influence (GZI)influence (GZI)

1. X set of n connex components {Xi}, i=1..n .2. The zone of influence of Xi , Z(Xi) , is the set of points closer

to some point of Xi than to a point of any other component. 3. Also, Voronoi partition.4. Dual to skeleton.

Calculating and using Geodesic Zones of InfluenceCalculating and using Geodesic Zones of Influence

thr erosion7x7

GZI opening5x5

and

thr erosion7x7

dist

Calculating and using Geodesic Zones of Influence (cont)Calculating and using Geodesic Zones of Influence (cont)

Skeleton by Maximal BallsSkeleton by Maximal Balls

Example – Morphological Processing of Example – Morphological Processing of Handwritten DigitsHandwritten Digits

thresholding

opening

thinning

smoothing

PROGRAMMING PROGRAMMING OF MORPHOLOGICAL OPERATIONSOF MORPHOLOGICAL OPERATIONS

USING LISP

USING LISP

USING LISP

USING LISP

USING LISP

Morphological Filtering

Morphological Filtering

Main idea of Morphological Filtering:Examine the geometrical structure of an image by matching it

with small patterns called structuring elements at various locations

By varying the size and shape of the matching patterns, we can extract useful information about the shape of the different parts of the image and their interrelations.

Combine set-theoretical and morphological operations:

Example 1: Morphological filtering

Noisy image will break down OCR systems

Clean original image Noisy image

Morphological filtering (MF)

Restored image

By applying MF, we increase the OCR accuracy!

Rank Filter Median

Input

1 operation

2 operations

Postprocessing

• Opening followed by closing.

• Removes noise and smoothes boundaries.

Postprocessing

• Opening followed by closing.

• Removes noise and smoothes boundaries.

(a) (b)

(c) (d)

Grey Level Grey Level MorphologyMorphology

erosion

dilation

Change of histogram as a result of dilationChange of histogram as a result of dilation

Removal of Border ObjectsRemoval of Border Objects

Marker is the border itself

Summary on Morphological Approaches

Mathematical morphology is an approach for processing digital image based on its shape

The language of morphology is set theory The basic morphological operations are erosion and

dilation Morphological filtering can be developed to extract useful

shape information Methods can be extended to more values and more

dimensions Nice mathematics can be formulated - non-linear

• Segmentation separates an image into regions.

• Use of histograms for brightness based segmentation.– Peak corresponds to object.

– Height of peak corresponds to size of object.

• If global image histogram is multimodal, local image region histogram may be bimodal.

• Local thresholds can give better segmentation.

ConclusionConclusion

• Postprocessing uses morphological operators.

• Same as convolution only use Boolean operators instead of multiply and add.– Erosion clears noise, makes smaller.

– Dilation fills in holes, makes larger.

• Postprocessing– Opening and closing to clean binary images.

– Repeated erosion with special rule produces skeleton.

ConclusionConclusion

Problems 1 - 6• 1. Write LISP or C++ program for dilation of binary

images

• 2. Modify it to do erosions (few types)

• 3. Modify it to perform shift and exor operation and shift and min operation

• 4. Generalize to multi-valued algebra

• 5. Create a comprehensive theory of multi-valued morphological algebra and its algorithms (publishable).

• 6. Write a program for inspection of Printed Circuit Boards using morphological algebra.

Problem 7.• Electric Outlet Extraction has been done Electric Outlet Extraction has been done

using a combination of Canny Edge using a combination of Canny Edge Detection and Hough TransformsDetection and Hough Transforms

• Write a LISP program that will use only basic morphological methods for this application.

Image Processing for electric outlet, how?• Currently there are many, many ways to

approach this problem– Segmentation

– Edge Detection

– DPC compression

– FFT

– IFFT

– DFT

– Thinning

– Growing

– Haar Transform

– Hex Rotate

Alpha filtering

DPC compression

Perimeter

Fractal

Gaussian Filter

Band Pass Filter

Homomorphic Filtering

Contrast

Sharper

Least Square Restoration

Warping

Dilation

Image Processing, how?

• Create morphological equivalents of other image processing methods.

• New, publishable, use outlet problem as example to illustrate

Problem 8. Openings and Closings as examples.

• The solution here is to follow up one operation with the other.

• An opening is defined as an erosion operation followed by dilation using the same structuring element.

• Similarly, a closing is dilation followed by erosion.• Define and implement other combined operations.

Problems 9 - 12.

• 9. Generalize binary morphological algebra from 2 dimensional to 3 dimensional images. What are the applications.

• 10. Write software for 9.

• 11. Generalize your generalized multi-valued morphological algebra to 3 or more dimensions, theoretically, find properties and theorems like those from this lecture.

• 12. Write software for 11.

Problem 13

• Mathematical morphology uses the concept of structuring elements to analyze image features.

• A structuring element is a set of pixels in some arrangement that can extract shape information from an image.

• Typical structuring elements include rectangles, lines, and circles.

• Think about other structuring elements and their applications.

Morphological Operations: Matlab

BWMORPH Perform morphological operations on binary image.

BW2 = BWMORPH(BW1,OPERATION) applies a specific morphological operation to the binary image BW1.

BW2 = BWMORPH(BW1,OPERATION,N) applies the operation N times. N can be Inf, in which case the operation is repeated until the image no longer changes.

OPERATION is a string that can have one of these values:

'close' Perform binary closure (dilation followed by erosion)

'dilate' Perform dilation using the structuring elementones(3)

'erode' Perform erosion using the structuring elementones(3)

'fill' Fill isolated interior pixels (0's surrounded by1's)

'open' Perform binary opening (erosion followed bydilation)

'skel' With N = Inf, remove pixels on the boundariesof objects without allowing objects to break apart

demos/demo9morph/

SourcesD.A. Forsyth, University of New Mexico,Qigong Zheng, Language and Media Processing LabCenter for Automation ResearchUniversity of Maryland College ParkOctober 31, 2000John MillerMatt RoachJ. W. V. Miller and K. D. WhiteheadThe University of Michigan-DearbornSpencer LustorLight Works Inc. C. Rössl, L. Kobbelt, H.-P. Seidel, Max-Planck Institute for, Computer Science, Saarbrücken, Germany LBA-PC4

Howard Schultz

Shreekanth MandayamECE DepartmentRowan University

D.A. Forsyth, University of New Mexico

• Howie Choset

• G.D. Hager,

• Z. Dodds,

• Dinesh Mocha

More recent SourcesMore recent Sources