BoxGridImage2d
Creates a new two-dimensional image containing a binary or labeled grid.
Access to parameter description
This algorithm generates a new binary or label image containing a rectangular pattern that can be presented as:
Figure 1. Generation of a 2D box grid image (a) in contiguous region mode and
(b) in lines mode
See also
Access to parameter description
This algorithm generates a new binary or label image containing a rectangular pattern that can be presented as:
- A grid of lines in a binary image
- A series of contiguous blocks identified by different labels
- A series of blocks identified by a different label and separated by a background line
(a) |
(b) |
See also
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > boxGridImage2d( BoxGridImage2d::OutputType outputType, iolink::Vector2u32 imageSize, iolink::Vector2u32 origin, iolink::Vector2u32 gridOffset, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype. box_grid_image_2d( output_type = BoxGridImage2d.OutputType.LINES, image_size = [128, 128], origin = [0, 0], grid_offset = [10, 10], output_image = None )
This function returns outputImage.
// Function prototype. public static IOLink.ImageView BoxGridImage2d( BoxGridImage2d.OutputType outputType = ImageDev.BoxGridImage2d.OutputType.LINES, uint[] imageSize = null, uint[] origin = null, uint[] gridOffset = null, IOLink.ImageView outputImage = null );
Class Syntax
Parameters
Class Name | BoxGridImage2d |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
outputType |
OutputType defines the type of desired grid in the output image.
|
Enumeration | LINES | ||||||||
imageSize |
The dimensions in pixels of the output image. | Vector2u32 | != 0 | {128, 128} | |||||||
origin |
The origin of the first full rectangular region to generate. | Vector2u32 | Any value | {0, 0} | |||||||
gridOffset |
The X and Y side size of boxes to create in the output images. In CONTIGUOUS_REGIONS or SEPARATED_REGIONS mode, it represents the number of pixels between the top left corners of contiguous labels in each direction. In LINES mode, it represents the offset, in pixels, between consecutive lines in each direction. | Vector2u32 | != 0 | {10, 10} | |||||||
outputImage |
The output 2d image containing the grid. Type depends of the type of the grid. | Image | nullptr |
Object Examples
BoxGridImage2d boxGridImage2dAlgo; boxGridImage2dAlgo.setOutputType( BoxGridImage2d::OutputType::LINES ); boxGridImage2dAlgo.setImageSize( {128, 128} ); boxGridImage2dAlgo.setOrigin( {0, 0} ); boxGridImage2dAlgo.setGridOffset( {10, 10} ); boxGridImage2dAlgo.execute(); std::cout << "outputImage:" << boxGridImage2dAlgo.outputImage()->toString();
box_grid_image_2d_algo = imagedev.BoxGridImage2d() box_grid_image_2d_algo.output_type = imagedev.BoxGridImage2d.LINES box_grid_image_2d_algo.image_size = [128, 128] box_grid_image_2d_algo.origin = [0, 0] box_grid_image_2d_algo.grid_offset = [10, 10] box_grid_image_2d_algo.execute() print( "output_image:", str( box_grid_image_2d_algo.output_image ) )
BoxGridImage2d boxGridImage2dAlgo = new BoxGridImage2d { outputType = BoxGridImage2d.OutputType.LINES, imageSize = new uint[]{128, 128}, origin = new uint[]{0, 0}, gridOffset = new uint[]{10, 10} }; boxGridImage2dAlgo.Execute(); Console.WriteLine( "outputImage:" + boxGridImage2dAlgo.outputImage.ToString() );
Function Examples
auto result = boxGridImage2d( BoxGridImage2d::OutputType::LINES, {128, 128}, {0, 0}, {10, 10} ); std::cout << "outputImage:" << result->toString();
result = imagedev.box_grid_image_2d( imagedev.BoxGridImage2d.LINES, [128, 128], [0, 0], [10, 10] ) print( "output_image:", str( result ) )
IOLink.ImageView result = Processing.BoxGridImage2d( BoxGridImage2d.OutputType.LINES, new uint[]{128, 128}, new uint[]{0, 0}, new uint[]{10, 10} ); Console.WriteLine( "outputImage:" + result.ToString() );