Generate grid
Generates a set points that uniformly covers the pixel grid of an image. With an iteration this tool can be used to apply an operation to sub-images.
To split an input image into fixed-size pieces, iterated grid corners can be used as an input to pixel-to-world coordinate transform followed by cropping. To apply an operation to sub-images without cropping one can connect the iterated grid corners as the frame input for many tools such as histogram.
Inputs
- image
- The image to cover with a grid.
- gridSpacing
- The horizontal and vertical spacing between points in pixel coordinates.
- gridPosition
- Specifies how the grid should be positioned.
Outputs
- corners
- The coordinates of the upper left corners of each grid cell in world coordinates in row-major order. A N-by-2 matrix. Note that due to perspective and non-linear lens distortions the points may not be uniformly spaced in world coordinates.
- gridSize
- A 1-by-2 integer matrix that contains the number of cells in the grid (width, height).
Different ways of positioning the grid.