Package boofcv.alg.segmentation
Class ComputeRegionMeanColor<T extends ImageBase<T>>
java.lang.Object
boofcv.alg.segmentation.ComputeRegionMeanColor<T>
- Direct Known Subclasses:
ComputeRegionMeanColor.F32
,ComputeRegionMeanColor.PL_F32
,ComputeRegionMeanColor.PL_U8
,ComputeRegionMeanColor.U8
Computes the mean color for regions in a segmented image.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addPixelValue
(int index, float[] sum) Image type specific implementation.void
process
(T image, GrayS32 pixelToRegion, DogArray_I32 regionMemberCount, DogArray<float[]> regionColor) Compute the average color for each region
-
Constructor Details
-
ComputeRegionMeanColor
protected ComputeRegionMeanColor(int numBands) Constructor- Parameters:
numBands
- Number of bands in the color image
-
-
Method Details
-
process
public void process(T image, GrayS32 pixelToRegion, DogArray_I32 regionMemberCount, DogArray<float[]> regionColor) Compute the average color for each region- Parameters:
image
- Input imagepixelToRegion
- Conversion between pixel to region indexregionMemberCount
- List which stores the number of members for each regionregionColor
- (Output) Storage for mean color throughout the region. Internal array must be fully declared.
-
addPixelValue
protected abstract void addPixelValue(int index, float[] sum) Image type specific implementation. Adds the pixel value at the specified pixel to sum- Parameters:
index
- Pixel index in the image which is being readsum
- Where the pixel's value is added to
-