HALCON示例程序resistor.hdev通过不同焦距图像提取深度信息
生活随笔
收集整理的這篇文章主要介紹了
HALCON示例程序resistor.hdev通过不同焦距图像提取深度信息
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
小哥哥小姐姐覺得有用點個贊唄!
HALCON示例程序resistor.hdev通過不同焦距圖像提取深度信息
示例程序源碼(加注釋)
- 關(guān)于顯示類函數(shù)解釋
Names := []
dev_close_window ()
for i := 1 to 10 by 1
Names := [Names,‘dff/focus_’ + (i$’.2’)]
endfor
read_image (Image, Names) - 將多通道圖像組成一個多通道圖像
channels_to_image (Image, Image)
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width, Height, ‘black’, WindowHandle)
for i := 1 to 10 by 1
訪問多通道圖像的指定通道
access_channel (Image, Image1, i)
endfor - depth_from_focus - 使用多個焦點水平提取深度。
- depth_from_focus(多通道圖像:深度信息,深度圖像:方式,提取清晰像素方式:)
depth_from_focus (Image, Depth, Confidence, ‘highpass’, ‘next_maximum’) - 均值濾波
mean_image (Depth, DepthHighConf, 11, 11) - 將像素值擴(kuò)大到0-255
scale_image_max (DepthHighConf, ImageScaleMax) - 均值濾波
mean_image (ImageScaleMax, DepthMean, 51, 51) - 二值化
threshold (DepthMean, Resistor, 158, 255) - 分割連通域
connection (Resistor, ConnectedRes) - 選取最大面積區(qū)域
select_shape_std (ConnectedRes, FinalRes, ‘max_area’, 0) - 二值化
threshold (DepthMean, Solder, 125, 158) - 分割連通域
connection (Solder, ConnectedSol) - 篩選最大面積區(qū)域
select_shape_std (ConnectedSol, SelectedSol, ‘max_area’, 0) - 填充孔洞
fill_up (SelectedSol, FinalSol)
dev_set_line_width (3)
dev_set_draw (‘margin’)
dev_display (Image)
dev_set_color (‘red’)
dev_display (FinalSol)
dev_set_color (‘blue’)
dev_display (FinalRes)
處理思路
這個例子是主要講解了通過不同焦距圖像提取深度信息的應(yīng)用。
后記
大家有什么問題可以向我提問哈,我看到了第一時間回復(fù),希望在學(xué)習(xí)的路上多多結(jié)交良師益友。
總結(jié)
以上是生活随笔為你收集整理的HALCON示例程序resistor.hdev通过不同焦距图像提取深度信息的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: RabbitMQ 声明Queue时的参数
- 下一篇: 什么是大数据,怎么理解和应对大数据时代