bottom_hatbottom_hatBottomHatBottomHatbottom_hat底帽(算子)

名称

bottom_hatbottom_hatBottomHatBottomHatbottom_hat — 计算区域的底帽。

签名

bottom_hat(Region, StructElement : RegionBottomHat : : )

Herror bottom_hat(const Hobject Region, const Hobject StructElement, Hobject* RegionBottomHat)

Herror T_bottom_hat(const Hobject Region, const Hobject StructElement, Hobject* RegionBottomHat)

void BottomHat(const HObject& Region, const HObject& StructElement, HObject* RegionBottomHat)

HRegion HRegion::BottomHat(const HRegion& StructElement) const

static void HOperatorSet.BottomHat(HObject region, HObject structElement, out HObject regionBottomHat)

HRegion HRegion.BottomHat(HRegion structElement)

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

描述

bottom_hatbottom_hatBottomHatBottomHatBottomHatbottom_hat 通过 StructElementStructElementStructElementStructElementstructElementstruct_element 计算 RegionRegionRegionRegionregionregionclosingclosingClosingClosingClosingclosing。闭结果与原始区域之间的差异称为底帽。与在特定情况下合并区域的 closingclosingClosingClosingClosingclosing 不同,bottom_hatbottom_hatBottomHatBottomHatBottomHatbottom_hat 计算由此类合并生成的区域。

StructElementStructElementStructElementStructElementstructElementstruct_element 的位置无关紧要,因为闭操作对参考点的选择具有不变性。

结构元素(StructElementStructElementStructElementStructElementstructElementstruct_element)可通过以下算子生成: gen_circlegen_circleGenCircleGenCircleGenCirclegen_circlegen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1gen_rectangle1gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2gen_rectangle2gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipsegen_ellipsedraw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_regiongen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygonGenRegionPolygongen_region_polygongen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points等。

执行信息

参数

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

待处理区域。

StructElementStructElementStructElementStructElementstructElementstruct_element (输入对象)  region objectHRegionHObjectHRegionHobject

结构元素(位置无关)。

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

底帽算子的结果。

示例(HDevelop)

read_image (Image, 'brake_disk/brake_disk_bike_01')
threshold (Image, Regions, 128, 255)
gen_circle (Circle, 40, 40, 20)
bottom_hat (Regions, Circle, RegionBottomHat)

示例(C)

threshold(Image,&Regions,128.0,255.0);
gen_circle(&Circle,128.0,128.0,16.0);
bottom_hat(Regions,Circle,&RegionBottomHat);
set_color(WindowHandle,"red");
disp_region(Regions,WindowHandle);
set_color(WindowHandle,"green");
disp_region(RegionBottomHat,WindowHandle);

示例(HDevelop)

read_image (Image, 'brake_disk/brake_disk_bike_01')
threshold (Image, Regions, 128, 255)
gen_circle (Circle, 40, 40, 20)
bottom_hat (Regions, Circle, RegionBottomHat)

示例(HDevelop)

read_image (Image, 'brake_disk/brake_disk_bike_01')
threshold (Image, Regions, 128, 255)
gen_circle (Circle, 40, 40, 20)
bottom_hat (Regions, Circle, RegionBottomHat)

示例(HDevelop)

read_image (Image, 'brake_disk/brake_disk_bike_01')
threshold (Image, Regions, 128, 255)
gen_circle (Circle, 40, 40, 20)
bottom_hat (Regions, Circle, RegionBottomHat)

结果

bottom_hatbottom_hatBottomHatBottomHatBottomHatbottom_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

替代

closingclosingClosingClosingClosingclosing, differencedifferenceDifferenceDifferenceDifferencedifference

另见

top_hattop_hatTopHatTopHatTopHattop_hat, gray_bothatgray_bothatGrayBothatGrayBothatGrayBothatgray_bothat, openingopeningOpeningOpeningOpeningopening

模块

基础