Each pixel is 0 or 1, background or foreground Image processing to

Slides:



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

Document Image Processing
CDS 301 Fall, 2009 Image Visualization Chap. 9 November 5, 2009 Jie Zhang Copyright ©
1Ellen L. Walker ImageJ Java image processing tool from NIH Reads / writes a large variety of images Many image processing operations.
Computer Vision Lecture 16: Region Representation
Chapter 9: Morphological Image Processing
Introduction to Morphological Operators
Provides mathematical tools for shape analysis in both binary and grayscale images Chapter 13 – Mathematical Morphology Usages: (i)Image pre-processing.
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
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.
1Ellen L. Walker Matching Find a smaller image in a larger image Applications Find object / pattern of interest in a larger picture Identify moving objects.
Lectures 10&11: Representation and description
Binary Image Analysis. YOU HAVE TO READ THE BOOK! reminder.
Chapter 11 Representation and Description. Preview Representing a region involves two choices: In terms of its external characteristics (its boundary)
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.
Introduction --Classification Shape ContourRegion Structural Syntactic Graph Tree Model-driven Data-driven Perimeter Compactness Eccentricity.
1. Binary Image B(r,c) 2 0 represents the background 1 represents the foreground
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.
Digital Image Processing Lecture 20: Representation & Description
MATHEMATICAL MORPHOLOGY I.INTRODUCTION II.BINARY MORPHOLOGY III.GREY-LEVEL MORPHOLOGY.
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
Digital Image Processing CSC331
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.
Gianni Ramponi University of Trieste Images © 2002 Gonzalez & Woods Digital Image Processing Chapter 9 Morphological Image.
Introduction Image geometry studies rotation, translation, scaling, distortion, etc. Image topology studies, e.g., (i) the number of occurrences.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Representation & Description.
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014.
Introduction --Classification Shape ContourRegion Structural Syntactic Graph Tree Model-driven Data-driven Perimeter Compactness Eccentricity.
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.
CS654: Digital Image Analysis Lecture 5: Pixels Relationships.
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
Nottingham Image Analysis School, 23 – 25 June NITS Image Segmentation Guoping Qiu School of Computer Science, University of Nottingham
CDS 301 Fall, 2008 Image Visualization Chap. 9 November 11, 2008 Jie Zhang Copyright ©
1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction.
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.
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.
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.
Morphological Image Processing
 After an image has been segmented into regions by methods such as those discussed in image segmentation chapter, the segmented pixels usually are represented.
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.
Materi 09 Analisis Citra dan Visi Komputer Representasi and Deskripsi 1.
COMP 9517 Computer Vision Binary Image Analysis 4/15/2018
Image Representation and Description – Representation Schemes
图像处理技术讲座(3) Digital Image Processing (3) Basic Image Operations
CSE 554 Lecture 1: Binary Pictures
Digital Image Processing Lecture 20: Representation & Description
Introduction to Morphological Operators
Mean Shift Segmentation
Computer Vision Lecture 5: Binary Image Processing
Binary Image processing بهمن 92
Department of Computer Engineering
Binary Image Analysis: Part 2 Readings: Chapter 3:
Representation and Description
Computer and Robot Vision I
Presentation transcript:

Each pixel is 0 or 1, background or foreground Image processing to Binary Images Each pixel is 0 or 1, background or foreground Image processing to Enhance separation of objects of interest Separate and count multiple objects Understand the shapes of multiple objects

From image to binary image Classification: dividing pixels into "foreground" and "background" Thresholding If a pixel has a value in range (min, max) it is foreground Often min is 0 or max is maximum pixel value Choice of range can be manual or automatic (E.g. look for peaks / valleys in histogram) More complex operations Use information from neighboring pixels Use properties besides pixel value (e.g. location) …

Neighborhoods can be defined for each pixel Image Neighborhoods Neighborhoods can be defined for each pixel The two most common neighborhoods 4-neighborhood 8-neighborhood N W E S

Applying a Mask Mask is a set of relative pixel positions. One is designated the origin (0,0) - usually at center Each mask element is weighted To apply the mask, put the origin pixel over the image pixel and multiply weights by the pixels under them, then add up all the values. Usually this is repeated for every image in the pixel. Assumptions must be made for pixels near the edge of the image.

Mask application example Mask = 1 1 1, origin at center Apply to every pixel in image: 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 Result is 0 0 0 1 1 0 0 1 2 2 0 1 2 3 2 1 2 3 3 2 2 3 3 3 2

Shapes in a binary image 1

Masks for object counting External corners (origin = top left) 0 0 0 0 1 0 0 1 0 1 1 0 0 0 0 0 Internal corners (origin = top left) 1 1 1 1 1 0 0 1 1 0 0 1 1 1 1 1 Apply using exact match (result is 1 if every pixel in mask matches the image) If any of the 4 external corner masks matches, the corner is external (& same for internal)

Counting 4-Connected Objects The number of 4-connected objects in an image is (E - I) / 4 where E is the number of external corners and I is the number of internal corners. Assumptions: Objects are 4-connected (2 diagonal pixels are 2 objects) Objects do not contain "holes" within them Go back and try it on example two slides back. Note how the hole affects things.

"Blobs" are connected components 4-connected (diagonal neighbors don't count) 8-connected (diagonal neighbors are connected) The following diagram has 3 4-connected components (red, blue, black) or 2 8-connected components (non-black, black)

Recursive Connected Components Copy the image While at least one 1-pixel exists in the existing image Create a new label REC_LABEL(label, pixel) Label and remove the pixel For each non-zero neighbor REC_LABEL(label, neighbor)

Recursive Connected Components Example First pixel After 4 recursive calls, no 4-neighbors neighbors to color Start again with a new color on an unmarked pixel

Two-Pass Connected Components For every pixel in the image (left-right, top-bottom) If the pixel is non-zero If the pixel has no labeled neighbors (above/left) Create a new label & label it Else if all labeled neighbors are the same Give the pixel the same label Else if neighbors have 2 different labels Give the pixel the largest label Mark the smaller label as a parent of the larger one (parent [larger] = smaller)

Two-Pass Connected Components Renumber all pixels using only one value for each "equivalence class" This value is the root of the tree While (parent[x] != 0) x = parent[x];

Two-pass Connected Component Example 2 lines scanned 3 lines scanned 4th line -- Conflict - set black = blue ?

Binary Image Morphology Morphology = "Study of Shape" Set of operations that are useful for processing connected components ("blobs") based on shape Examples Remove small holes or outcroppings Remove objects below a given size Smooth corners

Mask used for binary morphology Structuring Element Mask used for binary morphology Like convolution masks, they slide over the image and operate on the pixels under them Common elements: Box (square or rectangle) Disk (digital filled circle) Bar (horizontal or vertical)

Morphology Operations Dilation Result is mask OR original Erosion Result pixel is 1 if origin pixel is 1 and all pixels covered by the mask are also 1

Morphology Operations Closing = dilation followed by erosion Opening = erosion followed by dilation

Applications of Morphology General Closing closes holes (up to size of element) Opening opens spaces (up to size of element) Specialized Choose elements of size/shape based on your object Eliminate objects that are too small / large Isolate interesting features

Each pixel is distance to closest “1” in the original image. Grassfire Transform Each pixel is distance to closest “1” in the original image. 2 1 3 4 5 6

Another Example

Two-Pass Algorithm for Grassfire Set all boundary pixels to Max First pass: top left to bottom right If original pixel was 1, pixel is 0 Else pixel = min(above + 1, left + 1); Second pass: bottom right to top left Pixel = min(pixel, below+1,right+1);

Distance Transforms and Medial Axis Grassfire as described here measures 4-connected distance to the region of interest Variations Use a different distance transform, e.g. Euclidean Use 0 instead of a large value at the boundaries Medial axis is set of points furthest from a boundary Set of pixels with maximal values in grassfire Very sensitive to changes in boundary

Examples Figure 3.9 (f = dilated, g=grassfire, h=components)

Other Useful Binary Image Operations Pixelwise AND, OR Pixelwise Subtraction 0 if first image is 0, or both images are 1 Translation Every pixel is copied (dx, dy) away from its original position

Shape = list of features Shape Representation Shape = list of features Boundary points, segments Region features (center, convex hull, etc.) “Interesting” points, e.g. corners Shape invariants Shape = mathematical description Function type & parameters (e.g. circle, radius 5, centered at (0,0)) Mathematical function approximation of boundary, e.g. B-spline Shape Classes

Shape Features Region features Boundary features Simple properties (area, Euler’s #, projections, bounding box, eccentricity, elongatedness, direction, compactness) Statistical moments Convex Hull Region decompositions (hierarchical representation) Skeleton Boundary features Boundary points (e.g. chain code) Geometric properties (perimeter, curvature, chords, etc.)

Compactness = (Perimeter & Perimeter) / Area Simple Properties Area Number of pixels in the region Perimeter Number of boundary pixels Compactness = (Perimeter & Perimeter) / Area Maximal for circle, minimal for thin, long rectangle Centroid Average x value, average y value

Statistical Moments In a binary image, a moment is the sum of relevant x’s and y’s. (0,0) moment = area (1,0) moment / area = average x coordinate (0,1) moment / area = average y coordinate

Variations on Statistical Moments Central moment First translate the shape so that its center is (0,0), i.e. subtract the (average x, average y) values from all pixel locations Scaled central moment Divide the central moment by a power of the scale factor and the area Unscaled central moment Divide the central moment by a power of the area only

2nd Order Moments and Ellipses Central (2,0) moment relates to the horizontal axis of an ellipse approximating the shape Central (0, 2) moment relates to the vertical axis of an ellipse approximating the shape Central (1,1) moment relates to the rotation of an ellipse approximating the shape

More Region Properties Bounding box Min, max x-value, min-max y-value Extremal points (on the bounding box) Topmost left, topmost right, leftmost top, leftmost bottom, etc. Lengths of extremal axes (e.g. top left -> bottom right) These approximate the Convex Hull of the object Convex hull is the shape you get by pounding nails into the black pixels and then wrapping them with a rubber band.

Boundary Pixels and Perimeter 4-connected object (black) Boundary pixels have at least one white 8-neighbor 8-connected object (black) Boundary pixels have at least one white 4-neighbor If the object is 4-connected, the background is 8-connected and vice versa Perimeter is the number of boundary pixels Chain code: start at uppermost, leftmost boundary pixel - list DIRECTION to next pixel until the first one is reached again

Centroid, center of mass Center of contour Where is the center? Centroid, center of mass (average x over all pixels, average y over all pixels) Center of contour (average x, y over boundary pixels only) Example (note sensitivity to contour!)

Basis: thinning (many algorithms!) Region Skeletons Basis: thinning (many algorithms!) Maximum values of grassfire transform (medial axis) Last pixels to disappear with repeated erosion

Hierarchical or Graph Shape Description Define a set of primitive shapes Define a set of operations (concatenation, union, intersection, etc.) Define a shape as a network of primitive shapes (parts) connected by operations Recognize a shape by recognizing its parts and the relationships between them.

Region Adjacency Graph Primitive shape = "connected set of pixels" Operations = "adjacent to" Element of region 1 is in the neighborhood of element of region 2 In binary images, all regions with no holes are adjacent to the single background region All holes are adjacent to the objects that contain them