gen_grid_regiongen_grid_regionGenGridRegionGenGridRegiongen_grid_region (算子)
名称
gen_grid_regiongen_grid_regionGenGridRegionGenGridRegiongen_grid_region — 从线或像素创建区域。
签名
Herror gen_grid_region(Hobject* RegionGrid, const Hlong RowSteps, const Hlong ColumnSteps, const char* Type, const Hlong Width, const Hlong Height)
Herror T_gen_grid_region(Hobject* RegionGrid, const Htuple RowSteps, const Htuple ColumnSteps, const Htuple Type, const Htuple Width, const Htuple Height)
void GenGridRegion(HObject* RegionGrid, const HTuple& RowSteps, const HTuple& ColumnSteps, const HTuple& Type, const HTuple& Width, const HTuple& Height)
void HRegion::GenGridRegion(const HTuple& RowSteps, const HTuple& ColumnSteps, const HString& Type, Hlong Width, Hlong Height)
void HRegion::GenGridRegion(Hlong RowSteps, Hlong ColumnSteps, const HString& Type, Hlong Width, Hlong Height)
void HRegion::GenGridRegion(Hlong RowSteps, Hlong ColumnSteps, const char* Type, Hlong Width, Hlong Height)
void HRegion::GenGridRegion(Hlong RowSteps, Hlong ColumnSteps, const wchar_t* Type, Hlong Width, Hlong Height)
(
Windows only)
static void HOperatorSet.GenGridRegion(out HObject regionGrid, HTuple rowSteps, HTuple columnSteps, HTuple type, HTuple width, HTuple height)
void HRegion.GenGridRegion(HTuple rowSteps, HTuple columnSteps, string type, int width, int height)
void HRegion.GenGridRegion(int rowSteps, int columnSteps, string type, int width, int height)
描述
算子 gen_grid_regiongen_grid_regionGenGridRegionGenGridRegionGenGridRegiongen_grid_region creates a grid constructed
of lines (TypeTypeTypeTypetypetype = 'lines') or pixels
(TypeTypeTypeTypetypetype = '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
(HeightHeightHeightHeightheightheight-1,WidthWidthWidthWidthwidthwidth-1) the grid is
built up at stepping width RowStepsRowStepsRowStepsRowStepsrowStepsrow_steps in row
direction and ColumnStepsColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps in column direction.
The step widths have to be greater than 1.
Exceptions are in 'lines' mode RowStepsRowStepsRowStepsRowStepsrowStepsrow_steps, where
RowStepsRowStepsRowStepsRowStepsrowStepsrow_steps or ColumnStepsColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps can be set equal to 0.
In such a case, only columns, rows respectively, are created.
注意
If a very small pattern is chosen
(RowStepsRowStepsRowStepsRowStepsrowStepsrow_steps < 4 or ColumnStepsColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps
< 4) the created region requires much storage.
In the 'points' mode RowStepsRowStepsRowStepsRowStepsrowStepsrow_steps and
ColumnStepsColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps must not be set to zero.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
RegionGridRegionGridRegionGridRegionGridregionGridregion_grid (输出对象) region → objectHRegionHObjectHRegionHobject *
Created lines/pixel region.
RowStepsRowStepsRowStepsRowStepsrowStepsrow_steps (输入控制) extent.y → HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Step width in line direction or zero.
默认值:
10
建议值:
0, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 100
值范围:
RowSteps
RowSteps
RowSteps
RowSteps
rowSteps
row_steps
(lin)
最小增量:
1
建议增量:
10
限制:
RowSteps > 1 || RowSteps == 0
ColumnStepsColumnStepsColumnStepsColumnStepscolumnStepscolumn_steps (输入控制) extent.x → HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Step width in column direction or zero.
默认值:
10
建议值:
0, 2, 3, 4, 5, 7, 10, 15, 20, 30, 50, 100
值范围:
ColumnSteps
ColumnSteps
ColumnSteps
ColumnSteps
columnSteps
column_steps
(lin)
最小增量:
1
建议增量:
10
限制:
ColumnSteps > 1 || ColumnSteps == 0
TypeTypeTypeTypetypetype (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Type of created pattern.
默认值:
'lines'
"lines"
"lines"
"lines"
"lines"
"lines"
值列表:
'lines'"lines""lines""lines""lines""lines", 'points'"points""points""points""points""points"
WidthWidthWidthWidthwidthwidth (输入控制) extent.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Maximum width of pattern.
默认值:
512
建议值:
128, 256, 512, 1024
值范围:
1
≤
Width
Width
Width
Width
width
width
(lin)
最小增量:
1
建议增量:
10
HeightHeightHeightHeightheightheight (输入控制) extent.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Maximum height of pattern.
默认值:
512
建议值:
128, 256, 512, 1024
值范围:
1
≤
Height
Height
Height
Height
height
height
(lin)
最小增量:
1
建议增量:
10
示例(HDevelop)
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)
dev_display(GridSobel)
示例(C)
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);
T_disp_image(GridSobel,WindowHandle);
示例(HDevelop)
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)
dev_display(GridSobel)
示例(HDevelop)
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)
dev_display(GridSobel)
示例(HDevelop)
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)
dev_display(GridSobel)
复杂度
The necessary storage (in bytes) for the region is:
O((ImageWidth / ColumnSteps) * (ImageHeight / RowSteps))
结果
如果参数值正确,算子 gen_grid_regiongen_grid_regionGenGridRegionGenGridRegionGenGridRegiongen_grid_region 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。
The clipping according to the current image format is set via the operator
set_system('clip_region',<'true'/'false'>)set_system("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)set_system("clip_region",<"true"/"false">)。
可能的后继
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain,
paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region
替代
gen_region_linegen_region_lineGenRegionLineGenRegionLineGenRegionLinegen_region_line,
gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygonGenRegionPolygongen_region_polygon,
gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points,
gen_region_runsgen_region_runsGenRegionRunsGenRegionRunsGenRegionRunsgen_region_runs
另见
gen_checker_regiongen_checker_regionGenCheckerRegionGenCheckerRegionGenCheckerRegiongen_checker_region,
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain
模块
基础