ImageDev

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:
<b> (a) </b>
(a)
<b> (b) </b>
(b)
Figure 1. Generation of a 2D box grid image (a) in contiguous region mode and (b) in lines mode

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 = nullptr );
This function returns outputImage.
// Function prototype.
box_grid_image_2d(output_type: BoxGridImage2d.OutputType = BoxGridImage2d.OutputType.LINES,
                  image_size: Iterable[int] = [128, 128],
                  origin: Iterable[int] = [0, 0],
                  grid_offset: Iterable[int] = [10, 10],
                  output_image: idt.ImageType = None) -> idt.ImageType
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

Parameter Name Description Type Supported Values Default Value
input
outputType
OutputType defines the type of desired grid in the output image.
LINES The output image contains a binary grid.
CONTIGUOUS_REGIONS The output image contains a grid of connected labels.
SEPARATED_REGIONS The output image contains a grid of separated labels.
Enumeration LINES
input
imageSize
The dimensions in pixels of the output image. Vector2u32 != 0 {128, 128}
input
origin
The origin of the first full rectangular region to generate. Vector2u32 Any value {0, 0}
input
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}
output
outputImage
The output 2d image containing the grid. Type depends of the type of the grid. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
output_type
OutputType defines the type of desired grid in the output image.
LINES The output image contains a binary grid.
CONTIGUOUS_REGIONS The output image contains a grid of connected labels.
SEPARATED_REGIONS The output image contains a grid of separated labels.
enumeration LINES
input
image_size
The dimensions in pixels of the output image. vector2u32 != 0 [128, 128]
input
origin
The origin of the first full rectangular region to generate. vector2u32 Any value [0, 0]
input
grid_offset
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]
output
output_image
The output 2d image containing the grid. Type depends of the type of the grid. image None
Parameter Name Description Type Supported Values Default Value
input
outputType
OutputType defines the type of desired grid in the output image.
LINES The output image contains a binary grid.
CONTIGUOUS_REGIONS The output image contains a grid of connected labels.
SEPARATED_REGIONS The output image contains a grid of separated labels.
Enumeration LINES
input
imageSize
The dimensions in pixels of the output image. Vector2u32 != 0 {128, 128}
input
origin
The origin of the first full rectangular region to generate. Vector2u32 Any value {0, 0}
input
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}
output
outputImage
The output 2d image containing the grid. Type depends of the type of the grid. Image null

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() );