Another way to detect edges is the following sequence:
HImage Image("file_xyz");
HImage Mean = Image.MeanImage(11,11);
HRegion Threshold = Image.DynThreshold(Mean,5,"light");
Again some remarks:
The size of the filter mask (in our case 11 × 11) is correlated with
the size of the objects which have to be found in the image. In fact, the
sizes are proportional.
The dynamic threshold selects the pixels with a positive gray value
difference of more than 5 (brighter) than the local environment (mask 11 × 11).