测量小结

 步骤:

1.生成矩形框--正常应该要垂直于边缘线

2.利用此矩形框进行测量 <测量的位置在框形的中线上>

 

================================

read_image (Image, 'D:/Project/PC_视觉类/视库/样图/二维测量例子2.png')
dev_get_window (WindowHandle)
get_image_size (Image, Width, Height)
draw_rectangle2 (WindowHandle, Row, Column, Phi, Length1, Length2)

gen_measure_rectangle2 (Row, Column, Phi, Length1, Length2, Width, Height, 'nearest_neighbor', MeasureHandle)  //生成矩形框

measure_pos (Image, MeasureHandle, 1, 30, 'all', 'all', RowEdge, ColumnEdge, Amplitude, Distance)  //利用此矩形框进行测量

gen_cross_contour_xld (Cross, RowEdge, ColumnEdge, 16, 0.785398)

 

 

 

================另一种方式==================

不使用measure_pos,而使用measure_pairs,前面都一样

2个边界端点在RowEdgeFirst, ColumnEdgeFirst  与 RowEdgeSecond, ColumnEdgeSecond,

测量值在IntraDistance

measure_pairs (Image, MeasureHandle, 1, 30, 'all', 'all', RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, IntraDistance, InterDistance)

dev_set_color ('blue')
gen_cross_contour_xld (Cross, RowEdgeFirst, ColumnEdgeFirst, 16, 0.785398)
gen_cross_contour_xld (Cross, RowEdgeSecond, ColumnEdgeSecond, 16, 0.785398)

posted @ 2020-06-02 19:38  低调95  阅读(216)  评论(0)    收藏  举报