Chapter 2 Binary Image processing 92 1 Binary

Chapter 2 Binary Image processing 92 ﺑﻬﻤﻦ 1

Binary Image Processing n n Basic thresholding Geometric Properties of binary images n Projection Run-Length coding n Binary algorithms n 2

Morphological operators n n Dilation and Erosion Opening and Closing The Hit or Miss Transform Some basic Morphological algorithms Boundary Detection Region Filling Thinning and Thickening 3

Thresholding 4


An example of Thresholding Original Image 6










Object orientation ﺟﻬﺖ ﻳک ﺷﺌﻲ 16

Object orientation ﺟﻬﺖ ﻳک ﺷﺌﻲ 17




Run length Encoding 21

Run length Encoding (An example) 22

Boundary, Interior and Surround Pixels 25

An algorithm for connected component labeling 26

An algorithm for connected component labeling 27

Size filter for noise removal Note that all objects (connected components) smaller that 10 pixels are removed 28

Size filter for noise removal The effect of selecting bad Threshold, See that the point on top of i is removed 29


Region Boundary 31

A Boundary detection algorithm 1. Find the starting point s εS for the region. You can use a scan from left to right and top to bottom of the image. 2. Let c be the current pixel in boundary tracking. set c = s and let the 4 -neighbor to the west of s be 3. Let the eight 8 -neighbor of c starting at b in clockwise order be n 1 (point b), n 2, …, n 8. Find ni for the first i that is in S. // in above fig: point n 5 // 4. Set c = ni and b = ni-1 => // In above fig: c = n 5 , b = n 4 // 5. Repeat step 3 and 4 until c = s // Until returning to the starting point/ 32


Some more basic definitions (Compactness) : گﺮﺩ گﻮﻧگﻲ 34

Some more basic definitions (Compactness) : گﺮﺩ گﻮﻧگﻲ 35

Some more basic definitions (Compactness) 36

Some more basic definitions (Compactness) 37

Distance Measures 38

Distance Measures 39

Distance Measures Euclidean Distance City Block Chess board 40


The Skeleton of a Region 42

The Skeleton of a Region 43

The Skeleton of a Region 44




Two example of Thinning (Skeleton Extraction) Pixels on Right and bellow Pixels on Left and Top 48


The Thinning Algorithm – Step 1 50

The Thinning Algorithm – Step 2 Pixels on left side P 2 P 8 P 4 P 6 51

How the Thinning algorithm works Repeat Step 1 (Mark pixels on the right and bellow side) Step 2 (Mark pixels on left and up side) Until no more pixel can be marked during either Step 1 or Step 2 52



Expanding and Shrinking Expanding : Change a pixel 0 to 1, if any neighbor of that pixel is 1 Shrinking: Change a pixel 1 to 0, if any neighbor of that pixel is 0 55

Expanding and Shrinking ﺣﻔﺮﻩ ﻫﺎ 56


Expanding and Shrinking b: One time expansion of (a) c: One time shrinking of (b) (a) (b) پﺮ کﺮﺩﻥ ﺣﻔﺮﻩ ﻫﺎ d: One time Shrinking of (c) e: One time expansion of (d ) (c ) ﺣﺬﻑ ﻧﻮﻳﺰ (e) (d) 58
- Slides: 56