image segmentation dr. abdul basit siddiqui. contents today we will continue to look at the problem...

27
Image Segmentation Image Segmentation Dr. Abdul Basit Siddiqui

Upload: clinton-patrick

Post on 18-Jan-2016

242 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Image SegmentationImage Segmentation

Dr. Abdul Basit Siddiqui

Page 2: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Contents

• Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

• In particular we will look at:– What is thresholding?– Simple thresholding– Adaptive thresholding

Page 3: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Segmentation

• Divide the image into segments.

• Each segment:– Looks uniform– Belongs to a single object.– Have some uniform attributes.– All the pixel related to it are connected.– …

Page 4: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Detection of Discontinuities

• Point Detection

• Line Detection

• Edge Detection

Page 5: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Detection of DiscontinuitiesDetection of Discontinuities

ni

iii

i

iii zwzw

zwzwzwR

1

9

1

992211

generalor

.....

mask 3x3n with Convolutio

Matrix notation

w = [w1 w2 ... wn] maske

Z = [ z1 z2 … zn] tilhørende billed pixels

R(x,y) = [w] [Z]’

Page 6: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Point detectionPoint detection

TR

T is a non-zero threshold

Page 7: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Segmentation Algorithms

• Segmentation algorithms are based on one of two basic properties of intensity values discontinuity and similarity.

• First category is to partition an image based on abrupt changes in intensity, such as edges in an image.

• Second category are based on partitioning an image into regions that are similar according to a predefined criteria. Thresholding, Histogram Thresholding approach falls under this category.

Page 8: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Thresholding

• Thresholding is usually the first step in any segmentation approach

• We have talked about simple single value thresholding already

• Single value thresholding can be given mathematically as follows:

Tyxfif

Tyxfifyxg

),( 0

),( 1),(

Page 9: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Thresholding

3 5 7 3 4 2 1

2 4 9 10 22 9 3

3 5 12 11 15 10 3

5 6 11 9 17 19 1

2 3 11 12 18 16 2

3 6 8 10 18 9 5

4 6 7 8 3 3 1

Page 10: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Thresholding

3 5 7 3 4 2 1

2 4 9 10 22 9 3

3 5 12 11 15 10 3

5 6 11 9 17 19 1

2 3 11 12 18 16 2

3 6 8 10 18 9 5

4 6 7 8 3 3 1

Page 11: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Thresholding

3 5 7 3 4 2 1

2 4 9 10 22 9 3

3 5 12 11 15 10 3

5 6 11 9 17 19 1

2 3 11 12 18 16 2

3 6 8 10 18 9 5

4 6 7 8 3 3 1

Page 12: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Thresholding

3 5 7 3 4 2 1

2 4 9 10 22 9 3

3 5 12 11 15 10 3

5 6 11 9 17 19 1

2 3 11 12 18 16 2

3 6 8 10 18 9 5

4 6 7 8 3 3 1

Page 13: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding
Page 14: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Thresholding Example

• Imagine a poker playing robot that needs to visually interpret the cards in its hand

Original Image Thresholded Image

Page 15: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

But Be Careful

• If you get the threshold wrong the results can be disastrous

Threshold Too Low Threshold Too High

Page 16: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Basic Global Thresholding

• Based on the histogram of an image

• Partition the image histogram using a single global threshold

• The success of this technique very strongly depends on how well the histogram can be partitioned

Page 17: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Basic Global Thresholding Algorithm

• The basic global threshold, T, is calculated as follows:1. Select an initial estimate for T (typically the average

grey level in the image)

2. Segment the image using T to produce two groups of pixels: G1 consisting of pixels with grey levels >T and G2 consisting pixels with grey levels ≤ T

3. Compute the average grey levels of pixels in G1 to give μ1 and G2 to give μ2

Page 18: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Basic Global Thresholding Algorithm

4. Compute a new threshold value:

5. Repeat steps 2 – 4 until the difference in T in successive iterations is less than a predefined limit T∞

•This algorithm works very well for finding thresholds when the histogram is suitable

221

T

Page 19: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Thresholding Example 1

Page 20: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Thresholding Example 2

Page 21: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Problems With Single Value Thresholding

• Single value thresholding only works for bimodal histograms

• Images with other kinds of histograms need more than a single threshold

Page 22: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Problems With Single Value Thresholding (cont…)

• Let’s say we want to isolate the contents of the bottles

• Think about what the histogram for this image would look like

• What would happen if we used a single threshold value?

Page 23: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Single Value Thresholding and Illumination

• Uneven illumination can really upset a single valued thresholding scheme

Page 24: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Basic Adaptive Thresholding

• An approach to handling situations in which single value thresholding will not work is to divide an image into sub images and threshold these individually

• Since the threshold for each pixel depends on its location within an image this technique is said to adaptive

Page 25: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Basic Adaptive Thresholding Example

• The image below shows an example of using adaptive thresholding with the image shown previously

• As can be seen success is mixed

• But, we can further subdivide the troublesome sub images for more success

Page 26: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Basic Adaptive Thresholding Example (cont…)

• These images show the troublesome parts of the previous problem further subdivided

• After this sub division successful thresholding can be achieved

Page 27: Image Segmentation Dr. Abdul Basit Siddiqui. Contents Today we will continue to look at the problem of segmentation, this time though in terms of thresholding

Segmentation Based on Clustering