HALCON示例程序obj_diff.hdev算子obj_diff 的使用

示例程序源码(加注释)

  • 关于显示类函数解释
    read_image (Image, ‘particle’)
  • 二值化
    threshold (Image, Region, 57, 255)
  • 分割连通域
    connection (Region, ConnectedRegions)
    dev_close_window ()
    get_image_size (Image, Width, Height)
    dev_open_window_fit_image (Image, 0, 0, Width, Height, WindowHandle)
    set_display_font (WindowHandle, 16, ‘mono’, ‘true’, ‘false’)
    dev_set_draw (‘fill’)
    dev_set_colored (6)
  • 使用区域列坐标
    select_shape (ConnectedRegions, LeftRegions, ‘column’, ‘and’, 0.0, 256.0)
  • 求取两个对象不同
    obj_diff (ConnectedRegions, LeftRegions, RightRegions)
    dev_clear_window ()
    dev_display (RightRegions)
    disp_message (WindowHandle, ‘Difference of all regions and\nleft hand side regions:\nRight hand side regions’, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowHandle, ‘black’, ‘true’)
    stop ()
  • 一个空区域与一个区域的不同
    gen_empty_obj (EmptyObject)
    obj_diff (ConnectedRegions, EmptyObject, ObjectsDiff)
    dev_clear_window ()
    dev_display (ObjectsDiff)
    disp_message (WindowHandle, ‘Difference of all regions and\nan empty object:\nAll regions’, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowHandle, ‘black’, ‘true’)
    stop ()
    obj_diff (EmptyObject, LeftRegions, ObjectsDiff)
    dev_clear_window ()
    dev_display (ObjectsDiff)
    disp_message (WindowHandle, ‘Difference of an empty object\nand any other object:\nAn empty object’, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowHandle, ‘black’, ‘true’)
    stop ()
  • 图片与图片不在同一对象下,所以完全不同
    read_image (SameImage, ‘particle’)
    obj_diff (Image, SameImage, ObjectsDiff)
    dev_clear_window ()
    dev_display (ObjectsDiff)
    disp_message (WindowHandle, ‘Difference of an image and\nthe same image reloaded:\nThe original image’, ‘window’, 12, 12, ‘black’, ‘true’)
    disp_continue_message (WindowHandle, ‘black’, ‘true’)
    stop ()
  • xld轮廓与图片一样
    gen_contour_polygon_xld (Contour, [50,150,250,250,250], [50,50,50,150,250])
    concat_obj (Region, Contour, RegionAndXLD)
    concat_obj (Region, Image, ImageAndRegion)
    obj_diff (RegionAndXLD, ImageAndRegion, ObjectsDiff)
    dev_clear_window ()
    dev_display (ObjectsDiff)
    disp_message (WindowHandle, ‘Difference of mixed type objects’, ‘window’, 12, 12, ‘black’, ‘true’)

处理思路

这个例子是主要讲解了obj_diff 算子的应用。

后记

大家有什么问题可以向我提问哈,我看到了第一时间回复,希望在学习的路上多多结交良师益友。

HALCON示例程序obj_diff.hdev算子obj_diff 的使用相关推荐

  1. HALCON示例程序train_characters_ocr.hdev使用SVM分类器训练字体

    HALCON示例程序train_characters_ocr.hdev使用SVM分类器训练字体 小哥哥小姐姐觉得有用点个赞呗! 示例程序源码(加注释) 蓝色字体均为算子解释链接,可以前往查看解答 关于 ...

  2. HALCON示例程序sequence_diff.hdev通过两张连续图像进行车辆流量监控

    小哥哥小姐姐觉得有用点个赞呗! HALCON示例程序sequence_diff.hdev通过两张连续图像进行车辆流量监控 示例程序源码(加注释) 关于显示类函数解释 Thresh := 35 dev_ ...

  3. HALCON示例程序pcb_inspection.hdev检测pcb印刷缺陷

    HALCON示例程序pcb_inspection.hdev检测pcb印刷缺陷 示例程序源码(加注释) 关于显示类函数解释 read_image (Image, 'pcb') dev_close_win ...

  4. HALCON示例程序measure_screw.hdev螺纹尺寸测量

    HALCON示例程序measure_screw.hdev螺纹尺寸测量 示例程序源码(加注释) 关于显示类函数解释 dev_update_off () read_image (Image, 'screw ...

  5. HALCON示例程序measure_circuit_width_lines_gauss.hdev电路板线宽检测

    HALCON示例程序measure_circuit_width_lines_gauss.hdev电路板线宽检测 示例程序源码(加注释) 关于显示类函数解释 dev_update_off () dev_ ...

  6. HALCON示例程序measure_circles.hdev测量圆的半径

    HALCON示例程序measure_circles.hdev测量圆的半径 示例程序源码(加注释) 关于显示类函数解释 dev_update_off () read_image (Image, 'cir ...

  7. HALCON示例程序measure_chip.hdev芯片封装检测

    HALCON示例程序measure_chip.hdev芯片封装检测 示例程序源码(加注释) 关于显示类函数解释 dev_update_off () read_image (Image, 'die_on ...

  8. HALCON示例程序measure_ball_bond.hdev电路板焊点位置测量

    HALCON示例程序measure_ball_bond.hdev电路板焊点位置测量 示例程序源码(加注释) 关于显示类函数解释 dev_update_off () dev_close_window ( ...

  9. HALCON示例程序inspect_bottle_mouth.hdev玻璃瓶口缺陷检测

    HALCON示例程序inspect_bottle_mouth.hdev玻璃瓶口缺陷检测 示例程序源码(加注释) 定义变量并初始化 SmoothX := 501 ThresholdOffset := 2 ...

最新文章

  1. linux部署项目文档,Linux系统部署项目
  2. UIProgressView(进度条控件)
  3. 2015年11月 广州深圳 MVP 线下活动
  4. IT趣闻:世界知名IT公司名字由来
  5. 网络:forward和redirect的区别
  6. PostgreSQL统计信息的几个重要视图
  7. form表单重复提交
  8. noip2013 day2
  9. 计算机四级网络工程师题目,计算机四级网络工程师题库
  10. ue4 visual studio 好用的插件Visual AssistX 10.9.2301.0 破解版
  11. 干货丨网站域名后缀都是什么含义?
  12. 交流电桥———实验原理
  13. 扫码反馈,“码”上回复:二维码在业主意见反馈中的应用
  14. 要成为游戏开发人员需要有以下书籍(二)
  15. 【Android 教程系列第 27 篇】如何使用 Keytool 工具生成 keystore 签名文件
  16. dataframe python,使用pandas dataframe python创建实时更新图
  17. 甘肃省全国计算机等级考试(NCRE)报名
  18. 关于centos7.8.2安装mysql5.6.38的奇遇
  19. python在软件测试中的应用_Python在软件测试中的应用
  20. 好工具推荐系列:截图抓图软件Snipaste/HprSnap6

热门文章

  1. eval函数的工作原理
  2. ubuntu安装配置elasticSearch(vagrant)
  3. hdu1428(spfa与记忆化搜索)
  4. [转]第一章 Windows Shell是什么 【来源:http://blog.csdn.net/wangqiulin123456/article/details/7987862】...
  5. 设置安全性根据Folder关联的条目模板设置上传文档安全性
  6. javascript作用域容易记错的两个地方
  7. STM32堆栈溢出的问题
  8. java调用、执行groovy代码
  9. HTTP 错误 404 - 文件或目录未找到 - 最终解决方法
  10. MySQL 5.7.11 重置root密码