Result
Explanation
唯一需要注意的點就是 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