案例-定位

案例一:篩選硬幣並且定位

實驗流程:採集->預處理(濾波)->特徵提取(特徵直方圖)->識別

程序代碼:

dev_close_window()
dev_open_window(0, 0, 512, 512, 'black', WindowHandle)
dev_open_file_dialog('read_image', 'default', 'default', Selection)
read_image (Image,Selection)
invert_image(Image, ImageInvert)
rgb1_to_gray(ImageInvert, GrayImage)
median_image(GrayImage, ImageMedian, 'circle', 1, 'mirrored')
hreshold(GrayImage, Union, 93, 255)
opening_circle(Union, RegionOpening, 4.5)
fill_up(RegionOpening, RegionFillUp)
connection(RegionFillUp, ConnectedRegions)
shape_trans(ConnectedRegions, RegionTrans, 'convex')
select_shape (RegionTrans,SelectedRegions, ['area','convexity'], 'and', [37614.7,0.4202], [322018,2])
disp_message(WindowHandle, 'X軸座標'+Row+'y軸座標'+Column, 'window', 12, 12, 'black',
'true')

實驗結果

在這裏插入圖片描述在這裏插入圖片描述圖1

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章