Lecture 06 Binary Image Analysis Lecture 06 Binary Image Analysis Mata kuliah: T0283 - Computer Vision Tahun: 2010.

Slides:



Advertisements
Similar presentations
電腦視覺 Computer and Robot Vision I
Advertisements

Document Image Processing
Lecture 07 Segmentation Lecture 07 Segmentation Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing Lecture 12: Image Topology
Each pixel is 0 or 1, background or foreground Image processing to
September 10, 2013Computer Vision Lecture 3: Binary Image Processing 1Thresholding Here, the right image is created from the left image by thresholding,
Image Indexing and Retrieval using Moment Invariants Imran Ahmad School of Computer Science University of Windsor – Canada.
IS THERE A MORE COMPUTATIONALLY EFFICIENT TECHNIQUE FOR SEGMENTING THE OBJECTS IN THE IMAGE? Contour tracking/border following identify the pixels that.
COMP322/S2000/L201 Recognition: Object Descriptor Example: A binary image, object is indicated by one’s Run Length.
COMP322/S2000/L181 Pre-processing: Smooth a Binary Image After binarization of a grey level image, the resulting binary image may have zero’s (white) and.
Objective of Computer Vision
Objective of Computer Vision
Computer Vision Basics Image Terminology Binary Operations Filtering Edge Operators.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
EE465: Introduction to Digital Image Processing 1 What is in Common?
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.
Lecture 11 Stereo Reconstruction I Lecture 11 Stereo Reconstruction I Mata kuliah: T Computer Vision Tahun: 2010.
Digital Image Processing
Digital Image Processing
Machine Vision for Robots
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
OBJECT RECOGNITION. The next step in Robot Vision is the Object Recognition. This problem is accomplished using the extracted feature information. The.
EE465: Introduction to Digital Image Processing
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.
Lecture 03 Area Based Image Processing Lecture 03 Area Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Introduction Image geometry studies rotation, translation, scaling, distortion, etc. Image topology studies, e.g., (i) the number of occurrences.
Data Extraction using Image Similarity CIS 601 Image Processing Ajay Kumar Yadav.
Lecture 08 Detecting Shape Using Hough Transform Lecture 08 Detecting Shape Using Hough Transform Mata kuliah: T Computer Vision Tahun: 2010.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Digital Image Processing In The Name Of God Digital Image Processing Lecture2: Digital Image Fundamental M. Ghelich Oghli By: M. Ghelich Oghli
1 Euler Number Computation By Kishore Kulkarni (Under the Guidance of Dr. Longin Jan Latecki)
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 24, 2009.
CS654: Digital Image Analysis Lecture 5: Pixels Relationships.
Digital Image Processing Lecture 12: Image Topology (Suppl)
Low level Computer Vision 1. Thresholding 2. Convolution 3. Morphological Operations 4. Connected Component Extraction 5. Feature Extraction 1.
Digital Topology CIS 601 Fall 2004 Longin Jan Latecki.
    LICENSE PLATE EXTRACTION AND CHARACTER SEGMENTATION   By HINA KOCHHAR NITI GOEL Supervisor Dr. Rajeev Srivastava        
Nottingham Image Analysis School, 23 – 25 June NITS Image Segmentation Guoping Qiu School of Computer Science, University of Nottingham
CSSE463: Image Recognition Day 9 Lab 3 (edges) due Weds, 3:25 pm Lab 3 (edges) due Weds, 3:25 pm Take home quiz due Friday, 4:00 pm. Take home quiz due.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
Lecture 02 Point Based Image Processing Lecture 02 Point Based Image Processing Mata kuliah: T Computer Vision Tahun: 2010.
Machine Vision ENT 273 Hema C.R. Binary Image Processing Lecture 3.
Digital Image Processing, 3rd ed. © 1992–2008 R. C. Gonzalez & R. E. Woods Gonzalez & Woods Chapter 11 Representation and.
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.
Relationship between pixels Neighbors of a pixel – 4-neighbors (N,S,W,E pixels) == N 4 (p). A pixel p at coordinates (x,y) has four horizontal and vertical.
Digital Image Processing CCS331 Relationships of Pixel 1.
Sheng-Fang Huang Chapter 11 part I.  After the image is segmented into regions, how to represent and describe these regions? ◦ In terms of its external.
October 3, 2013Computer Vision Lecture 10: Contour Fitting 1 Edge Relaxation Typically, this technique works on crack edges: pixelpixelpixel pixelpixelpixelebg.
Image Sampling and Quantization
Course : T Computer Vision
CSSE463: Image Recognition Day 9
Image Representation and Description – Representation Schemes
图像处理技术讲座(3) Digital Image Processing (3) Basic Image Operations
CSE 554 Lecture 1: Binary Pictures
Computer and Robot Vision I
Mean Shift Segmentation
Computer Vision Lecture 5: Binary Image Processing
Morphological Operations
Binary Image processing بهمن 92
Computer and Robot Vision I
CSSE463: Image Recognition Day 9
CSSE463: Image Recognition Day 9
Disjoint Sets DS.S.1 Chapter 8 Overview Dynamic Equivalence Classes
Midterm Exam Closed book, notes, computer Similar to test 1 in format:
Computer and Robot Vision I
Computer and Robot Vision I
Presentation transcript:

Lecture 06 Binary Image Analysis Lecture 06 Binary Image Analysis Mata kuliah: T Computer Vision Tahun: 2010

January 20, 2010T Computer Vision3 Learning Objectives After carefullylistening this lecture, students will be able to do the following : After carefully listening this lecture, students will be able to do the following : show how connected component labeling is performed and its uses in shape classifier show how connected component labeling is performed and its uses in shape classifier demonstrate object area and perimeter calculation based on binary images demonstrate object area and perimeter calculation based on binary images

January 20, 2010T Computer Vision4 From Processing to Analysis Holistic perspective in binary image analysis PHIL High-level vision Low-level vision Localized perspective in binary image processing

January 20, 2010T Computer Vision5 Connectivity X Y X’ Y’ X and Y are connected X’ and Y’ are NOT connected a and b are connected if there exists a path from a to b Notation: if a and b are connected, we write a ~ b

January 20, 2010T Computer Vision6 Connected Components in Digital Images A set S of pixels is a CC if there is at least one path that joins every pair {p,q} of pixels in S, and contains exclusively of pixels in S. Two types of connectivity: 4 - (edge) connectivity and 8- (vertex) connectivity

January 20, 2010T Computer Vision7 Connected Component Two pixels are c-adjacent (c=4 or 8) if they share at least an edge (c=4), or a vertex (c=8). Two pixels are c-connected (c=4 or 8) if it is possible to find a path between these two pixels through pairs of c-adjacent (c=4,8) pixels. A c-connected component is a maximal connected set where each pixel is c-connected to other pixels in the set.

January 20, 2010T Computer Vision8 Example p q p ~ q no matter 4-neighbors or 8-neighbors p q p ~ q only when 8-neighbors is considered

January 20, 2010T Computer Vision9 Component Labeling If 4-neighbors, three connected components If 8-neighbors, two connected components original binary image

January 20, 2010T Computer Vision10 Connected Component Labeling

January 20, 2010T Computer Vision11 MATLAB Function BWLABEL >help bwlabel BWLABEL Label connected components in binary image. L = BWLABEL(BW,N) returns a matrix L, of the same size as BW, containing labels for the connected components in BW. N can have a value of either 4 or 8, where 4 specifies 4-connected objects and 8 specifies 8-connected objects; if the argument is omitted, it defaults to 8. The elements of L are integer values greater than or equal to 0. The pixels labeled 0 are the background. The pixels labeled 1 make up one object, the pixels labeled 2 make up a second object, and so on. [L,NUM] = BWLABEL(BW,N) returns in NUM the number of connected objects found in BW. See also bwareaopen, bweuler, bwlabeln, bwselect, label2rgb.

January 20, 2010T Computer Vision12 Euler Number Euler Number EN=number of connected components – number of holes EN=-3 EN=0 EN=-1

January 20, 2010T Computer Vision13 CC Algorithm Process the image row by row Assign a label to the first pixel of each CC Otherwise assign its label by propagating from left or top Clash! (equivalence) ?

January 20, 2010T Computer Vision14 One approach Propagate the smaller label in case of clash Record the equivalence in a table After the entire image is processed, find the set of equivalence classes Second pass replaces each label with its equivalent class Two passes!

January 20, 2010T Computer Vision15 Boundary of Binary Objects XX X  X=X-(X B) _  X=(X B) – B + or

January 20, 2010T Computer Vision16 Chain Codes Boundary Representation 4-directional chain code: directional chain code:

January 20, 2010T Computer Vision17 Two Problems with the Chain Code Chain code representation is conceptually appealing, yet has the following two problems Dependent on the starting point Dependent on the orientation To use boundary representation in object recognition, we need to achieve invariance to starting point and orientation Normalized codes Differential codes

January 20, 2010T Computer Vision18 Normalization Strategy Sort rows First row gives the normalized chain code

January 20, 2010T Computer Vision19 Differential Strategy Differential coding: d k =c k -c k-1 (mod 4) for 4-directional chain codes d k =c k -c k-1 (mod 8) for 8-directional chain codes normalize 90 o

January 20, 2010T Computer Vision20 Shape Numbers= Normalized Differential Chain Codes Differential code: d k =c k -c k-1 (mod 4) differentiate normalize differentiate normalize Note that the shape numbers of two objects related by 90 o rotation are indeed identical

January 20, 2010T Computer Vision21 Examples : Chain Encoding x y Encoding start point 1 unit pixel  2 unit pixel

January 20, 2010T Computer Vision22 PDirection Start Perimeter P = S E + V2 S O units = V2 = units Perimeter Calculation

January 20, 2010T Computer Vision23 Y Direction 0 Additive comp. = 1 x y Y Direction 5 Subtractive comp = (1 x y) – 0.5 Y Direction 1 Subtrac. comp. = (1 x y) Direction 2 dan 6 Zero component (neutral) Area Calculation Y

January 20, 2010T Computer Vision24 P Start AdditiveSubtractive y-coordinate Area = – – 2 – 2 – 2 – 2 – 2.5 – = 29 square units Area Calculation (cont’d)

January 20, 2010T Computer Vision25 MATLAB Implementation

January 20, 2010T Computer Vision26 Segmen citra biner # # #0#0 00####00 00###0# ## Run Length Encoding (RLE) 10(0), 3(1), 1(0), 1(1), 3(0), 4(1), 4(0), 3(1), 1(0), 1(1), 6(0), 2(1), 9(0)

January 20, 2010T Computer Vision27 Segmen citra biner # # #0#0 00####00 00###0# ## Chord Encoding 1 (2,4) (6,6); 2 (2,5); 3 (2,4) (6,6); 4 (5,6). baris kolom

January 20, 2010T Computer Vision28 Matlab Implementation on Shapes Classifier Step 1: Read image Step 2: Convert image from rgb to gray Step 3: Threshold the image Step 4: Invert the Binary Image Step 5: Find the boundaries Concentrate Step 6: Determine Shapes properties Step 7: Classify Shapes according to

January 20, 2010T Computer Vision29 Step 1: Read image RGB = imread('test.bmp'); figure, imshow(RGB), title('INPUT IMAGE');

January 20, 2010T Computer Vision30 Step 2: Convert image from rgb to gray GRAY = rgb2gray(RGB); figure,imshow(GRAY),title('GRAY IMAGE');

January 20, 2010T Computer Vision31 Step 3: Threshold the image. threshold = graythresh(GRAY); BW = im2bw(GRAY, threshold); figure, imshow(BW), title('BINARY IMAGE');

January 20, 2010T Computer Vision32 Step 4: Invert the Binary Image BW = ~ BW; figure,imshow(BW),title('INVERTED BINARY IMAGE');

January 20, 2010T Computer Vision33 Step 5: Find the boundaries Concentrate only on the exterior boundaries. Option 'noholes' will accelerate the processing by preventing bwboundaries from searching for inner contours. [B,L] = bwboundaries(BW, 'noholes'); %[L, N] = bwlabel(BW,8); Step 6: Determine objects properties STATS = regionprops(L, 'all'); % we need 'BoundingBox' and 'Extent'

January 20, 2010T Computer Vision34 Step 7: Classify Shapes according to properties % Square = 3 = (1 + 2) = (X=Y + Extent = 1) % Rectangular = 2 = (0 + 2) = (only Extent = 1) % Circle = 1 = (1 + 0) = (X=Y, Extent < 1) % UNKNOWN = 0 for i = 1 : length(STATS) W(i) = uint8(abs(STATS(i).BoundingBox(3) - STATS(i).BoundingBox(4)) < 0.1); W(i) = W(i) + 2 * uint8((STATS(i).Extent - 1) == 0 ); centroid = STATS(i).Centroid; switch W(i) case 1 plot(centroid(1),centroid(2),'wO'); case 2 plot(centroid(1),centroid(2),'wX'); case 3 plot(centroid(1),centroid(2),'wS'); end

January 20, 2010T Computer Vision35 Step 7: Classify Shapes according to properties (cont’d) figure, imshow(RGB), title('HASIL IDENTIFIKASI SQUARE, CIRCLE & RECTANGLE'); hold on