HALCON示例程序optical_flow.hdev如何使用optical_flow_mg计算图像序列中的光流以及如何分割光流。
示例程序源码(加注释)
- 关于显示类函数解释
dev_update_off ()
dev_close_window ()
read_image (Image1, ‘xing/xing000’)
dev_open_window_fit_image (Image1, 0, 0, -1, -1, WindowHandle)
dev_set_paint ([‘vector_field’,6,1,2])
dev_set_draw (‘margin’)
for I := 1 to 587 by 1read_image (Image2, 'xing/xing' + I$'03')* 计算两幅图像中的光流optical_flow_mg (Image1, Image2, VectorField, 'fdrig', 0.8, 1, 8, 5, 'default_parameters', 'accurate')* 二值化threshold (VectorField, Region, 1, 10000)dev_display (Image2)dev_set_color ('yellow')dev_set_line_width (1)dev_display (VectorField)dev_set_color ('green')dev_set_line_width (3)dev_display (Region)copy_obj (Image2, Image1, 1, 1)
endfor
处理思路
这个例子是主要讲解了如何使用optical_flow_mg计算图像序列中的光流以及如何分割光流。。
后记
大家有什么问题可以向我提问哈,我看到了第一时间回复,希望在学习的路上多多结交良师益友。