Using and Processing Binary Images Flashcards
What are connected components?
Pixels which are connected i.e. neighbours to at least one other connected pixel.
Connected can mean either 4 or 8 neighbours
What are the problems with calculating connected components?
They are slow, and often a bottleneck in image processing
How can you find connected components?
Using a sequential algorithm (example uses 4 neighbours) - keeps a separate output array for labels, with two passes over the image
What does the first pass entail with connected components?
Scan image top left to bottom right (like reading a book)
Look at top and left neighbours (already given labels)
If the current pixel is foreground, then you use one of the three cases:
left = top = background - assign current pixel a new label
One of left and top is background, the other foreground - assign current pixel the foreground pixel’s label
Left = top = foreground - assign current pixel one of their labels and note that their labels are equal in an equivalence table
Step 3 detects mergers between two previously separate components
What does the 2nd pass entail within connected components?
Consider each equivalent pair of labels. Set all instances of the higher label to the lower.
i.e. if you are using 4 neighbour solution, then anything that is connected in a + shape around the pixel will now become part of that connected component (the biggest component overrides). If using 8, then anything nearby the pixel will now become part of that connected component.
What can you do with connected components?
Can compute features of and apply tests to components to process the underlying image e.g. apply a size threshold T to the number of pixels in the component
Shape is captured by measures like area/boundary length
What is mathematical morphology, and where is it used?
A branch of image processing which treats images as sets of pixels, and uses set theoretic operations to process them.
They were developed for binary images, and were extended to be used on grey level images.
Elements of sets are (x,y) coordinates of either black or white pixels.
You perform operations by combining two sets:
A patch of the binary image to be processed, and a structuring element
What are structuring elements?
Binary masks which identify rather than weigh pixels
What are the different types of morphological operations?
Dilation expands a foreground (or background) object A using structuring element B
Erosion shrinks a foreground (or background) object A using structural element B
What happens when using either dilation or erosion? (general effects)
The boundaries between foreground and background are often smoothed in the process.
The amount and the way objects grow or shrink depend upon the choice of the structuring element.
What is dilation, and how does it work?
Takes two inputs - binary image to dilate, and a set of points to be considered (a structuring element), of which the origin is the central element.
The algorithm superimposes the structuring element on each of the background pixels such that the origin of the structuring element coincides with the input pixel position.
If any of the ‘1’ pixels in the structuring element overlap with the foreground, then the background pixel is also set to foreground.
What are the effects of dilating an image?
Gradually enlarges the boundaries of regions of foreground pixels i.e. white pixels typically.
Areas of foreground pixels grow in size while holes within those regions become smaller
How do you perform edge detection with dilation?
Dilate the input image (note, that does cause the corners to become round, rather than straight edges)
Subtract from the original
Edges remain (pixels on the outside of the boundary)
What is erosion, and how does it work?
Two inputs:
binary image to erode, and a set of points to be considered - a structuring element, where the origin is the central element
The algorithm erodes the foreground by superimposing the structural element on each of the foreground pixels such that the original of the structuring element coincides with the input pixel position
If any of the ‘1’ pixels in the structuring element overlap with the background, then the foreground pixel is also set to background.
How can erosion be used in a different way?
It can be used to separate joint together objects, for clearer edge detection