ImageVerifierCode 换一换
格式:DOC , 页数:3 ,大小:22.50KB ,
资源ID:8684839      下载积分:10 文币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.wenkunet.com/d-8684839.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录   微博登录 

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Halcon 通過xld檢測貼片.doc)为本站会员(青山)主动上传,文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知文库网(发送邮件至13560552955@163.com或直接QQ联系客服),我们立即给予删除!

Halcon 通過xld檢測貼片.doc

1、Halcon 通過xld檢測貼片 * This example program shows how to use HALCONs shape-based matching* to find SMD capacitors that exhibit independent size changes in the row and* column direction in images with a depth of 10 bits (i.e., in images of type uint2).dev_update_off ()* For visualization purposes, we spe

2、cify the number of significant bits in the uint2* images. We do this because this information cannot be stored in the image* files themselves.set_system (int2_bits, 10)read_image (Image, smd/smd_capacitors_01)get_image_size (Image, Width, Height)dev_close_window ()dev_open_window (0, 0, Width, Heigh

3、t, black, WindowHandle)dev_set_color (green)dev_set_line_width (3)set_display_font (WindowHandle, 16, mono, true, false)* Create a synthetic model for the SMD capacitors. This is just a rectangle* with rounded corners.gen_contour_polygon_rounded_xld (Contour, 50,100,100,50,50, 50,50,150,150,50, 6,6,

4、6,6,6, 0.01)*根據一個多邊形(polygon)(以元組形式給出)的圓形角點創建一個XLD輪廓(contour)*((輸出)結果輪廓,多邊形的行列坐標,多邊形的圓角半徑,采樣距離)gen_image_const (Image, byte, 200, 150)*創建一個固定灰度值的圖像(輸出圖像,像素類型,圖像寬,高)paint_xld (Contour, Image, ImageModel, 128)*把XLD目標畫在一個圖像中(要繪制到圖像去的XLD輪廓,圖像,結果圖像,xld輪廓期望的灰度值)create_aniso_shape_model (ImageModel, auto,

5、-rad(10), rad(20), auto, 0.9, 1.7, auto, 0.9, 1.1, auto, none, use_polarity, auto, 20, ModelID)*get_shape_model_contours (ModelContours, ModelID, 1)*Button := 0ImgNo := 1while (Button # 1) read_image (Image, smd/smd_capacitors_+ImgNo$02d) dev_display (Image) count_seconds (S1) find_aniso_shape_model

6、 (Image, ModelID, -rad(10), rad(20), 0.9, 1.7, 0.9, 1.1, 0.7, 0, 0.5, least_squares, 0, 0.8, Row, Column, Angle, ScaleR, ScaleC, Score) count_seconds (S2) Time := (S2-S1)*1000 Num := |Score| * Display the number of found models and the recognition time. set_tposition (WindowHandle, 10, 10) write_str

7、ing (WindowHandle, Num$d+ models found in +Time$5.2f+ ms) MeanColumn := mean(Column)*找出工件,並計算出工件與模板的關系 for I := 0 to Num-1 by 1 * Display the found model. hom_mat2d_identity (HomMat2D) *二維描述矩陣,就是一個三維單位矩陣。 hom_mat2d_scale (HomMat2D, ScaleRI, ScaleCI, 0, 0, HomMat2D) *為一個同質二維變換矩陣添加一個縮放(輸入矩陣,縮放因子,固定點,結

8、果矩陣) hom_mat2d_rotate (HomMat2D, AngleI, 0, 0, HomMat2D) *為一個同質二維變換矩陣添加一個循環(輸入矩陣,旋轉角度,固定點,輸出矩陣) hom_mat2d_translate (HomMat2D, RowI, ColumnI, HomMat2D) *為一個同質二維變換矩陣添加一個轉換 affine_trans_contour_xld (ModelContours, ContoursTrans, HomMat2D) *仿射轉換。 dev_display (ContoursTrans) * Display the models scale n

9、ext to the found model. ScaleRowStr := ScaleRow=+ScaleRI$5.3f ScaleColStr := ScaleCol=+ScaleCI$5.3f get_string_extents (WindowHandle, ScaleRowStr, AscentStr, DescentStr, WidthStr, HeightStr) *獲取一個字符串的空間大小(窗口句柄,要考慮的變量,往上的最大高度,往下的最大延伸,文本寬,文本高) if (ColumnI 4) ImgNo := 1 endif dev_error_var (Error, 1) dev_set_check (give_error) get_mposition (WindowHandle, R, C, Button) dev_error_var (Error, 0) dev_set_check (give_error) if (Error#H_MSG_TRUE) Button := 0 endifendwhileclear_shape_model (ModelID)* Reset the number of significant bits of uint2 images to unknown.set_system (int2_bits, -1)

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:文库网官方知乎号:文库网

经营许可证编号: 粤ICP备2021046453号世界地图

文库网官网©版权所有2025营业执照举报