Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
100 CHAPTER 5. PROGRAM EXAMPLES<br />
ÐØÓÒÖÐ ´ÄÖ¸ ÄÖÐØÓÒ¸ ºµ<br />
ÓÑÔÐÑÒØ ´ÄÖÐØÓÒ¸ ÆÓØÄÖµ<br />
ÖÙÓÑÒ ´ÈÖØи ÆÓØÄÖ¸ ÈÖØÐʵ<br />
ÑÒÑ ´ÈÖØÐʸ ÅÒ¸ ¿½¸ ¿½µ<br />
ÝÒØÖ×ÓÐ ´ÈÖØÐʸ ÅÒ¸ ËÑÐи ¿¸ ³Ðسµ<br />
This method shows two advantages: First, the (reliable) model of the large particles can be used<br />
to extract the small ones. This increases the quality of the segmentation. Second, the processing<br />
speed is increased, as the second segmentation works only on a part of the image data. The right<br />
side of figure 5.6 shows the segmentation result.<br />
Unfortunately, the image still contains noise. To remove it, you may either sort out noisy objects<br />
by their area as described above, or by an opening operation. We prefer the second method as<br />
it additionally smooths the object edges.<br />
ÓÔÒÒÖÐ ´ËÑÐи ËÑÐÐÐÒ¸ ¾ºµ<br />
Here, a circle is used as the structuring element of the opening operation. The operator preserves<br />
regions only that may at least cover a circle of radius 2.5. Smaller regions are eliminated.<br />
Figure 5.7: Noise-removed segmentation (left) and final result (right).<br />
Figure 5.7 shows the result of the segmentation with noise removal on the left side. The right<br />
side contains the final result.<br />
Finally, we would like to show within this example how to select regions with the mouse interactively.<br />
At this, a loop is executed until you press the middle or right mouse button. When<br />
pressing a mouse button, the operator Ø ÑÙØØÓÒ returns the button that was pressed and<br />
the position (coordinates) where it was pressed. This information is used to select the chosen<br />
object. In the following you see the corresponding program part:<br />
<strong>HDevelop</strong> / 2000-11-16