Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
106 CHAPTER 5. PROGRAM EXAMPLES<br />
Figure 5.12: Board with electonic devices (left) and the corresponding color value image in the<br />
HSV space (right).<br />
ÖÑ ´Á׸ ³³µ<br />
ÓÑÔÓ׿ ´Á׸ ʸ ÖÒ¸ ÐÙµ<br />
ØÖÒ×ÖÓÑÖ ´Ê¸ ÖÒ¸ ÐÙ¸ ÀÙ¸ ËØÙÖØÓÒ¸ ÁÒØÒ×Øݵ<br />
ØÖ×ÓÐ ´ËØÙÖØÓÒ¸ ÓÐÓÖ¸ ½¼¼¸ ¾µ<br />
ÖÙÓÑÒ ´ÀÙ¸ ÓÐÓÖ¸ ÀÙÓÐÓÖµ<br />
ØÖ×ÓÐ ´ÀÙÓÐÓÖ¸ ÐÙ¸ ½½¸ ½¿µ<br />
ÓÒÒØÓÒ ´ÐÙ¸ ÐÙÓÒÒص<br />
×ÐØ×Ô ´ÐÙÓÒÒظ ÐÙÄÖ¸ ³Ö³¸ ³Ò³¸ ½¼¸ ½¼¼¼¼¼µ<br />
×ÔØÖÒ× ´ÐÙÄÖ¸ ÓÒÒ×ØÓÖ׸ ³ÖØÒо³µ<br />
ØÖ×ÓÐ ´ÀÙÓÐÓÖ¸ ʸ ½¼¸ ½µ<br />
ÓÒÒØÓÒ ´Ê¸ ÊÓÒÒص<br />
×ÐØ×Ô ´ÊÓÒÒظ ÊÄÖ¸ ³Ö³¸ ³Ò³¸ ½¼¸ ½¼¼¼¼¼µ<br />
×ÔØÖÒ× ´ÊÄÖ¸ Ê××ØÓÖ׸ ³ÖØÒо³µ<br />
If you look closer at this program segment you will notice some obvious enhancements that can<br />
be made. One is necessary due to the color model: The thresholding of the color image chooses<br />
all pixels with a certain color. This selection is independent of the color saturation. Thus it<br />
might happen that very bright pixels (nearly white pixels) or very dark pixels (nearly black<br />
pixels) have the same color value as the components. But you are only looking for stronger<br />
colors. For this you select all pixels first whose color is strong, i.e., all pixels with a high<br />
saturation.<br />
The second enhancement concerns the objects’ shape. As the devices are rectangular you<br />
can specify the smallest enclosing rectangle of all connected components to enhance the segments.On<br />
the left side of figure 5.13 the resulting components are marked.<br />
In a second step, we will search for all ICs. This seems to be easy, as they are rather large<br />
and dark. However, some problems emerge due to the bright labels that are printed across<br />
some ICs. Thus a simple thresholding alone is not sufficient. In addition you have to combine<br />
the segments belonging to one IC. This is done by examining the spatial adjacencies of the<br />
segments. A dilation is used to enlarge the regions until they overlap each other. This dilation<br />
must not be so large that different ICs are merged. Thus gaps caused by labels have to be<br />
smaller than gaps between ICs. Now you can separate the enlarged ICs in their connected<br />
<strong>HDevelop</strong> / 2000-11-16