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.

Slides:



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

E.G.M. PetrakisImage Segmentation1 Segmentation is the process of partitioning an image into regions –region: group of connected pixels with similar properties.
Document Image Processing
Image Segmentation Image segmentation (segmentace obrazu) –division or separation of the image into segments (connected regions) of similar properties.
Chapter 9: Morphological Image Processing
Some Basic Morphological Algorithm
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,
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Thinning Algorithms Thick images Thin images Color images
Segmentation Divide the image into segments. Each segment:
Objective of Computer Vision
Objective of Computer Vision
E.G.M. PetrakisBinary Image Processing1 Binary Image Analysis Segmentation produces homogenous regions –each region has uniform gray-level –each region.
Digital Image Processing
Digital Image Processing
Machine Vision for Robots
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 11 Representation & Description Chapter 11 Representation.
Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals.
Recap CSC508.
Chapter 9.  Mathematical morphology: ◦ A useful tool for extracting image components in the representation of region shape.  Boundaries, skeletons,
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
Introduction Image geometry studies rotation, translation, scaling, distortion, etc. Image topology studies, e.g., (i) the number of occurrences.
Digital Image Fundamentals Faculty of Science Silpakorn University.
Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.
CS654: Digital Image Analysis Lecture 5: Pixels Relationships.
Course 8 Contours. Def: edge list ---- ordered set of edge point or fragments. Def: contour ---- an edge list or expression that is used to represent.
Low level Computer Vision 1. Thresholding 2. Convolution 3. Morphological Operations 4. Connected Component Extraction 5. Feature Extraction 1.
Course14 Dynamic Vision. Biological vision can cope with changing world Moving and changing objects Change illumination Change View-point.
October 1, 2013Computer Vision Lecture 9: From Edges to Contours 1 Canny Edge Detector However, usually there will still be noise in the array E[i, j],
Nottingham Image Analysis School, 23 – 25 June NITS Image Segmentation Guoping Qiu School of Computer Science, University of Nottingham
1 Overview representing region in 2 ways in terms of its external characteristics (its boundary)  focus on shape characteristics in terms of its internal.
Morphological Image Processing Robotics. 2/22/2016Introduction to Machine Vision Remember from Lecture 12: GRAY LEVEL THRESHOLDING Objects Set threshold.
Some Basic Relationships Between Pixels Definitions: –f(x,y): digital image –Pixels: q, p –Subset of pixels of f(x,y): S.
Course 5 Edge Detection. Image Features: local, meaningful, detectable parts of an image. edge corner texture … Edges: Edges points, or simply edges,
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.
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.
Lecture(s) 3-4. Morphological Image Processing. 3/13/20162 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of.
Chapter 6 Skeleton & Morphological Operation. Image Processing for Pattern Recognition Feature Extraction Acquisition Preprocessing Classification Post.
Morphological Image Processing (Chapter 9) CSC 446 Lecturer: Nada ALZaben.
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.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
Image Sampling and Quantization
Image Representation and Description – Representation Schemes
图像处理技术讲座(3) Digital Image Processing (3) Basic Image Operations
IT472: Digital Image Processing
Mean Shift Segmentation
Computer Vision Lecture 12: Image Segmentation II
Computer Vision Lecture 5: Binary Image Processing
Fitting Curve Models to Edges
Computer Vision Lecture 9: Edge Detection II
CS Digital Image Processing Lecture 5
Binary Image processing بهمن 92
Computer and Robot Vision I
Computer and Robot Vision I
Computer and Robot Vision I
Department of Computer Engineering
Digital Image Processing
Computer and Robot Vision I
Computer and Robot Vision I
Computer and Robot Vision I
Presentation transcript:

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 an intensity image appear in binary form, e.g. edge, contour, … —— human can understand binary line drawings.

1. Neighbors/path/connectivity (1) Neighbors of a pixel a. 4-neighbors: the upper, lower, left and right neighbor pixels of a pixel. b. 8-neighbors: the 4-neighbors pixels plus the diagonal neighbors. 4-neighbor 8-neighbor [i-1,j] [i,j-1][i,j][i,j+1] [i+1,j] [i-1,j-1][i-1,j][i-1,j+1] [i,j-1][i,j][i,j+1] [i+1,j-1][i-1,j][i+1,j+1]

(2) Path A path form pixel to the pixel is a sequence of pixel indices: where the pixel is a neighbor of pixel for all. ——4 pathif 4-neighbor is used ——8 pathif 8-neighbor is used

(3) Connectivity: A pixel is said to be connected to if there is a path from to consisting of pixels of. Connected component: A set of pixels in which each pixel is connected to all other pixels of the set.                 4-connected 8-connected

2. Geometric attributes of a binary image/component: (1) size (area): for all B[.,.] = 1 pixels. (2) position: the position of a binary image component is defined by its mass center.

(3)Orientation: The orientation of binary image component is defined by a straight line that the distance sum from all the pixels to the line is minimized,i.e., where is the distance from pixel [ i, j ]to the line. Let the line in polar coordinates be: Then: So:

Set, and We get: where is the center of the component, and where

Note: may minimize or maximize. The has two values; the corresponding lines are called maximum axis and minimum axis of the image component. Maximum axis Minimum axis

(4) Foreground / Background : Foreground: the set f all “1” pixels in an image. Background: the set of all connected components of that have points on the border of the image. Hole: the connected component in but it does not have border points. Note: foreground and background must use different connectivities. Hole or not?

(1) Boundary: boundary of S is a set of pixels in S that has 4-neighbours in, denoted by. (2) Interior (pixels in S but not in ) Surrounds: if any 4-path from any point of S to image border must intersect region T, we say region T surrounds region S.

(7) Perimeter Def.1: The total length of lines that separate pixels of S from. Def.2: The number of boundary pixels. (8) Compactness Where P— perimeter, A— area. The smallest value of c is. If c =, S is a circular region. When c is larger, S is elongated when, S is a line segment.

3. Binary Processing: (1) Thresholding: Thresholding converts an intensity image into a binary image, partitioning the original image to regions. Let image has gray level ranged in [0,L], T be threshold, 0<T<L Then, If you are interested in image information of certain range of gray level, you can choose double thresholds

Then, Original image Image by threshold double threshold (L=64) T=48 T 1 = 2, T 2 = 48

(2) Run-length encode: —— Run-length code is a compact way to represent a binary image. —— Run-length encoding is a row-based operation. Method 1: only encode “1” pixels. Using start position and length of runs of “1” to represent the runs. Method 2: encode “1” runs and “0” runs alternatively. Using only one number to indicate the length of the run. If an image row starts with a “0” run, put a “0” as the header of the code of the row, otherwise the header will not appear.

Method1: (1,3), (7,2), (12,4), (17,2), (20,3) (5,13), (19,4) (1,3), (17,6) Method 2: 3, 3, 2, 3, 4, 1, 2, 1, 3; 0, 4,13,1, 4; 3, 13, 6

(3) Boundary-following: Track boundary pixels of a region in a particular order (chain sequence)

Algorithm: a) Use systematic scan (from left to right, and from top to bottom) to find the first pixels as a starting pixel. b) Set c=s, and b=left neighbor of c,. c) From pixel b, in clockwise order check the 8-neighbors of c, ; find the first such that. d) Set e) Repeat step c) and d) until c=s.

(4) Projections Projecting a binary image onto a line (usually horizontally or vertically) may provide partition information of the image. It is often used in OCR for character separation. Horizontal projection: Vertical projection: For a well alined text binary image, the projection has comb shape, image can be easily partitioned.

(5) Clustering Clustering, or component labeling, is a common operation in computer vision to find connected components. Each connected component may represent an object or a part of an object.

Algorithm (Sequential) a) Scan the image from left to right, top to bottom. b) If find a pixel of value “1”, then check its left, upper-left, upper and upper-right neighbor pixels: i) If one or more neighbor pixels having the same label, then copy the label. ii) If neighbor pixels have different labels, then copy the label anyone of the neighbor pixel. Add labels in equivalence table as equivalent labels. iii) Otherwise, assign a new label to this pixel and enter this label in equivalence table. c) If there are more pixels to consider, then go to step b).

D) Find the lowest label for each equivalent set in the equivalence table. E) Remember the equivalence table to eliminate the gaps of labels. F) Rescan the image; replace each label by the new label of equivalence table. (6) Distance transformation: a) Distance measurements: Euclidean distance: City-block distance:

Chessboard distance: a) Distance transformation: Distance transformation computes the minimum distance from a pixel of S to the background, for all pixels in S. Algorithm: Iteratively visit image m times: where N —— 4-neighbors of [ i, j];

st iteration 2 nd iteration 3 rd iteration Medial axis: The set of pixels in S with the distance from the pixels to background locally maximized is called medial axis of region S, or skeleton, or symmetric axis.

(7) Thinning: —— thinning operation reduces a binary image S to the lines that approximate their central lines —— thinning is an iterative operation. —— thinning operation usually applied to elongated shapes, such as line draws or characters. Thinning operation must satisfy that: —— not break connectivity of a pattern. —— thinned result is 8-connected. —— thinned result approximates the medial lines. —— extraneous spurs keep minimized.

(a) Algorithm 1 (iterative method): Definition: connectivity number of a pixel is the number of value changes (1 or 0) countered by clockwise visiting its 8-neighbors n 1, n 2,…,n 8. No=1 No=2 No=3 No=4 No=

The algorithm is a template-based method: i) Find a pixel [i, j] where the pixel in image S matches template M 1 ii) If center pixel is not an endpoint, and has connectivity number = 1, mark this pixel for later detection. x0x x1x x1x xxx 011 xxx x1x x1x x0x xxx 110 xxx M 1 M 2 M 3 M 4

iii) Repeat step i) and step ii) for all pixels matching the templates M 1 iv) Repeat steps 1-3 for templates M 2, M 3, M 4. v) If any pixels have marked for detection, change the pixel values to “0” vi) If any pixels were changed value in step 5, repeat entire process from step i); otherwise stop.

Algorithm 2 (line following) i) Set a window across the line draw. ii) Adjust the window size and position, such that the distance from window boundaries to the draw equal a preset width (e.g.2 pixel wide). iii) Set the center of the window be a skeleton point. iv) Move window forward. If no branch junction is met, go to step ii). v) If a branch junction is met, use BFS method, move window to one of the branch, go to step ii).

vi) If window moves to the end of a line or branch, and the queque of BFS is empty, stop. —— One pass method, fast —— Relink problem at branches.