0% found this document useful (0 votes)
7 views4 pages

Binary Vision: Inte 1

The document discusses binary images, which consist of a single bit per pixel, and the process of creating them through thresholding from grey-scale images. It highlights the importance of distinct foreground and background for effective thresholding and explores various threshold detection methods, including adaptive and multispectral thresholding. Additionally, it covers morphological operations like dilation, erosion, opening, and closing, which can be applied to binary, grey-scale, and color images to enhance image processing results.

Uploaded by

mh3749175
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Binary Vision: Inte 1

The document discusses binary images, which consist of a single bit per pixel, and the process of creating them through thresholding from grey-scale images. It highlights the importance of distinct foreground and background for effective thresholding and explores various threshold detection methods, including adaptive and multispectral thresholding. Additionally, it covers morphological operations like dilation, erosion, opening, and closing, which can be applied to binary, grey-scale, and color images to enhance image processing results.

Uploaded by

mh3749175
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Binary Vision

Grey-scale images generally have 8 bits per pixel. While processing these images is easier in some ways than
processing colour images, there is a simpler form of image, the binary image, in which processing is even
more straight forward.

A binary image is one in which there is only a single bit per pixel (black or white). These images are created by
thresholding where the thresholds used are determined in a variety of ways The resulting binary images are
often post-processed using mathematical morphology and the resulting segmented binary regions are
extracted from the image using connected components analysis .

4.1 Thresholding

A binary image is created from a grey-scale image by thresholding.

Figure 4.1 A binary version (right) of a grey-scale image (left) thresholded at grey-level 97

The thresholding operation is generally used in order to separate some objects of interest from the
background. Most typically the object(s) of interest are represented by 1 (or 255), but sometimes the binary
image would have to be inverted for this to be the case.

4.1.1 Thresholding Problems

Arguably, the most important thing to note about binary imaging is that the foreground and the background
that are being need to be distinct in the image being thresholded. If they are not distinct then it will be
difficult to accurately segment them using thresholding. However, there are a number of techniques

Figure 4.2 A grey-scale image (top left) together with a binary version where the threshold is ‘correct’ (top
right), a version where the threshold is too low (bottom left) and a version where it is too high

which are used to try to deal with situations where the distinction between foreground and background is
not clear, and there are a number of techniques which aim to improve a binary image where the
segmentation is imperfect.

Figure 4.2 shows examples of what happens when the threshold is not chosen correctly. However, even in
the ‘correctly’ thresholded binary image there are some errors

4.2 Threshold Detection Methods

While for some Factory-based applications thresholds are set manually, this can cause problems over time as
lighting changes throughout the day. Even within Factory-based lighting Cases, the lighting sources gradually
become weaker over time. Hence, mechanisms are required to automatically Identify thresholds

1 Inte

Figure 4.3 A grey-scale image (top left) which has been thresholded (bottom left) by selecting the anti-mode
(100) from the histogram (right)

-1-
4.2.1 Bimodal Histogram Analysis

It is possible to determine a threshold for an image by analysis of the histogram of the image. If we suppose
that the background is Mainly centred around one grey-scale, and the foreground is mainly centred around
another grey-scale, then we can assume that the histogram will be bimodal .

4.3 Variations on Thresholding


4.3.1 Adaptive Thresholding

, global thresholding has been used In some situations, it is possible to Notably improve thresholding results
by using multiple thresholds.

Consider the thresholding in Figure 4.7, where an Perfect global threshold hides most of the written details of
the diagram. Using Flexible thresholding (with 64 thresholds/image blocks) most of the details appear
correctly.

Note, in Figure 4.7, that the adaptive thresholding has not worked correctly everywhere. There are two black
regions at the top (middle and right) which should be white, and one region near the centre of the image that
clearly has the wrong threshold. It might be possible to avoid this problem By making sure that the threshold
values do not vary Notably across the image.

Figure 4.7 A grey-scale image (left) which has Notably variation in lighting across the image, together with an
optimally thresholded binary version (middle) and an Flexibly thresholded binary version

4.3.4 Multispectral Thresholding

For colour images, it is not clear how thresholding should be applied. The most common thing to do is to
convert the images to grey-scale and then threshold, although obviously thresholding

Figure 4.10 A grey-scale image (left) which has been semi-thresholded (right). In this case, pixels below the
threshold have been considered as object pixels (as the background is brighter than the foreground)

can be applied to each channel independently It is also possible to threshold within 3D colour space
(effectively defining object pixels as those having a colour within a particular subspace of the 3D colour
space).

4.4.1 Dilation

Dilation is a technique for expanding the number of object pixels, typically in all directions simultaneously :

It works by translating every object point x in the binary image X by each of the object points b in the
structuring element B. Hence each object point in the image X can result in a number of object points in the
output set/image. Duplicates are not maintained.

-2-
Figure4.13 Dilation of a binary image (left) using a 3×3 isotropic structuring element The resultant dilated
binary image is shown on the right. Note that the hole has been filled in and close objects have been joined
together

This operation results in small holes being filled and fills in narrow gaps between larger groups of set points.
It also increases the size of objects (i.e. the number of points in the set). Note that normal dilation in an
imaging context uses an isotropic structuring element. Erosion using a 3×3 isotopic structuring element is
shown in Figure 4.14.

Binary image before (left) and after dilation (right) with a 3×3 isotropic structuring element Figure4.14

Figure4.15 Erosion of a binary image (left) using a 3×3 isotropic structuring element (see Figure 4.12). The
resultant eroded binary image is shown on the right. Note that the small point of noise has been removed,
although at the same time the shape on the top left has been removed because of the missing pixel in the
middle. The two connected larger blocks have been separated

4.4.2 Erosion

Erosion is a technique for shrinking object shapes by removing pixels from the boundary (see Figure 4.15):

A point p is an element of the eroded output set if, and only if, that point is a member of the input image set
X when translated by each (and all) of the structuring element points/vectors b. It can also be thought of as a
matching problem where the structuring element is compared with the input image set at every possible
location, and the output is marked only where the structuring element and the image match perfectly.

This operation results in any small points of noise and any narrow features being removed. It also reduces the
size of objects (i.e. number of points in the set). Similar to dilation, normal erosion in an imaging context uses
an isotropic structuring element. Erosion using a 3×3 isotopic structuring element is shown in Figure 4.16.

Figure4.16 Binary image before (left) and after erosion (right) with a 3×3 isotropic structuring
element

4.4.3 Opening and Closing

Erosion is the dual (i.e. mirror concept) of dilation and vice versa. While one expands the object pixels, the
other shrinks them, and if we combine these operations together we get some interesting and useful effects.

An opening is an erosion operation followed by a dilation operation with the same structuring element (B):

An opening removes noise (i.e. eliminates image details smaller than the structuring element), narrow
features (such as bridges between larger groups of points), and smoothes the object boundaries. Unlike
erosion and dilation though, it maintains the approximate size of the objects.

-3-
A closing joins objects which are close together and fills in holes within objects. It tends to distort the shape
of objects somewhat. Like opening, closing roughly maintains the size of objects.

Figure 4.17 A binary image (top right) which has been determined through subtracting the current image (top
left) from a background image, converting to grey-scale and thresholding. That binary image is closed to fill in
holes and bridges small gaps (bottom left), and then is opened to remove small and narrow regions (bottom
right). The original image (top left) is reproduced by permission of Dr. James Ferryman, University of Reading

Figure 4.18 A binary image (top left) which has been closed to join close objects (middle) and then opened to
break thin connections (right). Note that one of the tracks (bottom middle) of the printed circuit board has
broken during the opening operation, which may indicate that there is a problem with the board

Morphological operations can be applied to grey-scale and colour images as well as to binary images. In these
cases, each distinct grey-level on each channel is considered as a distinct set (i.e. all points that are greater
than or equal to a particular grey-level). See Figure 4.19 for an illustration of how grey-scale erosion and
dilation work, Figure 4.20 for an example of grey-scale opening and Figure 4.21 for a sample of colour
opening.

4.4.4 Grey-Scale and Colour Morphology

Morphological operations can be applied to grey-scale and colour images as well as to binary images. In these
cases, each distinct grey-level on each channel is considered as a distinct set (i.e. all points that are greater
than or equal to a particular grey-level). See Figure 4.19 for an illustration of how grey-scale erosion and
dilation work, Figure 4.20 for an example of grey-scale opening and Figure 4.21 for a sample of colour
opening

Figure 4.19 The bar chart in the centre shows 15 columns of a single row of an image with 7 greylevels (0 to 6
inclusive) shown vertically. Each different grey-level is considered independently when performing
morphological operations such as erosion (shown to the left) and dilation (shown to the right)

Figure 4.20 Example grey-scale 5×5 opening operation (centre) followed by binary thresholding

Figure 4.21 Example colour opening and closing operations. Original image is in the centre, with an opened
version on the right and a closed version on the right (both created using an isotropic 5×5 structuring
element)

Interestingly, grey-scale erosion and dilation are sometimes used to locate local maxima and minima in
probability spaces (such as within template matching; see Section 8.1.4).

-4-

You might also like