boofcv.alg.segmentation.ms
Class MergeSmallRegions<T extends ImageBase>
- java.lang.Object
-
- boofcv.alg.segmentation.ms.RegionMergeTree
-
- boofcv.alg.segmentation.ms.MergeSmallRegions<T>
-
public class MergeSmallRegions<T extends ImageBase> extends RegionMergeTree
Finds regions which are too small and merges them with a neighbor that is the most similar to it and connected. The process is repeated until there are no more regions below the size threshold. How similar two neighbors are is determined using each region's average color. Connectivity is determined using a 4-connect rule.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classMergeSmallRegions.NodeNode in a graph.
-
Constructor Summary
Constructors Constructor and Description MergeSmallRegions(int minimumSize, ConnectRule rule, ComputeRegionMeanColor<T> computeColor)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidprocess(T image, GrayS32 pixelToRegion, GrowQueue_I32 regionMemberCount, FastQueue<float[]> regionColor)Merges together smaller regions.voidsetMinimumSize(int minimumSize)-
Methods inherited from class boofcv.alg.segmentation.ms.RegionMergeTree
initializeMerge, performMerge
-
-
-
-
Constructor Detail
-
MergeSmallRegions
public MergeSmallRegions(int minimumSize, ConnectRule rule, ComputeRegionMeanColor<T> computeColor)Constructor- Parameters:
minimumSize- Minimum number of pixels a region must have for it to not be pruned.computeColor- Computes the color of each region
-
-
Method Detail
-
setMinimumSize
public void setMinimumSize(int minimumSize)
-
process
public void process(T image, GrayS32 pixelToRegion, GrowQueue_I32 regionMemberCount, FastQueue<float[]> regionColor)
Merges together smaller regions. Segmented image, region member count, and region color are all updated.- Parameters:
image- Input image. Used to compute color of each regionpixelToRegion- (input/output) Segmented image with the ID of each region. Modified.regionMemberCount- (input/output) Number of members in each region Modified.regionColor- (Output) Storage for colors of each region. Will contains the color of each region on output.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG