Segmentation

Similar documents
Segmentation

EECS490: Digital Image Processing. Lecture #22

Ulrik Söderström 16 Feb Image Processing. Segmentation

REGION & EDGE BASED SEGMENTATION

Today INF How did Andy Warhol get his inspiration? Edge linking (very briefly) Segmentation approaches

Topic 4 Image Segmentation

Lecture: Segmentation I FMAN30: Medical Image Analysis. Anders Heyden

Region & edge based Segmentation

Image Analysis Image Segmentation (Basic Methods)

Chapter 10: Image Segmentation. Office room : 841

ECEN 447 Digital Image Processing

Computer Vision. Image Segmentation. 10. Segmentation. Computer Engineering, Sejong University. Dongil Han

ECG782: Multidimensional Digital Signal Processing

Digital Image Processing Lecture 7. Segmentation and labeling of objects. Methods for segmentation. Labeling, 2 different algorithms

C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S. Image Operations II

Digital Image Analysis and Processing

Digital Image Processing. Prof. P.K. Biswas. Department of Electronics & Electrical Communication Engineering

Lecture 9: Hough Transform and Thresholding base Segmentation

Image Segmentation. Schedule. Jesus J Caban 11/2/10. Monday: Today: Image Segmentation Topic : Matting ( P. Bindu ) Assignment #3 distributed

Image segmentation. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

CITS 4402 Computer Vision

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

Practical Image and Video Processing Using MATLAB

Edge linking. Two types of approaches. This process needs to be able to bridge gaps in detected edges due to the reason mentioned above

HOUGH TRANSFORM. Plan for today. Introduction to HT. An image with linear structures. INF 4300 Digital Image Analysis

EECS490: Digital Image Processing. Lecture #21

Idea. Found boundaries between regions (edges) Didn t return the actual region

Region-based Segmentation

Structural Analysis of Aerial Photographs (HB47 Computer Vision: Assignment)

Lecture 6: Edge Detection

VC 10/11 T9 Region-Based Segmentation

Segmentation algorithm for monochrome images generally are based on one of two basic properties of gray level values: discontinuity and similarity.

CS 490: Computer Vision Image Segmentation: Thresholding. Fall 2015 Dr. Michael J. Reale

1. What are the derivative operators useful in image segmentation? Explain their role in segmentation.

Object Segmentation. Jacob D. Furst DePaul CTI

Image Segmentation. Selim Aksoy. Bilkent University

Image Segmentation. Selim Aksoy. Bilkent University

Binary Image Processing. Introduction to Computer Vision CSE 152 Lecture 5

Image Analysis Lecture Segmentation. Idar Dyrdal

(10) Image Segmentation

Bioimage Informatics

Introduction to Medical Imaging (5XSA0) Module 5

EE795: Computer Vision and Intelligent Systems

Processing of binary images

CS4670: Computer Vision Noah Snavely

09/11/2017. Morphological image processing. Morphological image processing. Morphological image processing. Morphological image processing (binary)

Chapter 3: Intensity Transformations and Spatial Filtering

Operators-Based on Second Derivative double derivative Laplacian operator Laplacian Operator Laplacian Of Gaussian (LOG) Operator LOG

COMP_4190 Artificial Intelligence Computer Vision. Computer Vision. Levels of Abstraction. Digital Images

Introduction. Chapter Overview

CS4733 Class Notes, Computer Vision

Biomedical Image Analysis. Point, Edge and Line Detection

Processing and Others. Xiaojun Qi -- REU Site Program in CVMA

EDGE BASED REGION GROWING

Image Segmentation. Shengnan Wang

Histograms. h(r k ) = n k. p(r k )= n k /NM. Histogram: number of times intensity level rk appears in the image

Other Linear Filters CS 211A

6. Object Identification L AK S H M O U. E D U

EE795: Computer Vision and Intelligent Systems

Announcements. Edges. Last Lecture. Gradients: Numerical Derivatives f(x) Edge Detection, Lines. Intro Computer Vision. CSE 152 Lecture 10

Image Segmentation Based on Height Maps

Edge detection. Stefano Ferrari. Università degli Studi di Milano Elaborazione delle immagini (Image processing I)

OBJECT detection in general has many applications

Lecture 7: Most Common Edge Detectors

HOUGH TRANSFORM CS 6350 C V

Chapter 11 Arc Extraction and Segmentation

Dr. Ulas Bagci

Image Processing and Image Analysis VU

Image Segmentation! Thresholding Watershed. Hodzic Ernad Seminar Computa9onal Intelligence

Perception. Autonomous Mobile Robots. Sensors Vision Uncertainties, Line extraction from laser scans. Autonomous Systems Lab. Zürich.

Digital Image Processing

Lecture 8 Object Descriptors

PPKE-ITK. Lecture

Announcements. Binary Image Processing. Binary System Summary. Histogram-based Segmentation. How do we select a Threshold?

Edges and Binary Images

CHAPTER 3 IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN

Chapter 10 Image Segmentation. Yinghua He

Image Segmentation Techniques

Mathematical Morphology and Distance Transforms. Robin Strand

Edge Detection. EE/CSE 576 Linda Shapiro

Image Segmentation. Segmentation is the process of partitioning an image into regions

CSE 152 Lecture 7. Intro Computer Vision

Image Segmentation Based on Watershed and Edge Detection Techniques

IMAGE SEGMENTATION AND FEATURE EXTRACTION

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

Image Processing Fundamentals. Nicolas Vazquez Principal Software Engineer National Instruments

Segmentation I: Edges and Lines

Perception IV: Place Recognition, Line Extraction

Basic Algorithms for Digital Image Analysis: a course

Digital Image Processing. Lecture # 15 Image Segmentation & Texture

Biomedical Image Analysis. Mathematical Morphology

Lecture 6: Segmentation by Point Processing

Urban Road Network Extraction Based on Fuzzy ART, Radon Transform and Morphological Operations on DSM Data


Anno accademico 2006/2007. Davide Migliore

Segmentation of Images

Automated Detection for Baseball Batter Analysis Using Image Processing and Segmentation Methods

Image Segmentation Image Thresholds Edge-detection Edge-detection, the 1 st derivative Edge-detection, the 2 nd derivative Horizontal Edges Vertical

Content-based Image and Video Retrieval. Image Segmentation

BIM472 Image Processing Image Segmentation

Transcription:

Lecture 6: Segmentation 215-13-11 Filip Malmberg Centre for Image Analysis Uppsala University

2 Today What is image segmentation? A smörgåsbord of methods for image segmentation: Thresholding Edge-based segmentation Hough transform Region-based segmentation Watershed Match-based segmentation Chapter 1.1-1.2.5, and 1.3-1.5 in Gonzalez & Woods: Digital Image Processing, 3rd ed., 28

3 What is segmentation? Dividing the image into different regions. Separating objects from background and giving them individual ID numbers (labels).

4 Why segmentation? Accurate segmentation of objects of interest in an image greatly facilitates further analysis of these objects. For example, it allows us to: Count the number of objects of a certain type. Measure geometric properties (e.g., area, perimeter) of objects in the image. Study properties of an individual object (intensity, texture, etc.)...

5 Segmentation Segmentation is often the most difficult problem to solve in image analysis. There is no universal solution!

6 Wikipedia on segmentation - In computer vision, Segmentation is the process of partitioning a digital image into multiple segments - More precisely, image segmentation is the process of assigning a label to every pixel in an image such that pixels with the same label share certain visual characteristics. - Each of the pixels in a region are similar with respect to some characteristic or computed property, such as color, intensity, or texture. Adjacent regions are significantly different with respect to the same characteristic(s). - Since there is no general solution to the image segmentation problem, these [general purpose] techniques often have to be combined with domain knowledge in order to effectively solve an image segmentation problem for a problem domain.

7 Targeted Segmentation Segmentation is an ill-posed problem... What is a correct segmentation of this image?

8 Targeted Segmentation...unless we specify a segmentation target. Segment the orange car from the background Segment all road signs from the background

9 Targeted Segmentation A segmentation can also be defined as a mapping from the set of pixels to some application dependent target set, e.g. {Object, Background} {Humans, Other objects} {1,2,3,4,...} {Healthy tissue, Tumors} To perform accurate segmentation, we (or our algorithms) need to somehow know how to differentiate between different elements of the target set.

1 Segmentation Segmentation algorithms are often based on one of the following two basic properties of intensity values: Similarity Partitioning an image into regions that are similar according to a set of predefines criteria. Discontinuity Detecting boundaries of regions based on local discontinuity in intensity.

11 Four types of segmentation algorithms Thresholding - Similarity Based on pixel intensities (shape of histogram is often used for automation). Edge-based - Discontinuity Detecting edges that separate regions from each other. Region-based - Similarity Grouping similar pixels (with e.g. region growing or merge & split). Watershed segmentation - Discontinuity Find regions corresponding to local minima in intensity. Match-based - Similarity Comparison to a given template.

12 Thresholding

13 Thresholding Which pixels belong to the object? A threshold T, a gray level intensity, classifies every pixel as belonging to objects (foreground) or background. (Or rather, {dark objects, bright objects}).

14 Thesholding Global threshold The same value is used for the whole image. Optimal global threshold Based on the shape of the current image histogram. Searching for valleys, Gaussian distribution etc. Local (or dynamic) threshold The image is divided into non-overlapping sections, which are thresholded one by one.

15 Global thesholding Histogram T 255 We chose a threshold T midway between the two gray value distributions. Here: In the tresholded binary image, pixel values below T belong to the object (black), pixels above T are background (white).

16 How to find a global threshold Example method 1. 2. 3. 4. 5. Choose initial threshold T Define f(x,y) > T as background and f(x,y) < T as foreground Calculate mean for background µbg and foreground µfg Set next threshold Ti = (µbg+µfg)/2 Repeat 2.-4. until stopping criteria, Ti = Ti-1, is fulfilled

17 When does intensity based thresholding work? 255 255

18 Local thresholding Example method Subdivide image into non-overlapping rectangles. These rectangles are chosen small enough so that the illumination of each is approximately uniform. Then determine a global threshold for each subimage.

19 Thresholding in matlab > > > > im = imread('coins.png'); T = graythresh(im); % Gives value in [,1] BW = im>(t*max(im(:))); imagesc(bw) Graythresh uses Otsu's method for finding the threshold. Otsu's method minimizes the intraclass variance.

2 Edge-based segmentation

21 Edge-based segmentation Detection of sharp, local changes in intensity. Step light dark Ramp Line Point

22 Edge-based segmentation General workflow 1. Detect edges, i.e., mark each pixel as edge or not edge. 2. Divide the image into regions, based on the detected edges. (Edge linking, Hough transform)

23 Edge-based segmentation General workflow 1. Detect edges, i.e., mark each pixel as edge or not edge. 2. Divide the image into regions, based on the detected edges. (Edge linking, Hough transform) This part is non-trivial!

24 Edge detection Edge detection typically consists of two steps: 1. Enhance edges Apply an edge/point detector (e.g. Sobel, Laplace) 2. Extract edges Segment edges of interest (e.g. thresholding)

25 Example Task: Find lines in this image, that are 1 pixel thick and have an orientation of -45. Original image (Wire-bond mask of an electric circuit) Filtered 2-1 -1-1 2-1 -1-1 2 Thresholded

26 Hough transform A method for detecting lines (or other parametric objects) in images. Patented by Paul Hough in 1962. The version of the method as it is used today was invented by Richard Duda and Peter Hart in 1972. Richard Duda Peter Hart

27 Hough transform Consider a point (xi,yi) in the plane. Infinitely many lines pass through (xi,yi), all satisfying the equation yi=axi+b for varying a and b. We can rewrite this equation as b=-xia+yi. The set of lines passing through the fixed point (xi,yi) in the xy-plane form a single line in the ab-plane (parameter space). A second point (xj,yj) is also associated with a line in parameter space. This line intersects the line associated with (xi,yi) at a point (a',b') corresponding to the line containing both (xi,yi) and (xj,yj). In fact, all points on this line have lines in parameter space that intersect at (a',b').

28 Hough transform Assume that we are given n points in an image (detected edge points). Each of these points can be considered as evidence for the family of lines passing through that point (a line in parameter space). In principle, the parameter space line corresponding to each point could be plotted, and principal lines in the image could be found by identifying points in parameter space where a large number of lines intersect. A practical problem is that a (the slope of the line) approaches infinity as the line approaches the vertical direction. This can be solved by using the following representation of a line: x cos Θ + y sin Θ = ρ.

29 Hough transform Original image Hough transform (Matlab: hough(image);)

3 Hough transform The Hough transform groups edge points into object candidates. This is performed by an explicit voting procedure over a set of parameterized image objects. What is it good for? Holes (missing pixels) in the desired curves. Noisy edge points (detected by the edge detector) The Hough transform can also be extended to find other parametric objects (curves, ellipses, etc.)

31 Hough transform in MATLAB im = imread('circuit.tif'); BW = edge(im,'canny'); [H,theta,rho] = hough(bw); P = houghpeaks(h,5,'threshold',ceil(.3*max(h(:)))); lines = houghlines(bw,theta,rho,p,'fillgap',5,'minlength',7); figure, imshow(im), hold on xy = [lines(1).point1; lines(1).point2]; plot(xy(:,1),xy(:,2),'linewidth',2,'color','green'); hough computes the hough transform. houghpeaks find maxima in the hough transform H. houghlines find start and end points of line segments.

32 Region-based segmentation

33 Region-based segmentation Region splitting and merging (Top-down approach) 1. 2. 3. 4. 5. 6. Set up criteria for what is a uniform area (e.g. mean, variance, bimodality of histogram, texture, etc.). Start with the full image and split it into four sub-images. Check each sub-image. If it is not uniform, split it again into four subimages. Repeat 3. until no more splitting is performed. Compare sub-images with the neighboring regions and merge, if they are uniform. Repeat 5. until no more merging is performed. The method is also called quad-tree division.

34 Region-based segmentation Region growing (Bottom-up approach) 1. 2. 3. Find starting points. Include neighboring pixels with similar feature (gray level, texture, color, etc.). Continue until all pixels have been associated with one of the starting points. Problems Non trivial to find good starting points, difficult to automate and needs good criteria for similarity.

35 Watershed segmentation

36 Watershed The watershed algorithm was introduced by H. Digabel and Christian Lantuéjoul in 1978 and extended by Serge Beucher in 1982. Serge Beucher

37 Watershed -flooding analogy Think of the gray level image as a landscape. Let water rise from the bottom of each valley (the water from the valley it given its own label). As soon as the water from two valleys meet, build a dam, or a watershed. These watersheds will define the borders between different regions in the image. The watershed algorithm can be used directly on the image, on an edge enhanced image or on a distance transformed image.

38 Watershed -drop of water analogy Think of the gray level image as a landscape. A drop of water landing at any point in the landscape will flow down to a local minimum in the landscape. For any local minimum in the landscape, there is a set of points, called the catchment basin, from which a drop of water will flow to that given minimum. The boundaries between adjacent catchment basins form the watershed.

39 Watershed process

4 Watershed process

41 Watershed process

42 Watershed process

43 Watershed process

44 Watershed process

45 Watershed process

46 Watershed process

47 Watershed process

48 Watershed process

49 Watershed Example of watershed directly applied on gray level image: Original image Inverted image (starting points are in valleys) Segmentation result

5 Watershed Example of watershed directly applied on gray level image: Original image Segmentation result

51 Watershed Example of watershed directly applied on gray level image: Blurred image Segmentation result

52 Distance transform Distance measure 2 1 2 1 1 2 1 2 1 1 1 2 2 1 1 1 1 2 3 2 1 1 1 1 2 2 1 1 2 1 1 1 1 1 1 1 1 1 Distance transform Original image

53 Watershed Example of watershed on distance transformed image: Distance transform DT inverse Intensity landscape DT as intensity Intensity Original image Segmentation result

54 Seeded watershed Oversegmentation Seeds (nuclei) Seeded watershed result Example for seeded watershed: Every cell has a cell nucleus, which can be detected by thresholding and watershed segmentation. Using these nuclei as seeds, the cytoplasms are easy to find.

55 Seeded watershed - demo

56 Computing watersheds Algorithm by F. Meyer (early 9's) 1. A set of markers, pixels where the flooding shall start, are chosen. Each is given a different label. 2. The neighboring 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 extracted from the priority queue. If the neighbors of the extracted pixel that have already been labeled all have the same label, then the pixel is labeled with their label. All non-marked neighbors that are not yet in the priority queue are put into the priority queue. 4. Redo step 3 until the priority queue is empty. The non-labeled pixels are the watershed lines.

57 Match-based segmentation

58 Match-based segmentation Compare a template to the underlying image to find objects with a certain intensity distribution or shape.

59 Match-based segmentation Computational problem: Testing all possible transformation (translation, rotation, scaling) of the template.

6 Simplify segmentation by experimental design When possible: Make sure the illumination is even Avoid shading Have a uniform background (in a different color) Avoid reflection (glittering) Use a standardized position (industry)

61 Simplify segmentation by experimental design

62 Review questions Problems 1.2, 1.27, 1.29, 1.43 in GonzalesWoods.