Image segmentation

22
Image Segmentati on 06/07 /2022 1

description

 

Transcript of Image segmentation

Page 1: Image segmentation

04/10/2

023

Image Segmentation

1

Page 2: Image segmentation

04/10/2

023

INTRODUCTION

Segmentation divides an image into its constituent regions or objects.

Segmentation allows to extract objects in images.

Segmentation Should Stop when the objects of interest in an application has been solved.

EX: Automated inspection of electronic such as missing component or broken path

Image Segmentation algorithm based on property of intensity values :Discontinuity and Similarity

Discontinuity: partition based on abrupt change in intensity

Similarity: Partition of image based on predefined criteria

2

Page 3: Image segmentation

04/10/2

023

3

Applications of image segmentation include

Identifying objects in a scene for object- based measurements such as size and shape

-Identifying objects in a moving scene for object-based video compression (MPEG4)

-Identifying objects which are at different distances from a sensor using depth measurements from a laser range finder enabling path planning for a mobile robots

Page 4: Image segmentation

04/10/2

023

4

Segmentation Based on Grey Scale

-Very simple ‘model’ of grey scale leads to inaccuracies in object labelling

Grey Scale ImageSegmented Image

Page 5: Image segmentation

04/10/2

023

5

-Enables object surfaces with varying patterns of grey to be segmented

Segmentation Based on texture

Page 6: Image segmentation

04/10/2

023

6

-The main difficulty of motion segmentation is that an intermediate step is required to (either implicitly or explicitly) estimate an optical flow field

-The segmentation must be based on this estimate and not, in general, the true flow

Segmentation based on motion

Page 7: Image segmentation

04/10/2

023

7

-This example shows a range image, obtained with a laser range finder -A segmentation based on the range (the object distance from the sensor) is useful in guiding mobile robots

Segmentation based on depth

Original image

Segmented Image

Page 8: Image segmentation

04/10/2

023

8

-TWO VERY SIMPLE IMAGE SEGMENTATION TECHNIQUES THAT ARE BASED ON THE GREYLEVEL HISTOGRAM OF AN IMAGE IS -THRESHOLDING -CLUSTERINGWE CAN CONSIDER THE HISTOGRAMS OF OUR IMAGES

FOR THE NOISE FREE IMAGE, ITS SIMPLY TWO SPIKES AT I=100, I=150

FOR THE LOW NOISE IMAGE, THERE ARE TWO CLEAR PEAKS CENTRED ON I=100, I=150

FOR THE HIGH NOISE IMAGE, THERE IS A SINGLE PEAK –

Grey Level Histogram based Segmentation

0.00

500.00

1000.00

1500.00

2000.00

2500.00

0.00 50.00 100.00 150.00 200.00 250.00

i

h(i)

Noise free

Low noise

High noise

Page 9: Image segmentation

04/10/2

023

9

THERE ARE THREE BASIC TYPES OF GRAY-LEVEL DISCONTINUITIES IN A DIGITAL IMAGE: POINTS, LINES, AND EDGES

THE MOST COMMON WAY TO LOOK FOR DISCONTINUITIES IS TO RUN A MASK THROUGH THE IMAGE.

WE SAY THAT A POINT, LINE, AND EDGE HAS BEEN DETECTED AT THE LOCATION ON WHICH THE MASK IS CENTERED IF R>T

Edge-based segmentation

Page 10: Image segmentation

10

Point Detection

Point detection can be achieved simply using the mask below:

Points are detected at those pixels in the subsequent filtered image that are above a set threshold

Page 11: Image segmentation

11

Line Detection The next level of complexity is to try to detect lines

The masks below will extract lines that are one pixel thick and running in a particular direction

Page 12: Image segmentation

12

EDGE DETECTION

An edge is a set of connected pixels that lie on the boundary between two regions

Page 13: Image segmentation

13

EDGE DETECTION

Edge detection: Gradient operation

x

y

fG xG f

y

f

12 2 2( ) x yf mag f G G

1( , ) tan ( )y

x

Gx y

G

1st derivative tells us where an edge is2nd derivative canbe used to show edge direction

Page 14: Image segmentation

14

REGION-BASED SEGMENTATION

Region growing: Groups pixels or sub-region into larger regions.

step1:Start with a set of “seed” points and from these grow regions by appending to each seed those neighboring pixels that have properties similar to the seed.step2:Region splitting and merging

Advantage Disadvantage

With good connectivity Initial seed-points: different sets of initial seed-

point cause different segmented result

Time-consuming problem

Page 15: Image segmentation

15

THRESHOLDINGThresholding is usually the first step in

any segmentation approach

Single value thresholding can be given mathematically as follows:

Tyxfif

Tyxfifyxg

),( 0

),( 1),(

Tyxfif

Tyxfifyxg

),( 0

),( 1),(

Page 16: Image segmentation

16

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

Original Image Thresholded Image

Page 17: Image segmentation

17

THRESHOLDIf you get the threshold wrong the results can

be disastrous

Threshold Too Low Threshold Too High

Page 18: Image segmentation

18

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

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

04/10/2

023

19

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

Basic Adaptive Thresholding

Page 20: Image segmentation

20

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 21: Image segmentation

21

BASIC ADAPTIVE THRESHOLDING EXAMPLE

These images show the troublesome parts of the previous problem further

subdivided

After this sub division successful thresholding

can be achieved

Page 22: Image segmentation

04/10/2

023

THANKS

22