Threshold operator for signed images.
dual_threshold segments the input image into a region with gray values >= Threshold (``positive'' regions) and a region with gray values <= -Threshold (``negative'' regions). ``Positive'' or ``negative'' regions having a size of less than MinSize are suppressed, as well as regions whose maximum gray value is less than MinGray in absolute value.
The segmentation performed is not complete, i.e., the ``positive'' and ``negative'' regions together do not necessarily cover the entire image: Areas with a gray value between -Threshold and Threshold, -MinGray and MinGray respectively, are not taken into account.
dual_threshold is usually called after applying a Laplace operator (laplace, derivate_gauss or diff_of_gauss) or the difference of two images (sub_image) to an image.
The zero crossings of a Laplace image correspond to edges in an image, and are the separating regions of the ``positive'' and ``negative'' regions in the Laplace image. They can be determined by calling dual_threshold with Threshold = 1. The parameter MinGray controls the noise invariance, while MinSize controls the resolution of the edge detection.
Using byte images only the positive part of the operator is applied. Therefore dual_threshold behaves like a standard threshold operator (threshold) with successive connection and select_gray.
|
Image (input_object) |
image(-array) -> object : byte / int2 / int4 / real |
| Input Laplace image. | |
|
RegionCrossings (output_object) |
region-array -> object |
| ``Positive'' and ``negative'' regions. | |
|
MinSize (input_control) |
integer -> integer |
| Regions smaller than MinSize are suppressed. | |
| Default value: 20 | |
| Suggested values: 0, 10, 20, 50, 100, 200, 500, 1000 | |
| Typical range of values: 0 <= MinSize <= 10000 (lin) | |
| Minimum increment: 1 | |
|
Recommended increment: 10 | |
|
MinGray (input_control) |
real -> real |
| Regions whose maximum absolute gray value is smaller than MinGray are suppressed. | |
| Default value: 5.0 | |
| Suggested values: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 20.0 | |
| Typical range of values: 0.001 <= MinGray <= 10000.0 (lin) | |
| Minimum increment: 1.0 | |
|
Recommended increment: 10.0 | |
| Restriction: MinGray > 0 | |
|
Threshold (input_control) |
real -> real |
| Regions which have a gray value larger than Threshold (or smaller than -Threshold) are suppressed. | |
| Default value: 2.0 | |
| Suggested values: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 20.0 | |
| Typical range of values: 0.001 <= Threshold <= 10000.0 (lin) | |
| Minimum increment: 1.0 | |
|
Recommended increment: 10.0 | |
| Restriction: (Threshold >= 1) && (Threshold <= MinGray) | |
/* Edge detection with the Laplace operator (and edge thinning) */
diff_of_gauss(Image,Laplace,2.0,1.6)
/* find "`positive"' and "`negative"' regions: */
dual_threshold(Laplace,Region,20,2,1)
/*The zero runnings are the complement to these image section: */
complement('full',Region,Nulldurchgaenge).
/* Simulation of \OpRef{dual_threshold} */
dual_threshold(Laplace,Result,MinS,MinG,Threshold):
threshold(Laplace,Tmp1,Threshold,999999)
connection(Tmp1,Tmp2)
select_shape(Tmp2,Tmp3,'area','and',MinS,999999)
select_gray(Laplace,Tmp3,Tmp4,'max','and',MinG,999999)
threshold(Laplace,Tmp5,-999999,-Threshold)
connection(Tmp5,Tmp6)
select_shape(Tmp6,Tmp7,'area','and',MinS,999999)
select_gray(Laplace,Tmp7,Tmp8,'min','and',-999999,-MinG)
concat_obj(Tmp4,Tmp8,Result).dual_threshold returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior 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.
dual_threshold is reentrant and automatically parallelized (on tuple level).
min_max_gray, sobel_amp, gauss_image, reduce_domain, diff_of_gauss, sub_image, derivate_gauss
connection, dilation1, erosion1, opening, closing, rank_region, shape_trans, skeleton
threshold, connection, select_shape, select_gray, dyn_threshold, check_difference
laplace, diff_of_gauss, expand_region
Region processing