opening_seg opening_seg OpeningSeg OpeningSeg (Operator)
Name
opening_seg opening_seg OpeningSeg OpeningSeg
— Separate overlapping regions.
Warning
opening_seg opening_seg OpeningSeg OpeningSeg OpeningSeg
is obsolete and is only provided for
reasons of backward compatibility.
Signature
Description
The opening_seg opening_seg OpeningSeg OpeningSeg OpeningSeg
operation is defined as a sequence of
the following operators: erosion1 erosion1 Erosion1 Erosion1 Erosion1
,
connection connection Connection Connection Connection
and dilation1 dilation1 Dilation1 Dilation1 Dilation1
(see example).
Only one iteration is done in erosion1 erosion1 Erosion1 Erosion1 Erosion1
and
dilation1 dilation1 Dilation1 Dilation1 Dilation1
.
opening_seg opening_seg OpeningSeg OpeningSeg OpeningSeg
serves to separate overlapping regions whose
area of overlap is smaller than StructElement StructElement StructElement StructElement structElement
. It should
be noted that the resulting regions can overlap without actually
merging (see expand_region expand_region ExpandRegion ExpandRegion ExpandRegion
). opening_seg opening_seg OpeningSeg OpeningSeg OpeningSeg
uses the
center of gravity as the reference point of the structuring element.
Structuring elements (StructElement StructElement StructElement StructElement structElement
) can be generated
with operators such as gen_circle gen_circle GenCircle GenCircle GenCircle
, gen_rectangle1 gen_rectangle1 GenRectangle1 GenRectangle1 GenRectangle1
,
gen_rectangle2 gen_rectangle2 GenRectangle2 GenRectangle2 GenRectangle2
, gen_ellipse gen_ellipse GenEllipse GenEllipse GenEllipse
,
draw_region draw_region DrawRegion DrawRegion DrawRegion
, gen_region_polygon gen_region_polygon GenRegionPolygon GenRegionPolygon GenRegionPolygon
,
gen_region_points gen_region_points GenRegionPoints GenRegionPoints GenRegionPoints
, 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
Region Region Region Region region
(input_object) region(-array) →
object HRegion HRegion Hobject
Regions to be opened.
StructElement StructElement StructElement StructElement structElement
(input_object) region →
object HRegion HRegion Hobject
Structuring element (position-invariant).
RegionOpening RegionOpening RegionOpening RegionOpening regionOpening
(output_object) region-array →
object HRegion HRegion Hobject *
Opened regions.
Example (HDevelop)
* Simulation of opening_seg
* opening_seg(Region,StructElement,RegionOpening):
erosion1(Region,StructElement,H1,1)
connection(H1,H2)
dilation1(H2,StructElement,RegionOpening,1)
Example (C)
/* Simulation of opening_seg */
my_opening_seg(Hobject Region, Hobject StructElement, Hobject *Opening)
{
Hobject H1,H2;
erosion1(Region,StructElement,&H1,1);
connection(H1,&H2);
dilation1(H2,StructElement,Opening,1);
}
/* separation of circular objects */
gen_random_regions(&Regions,"circle",8.5,10.5,0.0,0.0,0.0,0.0,400,512,512);
union1(Regions,&UnionReg);
gen_circle(&Mask,100,100,8.5);
opening_seg(UnionReg,Mask,&RegionsNew);
Example (HDevelop)
* Simulation of opening_seg
* opening_seg(Region,StructElement,RegionOpening):
erosion1(Region,StructElement,H1,1)
connection(H1,H2)
dilation1(H2,StructElement,RegionOpening,1)
Example (HDevelop)
* Simulation of opening_seg
* opening_seg(Region,StructElement,RegionOpening):
erosion1(Region,StructElement,H1,1)
connection(H1,H2)
dilation1(H2,StructElement,RegionOpening,1)
Example (HDevelop)
* Simulation of opening_seg
* opening_seg(Region,StructElement,RegionOpening):
erosion1(Region,StructElement,H1,1)
connection(H1,H2)
dilation1(H2,StructElement,RegionOpening,1)
Complexity
Let F1 be the area of the input region, and F2 be the area of
the structuring element. Then the runtime complexity for one region
is:
Result
opening_seg opening_seg OpeningSeg OpeningSeg OpeningSeg
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>)
empty region:
set_system('empty_region_result',<RegionResult>)
Otherwise, an exception is raised.
Possible Predecessors
threshold threshold Threshold Threshold Threshold
,
regiongrowing regiongrowing Regiongrowing Regiongrowing Regiongrowing
,
connection connection Connection Connection Connection
,
union1 union1 Union1 Union1 Union1
,
watersheds watersheds Watersheds Watersheds Watersheds
,
class_ndim_norm class_ndim_norm ClassNdimNorm ClassNdimNorm ClassNdimNorm
,
gen_circle gen_circle GenCircle GenCircle GenCircle
,
gen_ellipse gen_ellipse GenEllipse GenEllipse GenEllipse
,
gen_rectangle1 gen_rectangle1 GenRectangle1 GenRectangle1 GenRectangle1
,
gen_rectangle2 gen_rectangle2 GenRectangle2 GenRectangle2 GenRectangle2
,
draw_region draw_region DrawRegion DrawRegion DrawRegion
,
gen_region_points gen_region_points GenRegionPoints GenRegionPoints GenRegionPoints
,
gen_region_polygon_filled gen_region_polygon_filled GenRegionPolygonFilled GenRegionPolygonFilled GenRegionPolygonFilled
Possible Successors
expand_region expand_region ExpandRegion ExpandRegion ExpandRegion
,
reduce_domain reduce_domain ReduceDomain ReduceDomain ReduceDomain
,
select_shape select_shape SelectShape SelectShape SelectShape
,
area_center area_center AreaCenter AreaCenter AreaCenter
,
connection connection Connection Connection Connection
Alternatives
erosion1 erosion1 Erosion1 Erosion1 Erosion1
,
connection connection Connection Connection Connection
,
dilation1 dilation1 Dilation1 Dilation1 Dilation1
Module
Foundation