Operator Reference
watersheds_threshold (Operator)
watersheds_threshold
— Extract watershed basins from an image using a threshold.
Signature
Description
The operator watersheds_threshold
segments regions (basins)
that are separated from each other by a watershed that has a
height of at least Threshold
.
In the first step, watersheds_threshold
computes the watersheds
without applying a threshold, resulting in the same basins that would be
obtained when calling watersheds
(for more details please refer to
the description of watersheds
). In the second step, the basins are
successively merged if they are separated by a watershed that is smaller than
Threshold
. Let and be the minimum
gray values of two neighboring basins and W the minimum gray value
of the watershed that separates the two basins. The watershed is eliminated
and the two basins are merged if
The thus obtained basins are returned in Basins
.
If Threshold
is set to 0, watersheds_threshold
is
comparable to watersheds
except that no watersheds but only expanded
basins are returned. If Threshold
is set to the maximum gray value
range of Image
then no two basins are separated by a watershed
exceeding Threshold
, and hence, Basins
will contain only
one region.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
Image
(input_object) singlechannelimage →
object (byte / uint2 / real)
Image to be segmented.
Basins
(output_object) region-array →
object
Segments found (dark basins).
Threshold
(input_control) number →
(integer / real)
Threshold for the watersheds.
Default: 10
Suggested values: 0, 5, 10, 20, 30, 50
Restriction:
Threshold >= 0
Result
watersheds
always returns 2 (
H_MSG_TRUE)
. The behavior with
respect to the input image 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.
Possible Predecessors
binomial_filter
,
gauss_filter
,
smooth_image
,
invert_image
Possible Successors
expand_region
,
select_shape
,
reduce_domain
,
opening
Alternatives
watersheds
,
pouring
,
watersheds_marker
Module
Foundation