本文主要是介绍affine_trans_pixel,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
if (|ScoreCheck|>0)
vector_angle_to_rigid (0, 0, 0, RowCheck, ColumnCheck, AngleCheck, HomMat2D)
affine_trans_contour_xld (ShapeModel, ContoursAffinTrans, HomMat2D)
dev_display (ContoursAffinTrans)
*转换卡尺工具匹配点
affine_trans_pixel (HomMat2D, line1[0], line1[1], RowTrans1, ColTrans1)
affine_trans_pixel (HomMat2D, line2[0], line2[1], RowTrans2, ColTrans2)
affine_trans_pixel (HomMat2D, line3[0], line3[1], RowTrans3, ColTrans3)
affine_trans_pixel (HomMat2D, line4[0], line4[1], RowTrans4, ColTrans4)
create_metrology_model (MetrologyHandle)
*添加卡尺工具 直线
RowStart:=[RowTrans1,RowTrans3]
ColumnSatrt:=[ColTrans1,ColTrans3]
RowEnd:=[RowTrans2,RowTrans4]
ColumnEnd:=[ColTrans2,ColTrans4]
*获取卡尺工具参数
add_metrology_object_line_measure (MetrologyHandle, RowStart, ColumnSatrt, RowEnd, ColumnEnd, 12, 5, 0.5, 1, [], [], Index2)
get_metrology_object_model_contour (Contour1, MetrologyHandle, 'all', 1.5)
get_metrology_object_measures (Contours1, MetrologyHandle, 'all', 'all', Row, Column)
*获取卡尺工具结果
apply_metrology_model (ImageCheck, MetrologyHandle)
get_metrology_object_result (MetrologyHandle, 'all', 'all', 'result_type', 'all_param', LineParameter)
get_metrology_object_result_contour (Contour3, MetrologyHandle, 'all', 'all', 1.5)
dev_clear_window ()
dev_display (ImageCheck)
dev_display (Contour3)
count_obj (Contour3, Number)
if (Number = 2)
*获取2条直线的交点坐标
intersection_lines (LineParameter[0], LineParameter[1], LineParameter[2], LineParameter[3], LineParameter[4], LineParameter[5], LineParameter[6], LineParameter[7], RowResult, ColumnResult, IsOverlapping)
disp_message (WindowHandle,'交点坐标为:'+ '(' + RowResult +','+ ColumnResult+ ')' , 'window', 0, 0, 'black', 'true')
gen_cross_contour_xld (Cross, RowResult, ColumnResult, 200, AngleCheck)
dev_display (Cross)
else
disp_message (WindowHandle, '找边失败', 'window', 0,0, 'black', 'true')
endif
这篇关于affine_trans_pixel的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!