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

public abstract class ComputeRegionMeanColor<T extends ImageBase<T>> extends Object
Computes the mean color for regions in a segmented image.
  • 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 image
      pixelToRegion - Conversion between pixel to region index
      regionMemberCount - List which stores the number of members for each region
      regionColor - (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 read
      sum - Where the pixel's value is added to