Image Processing Reference
In-Depth Information
Fig. 4.19 The two gray shapes in figure ( a )and( b ) are defined by threshold values and indicate
the regions within the two color spaces where object pixels lie. ( a ) The rg-color space. ( b )The
hs-color space. ( c ) An example of a shape that is not well defined by threshold values. Instead a
LUT should be applied
will stay the same, but the intensity will change. To handle such a situation, you
need to increase/decrease the threshold values accordingly. This will result in the
box in Fig. 4.18 being larger and hence the risk of including non-glove pixels will
increase. In the worst case, the box will be as large as the entire RGB color cube.
The solution is to convert the RGB color image into a representation where the
color and intensity are separated, and then do color thresholding on only the colors,
e.g., rg-values or hs-values. The thresholds can now be more tight, hence reducing
the risk of false classification. In Fig. 4.19 the equivalent of Fig. 4.18 is shown for
rg- and hs-representations, respectively. Regardless of which color representation is
applied, the problem of choosing proper threshold values is the same. Please consult
Appendix C regarding this matter.
Sometimes we can find ourselves in a situation where the colors of an object are
not easily described by a few threshold values. In Fig. 4.19 (c) this is illustrated by
the banana-shaped region. If you fit a box to this shape (by using four thresholds
values) you will clearly include non-object pixels and hence have an incorrect seg-
mentation of the object. The solution is to define a look-up-table (LUT). A LUT is
a table containing the color values belonging to the object of interest (in some color
space). These values can be found in a training phase by manually inspecting the
object of interest in a number of different images. Normally the values are consid-
ered as an image and a morphologic closing operation, see Chap. 6, is performed
to obtain a smooth and coherent shape. During run-time Eq. 4.14 is replaced by a
function that takes the value of a pixel and test if this value is present in the LUT. If
not, the corresponding output pixel is set to black, otherwise it is set to white.
No matter which color space you use for thresholding it is often a good idea to
also do some thresholding on the intensity values. If you look at the color cube you
can see that all possible colors will have a vector starting in ( 0 , 0 , 0 ) . This means
that the vectors will lie in the vicinity of ( 0 , 0 , 0 ) and the practical meaning of this
is that it is hard to distinguish colors when the intensity is low. Therefore it is often
a good idea not to process the colors of pixels with low intensity values. Likewise,
color pixels with a very high intensity might also be problematic to process. Say we
Search WWH ::

Custom Search