boofcv.alg.segmentation.ms
Class RegionMergeTree
- java.lang.Object
-
- boofcv.alg.segmentation.ms.RegionMergeTree
-
- Direct Known Subclasses:
- ClusterLabeledImage, MergeRegionMeanShift, MergeSmallRegions
public class RegionMergeTree extends java.lang.ObjectMerges regions together quickly and efficiently using a directed tree graph. To merge two segments together first callmarkMerge(int, int). Then after all the regions which are to be merged are marked callperformMerge(boofcv.struct.image.GrayS32, org.ddogleg.struct.GrowQueue_I32). Internally a disjoint-set forest tree graph is maintained using an array. When two regions are marked to be merged (set-union) path-compression is done. After merging hsa finished, the graph is fully compressed so that all nodes point to their root directly. Then the output is computed.
-
-
Constructor Summary
Constructors Constructor and Description RegionMergeTree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidinitializeMerge(int numRegions)Must call before any other functions.voidperformMerge(GrayS32 pixelToRegion, GrowQueue_I32 regionMemberCount)Merges regions together and updates the provided data structures for said changes.
-
-
-
Method Detail
-
initializeMerge
public void initializeMerge(int numRegions)
Must call before any other functions.- Parameters:
numRegions- Total number of regions.
-
performMerge
public void performMerge(GrayS32 pixelToRegion, GrowQueue_I32 regionMemberCount)
Merges regions together and updates the provided data structures for said changes.- Parameters:
pixelToRegion- (Input/Output) Image used to convert pixel location in region ID. Modified.regionMemberCount- (Input/Output) List containing how many pixels belong to each region. Modified.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG