[Halcon]算子学习

1.基于blob分析的算子学习

1.1 dev_close_window(Operator)

dev_close_window — Close the active graphics window.

关闭当前激活窗口

 

1.2 dev_open_window (Operator)

dev_open_window — Open a new graphics window.

创建新的图形窗口

dev_open_window( : : Row, Column, Width, Height, Background : WindowHandle)

 

The origin of the graphics window is the upper left corner with the coordinates (0,0). The x values (columns) increase from left to right, the y values (rows) increase from top to bottom. 

图像窗口以左上角为0,0起点,X参数为列,从左至右;Y参数为行,从上至下.

 

eg:

dev_open_window (0, 0, 768, 576, 'black', WindowHandle)

 

1.3 dev_update_off (Procedure)

dev_update_off — Switch dev_update_pc, dev_update_var and dev_update_window to 'off'.

将dev_update_pc, dev_update_var and dev_update_window关闭

dev_update_pc — Switches the update of the PC during program execution on or off.

在程序执行过程中选择将PC更新操作打开或关闭

dev_update_var — Switches the update of the variable window during program execution on or off.

在程序执行过程中选择将参数窗口更新操作打开或关闭

dev_update_window — Switches the automatic output of iconic output objects into the graphics window during program execution on or off.

在程序执行过程中选择将标志性输出目标自动载入图形窗口操作打开或关闭

 

1.4 dev_set_draw (Operator)

Name

dev_set_draw — Define the region fill mode.

定义区域填充模式

 If DrawMode is set to 'fill', regions are displayed filled, if set to 'margin', only contours are displayed. In the 'margin' mode, the appearance of the contours can be affected by dev_set_line_width, set_line_approx and set_line_style.

填充模式为fill,则区域被填充.

填充模式为margin,则区域只有轮廓被显示.该模式的轮廓外形受线的设置影响.

 

1.5 dev_set_line_width (Operator)

Name

dev_set_line_width — Define the line width for region contour output.

定义输出轮廓的线宽

 

1.6  set_display_font (Procedure)

设置字体独立于操作系统

eg:set_display_font (WindowHandle, 14, 'mono', 'true', 'false')

 

1.7  read_image (Operator)

Name

read_image — Read an image with different file formats.

读取不同文件格式的图片

Besides the HALCON formats, TIFF, GIF, BMP, JPEG, JPEG-2000, JPEG-XR, PNG, PCX, SUN-Raster, PGM, PPM, PBM, and XWD files can also be read.

 

1.8  threshold (Operator)

Name

threshold — Segment an image using global threshold.

使用全局阈值分割图像

Signature

threshold(Image : Region : MinGray, MaxGray : )

eg:threshold(EdgeAmp,Seg,50,255)

 

1.9  connection (Operator)

Name

connection — Compute connected components of a region.

计算区域的连通域,邻域默认为8

eg:connection(Light,Many)

 

2.0  area_center (Operator)

Name

area_center — Area and center of regions.

计算连通域的面积和中心

Signature

area_center(Regions : : : Area, Row, Column)

eg:area_center (Particles, Area, Row, Column)

 

2.1  bin_threshold (Operator)

Name

bin_threshold — Segment an image using an automatically determined threshold.

自动全局阈值方法(多次平滑直方图-寻找峰值-峰谷作为阈值)

 

2.2  gray_histo (Operator)

Name

gray_histo — Calculate the gray value distribution.

计算灰度直方图

eg:gray_histo (Image, Image, AbsoluteHisto, RelativeHisto)

 

2.3  dyn_threshold (Operator)

Name

dyn_threshold — Segment an image using a local threshold.

局部动态阈值分割图像

eg:mean_image(Image,Mean,D*2+1,D*2+1)

dyn_threshold(Image,Mean,Seg,5,'light')
connection(Seg,Regions)

适用性:

背景不均一,无法确定全局阈值

目标比背景局部亮一些或暗一些

需要通过邻域找到一个合适的阈值进行分割

 

邻域的选择通常使用平滑滤波算法进行,滤波器mask尺寸要大于要分割的各个区域

然后选择大于邻域或小于邻域的像素,即‘light’or‘dark’

 

2.4  watersheds (Operator)

分水岭算法

Name

watersheds — Extract watersheds and basins from an image.

提取图像的分水岭和盆地

 

watersheds_threshold (Operator)

Name

watersheds_threshold — Extract watershed basins from an image using a threshold.

使用阈值将图像的盆地区域合并提取

 

2.5  select_shape (Operator)

Name

select_shape — Choose regions with the aid of shape features.

选择形状

Signature

select_shape(Regions : SelectedRegions : Features, Operation, Min, Max : )

Typical range of values: 0.0 ≤ Min ≤ 99999.0

Typical range of values: 0.0 ≤ Max ≤ 99999.0

eg:select_shape(S2,Eyes,['area','anisometry'],'and',[500,1.0],[50000,1.7])

 

2.6  opening_circle (Operator)

Name

opening_circle — Open a region with a circular structuring element.

使用圆形结构元素对区域进行开运算

eg:opening_circle(H,Large,20)

 

同理opening_rectangle1, closing_rectangle1

 

2.7  difference (Operator)

Name

difference — Calculate the difference of two regions.

计算两个区域的差

eg:difference(X,Y,RegionDifference)

 

2.8  intersection (Operator)

Name

intersection — Calculate the intersection of two regions.

计算两区域的交

 

2.9  union1 (Operator)

Name

union1 — Return the union of all input regions.

将区域合并

 

3.1  fill_up (Operator)

Name

fill_up — Fill up holes in regions.

填充区域的空洞

 

3.2  boundary (Operator)

Name

boundary — Reduce a region to its boundary.

将区域减为边界

 

3.3  skeleton (Operator)

Name

skeleton — Compute the skeleton of a region.

计算一个区域的骨架

 

3.4  形态学算子

(1)腐蚀、膨胀、开、闭运算

erosion  dilation  opening  closing

(2)顶帽、低帽、击中击不中、边缘

top-hat  bottom-hat  hit-or-miss  boundary

(3)先开后闭、修剪、添加击中击不中结果、移除击中击不中结果、计算区域骨架

fitting  pruning  thickening  thinning  skeleton

 

3.5  特征提取

area_center, smallest_rectangle1, smallest_rectangle2,
compactness, eccentricity, elliptic_axis, area_center_gray,
intensity, min_max_gray

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值