下载此文档

Halcon表面划伤检测实例.doc


文档分类:行业资料 | 页数:约10页 举报非法文档有奖
1/10
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/10 下载此文档
文档列表 文档介绍
Halcon表面划伤检测实例
分类: Halcon 机器视觉 2013-05-04 10:36 216人阅读 评论(0) 收藏 举报
* : extraction of surface scratches via local thresholding and morphological post-processing
原图为:
 *关闭活动图形窗口
 dev_close_window ()
* 在程序执行中指定输出行为为 off。
 dev_update_window ('off')
 * ****
* step: acquire image 步骤:获取图像
 * ****读入文件名为 'surface_scratch' 的图像到Image
 read_image (Image, 'surface_scratch')
 get_image_size (Image, Width, Height)
*打开一个和Image宽高比一致的图像窗口
 dev_open_window_fit_image (Image, 0, 0, Width, Width, WindowID)
*设置 窗口字体大小为 12,字体类型为Courier,粗体不倾斜字体。
 set_display_font (WindowID, 12, 'Courier', 'true', 'false')
*设置填充模式为'margin'
 dev_set_draw ('margin')
*定义输出轮廓线宽为4
dev_set_line_width (4)
*显示Image到窗口
 dev_display (Image)
*WindowID窗口使用黑色字体在一个方框内显示按"F5"继续运行 字体,并注册F5消息处理
 disp_continue_message (WindowID, 'black', 'true')
 stop ()
 * ****
 * step: segment image 步骤:图像分割
 * ****
 * -> using a local threshold 使用局部阈值
* 对Image进行7*7均值滤波
 mean_image (Image, ImageMean, 7, 7)
*********************************************************************
*得到的图像为:
 
*
*
*
*用均值滤波图像作为二值化阈值图像,返回小于灰度值小于该点阈值-5的图像。
 dyn_threshold (Image, ImageMean, DarkPixels, 5, 'dark')
***************************************
****得到的区域为:
 * -> extract connected components 提取连通分量
*由分割出来的DarkPixels获得连通区域到ConnectedRegions
*******得到的连通区域为:
 connection (DarkPixels, Connecte

Halcon表面划伤检测实例 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数10
  • 收藏数0 收藏
  • 顶次数0
  • 上传人文库旗舰店
  • 文件大小701 KB
  • 时间2020-12-06