Segment an image using regiongrowing.
regiongrowing__ segments images into regions of the same intensity --- rastered into rectangles of size Row * Column. In order to decide whether two adjacent rectangles belong to the same region only the gray value of their center points is used. If the gray value difference is less or equal to Tolerance the rectangles are merged into one region.
If g_{1} und g_{2} are two gray values to be examined, they are merged into the same region if:
|g_1 - g_2| < ToleranceFor images of type 'cyclic', the following formulas are used:
|g1 - g2| < Tolerance und |g1 - g2| <= 127 256 - |g1 - g2| < Tolerance und |g1 - g2| > 127For rectangles larger than one pixel, ususally the images should be smoothed with a lowpass filter with a size of at least Row * Column before calling regiongrowing__ (so that the gray values at the centers of the regtangles are ``representative'' for the whole rectangle). If the image contains little noise and the rectangles are small, the smoothing can be omitted in many cases. This, of course, makes the whole procedure faster.
The resulting regions are collections of rectangles of the chosen size Row * Column. Only regions containing at least MinSize points are returned.
Regiongrowing is a very fast operation, and thus suited for time-critical applications.
Column and Row are automatically converted to odd values if necessary.
Image (input_object) |
image(-array) -> object : byte / int1 / int2 / int4 / cyclic / real |
Image to be segmented. |
Regions (output_object) |
region-array -> object |
Extracted segments. |
Row (input_control) |
extent.y -> integer |
Vertical distance between tested pixels (height of the raster). | |
Default value: 3 | |
Suggested values: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 | |
Range of values: 1 <= Row <= 99 (lin) | |
Minimum increment: 2 | |
Recommended increment: 2 | |
Restriction: (Row >= 1) && odd(Row) |
Column (input_control) |
extent.x -> integer |
Horiyontal distance between tested pixels (height of the raster). | |
Default value: 3 | |
Suggested values: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21 | |
Range of values: 1 <= Column <= 99 (lin) | |
Minimum increment: 2 | |
Recommended increment: 2 | |
Restriction: (Column >= 1) && odd(Column) |
Tolerance (input_control) |
number -> real / integer |
Points with a gray value difference less or equal to tolerance are accumulated into the same object. | |
Default value: 6.0 | |
Suggested values: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 18.0, 25.0 | |
Range of values: 1.0 <= Tolerance <= 127.0 (lin) | |
Minimum increment: 0.01 | |
Recommended increment: 1.0 | |
Restriction: (0 <= Tolerance) && (Tolerance < 127) |
MinSize (input_control) |
integer -> integer |
Minimum size of the output regions. | |
Default value: 100 | |
Suggested values: 1, 5, 10, 20, 50, 100, 200, 500, 1000 | |
Range of values: 1 <= MinSize <= 1000 (lin) | |
Minimum increment: 1 | |
Recommended increment: 5 | |
Restriction: MinSize >= 1 |
read_image(:Image:'fabrik':) > mean__(Image:Mean:Row,Column:) > regiongrowing__(Mean:Result:Row,Column,6.0,100:)
Let N be the number of found regions and M the number of points in one of these regions. Then the runtime complexity is O(N * log(M) * M).
regiongrowing__ returns TRUE if all parameters are correct. The behaviour with respect to the input images and output regions can be determined by setting the values of the flags 'no_object_result', 'empty_region_result', and 'store_empty_region' with set_system. If necessary, an exception is raised.
mean__, gauss__, smooth__, median, anisotrope_diff__
select_shape, reduce_domain, select_grey__
regiongrowing_n__, regiongrowing_mean, label_to_region