| Top |
| void | gwy_NIELD_splash_water () |
| GwyComputationState * | gwy_NIELD_watershed_init () |
| void | gwy_NIELD_watershed_iteration () |
| void | gwy_NIELD_watershed_finalize () |
| gint | gwy_NIELD_waterpour () |
| void | gwy_NIELD_mark_extrema () |
| void | gwy_NIELD_mark_watershed () |
void gwy_NIELD_splash_water (GwyField *field,GwyNield *water,GwyField *markbuf,gint locate_steps,gdouble locate_dropsize);
Performs a few location steps of watershed marking.
If a non-NULL markbuf
is passed, it must have the same dimensions as field
and water
.
GwyComputationState * gwy_NIELD_watershed_init (GwyField *field,GwyNield *grains,gint locate_steps,gint locate_thresh,gdouble locate_dropsize,gint wshed_steps,gdouble wshed_dropsize,gboolean prefilter,gboolean below);
Initializes the watershed algorithm.
This iterator reports its state as GwyWatershedStateType.
field |
Data to be used for marking. |
|
grains |
Result of marking (mask). |
|
locate_steps |
Locating algorithm steps. |
|
locate_thresh |
Locating algorithm threshold. |
|
locate_dropsize |
Locating drop size. |
|
wshed_steps |
Watershed steps. |
|
wshed_dropsize |
Watershed drop size. |
|
prefilter |
Use prefiltering. |
|
below |
If |
void
gwy_NIELD_watershed_iteration (GwyComputationState *state);
Performs one iteration of the watershed algorithm.
Fields state
and progress fraction
of watershed state are updated (fraction is calculated for each phase
individually). Once state
becomes GWY_WATERSHED_STATE_FINISHED, the calculation is finised.
A watershed iterator can be created with gwy_field_watershed_init(). When iteration ends, either by
finishing or being aborted, gwy_field_watershed_finalize() must be called to release allocated
resources.
void
gwy_NIELD_watershed_finalize (GwyComputationState *state);
Destroys a watershed iterator, freeing all resources.
gint gwy_NIELD_waterpour (GwyField *field,GwyNield *grains);
Performs the classical Vincent watershed segmentation of a data field.
The segmentation always results in the entire field being masked with the exception of thin (8-connectivity) lines
separating the segments (grains). The grains are already numbered in the same manner as
gwy_nield_number_contiguous() as a side-effect.
Compared to gwy_field_mark_watershed(), this algorithm is very fast. However, when used alone, it typically
results in a serious oversegmentation as each local minimum gives raise to a grain. Furthermore, the full
segmentation means that also pixels which would be considered outside any grain in the topographical sense will be
assigned to some catchment basin. Therefore, pre- and/or postprocessing is usually necessary, using the gradient
image or a more sophisticated method.
The function does not assign pixels with value HUGE_VAL or larger to any segment. This can be used to pre-mark
certain areas explicitly as boundaries.
void gwy_NIELD_mark_extrema (GwyField *field,GwyNield *extrema,gboolean maxima);