ClassesClasses | | Operators

bottom_hatbottom_hatBottomHatBottomHat (Operator)

Name

bottom_hatbottom_hatBottomHatBottomHat — Compute the bottom hat of regions.

Signature

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)

Description

bottom_hatbottom_hatBottomHatBottomHatBottomHat computes the closingclosingClosingClosingClosing of RegionRegionRegionRegionregion with StructElementStructElementStructElementStructElementstructElement. The difference between the result of the closing and the original region is called the bottom hat. In contrast to closingclosingClosingClosingClosing, which merges regions under certain circumstances, bottom_hatbottom_hatBottomHatBottomHatBottomHat computes the regions generated by such a merge.

The position of StructElementStructElementStructElementStructElementstructElement is meaningless, since a closing operation is invariant with respect to the choice of the reference point.

Structuring elements (StructElementStructElementStructElementStructElementstructElement) can be generated with operators such as gen_circlegen_circleGenCircleGenCircleGenCircle, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1, gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2, gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipse, draw_regiondraw_regionDrawRegionDrawRegionDrawRegion, gen_region_polygongen_region_polygonGenRegionPolygonGenRegionPolygonGenRegionPolygon, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPoints, etc.

Execution Information

Parameters

RegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHobject

Regions to be processed.

StructElementStructElementStructElementStructElementstructElement (input_object)  region objectHRegionHRegionHobject

Structuring element (position independent).

RegionBottomHatRegionBottomHatRegionBottomHatRegionBottomHatregionBottomHat (output_object)  region(-array) objectHRegionHRegionHobject *

Result of the bottom hat operator.

Example (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)

Example (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);

Example (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)

Example (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)

Example (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)

Result

bottom_hatbottom_hatBottomHatBottomHatBottomHat returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty or no input region can be set via:

Otherwise, an exception is raised.

Possible Predecessors

thresholdthresholdThresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionConnectionConnection, union1union1Union1Union1Union1, watershedswatershedsWatershedsWatershedsWatersheds, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNorm, gen_circlegen_circleGenCircleGenCircleGenCircle, gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipse, gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1GenRectangle1, gen_rectangle2gen_rectangle2GenRectangle2GenRectangle2GenRectangle2, draw_regiondraw_regionDrawRegionDrawRegionDrawRegion, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPoints, gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledGenRegionPolygonFilled

Possible Successors

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomain, select_shapeselect_shapeSelectShapeSelectShapeSelectShape, area_centerarea_centerAreaCenterAreaCenterAreaCenter, connectionconnectionConnectionConnectionConnection

Alternatives

closingclosingClosingClosingClosing, differencedifferenceDifferenceDifferenceDifference

See also

top_hattop_hatTopHatTopHatTopHat, gray_bothatgray_bothatGrayBothatGrayBothatGrayBothat, openingopeningOpeningOpeningOpening

Module

Foundation


ClassesClasses | | Operators