bottom_hatbottom_hatBottomHatBottomHatbottom_hat (Operator)
Name
bottom_hatbottom_hatBottomHatBottomHatbottom_hat
— Compute the bottom hat of regions.
Signature
Description
bottom_hatbottom_hatBottomHatBottomHatBottomHatbottom_hat
computes the closingclosingClosingClosingClosingclosing
of
RegionRegionRegionRegionregionregion
with StructElementStructElementStructElementStructElementstructElementstruct_element
. The difference
between the result of the closing and the original region is called
the bottom hat. In contrast to closingclosingClosingClosingClosingclosing
, which merges
regions under certain circumstances, bottom_hatbottom_hatBottomHatBottomHatBottomHatbottom_hat
computes
the regions generated by such a merge.
The position of StructElementStructElementStructElementStructElementstructElementstruct_element
is meaningless, since a
closing 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.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Parameters
RegionRegionRegionRegionregionregion
(input_object) region(-array) →
objectHRegionHObjectHRegionHobject
Regions to be processed.
StructElementStructElementStructElementStructElementstructElementstruct_element
(input_object) region →
objectHRegionHObjectHRegionHobject
Structuring element (position independent).
RegionBottomHatRegionBottomHatRegionBottomHatRegionBottomHatregionBottomHatregion_bottom_hat
(output_object) region(-array) →
objectHRegionHObjectHRegionHobject *
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_hatBottomHatBottomHatBottomHatbottom_hat
returns 2 (
H_MSG_TRUE)
if all parameters are correct.
The behavior in case of empty or no input region can be set via:
-
no region:
set_system('no_object_result',<RegionResult>)set_system("no_object_result",<RegionResult>)SetSystem("no_object_result",<RegionResult>)SetSystem("no_object_result",<RegionResult>)SetSystem("no_object_result",<RegionResult>)set_system("no_object_result",<RegionResult>)
-
empty region:
set_system('empty_region_result',<RegionResult>)set_system("empty_region_result",<RegionResult>)SetSystem("empty_region_result",<RegionResult>)SetSystem("empty_region_result",<RegionResult>)SetSystem("empty_region_result",<RegionResult>)set_system("empty_region_result",<RegionResult>)
Otherwise, an exception is raised.
Possible Predecessors
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
Possible Successors
reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain
,
select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape
,
area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center
,
connectionconnectionConnectionConnectionConnectionconnection
Alternatives
closingclosingClosingClosingClosingclosing
,
differencedifferenceDifferenceDifferenceDifferencedifference
See also
top_hattop_hatTopHatTopHatTopHattop_hat
,
gray_bothatgray_bothatGrayBothatGrayBothatGrayBothatgray_bothat
,
openingopeningOpeningOpeningOpeningopening
Module
Foundation