Herror ::gen_grid_region (
    Hobject *RegionGrid,
    const HTuple &RowSteps,
    const HTuple &ColumnSteps,
    const HTuple &Type,
    const HTuple &Width,
    const HTuple &Height
)
HRegion HRegion::GenGridRegion (
    const HTuple &RowSteps,
    const HTuple &ColumnSteps,
    const HTuple &Type,
    const HTuple &Width,
    const HTuple &Height
)

Create a region from lines or pixels.

The operator ::gen_grid_region 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 built up at stepping width RowSteps in line direction and ColumnSteps in column direction. In the 'lines' mode RowSteps, ColumnSteps respectively, can be set to zero. In this case only columns, lines respectively, are created.


Attention

If a very small pattern is chosen (RowSteps < 4 oder 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 -> Hobject * : HRegion
Created lines/pixel region.

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

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

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

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

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


Example
read_image(&Image,"fabrik");
gen_grid_region(&Raster,10,10,"lines",512,512);
reduce_domain(Image,Raster,&Mask);
sobel_amp(Mask,GridSobel,"sum_abs",3);
disp_image(GridSobel,WindowHandle);

Complexity

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

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


Result

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


Possible Successors

::reduce_domain, ::paint_region


Alternatives

::gen_region_line, ::gen_region_polygon, ::gen_region_points, ::gen_region_runs


See also

::gen_checker_region, ::reduce_domain


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH