COMP 9517 Computer Vision Segmentation 9172020 COMP 9517

  • Slides: 41
Download presentation
COMP 9517 Computer Vision Segmentation 9/17/2020 COMP 9517 S 2, 2018 1

COMP 9517 Computer Vision Segmentation 9/17/2020 COMP 9517 S 2, 2018 1

Introduction • What can you see from this image? 9/17/2020 COMP 9517 S 2,

Introduction • What can you see from this image? 9/17/2020 COMP 9517 S 2, 2018 2

Introduction • Image segmentation – one of the oldest and most widely studied problems

Introduction • Image segmentation – one of the oldest and most widely studied problems in computer vision 9/17/2020 COMP 9517 S 2, 2018 3

Introduction • Image segmentation the partition of an image into a set of regions

Introduction • Image segmentation the partition of an image into a set of regions • • meaningful areas border pixels grouped into structures groups of pixels with shapes foreground and background Background Structures, Shapes Foreground 9/17/2020 COMP 9517 S 2, 2018 4

Introduction • Two objectives of segmentation – decompose the image into parts for further

Introduction • Two objectives of segmentation – decompose the image into parts for further analysis – represent the image using meaningful and/or efficient higher-level units for further analysis Hang Ring 9/17/2020 COMP 9517 S 2, 2018 5

Introduction • Identifying Regions – regions should be uniform and homogeneous with some characteristic

Introduction • Identifying Regions – regions should be uniform and homogeneous with some characteristic – region interiors should be simple and without many small holes – adjacent regions should have significantly different values with respect to the characteristics on which they are uniform – boundaries of each segment should be smooth and spatially accurate 9/17/2020 COMP 9517 S 2, 2018 6

Introduction • Segmentation approaches – region-based – curve-based – early techniques tend to use

Introduction • Segmentation approaches – region-based – curve-based – early techniques tend to use region splitting and/or merging – recent algorithms optimise some global criterion 9/17/2020 COMP 9517 S 2, 2018 7

 • Issues Introduction – there is no single segmentation system working well for

• Issues Introduction – there is no single segmentation system working well for all problems so far – special domain knowledge of the application is typically essential for the implementation of computer vision applications Source: http: //www. isbe. man. ac. uk/~bim/Models/asms. html 9/17/2020 COMP 9517 S 2, 2018 8

Introduction • Results from some popular segmentation techniques a) b) c) d) e) f)

Introduction • Results from some popular segmentation techniques a) b) c) d) e) f) 9/17/2020 Active contours Level sets Graph-based merging Mean shift Normalised cuts Binary MRF COMP 9517 S 2, 2018 9

Region Split and Merge • Overview – recursively splitting the whole image into pieces

Region Split and Merge • Overview – recursively splitting the whole image into pieces based on region statistics – recursively merging pixels and regions together in a hierarchical fashion – combine both splitting and merging together 9/17/2020 COMP 9517 S 2, 2018 10

Region Split and Merge • The simplest possible techniques – use a threshold and

Region Split and Merge • The simplest possible techniques – use a threshold and then compute connected components – rarely sufficient due to lighting and intra-object statistical variations 9/17/2020 COMP 9517 S 2, 2018 11

Split and Merge • Watershed – a technique related to thresholding – operate on

Split and Merge • Watershed – a technique related to thresholding – operate on a grayscale image – segment an image into several catchment basins - regions of an image where rain would flow into the same lake – start flooding the landscape at all of the local minima and to label ridges whenever different evolving components meet – often used as part of an interactive system where the user first marks seed locations that correspond to the centres of different desired components 9/17/2020 COMP 9517 S 2, 2018 12

Split and Merge • Watershed – Meyer’s flooding algorithm 1) Choose a set of

Split and Merge • Watershed – Meyer’s flooding algorithm 1) Choose a set of markers to start the flooding, each is given a different label 2) The neighbouring pixels of each marked area are inserted into a priority queue with a priority level corresponding to the gray level of the pixel 3) The pixel with the highest priority level is popped from the queue. If the neighbours of the popped pixel that have already been labelled all have the same label, the pixel is labelled with the label. All non-labelled neighbours that are not yet in the queue are put into the queue. 4) Repeat step 3 until the queue is empty – The non-labelled pixels are the watershed lines 9/17/2020 COMP 9517 S 2, 2018 13

Split and Merge • Watershed 9/17/2020 COMP 9517 S 2, 2018 14

Split and Merge • Watershed 9/17/2020 COMP 9517 S 2, 2018 14

Split and Merge • Region Splitting – one of the oldest techniques in computer

Split and Merge • Region Splitting – one of the oldest techniques in computer vision – first computers a histogram for the whole image – then finds a threshold that best separates the large peaks in the histogram 9/17/2020 COMP 9517 S 2, 2018 15

Split and Merge • Region Splitting – repeated until regions are either fairly uniform

Split and Merge • Region Splitting – repeated until regions are either fairly uniform or below a certain size – more recent approach often optimise some metric of intra -region similarity and inter-region dissimilarity 9/17/2020 COMP 9517 S 2, 2018 16

Split and Merge • Histogram-based methods – follows a measurement-space clustering process – assumes

Split and Merge • Histogram-based methods – follows a measurement-space clustering process – assumes homogeneous objects in the image appear as the clusters in measurement space (histogram) – The measurement-space clustering can be accomplished by determining the valleys in the histogram and declaring the clusters to be the interval of values between valleys 9/17/2020 COMP 9517 S 2, 2018 17

Split and Merge • Histogram-based methods – segmentation is accomplished by mapping the clusters

Split and Merge • Histogram-based methods – segmentation is accomplished by mapping the clusters back to the image domain – maximum connected components of the cluster labels constitute the segments 9/17/2020 COMP 9517 S 2, 2018 18

Split and Merge • Histogram-based methods – the measurement-space clustering can be accomplished by

Split and Merge • Histogram-based methods – the measurement-space clustering can be accomplished by determining the valleys in the histogram and declaring the clusters to be the interval of values between valleys ? 9/17/2020 COMP 9517 S 2, 2018 ? ? ? 19

Split and Merge • A recursive version of histogram-based clustering • perform histogram mode

Split and Merge • A recursive version of histogram-based clustering • perform histogram mode seeking first on the whole image • and then on each of the regions obtained from the resultant clusters • until regions obtained cannot be decomposed further 9/17/2020 COMP 9517 S 2, 2018 20

Split and Merge • Region Merging – merge regions based on their relative boundary

Split and Merge • Region Merging – merge regions based on their relative boundary lengths and the strength of the visible edges at the boundaries – link clusters together based either on the distance between their closest points, their farthest points or some thing in between – merge adjacent regions whose average colour difference is below a threshold or whose regions are too small – a useful pre-processing stage to make higher-level algorithms faster and more robust 9/17/2020 COMP 9517 S 2, 2018 21

Split and Merge • Graph-based Segmentation – use relative dissimilarities between regions to merge

Split and Merge • Graph-based Segmentation – use relative dissimilarities between regions to merge – start with a pixel-to-pixel dissimilarity measure such as intensity differences between N 8 neighbours NW N – internal difference – difference between regions NE W C E SW S SE – merge any two adjacent regions whose difference is smaller than the minimum internal difference of these two regions 9/17/2020 COMP 9517 S 2, 2018 22

Split and Merge • Graph-based Segmentation 9/17/2020 COMP 9517 S 2, 2018 23

Split and Merge • Graph-based Segmentation 9/17/2020 COMP 9517 S 2, 2018 23

Region Representation • The outputs from segmentation methods need to be represented and stored

Region Representation • The outputs from segmentation methods need to be represented and stored • Methods to represent regions: – Labelled images (the most commonly used) – Overlays – Boundary coding – Quad trees – Property tables 9/17/2020 COMP 9517 S 2, 2018 24

Region Representation • Labelled images – assign each detected region a unique identifier (an

Region Representation • Labelled images – assign each detected region a unique identifier (an integer) 9/17/2020 COMP 9517 S 2, 2018 25

Region Representation • Labelled images – create an image where all the pixels of

Region Representation • Labelled images – create an image where all the pixels of a region will have its unique identifier as their pixel value 9/17/2020 COMP 9517 S 2, 2018 0 0 0 2 2 0 0 1 1 2 3 1 1 1 2 3 3 1 3 2 3 3 3 26

Region Representation • Overlays – overlaying some colour or colours on top of the

Region Representation • Overlays – overlaying some colour or colours on top of the original image 9/17/2020 COMP 9517 S 2, 2018 27

Region Representation • Boundary Coding – represents regions by their boundaries in a data

Region Representation • Boundary Coding – represents regions by their boundaries in a data structure instead of an image • a linear list of the border pixels • chain code • polygon approximation 9/17/2020 COMP 9517 S 2, 2018 28

Region Representation • Boundary Coding – encoding schema – start point – chain code

Region Representation • Boundary Coding – encoding schema – start point – chain code links – chain code representation – polygon approximation 9/17/2020 COMP 9517 S 2, 2018 29

Region Representation • Boundary Coding – encoding schema – start point – chain code

Region Representation • Boundary Coding – encoding schema – start point – chain code links 7 0 1 – chain code representation 6 2 – polygon approximation 5 4 3 8 -N 9/17/2020 0 3 1 2 4 -N COMP 9517 S 2, 2018 30

Region Representation • Boundary Coding – encoding schema – start Point – chain code

Region Representation • Boundary Coding – encoding schema – start Point – chain code links – chain code representation – polygon approximation 9/17/2020 COMP 9517 S 2, 2018 S 31

Region Representation • Boundary Coding – encoding schema – start Point – chain code

Region Representation • Boundary Coding – encoding schema – start Point – chain code links – chain code representation – polygon approximation 7 0 6 5 9/17/2020 S 1 2 4 3 COMP 9517 S 2, 2018 32

Region Representation • Boundary Coding – encoding schema – start Point – chain code

Region Representation • Boundary Coding – encoding schema – start Point – chain code links – chain code representation – polygon approximation S 7 Chain Code: 2223446756701 9/17/2020 COMP 9517 S 2, 2018 0 6 5 1 2 4 3 33

Region Representation • Quadtrees – a quadtree is a tree data structure in which

Region Representation • Quadtrees – a quadtree is a tree data structure in which each internal node has exactly four children – quadtrees are most often used to partition a two dimensional space by recursively subdividing it into four quadrants or regions 9/17/2020 COMP 9517 S 2, 2018 34

Region Representation • Quadtrees – space-saving representation encoding the whole region – each region

Region Representation • Quadtrees – space-saving representation encoding the whole region – each region of interest would be represented by a quadtree structure. 9/17/2020 A B C D I A COMP 9517 S 2, 2018 B C D 35

Region Representation • Quadtrees – encoding Schema – split the image – create the

Region Representation • Quadtrees – encoding Schema – split the image – create the tree 9/17/2020 COMP 9517 S 2, 2018 1 2 3 4 36

Region Representation • Quadtrees – encoding Schema – split the image – create the

Region Representation • Quadtrees – encoding Schema – split the image – create the tree 9/17/2020 COMP 9517 S 2, 2018 37

Region Representation • Quadtrees – encoding Schema – split the image – create the

Region Representation • Quadtrees – encoding Schema – split the image – create the tree I A A B A 9/17/2020 B C B D C A D B A COMP 9517 S 2, 2018 C B D C A D B A C B D C D 38

Region Representation • Quadtrees – each node of a quadtree representing a square region

Region Representation • Quadtrees – each node of a quadtree representing a square region in the image has one of three labels: Full, Empty or Mixed – only mixed nodes have child nodes M M E E E 9/17/2020 M M E F E E M M E F M F F E COMP 9517 S 2, 2018 E F E E M F E E E F E 39

Region Representation • Property Tables – represent a region by its extracted properties rather

Region Representation • Property Tables – represent a region by its extracted properties rather than by its pixels – properties can be the size, shape, intensity, colour or texture of the region 0 2 1 3 9/17/2020 0 2 2 Red 0 0 1 1 2 6 Blue 3 1 1 1 2 2 5 Green 3 3 1 3 2 3 9 Grey 3 3 3 Region Size colour 0 5 1 COMP 9517 S 2, 2018 … 40

References and Acknowledgements • Chapter 3, 5 Szeliski 2010 • Shapiro and Stockman 2001

References and Acknowledgements • Chapter 3, 5 Szeliski 2010 • Shapiro and Stockman 2001 • Some images drawn from Szeliski 2010 and other papers 9/17/2020 COMP 9517 S 2, 2018 41