rank_regionrank_regionRankRegionRankRegionrank_region (算子名称)

名称

rank_regionrank_regionRankRegionRankRegionrank_region — Rank operator for regions.

参数签名

rank_region(区域 : RegionCount : Width, Height, Number : )

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

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

void RankRegion(const HObject& 区域, 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 区域, out HObject regionCount, HTuple width, HTuple height, HTuple number)

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

def rank_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 区域区域区域区域区域区域 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.

运行信息

参数表

区域区域区域区域区域区域 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Region(s) to be transformed.

RegionCountRegionCountRegionCountRegionCountregionCountregion_count (output_object)  region(-array) objectHRegionHObjectHRegionHobject *

Resulting region(s).

WidthWidthWidthWidthwidthwidth (input_control)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the filter mask.

Default: 15

Suggested values: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21

Value range: 3 ≤ Width Width Width Width width width ≤ 511 (lin)

Minimum increment: 2

Recommended increment: 2

Restriction: Width >= 3 && odd(Width)

HeightHeightHeightHeightheightheight (input_control)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the filter mask.

Default: 15

Suggested values: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21

Value range: 3 ≤ Height Height Height Height height height ≤ 511 (lin)

Minimum increment: 2

Recommended increment: 2

Restriction: Height >= 3 && odd(Height)

NumberNumberNumberNumbernumbernumber (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimum number of points lying within the filter mask.

Default: 70

Suggested values: 5, 10, 20, 40, 60, 80, 90, 120, 150, 200

Value range: 1 ≤ Number Number Number Number number number ≤ 1000 (lin)

Minimum increment: 1

Recommended increment: 10

Restriction: 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)

Complexity

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

结果

rank_regionrank_regionRankRegionRankRegionRankRegionrank_region returns 2 ( H_MSG_TRUE) if all parameters are correct. The behavior in case of empty input (no regions given) can be set via 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>) and the behavior in case of an empty input region via 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>). If necessary, an exception is raised.

可能的前置算子

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

模块

Foundation