dev_open_window (0, 0, 512, 512, 『black』, windowhandle)
dev_set_color (『red』)
gen_region_points (region, 100, 100)
get_region_points (region, rows, columns)
disp_line (windowhandle, rows, columns, 64, 64)
*生成直線0和直線3
gen_region_line (regionlines, 100, 50, 150, 250)
gen_region_line (regionlines3, 45, 150, 125, 225)
*獲取直線0的位置
get_region_points (regionlines, rows2, columns2)
*生成直線1
gen_region_line (regionlines1, rows, columns, 150, 130)
*獲取直線0和1的交點
intersection (regionlines, regionlines1, regionintersection)
get_region_points (regionintersection, rows1, columns1)
line_orientation (rows, columns, rows1, columns1, phi)
gen_region_line (regionlines2, rows, columns, rows1, columns1)
orientation_region (regionlines2, phi1)
line_position (rows, columns, rows1, columns1, rowcenter, colcenter, length, phi2)
*計算點到點的距離
distance_pp (rows, columns, rows1, columns1, distance)
*計算點到直線的距離
distance_pl (200, 200, rows, columns, rows1, columns1, distance1)
*計算區域到區域的距離
distance_rr_min (regionlines2, regionlines3, mindistance, row1, column1, row2, column2)
*計算直線到區域的距離
distance_lr (regionlines2, row1, column1, 230, 340, distancemin, distancemax)
halcon中面到面的距離 Halcon標定步驟
halcon標定步驟 1.設定相機內部引數的初始值 startcampar 0.016,0,0.0000074,0.0000074,326,247,652,494 set calib data cam param calibdataid,0,area scan division startcampa...
Halcon 測量 輪廓到線的距離
唯一需要注意的點就是 distance lc 這個運算元測量的是正交位置的點矩。count obj unioncontours,countobj tuple length rowbegin,counttuple if countobj counttuple for index 1 to counto...
HALCON學習之區域中心座標提取
本次任務目標 基本步驟 讀取本地read image image,d 視覺 picture 杯蓋.jpg 關閉當前視窗,開啟乙個新的視窗,顯示dev close window dev open window 0,0,512,512,black windowhandle dev display ima...