The invention discloses a method and a device for detecting the direction of movement in a road. The method includes: a collection of each frame of the road image, block division of the road image, calculate the motion vector of each block, and to smooth the motion vector of each block, each block for each frame in the road image, calculate the motion vector of the block motion vector of the block and smooth smooth before the the angle difference, if the difference is in the preset range, the calculation deviation and the motion vector of the block is located in the same position of the n block of the smoothed nearest n frame of current frame, if the deviation is less than the threshold, the average direction of the recent n frame of the current frame and the motion vector of the block is located in the the same location of N blocks smoothed as the block movement forward, among them, n is a predetermined integer greater than 1. The invention realizes the automatic detection of road movement in a positive, not influenced by subjective factors, in the face of unexpected events or camera angle and position changes, you can update the road moving forward, to improve the detection accuracy.
【技术实现步骤摘要】
本专利技术涉及图像处理
,具体涉及道路中的运动方向检测方法及装置。
技术介绍
目前,在一些交通较繁忙的路段都安装了摄像头,以对道路的交通情况 进行监测。由于车辆逆行会严重影响交通安全,因此,在监测时, 一个重要 目的就是发现逆行现象。在摄像头角度、位置固定的情况下,监测者可根据道路的实际情况,预 先确定道路的运动正向,然后对采集到的道路图像进行分析,若发现道路图 像的运动方向与道路的运动正向的夹角超过 一 定角度,则确定存在逆行现可见,上述发现逆行的方法,需要手工确定道路的运动正向,当遇到突 发事件时,道路的运动正向可能发生更改,此时需要重新手工确定道路的运 动正向。另外,当摄像头角度、位置发生了变化后,也需要重新手工确定道路的运动正向,这不仅浪费了人力,还会受到主观影响,例如若监测者忘 记及时更改道路的运动正向,则会产生逆行判断错误。
技术实现思路
本专利技术提供道路中的运动方向检测方法及装置,以实现对道路中的运动方 向的自动4企测。本专利技术的技术方案是这样实现的一种道路中的运动方向检测方法,该方法包括每采集一帧道路图像,对该道路图像进行块划分,计算各块的运动矢量,并对各块的运动矢量进行平滑;对于每帧道路图像中的每个块,计算平滑前的该块的运动矢量与平滑后的 该块的运动矢量的角度之差,若该差值在预设范围内,则计算当前帧的最近n 帧中与该块位于同一位置的n个块的平滑后的运动矢量的偏差,若该偏差小于 阈值,则将当前帧的最近n帧中与该块位于同 一位置的n个块的平滑后的运动 矢量的平均方向作为该块的运动正向,其中,n为预设的大于l的整数。所述计算当前帧的最近 ...
【技术保护点】
一种道路中的运动方向检测方法,其特征在于,该方法包括: 每采集一帧道路图像,对该道路图像进行块划分,计算各块的运动矢量,并对各块的运动矢量进行平滑; 对于每帧道路图像中的每个块,计算平滑前的该块的运动矢量与平滑后的该块的运动矢量的角度之差,若该差值在预设范围内,则计算当前帧的最近n帧中与该块位于同一位置的n个块的平滑后的运动矢量的偏差,若该偏差小于阈值,则将当前帧的最近n帧中与该块位于同一位置的n个块的平滑后的运动矢量的平均方向作为该块的运动正向,其中,n为预设的大于1的整数。
【技术特征摘要】
【专利技术属性】
技术研发人员:高飞,黄英,
申请(专利权)人:北京中星微电子有限公司,
类型:发明
国别省市:11[中国|北京]
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。