跟我学机器视觉-halcon学习例程中文详解-ic引脚测量

跟我学机器视觉-halcon学习例程中文详解-ic引脚测量

ID:13091444

大小:2.30 MB

页数:9页

时间:2018-07-20

跟我学机器视觉-halcon学习例程中文详解-ic引脚测量_第1页
跟我学机器视觉-halcon学习例程中文详解-ic引脚测量_第2页
跟我学机器视觉-halcon学习例程中文详解-ic引脚测量_第3页
跟我学机器视觉-halcon学习例程中文详解-ic引脚测量_第4页
跟我学机器视觉-halcon学习例程中文详解-ic引脚测量_第5页
资源描述:

《跟我学机器视觉-halcon学习例程中文详解-ic引脚测量》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、跟我学机器视觉-HALCON学习例程中文详解-IC引脚测量*LeadMeasurement:Examplefortheapplicationofthemeasureobject*includingalotofvisualizationoperators.*First,thelengthoftheleadsismeasured,then,theirwidthanddistancefromeachother.***First,readintheimageandinitializetheprogramread_ima

2、ge(Image,'ic_pin')*****************取得图像第一通道的指针,同时得到图像宽度高度*********get_image_pointer1(Image,Pointer,Type,Width,Height)dev_close_window()dev_open_window_fit_image(Image,0,0,509,509,WindowHandle)set_display_font(WindowHandle,14,'mono','true','false')dev_display

3、(Image)****************显示图像如下:****************************************dev_set_draw('margin')dev_set_line_width(3)**DefineanddisplaytherectangularROIswithinwhichtheedgeswillbedetectedRow:=55RowBottom:=955Column:=200Phi:=rad(-90)Length1:=50Length2:=35dev_set_c

4、olor('gray')gen_rectangle2(Rectangle,Row,Column,Phi,Length1,Length2)gen_rectangle2(Rectangle,RowBottom,Column,Phi,Length1,Length2)*************************测量位置如绿色矩形所示下:**************************disp_continue_message(WindowHandle,'black','true')stop()**Create

5、ameasureobjectfortheROIatthetopoftheimage.******获取一阶灰度剖面图的插值方法,测量矩形框与图像坐标系之间有角度时生效******Interpolation:='nearest_neighbor'****************************生成测量矩形框,先测上部****************************gen_measure_rectangle2(Row,Column,Phi,Length1,Length2,Width,Height,In

6、terpolation,MeasureHandle)**DeterminealledgesandcalculatetheleadheightatthetopoftheimageSigma:=1.0Threshold:=30Transition:='all'Select:='all'**************************************进行测量********************************measure_pos(Image,MeasureHandle,Sigma,Thres

7、hold,Transition,Select,RowEdge,ColumnEdge,Amplitude,Distance)LeadLength1:=Distance**Displaytheresultsdev_set_color('white')***********************************将测量结果画出*****************************disp_line(WindowHandle,RowEdge,ColumnEdge-Length2,RowEdge,Column

8、Edge+Length2)disp_message(WindowHandle,'LeadLength:'+LeadLength1$'.2f','window',RowEdge[1]+40,ColumnEdge[1]+100,'yellow','false')**Shiftthemeasureobjectanddeterminetheleadheightatthebottomofthei

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。