rank_regionrank_regionRankRegionRankRegionrank_region (算子)

名称

rank_regionrank_regionRankRegionRankRegionrank_region — 区域秩算子。

签名

rank_region(Region : RegionCount : Width, Height, Number : )

Herror rank_region(const Hobject Region, Hobject* RegionCount, const Hlong Width, const Hlong Height, const Hlong Number)

Herror T_rank_region(const Hobject Region, Hobject* RegionCount, const Htuple Width, const Htuple Height, const Htuple Number)

void RankRegion(const HObject& Region, HObject* RegionCount, const HTuple& Width, const HTuple& Height, const HTuple& Number)

HRegion HRegion::RankRegion(Hlong Width, Hlong Height, Hlong Number) const

static void HOperatorSet.RankRegion(HObject region, out HObject regionCount, HTuple width, HTuple height, HTuple number)

HRegion HRegion.RankRegion(int width, int height, int number)

def rank_region(region: HObject, width: int, height: int, number: int) -> HObject

描述

rank_regionrank_regionRankRegionRankRegionRankRegionrank_region calculates the binary rank operator. A filter mask of size HeightHeightHeightHeightheightheight x WidthWidthWidthWidthwidthwidth) is used. In the process, for each point in the region the number of points of RegionRegionRegionRegionregionregion lying within the filter mask are counted. If this number is greater or equal to NumberNumberNumberNumbernumbernumber, the current point is added to the output region. If is chosen, the median operator is obtained.

注意

For HeightHeightHeightHeightheightheight and WidthWidthWidthWidthwidthwidth only odd values > 3 are valid. If invalid parameters are chosen they are converted automatically (without raising an exception) to the next larger odd values.

执行信息

参数

RegionRegionRegionRegionregionregion (输入对象)  region(-array) objectHRegionHObjectHRegionHobject

Region(s) to be transformed.

RegionCountRegionCountRegionCountRegionCountregionCountregion_count (输出对象)  region(-array) objectHRegionHObjectHRegionHobject *

Resulting region(s).

WidthWidthWidthWidthwidthwidth (输入控制)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the filter mask.

默认值: 15

建议值: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21

值范围: 3 ≤ Width Width Width Width width width ≤ 511 (lin)

最小增量: 2

建议增量: 2

限制: Width >= 3 && odd(Width)

HeightHeightHeightHeightheightheight (输入控制)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the filter mask.

默认值: 15

建议值: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21

值范围: 3 ≤ Height Height Height Height height height ≤ 511 (lin)

最小增量: 2

建议增量: 2

限制: Height >= 3 && odd(Height)

NumberNumberNumberNumbernumbernumber (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimum number of points lying within the filter mask.

默认值: 70

建议值: 5, 10, 20, 40, 60, 80, 90, 120, 150, 200

值范围: 1 ≤ Number Number Number Number number number ≤ 1000 (lin)

最小增量: 1

建议增量: 10

限制: Number > 0

示例(HDevelop)

read_image(Image,'monkey')
mean_image(Image,Mean,5,5)
dyn_threshold(Image,Mean,Points,25,'light')
rank_region(Points,Textur,15,15,30)
gen_circle(Mask,10,10,3)
opening(Textur,Mask,Seg)

示例(C)

read_image(&Image,"monkey");
mean_image(Image,&Mean,5,5);
dyn_threshold(Image,Mean,&Points,25,"light");
rank_region(Points,Textur,15,15,30);
gen_circle(&Mask,10,10,3);
opening(Textur,Mask,&Seg);

示例(HDevelop)

read_image(Image,'monkey')
mean_image(Image,Mean,5,5)
dyn_threshold(Image,Mean,Points,25,'light')
rank_region(Points,Textur,15,15,30)
gen_circle(Mask,10,10,3)
opening(Textur,Mask,Seg)

示例(HDevelop)

read_image(Image,'monkey')
mean_image(Image,Mean,5,5)
dyn_threshold(Image,Mean,Points,25,'light')
rank_region(Points,Textur,15,15,30)
gen_circle(Mask,10,10,3)
opening(Textur,Mask,Seg)

示例(HDevelop)

read_image(Image,'monkey')
mean_image(Image,Mean,5,5)
dyn_threshold(Image,Mean,Points,25,'light')
rank_region(Points,Textur,15,15,30)
gen_circle(Mask,10,10,3)
opening(Textur,Mask,Seg)

复杂度

Let F be the area of the input region. Then the runtime complexity is O(F * 8).

结果

rank_regionrank_regionRankRegionRankRegionRankRegionrank_region 在所有参数正确时返回 2 ( H_MSG_TRUE )。当输入为空(未指定区域)时则可设置行为通过 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>) 以及输入区域为空时可设置行为通过 set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)。如有必要,则抛出异常。

可能的前趋

thresholdthresholdThresholdThresholdThresholdthreshold, connectionconnectionConnectionConnectionConnectionconnection, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, pouringpouringPouringPouringPouringpouring, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNormclass_ndim_norm

可能的后继

select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region

替代

closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1ClosingRectangle1closing_rectangle1, expand_regionexpand_regionExpandRegionExpandRegionExpandRegionexpand_region

另见

rank_imagerank_imageRankImageRankImageRankImagerank_image, mean_imagemean_imageMeanImageMeanImageMeanImagemean_image

模块

基础