Hello Mat

 找回密码
 立即注册
查看: 6809|回复: 0

基于光流法的运动目标检测

[复制链接]

1294

主题

1520

帖子

112

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22635
发表于 2017-2-6 22:42:22 | 显示全部楼层 |阅读模式
  1. dev_update_off ()
  2. dev_close_window ()
  3. * 初始化一张参考图像
  4. read_image (Image1, 'xing/xing000')
  5. dev_open_window_fit_image (Image1, 0, 0, -1, -1, WindowHandle)
  6. * Set the display parameters for the vector field.
  7. dev_set_paint (['vector_field',6,1,2])
  8. dev_set_draw ('margin')
  9. for I := 1 to 587 by 1
  10.     * 读取当前图像.
  11.     read_image (Image2, 'xing/xing' + I  $ '03')
  12.     * 计算光流optical flow.
  13.     optical_flow_mg (Image1, Image2, VectorField, 'fdrig', 0.8, 1, 8, 5, 'default_parameters', 'accurate')
  14.     * 阈值分割
  15.     threshold (VectorField, Region, 1, 10000)
  16.    
  17.     * 显示当前图像以及分割结果
  18.     dev_display (Image2)
  19.     * Display the optical flow.
  20.     dev_set_color ('yellow')
  21.     dev_set_line_width (1)
  22.     dev_display (VectorField)
  23.     * 显示光流分割结果
  24.     dev_set_color ('green')
  25.     dev_set_line_width (3)
  26.     dev_display (Region)
  27.     * 更新当前参考图像
  28.     copy_obj (Image2, Image1, 1, 1)
  29. endfor
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-5-5 06:56 , Processed in 0.214956 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表