1D测量gen_measure_rectangle2
(1)gen_rectangle2:绘制矩形ROI
(2)gen_measure_rectangle2:创建边缘测量工具
(3)measure_pairs;measure_pos : 启动测量
* Pin Measurement: Example for the application of the HALCON Measure Tool
* (in this program: pure processing code without visualization)
*
read_image (Image, 'ic_pin')
get_image_size (Image, Width, Height)
Row := 47
Column := 485
Phi := 0
Length1 := 420
Length2 := 10
gen_rectangle2 (Rectangle, Row, Column, Phi, Length1, Length2)
* Width, Height 是图像image的
gen_measure_rectangle2 (Row, Column, Phi, Length1, Length2, Width, Height, 'nearest_neighbor', MeasureHandle)
* Extract straight edge pairs perpendicular to a rectangle
measure_pairs (Image, MeasureHandle, 1.5, 30, 'negative', 'all', RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, PinWidth, PinDistance)
avgPinWidth := sum(PinWidth) / |PinWidth|
avgPinDistance := sum(PinDistance) / |PinDistance|
numPins := |PinWidth|
* Delete the

该博客详细介绍了如何使用Halcon进行1D测量,主要通过gen_rectangle2绘制矩形ROI,gen_measure_rectangle2创建边缘测量工具,以及measure_pairs和measure_pos启动测量流程,深入探讨1D测量的应用。
最低0.47元/天 解锁文章
1380

被折叠的 条评论
为什么被折叠?



