22.01.2015 Views

HDevelop User's Manual

HDevelop User's Manual

HDevelop User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.3. PARTICLES 99<br />

each. Now it is easy to transform this observation into an algorithm. One way is to determine<br />

the threshold values locally (e.g., from a bar chart). Another solution might be the definition of<br />

a local environment by an Ò ¢ Ò window. This method is used in the example. The window’s<br />

mean value is used as an approximation of the background intensity. This can be done by applying<br />

a low pass filter, such as a mean filter or a Gaussian filter. The window size Ò defines<br />

the size of the local environment and should approximately be twice as large as the objects to<br />

search for. Since they show an average diameter of 15 pixels, a mask size of 31 is used.<br />

The resulting pixels are specified by the comparison of the original gray values with the mean<br />

image. To reduce problems caused by noise you add a constant to the mean image (3). The<br />

appropriate program segment looks as follows:<br />

ÑÒÑ ´ÈÖØи ÅÒ¸ ¿½¸ ¿½µ<br />

ÝÒØÖ×ÓÐ ´ÈÖØи ÅÒ¸ ËÑÐи ¿¸ ³Ðسµ<br />

The operator ÝÒ ØÖ×ÓÐ compares two images pixel by pixel. You can see the segmentation<br />

result in figure 5.6 left.<br />

Figure 5.6: Small objects: simple (left) and advanced segmentation (right).<br />

As we see, all objects have been found. Unfortunately, the edges of the large particles and<br />

several very small regions that emerged due to the noisy image material were found, too.<br />

We first try to suppress the edges. One way is to eliminate all objects that exceed a certain<br />

maximum size. You can do this by calling:<br />

ÓÒÒØÓÒ ´ËÑÐи ËÑÐÐËÒе<br />

×ÐØ×Ô ´ËÑÐÐËÒи ÊÐÐÝËÑÐи ³Ö³¸ ³Ò³¸ ½¸ ¿¼¼µ<br />

By the same method you might also eliminate all objects which are too small (blurring). For<br />

this, you would just have to increase the minimum size with the call of ×ÐØ ×Ô. Butif<br />

you examine the segmentation results again, you will notice that some of the resulting pixels<br />

were already extracted by the first segmentation. Thus you should search the small particles<br />

within the complement of the large ones only. To avoid the segmentation of small particles in<br />

the direct neighbourhood of the large ones, those are enlarged before building their complement.<br />

Thus we get the following modified program:<br />

HALCON 6.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!