Image segmentation¶
Segments an input color or grayscale image into regions with integer labels
Documentation¶
Algorithms¶
- Chan-Vese
Active contour model based segmentation starting from an evolving level set. Can be used to segment objects without clearly defined boundaries.
- iter:
Maximum number of iterations of algoritm
- mu:
Edge length parameter. Higher values will produce rounder edges while smaller values will detect smaller objects
- lambda1:
Difference-from-average weight parameter. Affects the total area labelled positive
- lambda2:
Difference-from-average weight parameter. Affects the total area labelled negative
- dt:
Multiplicative factor speeding up calculation at risk for non-convergence
- initial level set:
Starting level set
- morphological:
If true then use morphological Chan-Vese instead
- Felzenszwalb
Oversegmentation of a multichannel image based on minimum spanning trees on the image grid.
- sigma:
Standard deviation of gaussian kernel used in pre-processing (0.8)
- scale:
Observation level, higher number means larger clusters
- min size:
Minimum size of each component
- K-means
Segments image using K-means clustering in color and spatial space.
- n:
Number of clusters for K-means
- compactness:
Balances color proximity and space proximity. Higher values give more weight to space proximity, making superpixel shapes more square/cubic. In SLICO mode, this is the initial compactness. This parameter depends strongly on image contrast and on the shapes of objects in the image. We recommend exploring possible values on a log scale, e.g., 0.01, 0.1, 1, 10, 100, before refining around a chosen value.
- iter:
Maximum number of iterations of K-means
- sigma:
Width of a gaussian kernel used to smooth image before K-means
- CIE Lab:
If true (default) then image is converted to CIE-LAB colorspace before K-means, afterwards converted back to RGB. Image must be a 3 channel RGB image
- force connectivity:
Forces the generated segments to be continous
- Quickshift
Segments image using quickshift clustering in color and spatial space. Requires RGB images as inputs.
- sigma:
Width of a gaussian kernel used to smooth image before K-means
- ratio:
A value between 0.0 to 1.0. Balances between color and image space proximity
- kernel size:
Width of gaussian kernel smoothing sample density. Higher values mean fewer clusters.
- max dist:
Cut-off point for data distances. Higher means fewer clusters.
- CIE Lab:
If true (default) then image is converted to CIE-LAB colorspace before K-means. Image must be a 3 channel RGB image
- Watershed
Floods watershed basins based on a set of N markers, suitable for grayscale images
- n:
Desired number of markers
- compact:
If not zero then use the compact-watershed algorithm giving more regularly shaped basins
- line:
Draws a one-pixel area with value=0 around each region
Definition¶
Input ports¶
- source image
source image to segment
Output ports¶
- result image
result after segmentation
Configuration¶
- CIE Lab (CIE Lab)
(no description)
- Algorithm (algorithm)
(no description)
- compact (compact)
(no description)
- compactness (compactness)
(no description)
- dt (dt)
(no description)
- force connectivity (force connectivity)
(no description)
- initial level set (initial level set)
(no description)
- iter (iter)
(no description)
- kernel size (kernel size)
(no description)
- lambda1 (lambda1)
(no description)
- lambda2 (lambda2)
(no description)
- line (line)
(no description)
- max dist (max dist)
(no description)
- min size (min size)
(no description)
- morphological (morphological)
(no description)
- mu (mu)
(no description)
- n (n)
(no description)
- ratio (ratio)
(no description)
- scale (scale)
(no description)
- sigma (sigma)
(no description)
Examples¶
Implementation¶
- class node_segmentation.Segmentation[source]