跟我学机器视觉-HALCON学习例程中文详解-开关引脚测量

  • This example program demonstrates the basic usage of a measure object.

  • Here, the task is to determine the width of and the distance between the

  • pins of a switch.

*本例程演示了如何使用测量工具测量开关的引脚宽度和间距

  • First, read in the image and initialize the program.

**************************打开图像***********************************

read_image (Image, 'bin_switch/bin_switch_1')

get_image_size (Image, Width, Height)

dev_close_window ()

dev_open_window_fit_image (Image, 0, 0, 640, 640, WindowHandle)

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

dev_display (Image)

*显示图片如下

  • Define the rectangular ROI within which the edges will be detected

  • and create the measure.

Row := 390

Column := 380

Phi := rad(-60)

Length1 := 60

Length2 := 10

Interpolation := 'nearest_neighbor'

*************************生成测量矩形ROI**************************************
gen_measure_rectangle2 (Row, Column, Phi, Length1, Length2, Width, Height, Interpolation, MeasureHandle)

*测量矩形位置尺寸如下:

  • Determine all edge pairs that have a negative transition, i.e., edge pairs

  • that enclose dark regions.

Sigma := 0.9

Threshold := 12

Transition := 'negative'

Select := 'all'

*************************************测量边缘对*******************************

measure_pairs (Image, MeasureHandle, Sigma, Threshold, Transition, Select, RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst,
RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, IntraDistance, InterDistance)

  • Visualize the results

dev_display (Image)

dev_set_draw ('margin')

dev_set_color ('black')

*********显示测量矩形ROI**************************************************

gen_rectangle2 (Rectangle, Row, Column, Phi, Length1, Length2)

显示测量的边缘对的尺寸,length1要用ROI的宽度**************************

p_disp_dimensions (RowEdgeFirst, ColumnEdgeFirst, RowEdgeSecond, ColumnEdgeSecond, IntraDistance, InterDistance, Phi, Length2, WindowHandle)

*结果如下:

  • Free the memory that has been allocated for the measure.
    close_measure (MeasureHandle)

跟我学机器视觉-HALCON学习例程中文详解-开关引脚测量的更多相关文章

  1. 跟我学机器视觉-HALCON学习例程中文详解-IC引脚测量

    跟我学机器视觉-HALCON学习例程中文详解-IC引脚测量 Lead Measurement: Example for the application of the measure object in ...

  2. 跟我学机器视觉-HALCON学习例程中文详解-FUZZY检测用于开关引脚测量

    跟我学机器视觉-HALCON学习例程中文详解-FUZZY检测用于开关引脚测量 * This example program demonstrates the basic usage of a fuzz ...

  3. 跟我学机器视觉-HALCON学习例程中文详解-测量圆环脚宽间距

    跟我学机器视觉-HALCON学习例程中文详解-测量圆环脚宽间距 This example program demonstrates the basic usage of a circular meas ...

  4. 跟我学机器视觉-HALCON学习例程中文详解-QQ摄像头读取条码

    跟我学机器视觉-HALCON学习例程中文详解-QQ摄像头读取条码 第一步:插入QQ摄像头,安装好驱动(有的可能免驱动) 第二步:打开HDevelop,点击助手-打开新的Image Acquisitio ...

  5. 《TensorFlow学习指南深度学习系统构建详解》英文PDF+源代码+部分中文PDF

    主要介绍如何使用 TensorFlow 框架进行深度学习系统的构建.涉及卷积神经网络.循环神经网络等核心的技术,并介绍了用于图像数据和文本序列数据的模型.给出了分布式深度学习系统在TensorFlow ...

  6. Nginx配置文件nginx.conf中文详解(转)

    ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_ ...

  7. Nginx中文详解、配置部署及高并发优化

      一.Nginx常用命令: 1. 启动 Nginx          /usr/local/nginx/sbin/nginxpoechant@ubuntu:sudo ./sbin/nginx2. 停 ...

  8. iOS学习之UINavigationController详解与使用(一)添加UIBarButtonItem

    http://blog.csdn.net/totogo2010/article/details/7681879 1.UINavigationController导航控制器如何使用 UINavigati ...

  9. [转]iOS学习之UINavigationController详解与使用(三)ToolBar

    转载地址:http://blog.csdn.net/totogo2010/article/details/7682641 iOS学习之UINavigationController详解与使用(二)页面切 ...

随机推荐

  1. 基于Hadoop生态圈的数据仓库实践 —— ETL

    使用Hive转换.装载数据 1. Hive简介 (1)Hive是什么         Hive是一个数据仓库软件,使用SQL读.写.管理分布式存储上的大数据集.它建立在Hadoop之上,具有以下功能和 ...

  2. asp.net+MVC--1

    1.MVC入门 1)第一个路由: /*任何应用程序启动时发生的动作都应该存在于单独的类中,并且仅在该方法中按照正确顺序调用*/        protected void Application_St ...

  3. MySQL基础学习之开始

    学习MySQL数据库几个月了,从什么都不懂到现在这个地步,说实话感触很大,也感觉自己有许多不足之处.当接触MySQL的时候, 连创建一个数据表都想了很长的时间,不知道许多东西.幸亏我有一个好的老师,她 ...

  4. csv转json文件

    今天因为需要帮一个同事的新闻内容录入为html, 每次手改不方便,所以就弄了个csv(excel)转json的c++程序,然后再利用ejs把它渲染成网页,打开渲染好的网页再保存(不能保存源文件,不然还 ...

  5. VS2010制作网站自定义安装程序 转

    最近在把一个网站打包成安装程序,这方面的文章网上有很多,也看了不少,但因为开发环境的不同,遇到了一些问题,便写下这篇文章记下整个流程(有很多资源都来自互联网,由于条目颇多,所以无法说明其来处,敬请谅解 ...

  6. 问题分享:ActiveX component can't create object: "MSComDlg.CommonDialog"

    问题描述: 修改一个前辈的代码,在我自己电脑上面运行的很好,但是放到要用户电脑(win7 x64)上面却跑不了,报个如题的错误. 查了下是COMDLG32.OCX的问题,用到控件的地方是: Dim o ...

  7. oct(x) 将一个数字转化为8进制

    >>> a = 12 >>> b 21 >>> c = oct(a) >>> d = oct(b) >>> c ...

  8. 推荐一本书《深入理解PHP内核》

    <深入理解PHP内核> 在线网址:http://www.php-internals.com/

  9. php smarty 配置四个存放目录

    require("Smarty.class.php"); $smarty = new Smarty(); $smarty -> template_dir = "./ ...

  10. Android ListView(Selector 颜色)

    listview_color.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout ...