gen_image_const (Image, 'byte', 1000, 1000)
********************生成一条直线************************
Row1:=100
Col1:=500
Row2:=500
Col2:=100
gen_region_line (Line, Row1, Col1, Row2, Col2)
*获取该直线的位置信息
line_position (Row1, Col1, Row2, Col2, RowCenter, ColCenter, Length, Phi)
*********************生成延长线***********************
*延长线长度(不精确)
LineLength:=200
*起点
RowStart := RowCenter-cos(Phi+1.5708)*LineLength
ColStart := ColCenter-sin(Phi+1.5708)*LineLength
*终点
RowEnd := RowCenter-cos(Phi-1.5708)*LineLength
ColEnd := ColCenter-sin(Phi-1.5708)*LineLength
gen_region_line (Line2, RowStart, ColStart, RowEnd, ColEnd)
halcon生成延长线
最新推荐文章于 2024-06-01 09:40:55 发布