Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University

Slides:



Advertisements
Similar presentations
Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University
Advertisements

Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University
Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University
Linear Filtering – Part I Selim Aksoy Department of Computer Engineering Bilkent University
電腦視覺 Computer and Robot Vision I Chapter2: Binary Machine Vision: Thresholding and Segmentation Instructor: Shih-Shinh Huang 1.
Chapter 9: Morphological Image Processing
Each pixel is 0 or 1, background or foreground Image processing to
Morphological Image Processing Md. Rokanujjaman Assistant Professor Dept of Computer Science and Engineering Rajshahi University.
Color Image Processing
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 9 Morphological Image Processing Chapter 9 Morphological.
Common Low-level Operations for Processing & Enhancement
Chapter 9 Morphological Image Processing. Preview Morphology: denotes a branch of biology that deals with the form and structure of animals and planets.
1 Binary Image Analysis Binary image analysis consists of a set of image analysis operations that are used to produce or process binary images, usually.
Binary Image Analysis: Part 2 Readings: Chapter 3: mathematical morphology region properties region adjacency 1.
Computer Vision Basics Image Terminology Binary Operations Filtering Edge Operators.
1. Binary Image B(r,c) 2 0 represents the background 1 represents the foreground
2007Theo Schouten1 Morphology Set theory is the mathematical basis for morphology. Sets in Euclidic space E 2 (or rather Z 2 : the set of pairs of integers)
E.G.M. PetrakisBinary Image Processing1 Binary Image Analysis Segmentation produces homogenous regions –each region has uniform gray-level –each region.
1. Binary Image B(r,c) 2 0 represents the background 1 represents the foreground
Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals.
Chapter 9.  Mathematical morphology: ◦ A useful tool for extracting image components in the representation of region shape.  Boundaries, skeletons,
Chap 3 : Binary Image Analysis. Counting Foreground Objects.
CS 6825: Binary Image Processing – binary blob metrics
CS 376b Introduction to Computer Vision 02 / 22 / 2008 Instructor: Michael Eckmann.
September 23, 2014Computer Vision Lecture 5: Binary Image Processing 1 Binary Images Binary images are grayscale images with only two possible levels of.
Digital Image Processing CCS331 Relationships of Pixel 1.
Morphological Image Processing
1 Binary Image Analysis Binary image analysis consists of a set of image analysis operations that are used to produce or process binary images, usually.
Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram
Chapter 3 cont’d. Binary Image Analysis. Binary image morphology (nonlinear image processing)
Digital Image Processing CSC331 Morphological image processing 1.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014.
Mathematical Morphology Mathematical morphology (matematická morfologie) –A special image analysis discipline based on morphological transformations of.
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 24, 2009.
Digital Image Processing CSC331 Morphological image processing 1.
CS 376b Introduction to Computer Vision 02 / 11 / 2008 Instructor: Michael Eckmann.
CS654: Digital Image Analysis
Mathematical Morphology
Low level Computer Vision 1. Thresholding 2. Convolution 3. Morphological Operations 4. Connected Component Extraction 5. Feature Extraction 1.
CS654: Digital Image Analysis
CS 376b Introduction to Computer Vision 02 / 12 / 2008 Instructor: Michael Eckmann.
1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction.
Morphological Image Processing Robotics. 2/22/2016Introduction to Machine Vision Remember from Lecture 12: GRAY LEVEL THRESHOLDING Objects Set threshold.
BYST Morp-1 DIP - WS2002: Morphology Digital Image Processing Morphological Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department.
Machine Vision ENT 273 Hema C.R. Binary Image Processing Lecture 3.
Course 3 Binary Image Binary Images have only two gray levels: “1” and “0”, i.e., black / white. —— save memory —— fast processing —— many features of.
Lecture(s) 3-4. Morphological Image Processing. 3/13/20162 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of.
Digital Image Processing, Spring ECES 682 Digital Image Processing Week 8 Oleh Tretiak ECE Department Drexel University.
Morphological Image Processing (Chapter 9) CSC 446 Lecturer: Nada ALZaben.
Morphological Image Processing
Digital Image Processing CCS331 Relationships of Pixel 1.
COMP 9517 Computer Vision Binary Image Analysis 4/15/2018
Common Low-level Operations for Processing & Enhancement
Digital Image Processing CP-7008 Lecture # 09 Morphological Image Processing Fall 2011.
Binary Image Analysis Gokberk Cinbis
Computer Vision Lecture 5: Binary Image Processing
Binary Image Analysis: Part 1 Readings: Chapter 3: 3.1, 3.4, 3.8
Binary Image Analysis used in a variety of applications:
Binary Image Analysis: Part 1 Readings: Chapter 3: 3.1, 3.4, 3.8
CS Digital Image Processing Lecture 5
Binary Image processing بهمن 92
Department of Computer Engineering
Morphological Image Processing
Binary Image Analysis: Part 2 Readings: Chapter 3:
Computer and Robot Vision I
Computer and Robot Vision I
CS654: Digital Image Analysis
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Binary Image Analysis used in a variety of applications:
Presentation transcript:

Binary Image Analysis Selim Aksoy Department of Computer Engineering Bilkent University

CS 484, Spring 2010©2010, Selim Aksoy2 Outline Introduction to binary image analysis Mathematical morphology Pixels and neighborhoods Connected components analysis Automatic thresholding

CS 484, Spring 2010©2010, Selim Aksoy3 Binary image analysis Binary image analysis consists of a set of operations that are used to produce or process binary images, usually images of 0’s and 1’s where 0 represents the background, 1 represents the foreground

CS 484, Spring 2010©2010, Selim Aksoy4 Application areas Document analysis Industrial inspection Medical imaging Adapted from Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy5 Operations Separate objects from background and from one another. Aggregate pixels for each object. Compute features for each object.

CS 484, Spring 2010©2010, Selim Aksoy6 Example: red blood cell image Many blood cells are separate objects. Many touch each other  bad! Salt and pepper noise is present. How useful is this data? 63 separate objects are detected. Single cells have area of about 50 pixels. Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2010©2010, Selim Aksoy7 Thresholding Binary images can be obtained from gray level images by thresholding. Assumptions for thresholding: Object region of interest has intensity distribution different from background. Object pixels likely to be identified by intensity alone: intensity > a intensity < b a < intensity < b Works OK with flat-shaded scenes or engineered scenes. Does not work well with natural scenes.

CS 484, Spring 2010©2010, Selim Aksoy8 Use of histograms for thresholding Background is black. Healthy cherry is bright. Bruise is medium dark. Histogram shows two cherry regions (black background has been removed). Adapted from Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy9 Mathematical morphology The word morphology refers to form and structure. In computer vision, it is used to refer to the shape of a region. The language of mathematical morphology is set theory where sets represent objects in an image. We will discuss morphological operations on binary images whose components are sets in the 2D integer space Z 2.

CS 484, Spring 2010©2010, Selim Aksoy10 Mathematical morphology Mathematical morphology consists of two basic operations dilation erosion and several composite relations opening closing conditional dilation …

CS 484, Spring 2010©2010, Selim Aksoy11 Dilation Dilation expands the connected sets of 1s of a binary image. It can be used for growing features filling holes and gaps Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2010©2010, Selim Aksoy12 Erosion Erosion shrinks the connected sets of 1s of a binary image. It can be used for shrinking features removing bridges, branches and small protrusions Adapted from Linda Shapiro, U of Washington

CS 484, Spring 2010©2010, Selim Aksoy13 Basic concepts from set theory

CS 484, Spring 2010©2010, Selim Aksoy14 Basic concepts from set theory Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy15 Structuring elements Structuring elements are small binary images used as shape masks in basic morphological operations. They can be any shape and size that is digitally representable. One pixel of the structuring element is denoted as its origin. Origin is often the central pixel of a symmetric structuring element but may in principle be any chosen pixel.

CS 484, Spring 2010©2010, Selim Aksoy16 Structuring elements Adapted from Gonzales and Woods, and Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy17 Dilation

CS 484, Spring 2010©2010, Selim Aksoy18 Dilation Binary image A Structuring element B Dilation result (1 st definition)

CS 484, Spring 2010©2010, Selim Aksoy19 Dilation Structuring element B Dilation result (2 nd definition) Binary image A

CS 484, Spring 2010©2010, Selim Aksoy20 Dilation Pablo Picasso, Pass with the Cape, 1960 Structuring Element Adapted from John Goutsias, Johns Hopkins Univ.

CS 484, Spring 2010©2010, Selim Aksoy21 Dilation Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy22 Erosion

CS 484, Spring 2010©2010, Selim Aksoy23 Erosion Binary image A Structuring element B Erosion result (1 st definition)

CS 484, Spring 2010©2010, Selim Aksoy24 Erosion Structuring element B Erosion result (2 nd definition) Binary image A

CS 484, Spring 2010©2010, Selim Aksoy25 Erosion Pablo Picasso, Pass with the Cape, 1960 Structuring Element Adapted from John Goutsias, Johns Hopkins Univ.

CS 484, Spring 2010©2010, Selim Aksoy26 Erosion Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy27 Opening

CS 484, Spring 2010©2010, Selim Aksoy28 Opening Structuring element B Opening result Binary image A

CS 484, Spring 2010©2010, Selim Aksoy29 Opening Pablo Picasso, Pass with the Cape, 1960 Structuring Element Adapted from John Goutsias, Johns Hopkins Univ.

CS 484, Spring 2010©2010, Selim Aksoy30 Closing

CS 484, Spring 2010©2010, Selim Aksoy31 Closing Binary image A Structuring element B Closing result

CS 484, Spring 2010©2010, Selim Aksoy32 Examples Original imageEroded onceEroded twice

CS 484, Spring 2010©2010, Selim Aksoy33 Examples Original image Opened twice Closed once

CS 484, Spring 2010©2010, Selim Aksoy34 Examples Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy35 Properties

CS 484, Spring 2010©2010, Selim Aksoy36 Properties

CS 484, Spring 2010©2010, Selim Aksoy37 Boundary extraction

CS 484, Spring 2010©2010, Selim Aksoy38 Boundary extraction Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy39 Conditional dilation

CS 484, Spring 2010©2010, Selim Aksoy40 Region filling

CS 484, Spring 2010©2010, Selim Aksoy41 Region filling Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy42 Region filling Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy43 Hit-or-miss transform

CS 484, Spring 2010©2010, Selim Aksoy44 Hit-or-miss transform Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy45 Thinning

CS 484, Spring 2010©2010, Selim Aksoy46 Thinning

CS 484, Spring 2010©2010, Selim Aksoy47 Thickening

CS 484, Spring 2010©2010, Selim Aksoy48 Thickening Adapted from Gonzales and Woods

CS 484, Spring 2010©2010, Selim Aksoy49 Examples Detecting runways in satellite airport imagery

CS 484, Spring 2010©2010, Selim Aksoy50 Examples Segmenting letters, words and paragraphs

CS 484, Spring 2010©2010, Selim Aksoy51 Examples Extracting the lateral ventricle from an MRI image of the brain

CS 484, Spring 2010©2010, Selim Aksoy52 Examples Detecting defects in a microelectronic circuit

CS 484, Spring 2010©2010, Selim Aksoy53 Examples Decomposing a printed circuit board in its main parts

CS 484, Spring 2010©2010, Selim Aksoy54 Examples Grading potato quality by shape and skin spots

CS 484, Spring 2010©2010, Selim Aksoy55 Examples Classifying two dimensional pieces

Examples CS 484, Spring 2010©2010, Selim Aksoy56 Traffic scene Adapted from CMM/ENSMP/ARMINES Temporal averageAverage of differences Lane detection example

Examples CS 484, Spring 2010©2010, Selim Aksoy57 Threshold and dilation to detect lane markers White line detection (top hat) Detected lanes Lane detection example Adapted from CMM/ENSMP/ARMINES

CS 484, Spring 2010©2010, Selim Aksoy58 Pixels and neighborhoods In many algorithms, not only the value of a particular pixel, but also the values of its neighbors are used when processing that pixel. The two most common definitions for neighbors are the 4-neighbors and the 8-neighbors of a pixel.

CS 484, Spring 2010©2010, Selim Aksoy59 Pixels and neighborhoods

CS 484, Spring 2010©2010, Selim Aksoy60 Pixels and neighborhoods

CS 484, Spring 2010©2010, Selim Aksoy61 Connected components analysis Suppose that B is a binary image and that B[r,c] = B[r’,c’] = v where either v = 0 or v = 1. The pixel [r,c] is connected to the pixel [r’,c’] with respect to value v if a sequence of pixels forms a connected path from [r,c] to [r’,c’] in which all pixels have the same value v, and each pixel in the sequence is a neighbor of the previous pixel in the sequence. A connected component of value v is a set of pixels, each having value v, and such that every pair of pixels in the set are connected with respect to v.

CS 484, Spring 2010©2010, Selim Aksoy62 Connected components analysis Once you have a binary image, you can identify and then analyze each connected set of pixels. The connected components operation takes in a binary image and produces a labeled image in which each pixel has the integer label of either the background (0) or a component. Binary image after morphologyConnected components

CS 484, Spring 2010©2010, Selim Aksoy63 Connected components analysis Methods for connected components analysis: Recursive tracking (almost never used) Parallel growing (needs parallel hardware) Row-by-row (most common) Classical algorithm Run-length algorithm (see Shapiro-Stockman) Adapted from Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy64 Connected components analysis Recursive labeling algorithm: 1. Negate the binary image so that all 1s become -1s. 2. Find a pixel whose value is -1, assign it a new label, call procedure search to find its neighbors that have values -1, and recursively repeat the process for these neighbors.

CS 484, Spring 2010©2010, Selim Aksoy65 Adapted from Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy66 Connected components analysis Row-by-row labeling algorithm: 1. The first pass propagates a pixel’s label to its neighbors to the right and below it. (Whenever two different labels can propagate to the same pixel, these labels are recorded as an equivalence class.) 2. The second pass performs a translation, assigning to each pixel the label of its equivalence class. A union-find data structure is used for efficient construction and manipulation of equivalence classes represented by tree structures.

CS 484, Spring 2010©2010, Selim Aksoy67 Connected components analysis Adapted from Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy68 Connected components analysis Adapted from Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy69 Connected components analysis Adapted from Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy70

Connected components analysis CS 484, Spring 2010©2010, Selim Aksoy71

Connected components analysis CS 484, Spring 2010©2010, Selim Aksoy72

CS 484, Spring 2010©2010, Selim Aksoy73 Automatic thresholding How can we use a histogram to separate an image into 2 (or several) different regions? Is there a single clear threshold? 2? 3? Adapted from Shapiro and Stockman

CS 484, Spring 2010©2010, Selim Aksoy74 Automatic thresholding: Otsu’s method Assumption: the histogram is bimodal. Method: find the threshold t that minimizes the weighted sum of within-group variances for the two groups that result from separating the gray levels at value t. The best threshold t can be determined by a simple sequential search through all possible values of t. If the gray levels are strongly dependent on the location within the image, local or dynamic thresholds can also be used. t Group 1 Group 2

CS 484, Spring 2010©2010, Selim Aksoy75 Automatic thresholding A Pap smear image example: RGB image (left), grayscale image (center), histogram of the grayscale image.

CS 484, Spring 2010©2010, Selim Aksoy76 Automatic thresholding Grayscale image (top-left), closing with a very large structuring element (top-right), illumination corrected image using the black top-hat transform (bottom-left). The black top-hat transform is defined as the difference between the closing and the input image.

CS 484, Spring 2010©2010, Selim Aksoy77 Automatic thresholding Histogram of the illumination corrected image (top-left), sum of within-group variances versus the threshold (bottom-left), resulting mask overlayed as red on the original image (top).