Segment an image using thresholds determined from its histogram.
auto_threshold1 segments a single-channel image using multiple thresholding. First the relative histogram of the gray values is determined. Then relevant minima are extracted from the histogram, which are used successively as parameters for a thresholding operation. If the extracted regions are smaller than MinSize pixels they are suppressed. The values in the histogram are relative frequencies multiplied by 1000. Thus, the range of values for Threshold and Diff is between 0.0 and 1000.0. If Threshold is enlarged more thresholds are accepted (i.e., more regions are extracted). If, on the other hand, Diff is enlarged, less thresholds are accepted. For each gray value interval one region is generated. Thus, the number of regions is the number of minima + 1.
Image (input_object) |
image -> object : byte |
Image to be segmanted. |
RegionsThreshold (output_object) |
region-array -> object |
Result of the segmentation. |
Sigma (input_control) |
number -> real / integer |
Sigma for the Gaussian smoothing of the histogram. | |
Default value: 2.0 | |
Suggested values: 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0 | |
Range of values: 0.1 <= Sigma <= 50.0 (lin) | |
Minimum increment: 0.01 | |
Recommended increment: 0.2 |
Threshold (input_control) |
number -> real |
Minima in the histogram having a value less than Threshold are relevant. | |
Default value: 1.0 | |
Suggested values: 0.5, 1.0, 2.0, 4.0, 6.0, 10.0, 50.0, 100.0 | |
Range of values: 0.1 <= Threshold <= 100.0 (lin) | |
Minimum increment: 0.01 | |
Recommended increment: 1.0 | |
Restriction: (0.0 <= Threshold) && (Threshold <= 1000.0) |
Diff (input_control) |
number -> real |
Minimum difference between minima and maxima in the histogram. | |
Default value: 2.0 | |
Suggested values: 0.0, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0, 100.0, 200.0 | |
Range of values: 0.0 <= Diff <= 1000.0 (lin) | |
Minimum increment: 0.01 | |
Recommended increment: 10.0 | |
Restriction: (Diff >= 0.0) && (Diff <= 1000.0) |
MinSize (input_control) |
integer -> integer |
Minimum size of the output regions. | |
Default value: 100 | |
Suggested values: 0, 10, 20, 50, 100, 200, 500, 1000 | |
Range of values: 0 <= MinSize <= 1000 (lin) | |
Minimum increment: 1 | |
Recommended increment: 10 | |
Restriction: MinSize > 0 |
auto_threshold1 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.
anisotrope_diff__, median, illuminate__
connection, select_shape, select_grey__
auto_threshold2, histo__, histo_gauss, threshold__