3-D superpixel oversegmentation of 3-D image
[
computes superpixels of image L
,NumLabels
]
= superpixels3(___,Name,Value
)A
using
name-value pairs to control aspects of the segmentation.
The algorithm used in superpixels3
is a
modified version of the Simple Linear Iterative Clustering (SLIC)
algorithm used by superpixels
. At a high level,
it creates cluster centers and then iteratively alternates between
assigning pixels to the closest cluster center and updating the locations
of the cluster centers. superpixels3
uses a
distance metric to determine the closest cluster center for each pixel.
This distance metric combines intensity distance and spatial distance.
The function's Compactness
argument comes
from the mathematical form of the distance metric. The compactness
parameter of the algorithm is a scalar value that controls the shape
of the superpixels. The distance between two pixels i and j,
where m is the compactness value, is:
Compactness has the same meaning as in the 2-D superpixels
function:
It determines the relative importance of the intensity distance and
the spatial distance in the overall distance metric. A lower value
makes the superpixels adhere to boundaries better, making them irregularly
shaped. A higher value makes the superpixels more regularly shaped.
The allowable range for compactness is (0 Inf)
,
as in the 2-D function. The typical range has been found through experimentation
to be [0.01 0.1]
. The dynamic range of input images
is normalized within the algorithm to be from 0 to 1. This enables
a consistent meaning of compactness values across images.
boundarymask
| imoverlay
| label2idx
| label2rgb
| superpixels