top_hattop_hatTopHatTopHattop_hat(算子)

名称

top_hattop_hatTopHatTopHattop_hat — 计算区域的顶帽。

签名

top_hat(Region, StructElement : RegionTopHat : : )

Herror top_hat(const Hobject Region, const Hobject StructElement, Hobject* RegionTopHat)

Herror T_top_hat(const Hobject Region, const Hobject StructElement, Hobject* RegionTopHat)

void TopHat(const HObject& Region, const HObject& StructElement, HObject* RegionTopHat)

HRegion HRegion::TopHat(const HRegion& StructElement) const

static void HOperatorSet.TopHat(HObject region, HObject structElement, out HObject regionTopHat)

HRegion HRegion.TopHat(HRegion structElement)

def top_hat(region: HObject, struct_element: HObject) -> HObject

描述

top_hattop_hatTopHatTopHatTopHattop_hat computes the openingopeningOpeningOpeningOpeningopening of RegionRegionRegionRegionregionregion with StructElementStructElementStructElementStructElementstructElementstruct_element. The difference between the original region and the result of the opening is called the top hat. In contrast to openingopeningOpeningOpeningOpeningopening, which splits regions under certain circumstances, top_hattop_hatTopHatTopHatTopHattop_hat computes the regions removed by such a splitting.

The position of StructElementStructElementStructElementStructElementstructElementstruct_element is meaningless, since an opening operation is invariant with respect to the choice of the reference point.

Structuring elements (StructElementStructElementStructElementStructElementstructElementstruct_element) can be generated with operators such as gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1, gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2, gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipsegen_ellipse, draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygonGenRegionPolygongen_region_polygon, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points, etc.

执行信息

参数

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

待处理区域。

StructElementStructElementStructElementStructElementstructElementstruct_element (输入对象)  region objectHRegionHObjectHRegionHobject

结构元素(位置无关)。

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

Result of the top hat operator.

结果

top_hattop_hatTopHatTopHatTopHattop_hat 在所有参数正确时返回 2 (H_MSG_TRUE)。当输入区域为空或不存在时,其行为可通过以下方式设置:

否则,将抛出异常。

可能的前趋

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection, union1union1Union1Union1Union1union1, watershedswatershedsWatershedsWatershedsWatershedswatersheds, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNormclass_ndim_norm, gen_circlegen_circleGenCircleGenCircleGenCirclegen_circle, gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipsegen_ellipse, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1, gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2, draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points, gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledGenRegionPolygonFilledgen_region_polygon_filled

可能的后继

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center, connectionconnectionConnectionConnectionConnectionconnection

替代

openingopeningOpeningOpeningOpeningopening, differencedifferenceDifferenceDifferenceDifferencedifference

另见

bottom_hatbottom_hatBottomHatBottomHatBottomHatbottom_hat, gray_tophatgray_tophatGrayTophatGrayTophatGrayTophatgray_tophat, openingopeningOpeningOpeningOpeningopening

模块

基础