唯一需要注意的點就是 distance_lc 這個運算元測量的是正交位置的點矩。
count_obj (unioncontours, countobj)
tuple_length (rowbegin, counttuple)
if (countobj == counttuple)
for index := 1 to countobj by 1
dev_display (imagereduced)
select_obj (unioncontours, objectselected2, index)
* 測量實際輪廓與標準線的距離
distance_lc (objectselected2, rowbegin[index-1], colbegin[index-1], rowend[index-1], colend[index-1], distancemin, distancemax)
* 顯示測量結果
disp_message (windowhandle, 'min: ' + distancemin + '\nmax: ' + distancemax, 'window', -1, -1, 'black', 'true')
* 顯示實際輪廓
dev_set_color ('red')
dev_display (objectselected2)
* 顯示標準線
dev_set_color ('green')
disp_line (windowhandle, rowbegin[index-1], colbegin[index-1], rowend[index-1], colend[index-1])
* 等待2s
wait_seconds (2)
endfor
endif
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基於輪廓的模板匹配
大家自己找張測試,就是繪製搜尋區域跟模板提取,提取其輪廓,然後再找一張相似的,從中定位到模板。話不多說,直接上 read image image1,d users s200722103 桌面 r1 f8y046205u1n639a1 038 20201109103715200.jpg dev set...
基於halcon的圓環寬度測量
1 建立測量模型 create metrology model metrologyhandle 2 設定測量模型影象尺寸 set metrology model image size metrologyhandle,width,height 3 增加測量模型物件 add metrology obje...