grid ( : RegionGrid : RowSteps, ColumnSteps, Type, Width, Height : )

Create a region from lines or pixels.

The operator grid creates a grid constructed of lines (Type = 'lines') or pixels (Type = 'points'). In case of 'lines' continuous lines are returned, in case of 'points' only the intersections of the lines. Starting from the pixel (0,0) to the pixel (Height-1,Width-1) the grid is build up at stepping width RowSteps in line direction and ColumnSteps in column direction. In the 'lines' mode RowSteps orColumnSteps, respectively, can be set to zero. In this case only columns or lines, respectively, are created.


Attention

If a very small pattern is chosen (RowSteps/ColumnSteps < 4) the created region requires much storage. In the 'points' mode RowSteps and ColumnSteps must not be set to zero.


Parameters

RegionGrid (output_object)
region -> object
Created lines/pixel region.

RowSteps (input_control)
extent.y -> integer / real
Step width in line direction or zero.
Default value: 10
Suggested values: 0, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 100
Range of values: 0 <= RowSteps <= 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: (RowSteps > 1) || (RowSteps == 0)

ColumnSteps (input_control)
extent.x -> integer / real
Step width in column direction or zero.
Default value: 10
Suggested values: 0, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 100
Range of values: 0 <= ColumnSteps <= 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: (ColumnSteps > 1) || (ColumnSteps == 0)

Type (input_control)
string -> string
Type of created pattern.
Default value: 'lines'
List of values: 'lines', 'points'

Width (input_control)
extent.x -> integer
Maximum width of pattern.
Default value: 512
Suggested values: 128, 256, 512, 1024
Range of values: 1 <= Width <= 1024 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Width >= 1

Height (input_control)
extent.y -> integer
Maximum height of pattern.
Default value: 512
Suggested values: 128, 256, 512, 1024
Range of values: 1 <= Height <= 1024 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Height >= 1


Example
read_image(:Image:'fabrik':) >
grid(:Raster:10,10,'lines',512,512:) >
reduce_domain(Image,Raster:Mask::) >
sobel_amp(Mask:GridSobel:'sum_abs',3:) >
disp_image(GridSobel:::).

Complexity

The necessary storage (in bytes) for the region is:

O((ImageWidth / ColumnSteps) * (ImageHeight / RowSteps))


Result

If the parameter values are correct the operator grid returns the value TRUE. Otherwise an exception is raised. The clipping of the current image format is set via the operator set_system(::'clip_region',<true/false>:).


Possible Successors

reduce_domain, paint_region__


Alternatives

store_lines, store_polygon, store_coord, store_chord


See also

checker_region, reduce_domain



Copyright © 1996-1997 MVTec Software GmbH