public class MergeSmallRegions<T extends boofcv.struct.image.ImageBase> extends RegionMergeTree
| Modifier and Type | Class and Description |
|---|---|
static class |
MergeSmallRegions.Node
Node in a graph.
|
| Modifier and Type | Field and Description |
|---|---|
protected ComputeRegionMeanColor<T> |
computeColor |
protected georegression.struct.point.Point2D_I32[] |
connect |
protected int |
minimumSize |
protected org.ddogleg.struct.FastQueue<MergeSmallRegions.Node> |
pruneGraph |
protected org.ddogleg.struct.GrowQueue_B |
segmentPruneFlag |
protected org.ddogleg.struct.GrowQueue_I32 |
segmentToPruneID |
mergeList, rootID, tmpMemberCount| Constructor and Description |
|---|
MergeSmallRegions(int minimumSize,
boofcv.struct.ConnectRule rule,
ComputeRegionMeanColor<T> computeColor)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
adjacentBorder(boofcv.struct.image.GrayS32 pixelToRegion) |
protected void |
adjacentInner4(boofcv.struct.image.GrayS32 pixelToRegion) |
protected void |
adjacentInner8(boofcv.struct.image.GrayS32 pixelToRegion) |
protected void |
findAdjacentRegions(boofcv.struct.image.GrayS32 pixelToRegion)
Go through each pixel in the image and examine its neighbors according to a 4-connect rule.
|
void |
process(T image,
boofcv.struct.image.GrayS32 pixelToRegion,
org.ddogleg.struct.GrowQueue_I32 regionMemberCount,
org.ddogleg.struct.FastQueue<float[]> regionColor)
Merges together smaller regions.
|
protected void |
selectMerge(int pruneId,
org.ddogleg.struct.FastQueue<float[]> regionColor)
Examine edges for the specified node and select node which it is the best match for it to merge with
|
void |
setMinimumSize(int minimumSize) |
protected boolean |
setupPruneList(org.ddogleg.struct.GrowQueue_I32 regionMemberCount)
Identifies which regions are to be pruned based on their member counts.
|
flowIntoRootNode, initializeMerge, markMerge, performMerge, setToRootNodeNewIDprotected int minimumSize
protected ComputeRegionMeanColor<T extends boofcv.struct.image.ImageBase> computeColor
protected org.ddogleg.struct.GrowQueue_B segmentPruneFlag
protected org.ddogleg.struct.GrowQueue_I32 segmentToPruneID
protected org.ddogleg.struct.FastQueue<MergeSmallRegions.Node> pruneGraph
protected georegression.struct.point.Point2D_I32[] connect
public MergeSmallRegions(int minimumSize,
boofcv.struct.ConnectRule rule,
ComputeRegionMeanColor<T> computeColor)
minimumSize - Minimum number of pixels a region must have for it to not be pruned.computeColor - Computes the color of each regionpublic void setMinimumSize(int minimumSize)
public void process(T image, boofcv.struct.image.GrayS32 pixelToRegion, org.ddogleg.struct.GrowQueue_I32 regionMemberCount, org.ddogleg.struct.FastQueue<float[]> regionColor)
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.protected boolean setupPruneList(org.ddogleg.struct.GrowQueue_I32 regionMemberCount)
protected void findAdjacentRegions(boofcv.struct.image.GrayS32 pixelToRegion)
protected void adjacentInner4(boofcv.struct.image.GrayS32 pixelToRegion)
protected void adjacentInner8(boofcv.struct.image.GrayS32 pixelToRegion)
protected void adjacentBorder(boofcv.struct.image.GrayS32 pixelToRegion)
protected void selectMerge(int pruneId,
org.ddogleg.struct.FastQueue<float[]> regionColor)
pruneId - The prune Id of the segment which is to be merged into another segmentregionColor - List of region colors