Package boofcv.struct

Class ImageGrid<T>


public class ImageGrid<T>
extends Object
Breaks the image up into a grid. For use when processing individual regions of the image at a time. The size of a cell is designed to be approximately the target size, but adjusted to ensure even coverage.
  • Field Details

    • cells

      public final DogArray<T> cells
    • rows

      public int rows
    • cols

      public int cols
    • lengthX

      public int lengthX
    • lengthY

      public int lengthY
  • Constructor Details

  • Method Details

    • initialize

      public void initialize​(int targetLength, int imageWidth, int imageHeight)
      Initializes the grid based on how many pixels long a cell should be and the image size.
      targetLength - Target length of a grid cell in pixels
      imageWidth - Image width in pixels
      imageHeight - Image height in pixels
    • getCellAtPixel

      public T getCellAtPixel​(int pixelX, int pixelY)
      Returns the cell at the specified pixel. Coordinate must be inside image bounds
    • get

      public T get​(int row, int col)
      Returns the cell element at the specified grid coordinate
    • processCells

      public void processCells​(ImageGrid.ProcessCell<T> processor)
      Goes through every cell in the grid and passes in data to the processor
    • processCellsThreads

      public void processCellsThreads​(ImageGrid.ProcessCell<T> processor)