Class SegmentMeanShift<T extends ImageBase<T>>
- All Implemented Interfaces:
Performs mean-shift segmentation on an image. Primary based upon the description provided in , it first uses mean-shift to find the mode of each pixel in the image. The mode is the location mean-shift converges to when initialized at a particular pixel. All the pixels which have the same mode, to within tolerance, are combined into one region. Since mean-shift does not guarantee that pixels which have the same label are connected to each other the labeled image is now segmented to ensure connectivity between labels. If a minimum size is specified for a segment then small regions are pruned and their pixels combined into the adjacent region which has the most similar color.
Mean-shift segmentation can be slow but it has the advantage of there being relatively few tuning parameters. Few tuning parameters make it easier to work with and to some extent more robust.
NOTE: Connectivity rule of 4 tends to produce more tightly compact regions while 8 produces fewer regions but with a more complex surface.
 Comaniciu, Dorin, and Peter Meer. "Mean shift analysis and applications." Computer Vision, 1999. The Proceedings of the Seventh IEEE International Conference on. Vol. 2. IEEE, 1999.
Nested Class Summary
Nested classes/interfaces inherited from interface org.ddogleg.struct.Stoppable
(SegmentMeanShiftSearch<T> search, MergeRegionMeanShift merge, @Nullable MergeSmallRegions<T> prune, ConnectRule connectRule)Specifies internal classes used by mean-shift.
Method SummaryModifier and TypeMethodDescription
intThe number of regions which it found in the image.
DogArray<float>Average color of each regionNumber of pixels in each region
voidPerforms mean-shift segmentation on the input image.
(SegmentMeanShiftSearch<T> search, MergeRegionMeanShift merge, @Nullable @Nullable MergeSmallRegions<T> prune, ConnectRule connectRule)Specifies internal classes used by mean-shift.
search- mean-shift search
merge- Used to merge regions
prune- Prunes small regions and merges them If null then prune step will be skipped.
connectRule- Specify if a 4 or 8 connect rule should be used when segmenting disconnected regions. Try 4
processPerforms mean-shift segmentation on the input image. The total number of regions can be found by calling
output- Storage for output image. Each pixel is set to the region it belongs to.
getNumberOfRegionspublic int getNumberOfRegions()The number of regions which it found in the image.
- Total regions
getRegionColorpublic DogArray<float> getRegionColor()Average color of each region
getRegionSizepublic DogArray_I32 getRegionSize()Number of pixels in each region
requestStoppublic void requestStop()
- Specified by:
isStopRequestedpublic boolean isStopRequested()
- Specified by: