HALCON示例程序obj_diff.hdev算子obj_diff 的使用
生活随笔
收集整理的這篇文章主要介紹了
HALCON示例程序obj_diff.hdev算子obj_diff 的使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
HALCON示例程序obj_diff.hdev算子obj_diff 的使用
示例程序源碼(加注釋)
- 關于顯示類函數解釋
read_image (Image, ‘particle’) - 二值化
threshold (Image, Region, 57, 255) - 分割連通域
connection (Region, ConnectedRegions)
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window_fit_image (Image, 0, 0, Width, Height, WindowHandle)
set_display_font (WindowHandle, 16, ‘mono’, ‘true’, ‘false’)
dev_set_draw (‘fill’)
dev_set_colored (6) - 使用區域列坐標
select_shape (ConnectedRegions, LeftRegions, ‘column’, ‘and’, 0.0, 256.0) - 求取兩個對象不同
obj_diff (ConnectedRegions, LeftRegions, RightRegions)
dev_clear_window ()
dev_display (RightRegions)
disp_message (WindowHandle, ‘Difference of all regions and\nleft hand side regions:\nRight hand side regions’, ‘window’, 12, 12, ‘black’, ‘true’)
disp_continue_message (WindowHandle, ‘black’, ‘true’)
stop () - 一個空區域與一個區域的不同
gen_empty_obj (EmptyObject)
obj_diff (ConnectedRegions, EmptyObject, ObjectsDiff)
dev_clear_window ()
dev_display (ObjectsDiff)
disp_message (WindowHandle, ‘Difference of all regions and\nan empty object:\nAll regions’, ‘window’, 12, 12, ‘black’, ‘true’)
disp_continue_message (WindowHandle, ‘black’, ‘true’)
stop ()
obj_diff (EmptyObject, LeftRegions, ObjectsDiff)
dev_clear_window ()
dev_display (ObjectsDiff)
disp_message (WindowHandle, ‘Difference of an empty object\nand any other object:\nAn empty object’, ‘window’, 12, 12, ‘black’, ‘true’)
disp_continue_message (WindowHandle, ‘black’, ‘true’)
stop () - 圖片與圖片不在同一對象下,所以完全不同
read_image (SameImage, ‘particle’)
obj_diff (Image, SameImage, ObjectsDiff)
dev_clear_window ()
dev_display (ObjectsDiff)
disp_message (WindowHandle, ‘Difference of an image and\nthe same image reloaded:\nThe original image’, ‘window’, 12, 12, ‘black’, ‘true’)
disp_continue_message (WindowHandle, ‘black’, ‘true’)
stop () - xld輪廓與圖片一樣
gen_contour_polygon_xld (Contour, [50,150,250,250,250], [50,50,50,150,250])
concat_obj (Region, Contour, RegionAndXLD)
concat_obj (Region, Image, ImageAndRegion)
obj_diff (RegionAndXLD, ImageAndRegion, ObjectsDiff)
dev_clear_window ()
dev_display (ObjectsDiff)
disp_message (WindowHandle, ‘Difference of mixed type objects’, ‘window’, 12, 12, ‘black’, ‘true’)
處理思路
這個例子是主要講解了obj_diff 算子的應用。
后記
大家有什么問題可以向我提問哈,我看到了第一時間回復,希望在學習的路上多多結交良師益友。
總結
以上是生活随笔為你收集整理的HALCON示例程序obj_diff.hdev算子obj_diff 的使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HALCON示例程序novelty_de
- 下一篇: Matlab中的有限域计算