halcon_cheliang

在这里插入图片描述

* xing.hdev: Traffic monitoring (by Kalman filtering)
* 
dev_update_off ()
dev_close_window ()
read_image (Image, 'xing/init')
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width, Height, 'black', WindowID)
set_display_font (WindowID, 14, 'mono', 'true', 'false')
read_region (XingRegion, 'xing/xing_region')
dev_set_draw ('margin')
dev_set_colored (12)
dev_set_line_width (3)
dev_display (Image)
disp_continue_message (WindowID, 'black', 'true')
stop ()
zoom_image_factor (Image, ImageZoomed, 0.5, 0.5, 'constant')
create_bg_esti (ImageZoomed, 0.7, 0.7, 'fixed', 0.001, 0.03, 'on', 8.0, 10, 3.25, 15, BgEstiHandle)
for I := 0 to 587 by 1
    read_image (ActualImage, 'xing/xing' + (I$'03'))
    zoom_image_factor (ActualImage, ImageZoomed, 0.5, 0.5, 'constant')
    run_bg_esti (ImageZoomed, ForegroundRegion, BgEstiHandle)
    zoom_region (ForegroundRegion, RegionZoom, 2, 2)
    intersection (RegionZoom, XingRegion, RegionIntersection)
    connection (RegionIntersection, ConnectedRegions)
    select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 20, 99999)
    shape_trans (SelectedRegions, RegionTrans, 'convex')
    union1 (RegionTrans, RegionUnion)
    connection (RegionUnion, FinalConnected)
    select_gray (FinalConnected, ActualImage, SelectedRegionsGray, 'deviation', 'and', 25, 1000)
    union1 (SelectedRegionsGray, RegionUnionFinal)
    dilation_rectangle1 (RegionUnionFinal, RegionDilation, 5, 5)
    complement (RegionDilation, BackGround)
    clip_region (BackGround, RegionClipped, 0, 0, Height - 1, Width - 1)
    zoom_region (RegionClipped, BackGroundZoom, 0.5, 0.5)
    update_bg_esti (ImageZoomed, BackGroundZoom, BgEstiHandle)
    shape_trans (SelectedRegionsGray, Rects, 'rectangle1')
    dev_display (ActualImage)
    dev_display (Rects)
endfor
give_bg_esti (BackgroundImage, BgEstiHandle)
dev_display (BackgroundImage)
dev_set_draw ('fill')
dev_update_on ()
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值