dilation_rectangle1 dilation_rectangle1 DilationRectangle1 DilationRectangle1 dilation_rectangle1 (算子名称)
名称
dilation_rectangle1 dilation_rectangle1 DilationRectangle1 DilationRectangle1 dilation_rectangle1 — Dilate a region with a rectangular structuring element.
参数签名
def dilation_rectangle1 (区域 : HObject, width : int, height : int) -> HObject
描述
dilation_rectangle1 dilation_rectangle1 DilationRectangle1 DilationRectangle1 DilationRectangle1 dilation_rectangle1 applies a dilation with a rectangular
structuring element to the input regions 区域 区域 区域 区域 区域 区域 . The size
of the structuring rectangle is Width Width Width Width width width x
Height Height Height Height height height . 该算子 results in enlarged regions, and the
holes smaller than the rectangular mask in the interior of the
regions are closed.
dilation_rectangle1 dilation_rectangle1 DilationRectangle1 DilationRectangle1 DilationRectangle1 dilation_rectangle1 is a very fast operation because the
height of the rectangle enters only logarithmically into the runtime
complexity, while the width does not enter at all. This leads to
excellent runtime efficiency, even in the case of very large
rectangles (edge length > 100).
注意
dilation_rectangle1 dilation_rectangle1 DilationRectangle1 DilationRectangle1 DilationRectangle1 dilation_rectangle1 is applied to each input region
separately. If gaps between different regions are to be closed,
union1 union1 Union1 Union1 Union1 union1 or union2 union2 Union2 Union2 Union2 union2 has to be called first.
To enlarge a region by the same amount in all directions,
Width Width Width Width width width and Height Height Height Height height height must be odd. If this is not the
case, the region is dilated by a larger amount at the right or at
the bottom, respectively, than at the left or at the top.
运行信息
多线程类型:可重入(与非独占操作符并行运行)。
多线程作用域:全局(可以从任何线程调用)。
在元组级别自动并行化。
参数表
区域 区域 区域 区域 区域 区域 (input_object) region(-array) → object HRegion HObject HRegion Hobject
Regions to be dilated.
RegionDilation RegionDilation RegionDilation RegionDilation regionDilation region_dilation (output_object) region(-array) → object HRegion HObject HRegion Hobject *
Dilated regions.
Width Width Width Width width width (input_control) extent.x → HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Width of the structuring rectangle.
Default:
11
Suggested values:
1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201
Value range:
1
≤
Width
Width
Width
Width
width
width
≤
511 (lin)
Minimum increment:
1
Recommended increment:
10
Height Height Height Height height height (input_control) extent.y → HTuple int HTuple Htuple (integer) (int / long) (Hlong ) (Hlong )
Height of the structuring rectangle.
Default:
11
Suggested values:
1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201
Value range:
1
≤
Height
Height
Height
Height
height
height
≤
511 (lin)
Minimum increment:
1
Recommended increment:
10
Example (C++ (HALCON 5.0-10.0))
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_rectangle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = after segmentation " << endl;
HByteImage img("monkey");
HWindow w;
HRegionArray regs = (img >= 220).Connection();
HRegionArray dilreg = regs.DilationRectangle1 (2, 4);
img.Display (w); w.Click ();
w.SetColor ("blue"); dilreg.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
例程 (C)
threshold(Image,&Light,220.0,255.0);
dilation_rectangle1(Light,&Wide,50,50);
set_color(WindowHandle,"red");
disp_region(Wide,WindowHandle);
set_color(WindowHandle,"white");
disp_region(Light,WindowHandle);
Example (C++ (HALCON 5.0-10.0))
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_rectangle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = after segmentation " << endl;
HByteImage img("monkey");
HWindow w;
HRegionArray regs = (img >= 220).Connection();
HRegionArray dilreg = regs.DilationRectangle1 (2, 4);
img.Display (w); w.Click ();
w.SetColor ("blue"); dilreg.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
Example (C++ (HALCON 5.0-10.0))
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_rectangle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = after segmentation " << endl;
HByteImage img("monkey");
HWindow w;
HRegionArray regs = (img >= 220).Connection();
HRegionArray dilreg = regs.DilationRectangle1 (2, 4);
img.Display (w); w.Click ();
w.SetColor ("blue"); dilreg.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
Example (C++ (HALCON 5.0-10.0))
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif
#include "HalconCpp.h"
main()
{
cout << "Reproduction of 'dilation_rectangle ()'" << endl;
cout << "First = original image " << endl;
cout << "Blue = after dilation " << endl;
cout << "Red = after segmentation " << endl;
HByteImage img("monkey");
HWindow w;
HRegionArray regs = (img >= 220).Connection();
HRegionArray dilreg = regs.DilationRectangle1 (2, 4);
img.Display (w); w.Click ();
w.SetColor ("blue"); dilreg.Display (w); w.Click ();
w.SetColor ("red"); regs.Display (w); w.Click ();
return(0);
}
Complexity
Let F1 be the area of an input region and H be the height of the
rectangle. Then the runtime complexity for one region is:
结果
dilation_rectangle1 dilation_rectangle1 DilationRectangle1 DilationRectangle1 DilationRectangle1 dilation_rectangle1 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.
可能的前置算子
threshold threshold Threshold Threshold Threshold threshold ,
regiongrowing regiongrowing Regiongrowing Regiongrowing Regiongrowing regiongrowing ,
connection connection Connection Connection Connection connection ,
union1 union1 Union1 Union1 Union1 union1 ,
watersheds watersheds Watersheds Watersheds Watersheds watersheds ,
class_ndim_norm class_ndim_norm ClassNdimNorm ClassNdimNorm ClassNdimNorm class_ndim_norm
可能的后置算子
reduce_domain reduce_domain ReduceDomain ReduceDomain ReduceDomain reduce_domain ,
select_shape select_shape SelectShape SelectShape SelectShape select_shape ,
area_center area_center AreaCenter AreaCenter AreaCenter area_center ,
connection connection Connection Connection Connection connection
可替代算子
minkowski_add1 minkowski_add1 MinkowskiAdd1 MinkowskiAdd1 MinkowskiAdd1 minkowski_add1 ,
minkowski_add2 minkowski_add2 MinkowskiAdd2 MinkowskiAdd2 MinkowskiAdd2 minkowski_add2 ,
expand_region expand_region ExpandRegion ExpandRegion ExpandRegion expand_region ,
dilation1 dilation1 Dilation1 Dilation1 Dilation1 dilation1 ,
dilation2 dilation2 Dilation2 Dilation2 Dilation2 dilation2 ,
dilation_circle dilation_circle DilationCircle DilationCircle DilationCircle dilation_circle
参考其它
gen_rectangle1 gen_rectangle1 GenRectangle1 GenRectangle1 GenRectangle1 gen_rectangle1 ,
gen_region_polygon_filled gen_region_polygon_filled GenRegionPolygonFilled GenRegionPolygonFilled GenRegionPolygonFilled gen_region_polygon_filled
模块
Foundation