Download presentation
Published byAnis Page Modified over 9 years ago
1
CS 6825: Binary Image Processing – binary blob metrics
2
Recall - Creating a Binary Image - Thresholding
Input gray-level value Output gray-level value
3
“Blob Detection” - Segmentation
Often with binary images such as the one shown here, you want to detect the separate “blobs”, connected groupings of object pixels. Each blob may represent an entirely separate object or a surface of an object. When using color or grey scale images this process is called segmentation. We will discuss this in another module. 2 1 5 3 4 9 6 7 8 12 11 10 Here “object pixels” are labeled black. We have 12 blobs in binary image, each corresponding to a different object.
4
Knowing your blobs: Label Image
Original Binary Image The output of a segmentation algorithm on a binary image will be what is called a “label image”. Basically, it gives a unique identifier (like number the blobs 0 to n) for each blob and every pixel that belongs to that blob gets its label id. The color image show the label image where each unique label id has a different color Label Image – Colors indicate different blobs, random colors were assigned
5
Blob Detection Blob = connected pixels. This image has 4 blobs ( that are 8 – connected) See our previous lecture on neighborhoods to review 8- connected.
6
Blob Detection Recursive Algorithm
Initialize your label image with no labels for all pixels. Scan your binary image and find the first non-zero pixel, that has no label. Create a label for it in the label image. Find all unmarked non-zero neighbors and mark them as visited with the same label id. For each of these neighbors, go to step 3. Repeat step 2 until you have scanned the entire image.
7
Blob Detection Iterative Algorithm
Scan the array, raster fashion. When a non-zero pixel is found, look above and to left for other non-zero pixels and if one is found, join the current pixel to this blob. Join blobs at the bottom of U's.
8
Example: Labeling Blobs (here application is medical image – cell detection)
Adaptive Smoothing & Thresholding Connected Components Labeling Binary image Regions labeled image Image Binary Segmentation Connected Components Labeling
9
Small Blob removal Small blobs considered “noise” , not important.
For all pixels f(x,y), left to right, top to bottom { counter(label(x,y)) ++; } //increment count of this label //remove blobs with less than S pixels { if f(x,y)=0, do nothing. if f(x,y)=1 and counter(label(x,y))<S) then set f(x,y)=0 }
10
Blob Measurements Often wish to measure geometric properties on blobs
11
Geometric Properties: Area of a blob
Size The area A is measured as the number of pixels in the region weighted by their intensity. Below B represents a set of pixels belonging to a “blob” that we wish to measure the area of. This could be, for example the black pixels in the hole of the manufacturing object we saw previously.
12
Geometric Properties: Center position of blob
The equation below calculates the center of the region x, y.
13
Geometric Properties: Orientation
To have a unique orientation along the length of an object, the object must be elongated in one direction. If this is the case, the axis of elongation can be used to define the orientation. The axis of least second moment is equivalent to the axis of least inertia and is used as the axis of elongation. The axis of second moment for an object is that line for which the sum of the squared distances between the object pixels and the line is minimum.
14
Geometric Properties: Projections
The projection of a binary image onto a line can be useful for segmenting areas along the line for further processing. Consider the task of trying to find separation between horizontal lines of text on a page. If you were to perform a projection along a vertical line, for black text against a white background the high values of the projection would indicate the line separations. Text image and vertical projection. These lines/rows of image contain the words “To: Lynne” as they have lower values/ more black.
15
Example: OCR First Vertical Projection is used to detect lines in text to separate them from each other. The valleys in the projection curve indicate areas between lines. Line 1 Line 2 Line 3 Line 3
16
Example: OCR For each line of text, Horizontal Projection is used to detect and separate characters in it. Valleys again indicate possible separation between characters. This is harder to see visually.
17
Conclusion We learned about some of the properties / “features” that are used for Binary Images Started with finding of “blobs” (idea is a blob is part of an object, or an entire object or could be more tan one object…it is object related). Looked at an algorithm (there are many) to find blobs How to remove small blobs Features of a blob : size, center, orientation, projections. THERE are MANY more possible features – can you think of any? How about shape, or diameter, or length of perimeter, etc.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.