introduction segmentation plays an important part in computer vision and image processing...

48
Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects. Image segmentation method look for objects that either : 1. have some measure of homogeneity within themselves or 2. have some measure of contrast with their objects on the board.

Upload: leon-cole

Post on 18-Jan-2016

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Introduction

Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects.

Image segmentation method look for objects that either :

1. have some measure of homogeneity within themselves or

2. have some measure of contrast with their objects on the board.

Page 2: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Noise in the image

- typically caused by the camera, the lenses, the lightning or the signal path.

- can be reduced by the use of the preprocessing methods

Spatial digitization

-cause problems regarding connectivity of objects.

-can be resolved with careful connectivity definitions and heuristics.

Image Segmentation Problem

Page 3: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Connectivity Connectivity refers to the way in which we define an objects. For example,

after we have segmented an image, which segments should be connected to form an objects. Or at lower level, when searching image for homogeneous regions, how do we define which pixel are connected.

Pixel has 8 possible neighbors :

i. Two horizontal neighbors

ii. Two vertical neighbors

iii. Four diagonal neighbors

Connectivity can be defined in 3 different ways :

i. Four connectivity

ii. Eight connectivity

iii. Six connectivity

Page 4: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Connectivity cont.Figure A. connectivity

a. Four connectivity b. Eight connectivity

Page 5: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Connectivity cont.

c. Six connectivity NW/SE d. Six connectivity NE/SW

Page 6: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Image segmentation techniques can be divided into 3 main categories which are :

1. region growing and shrinking

2. clustering methods

3. boundary detection

Segmentation Techniques

Page 7: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Region growing and shrinking is performed by finding homogenous regions and changing them until they no longer meet the homogeneity area.

Region Growing and Shrinking

Figure B. Growing & Shrinking

Page 8: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Clustering looks for data that can be grouped in domains other than the spatial domain.

Clustering

Figure C. Clustering

Page 9: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Boundary detection is often achieved using a differentiation operator to find lines or edges, followed by post processing to connect the points into borders

Boundary Detection

Figure D. Boundary Detection

Page 10: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

•  Region growing and shrinking method segment an image into regions by operating principally in the r^c (row, column)-based image space.

• Methods that can combine local and global techniques, such as split and merge, are referred to as state space techniques and use graph structures to represent the regions and their boundaries.

Region Growing and Shrinking

Page 11: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

The split and merge techniques proceeds as follows :

1.    Define a homogeneity test. This involves defining a homogeneity measure, which incorporate brightness, color, texture and determining a criterion the region must meet to pass the homogeneity test.

2. Split the image into equally sized regions.

3. Calculate the homogeneity measure for each region.

4. If the homogeneity test is passed for a region, then try to merge it with the neighbor(s). if the criterion is unfulfilled, the region is split.

5.    Continue the process until all regions pass the homogeneity test.

 

Region Growing and Shrinking cont.

Page 12: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

• Clustering technique threat individual elements placed into groups, that are based on some measure of similarity within the group.

• Difference than previous technique by domain other than the rc-based image space.

• example are color spaces, histogram spaces.

• The simplest method is to divide the space of interest into regions by selecting the center or median along each dimensions and splitting it there.

Clustering Techniques

Page 13: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

• Clustering method is used in SCT/Center and PCT/Median segmentation algorithms

• Another method will include histogram thresholding and other complex statistical method.

• Recursive region splitting is a clustering method that uses a thresholding of histograms technique to segment the image by calculating for a specific set of feature, and then each of this histograms is searched for distinct peaks.The best peak is selected and split into regions based on this thresholding of the histogram.

Clustering Techniques cont.

Page 14: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Splitting algorithm :

1. Consider the entire image as one region and compute histograms for each component of interest.

2. Apply a peak finding test to each histogram. Select the best peak and put threshold on either side of the peak. Segment the image into two regions based on the peak.

3. Smooth the binary thresholded image so that only a single connected sub region is left.

4. Repeats steps 1-3 for each region until no new subregions can be created, that is no histogram have significant peaks.

 

Clustering Techniques cont.

Page 15: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Histogram peak finding :

Number of pixel

Figure E. Histogram peak finding

Region 1

Region 2

Region 2

Clustering Techniques cont.

Two thresholds are selected, one on each side of the best peak. The image is then split into two regions. Region 1 corresponds to those pixel with feature values between the selected thresholds, known as those in the peak. Region 2 consists of those pixels with feature values outside the threshold.

Page 16: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Clustering Techniques cont.

Figure E.1. Histogram Thresholding Segmentation

a. Original image b. Histogram of image (a)

Page 17: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Clustering Techniques cont.

c. Image after histogram thresholding using 4 gray levels

d. Histogram of image (c)

Page 18: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

• Initially developed for the identification of variegated coloring in skin tumor images. Variegated coloring is features for diagnosis of melanoma, deadliest skin cancer.

• SCT decouples the color information from the brightness information. Due brightness effected by lightning condition, 2-dimensional color subspace (2 angles) used with more robust algorithm.

Spherical Coordinate Transform - SCT

Page 19: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

1.  Convert the RGB triple into spherical coordinates (L, angle A, angle B).

2. Find the minima and maxima of angles A and B.

3. Divide the subspace, define by the maxima and minima, into equally seized blocks

4. Calculate the RGB means for the pixel values in each block.

5. Replace the original pixel values with the corresponding RGB means.

 

SCT/Center Segmentation Algorithm

Page 20: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

BLUE

GREEN

RED

Angle A

Angle B

BLUE

GREEN

RED

Angle A

Angle B

SCT/Center Segmentation Algorithm cont.

a. The spherical coordinate transform separate the red, green and blue information into a two-dimensional color space defined by angles A and B, and a one-dimensional brightness space defined by L

b. The color triangle

Figure F. SCT

Page 21: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Angle A

Angle A

RED GREEN

BLUE

Angle B

10 Center is

WHITE in color (255,255,255)

SCT/Center Segmentation Algorithm cont.

c. The color triangle showing regions defined by 10 degree increments on angle A and angle B

++ =

Page 22: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

SCT/Center Segmentation Algorithm cont.

Figure F.1

a. Original image b. SCT/Center segmentation using 4 colors

Page 23: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

1. The algorithm develops based on color compression map (24 bits/pixel color to average 2 bit/pixels color images).

2. PCT principal components transform is base on statistical properties of the image and can be applied to any K-dimensional mathematical space (e.g. 3 dimensional color space).

3. PCT use median split algorithm in image segmentation. It happens when PCT aligns the main axis along the variance path. (See figure below)

Principal Component Transform – PCT

Page 24: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

1. Find the PCT for the RGB image. Transform the RGB data using the PCT

2. Perform the median split algorithm: find the axis that has the maximal range (initially it will be the PCT axis). Divide the data along this axis so that there are equal numbers of points on either side if the split-the median point. Continue until the desired number of color reached.

3. Calculate averages for all the pixels falling within a single parallelepiped (box).

4. Map each pixel to the closest average color values, base on a Euclidean distance measure.

PCT also used in image compression (coding), since this transform

is optimal in the least-square-error sense.

PCT/Median Algorithm

Page 25: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

X

Y

Large range

Y

X

Large range

Y’

X’

a. Original data exhibit a large range

b. PCT aligns the main axis (x’) along the maximum variance path

Principal Components TransformFigure G. PCT

Page 26: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Y’

X’Y’

X’Small range

c. The new axes are rotated d. Transformed data now have a small range. Most of the variance, or information, is along the x’-axis, in one dimension rather than two, as in (a).

Principal Components Transform cont.

Page 27: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Principal Components Transform cont.

Figure G.1

a. Original imageb. PCT/Median segmented with 2 colors

Page 28: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Principal Components Transform cont.

c. PCT/Median segmented with 4 colors

d. PCT/Median segmented with 8 colors

Page 29: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Boundary Detection

-One of the methods of segmentation. Done by defining objects through finding the boundaries between objects

Algorithm

a. Perform edge detection algorithm

• mark the points that are part of an image

•those points are then merged into line segments

•merge the lines to become object boundaries

b. Image thresholding

•Done by considering the histogram of edge detection by finding the best valley

•Merge the existing image segments into boundaries through image linking

Page 30: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Boundary Detection cont.Figure H. Edge detection threshold

Number of pixel

Threshold

Pixel value after edge detection

Page 31: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Boundary Detection cont.

Figure H.1

Image after Sobel edge detection

Page 32: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Morphological Filtering

•The purpose of morphological filtering is to simplify the search for object of interest.

Done by smoothing out object outlines thus filing small holes, eliminating small projections, etc.

•Two kinds of operation discussed here:

a. Dilation

b. Erosion

Page 33: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Dilation

Allows objects to expand, thus potentially filling in small holes and connecting disjoint objects.

The process is performed by laying the structuring element on the image and sliding it across the image in a manner similar to convolution. The difference is in the operation performed.

Algorithm

1. If the origin of the structuring elements coincides with a ‘0’ in the image, there is no change; move to the next pixel.

2. If the origin of the structuring element coincides with a ‘1’ in the image, performed the OR logic operation on all pixel within the structuring element.

Dilation

Page 34: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Figure I. Dilation

Figure A shows a dilation process. Note that with a dilation operation all the ‘1’ pixels in the original image will retained, any boundaries will be expanded, and small holes will be filled.

Dilation cont.

Page 35: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Erosion

• Shrinks objects by etching away (eroding) their boundaries.

• The erosion process is similar to dilation, but we turn pixels to ‘0’ not ‘1’.

Algorithm

1. If the origin of the structuring element coincides with ‘0’ in the image, there is no change; move to the next pixel.

2. If the origin of the structuring element coincides with a ‘1’ in the image, and any of the ‘1’ pixels in the structuring element extended beyond the object (‘1’ pixels) in the image, then change the ‘1’ pixel in the image to a ‘0’.

Erosion

Page 36: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

X

Figure J. Erosion

Figure B shows that the only remaining pixels are those that coincides to the origin of the structuring element where the entire structuring element was contained in the existing object. Because the structuring element is 3 pixels wide, the 2-pixel-wide right leg of the image object eroded away, but the 3-pixel-wide left leg retained some of its center pixels.

Erosion cont.

Page 37: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

• Opening = erosion followed by dilation

• Used to eliminate all pixels in region that are too small to contain the structuring element.

Figure K.1.1 Original image.

Opening and Closing

Page 38: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

X

Figure K.1.2 Structural element; x origin

Figure K.1.3 Image after closing; dilation followed by erosion; original in dashes

Opening and Closing cont.

Page 39: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

• Closing = dilation followed by erosion

• Used to fill in holes and small gaps.

• Different results even though both consist of erosion and dilation. They also can be extended to gray level images in different ways.

Figure K.2.1 Original image

Opening and Closing cont.

Page 40: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

X

Figure K.2.2 Structural element; x origin.

Figure K.2.3 Image after closing; dilation followed by erosion.

Opening and Closing cont.

Page 41: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Opening and Closing cont.

Figure K.3.1 Opening

a. Original imageb. Image (a) after morphological opening using a 5x5 circular structuring element

Page 42: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Opening and Closing cont.

Figure K.3.2 Opening and Closing

b. Image (a) after morphological closing using a 5x5 circular structuring element

Page 43: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Binary Morphological Filtering

• Based on iterative approach (6-connectivity)

• Flexibility

• If pixel 1’s, all surround connectivity threat as 0

• If pixel 0’s do nothing

• Then each pixel underlying each other on top with the high value promoted

Page 44: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Binary Morphological Filtering

00

00

00

10

00

00

11

000

0 0

111

00 11 1

1

00 1

111

1

0

11 1

111

1

1

100

0

11

1

00

0 11

10

00

1

11

100

11

000

0

11 0

0

00 0

011

11

1 2 3 4 5 6

7 8 9 10 11 12

13 14

Figure L. Surrounds for Iterative Morphological Filtering

Page 45: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

The different combination surrounds is define by :

1. The set of surround S, where a = 1.

2. A logic function, L(a,b) ,where b is the current pixel value, specifies the output of the morphological function.

3. The number of iterations n

Binary Morphological Filtering cont.

Page 46: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

• Dilation, erosion, opening and closing can be extended to gray level images in various ways.

• By thresholding the gray level image to create binary image and then apply the existing operators is the easiest way.

• However this method is not suitable for many application because too much information is lost during the thresholding process.

• More information can be retained if we treat the image as a sequence of binary image by operating on each gray level as if it were the 1 value and assuming everything else to be 0.

Binary Morphological Filtering cont.

Page 47: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

a. Rectangular image grid with every other row shifted by one half pixel

b. Hexagonal grid

Binary Morphological Filtering cont.

Figure L.1 Hexagonal Grid

Page 48: Introduction Segmentation plays an important part in computer vision and image processing applications. Its goal is to find regions that represent objects

Author…………………….Author…………………….

Asyrul Naim Ibrahim Asyrul Naim Ibrahim IT 02153IT 02153

Andi Rossi Abd Razak Andi Rossi Abd Razak IT01496IT01496

Azmi Abd Rahman Azmi Abd Rahman IT02240IT02240

Saiful Nizam Samsudin Saiful Nizam Samsudin IT01508IT01508

Triple A and STriple A and S