CN102682454A - Method and device for tracking region of interest in video - Google Patents

Method and device for tracking region of interest in video Download PDF

Info

Publication number
CN102682454A
CN102682454A CN201210132913XA CN201210132913A CN102682454A CN 102682454 A CN102682454 A CN 102682454A CN 201210132913X A CN201210132913X A CN 201210132913XA CN 201210132913 A CN201210132913 A CN 201210132913A CN 102682454 A CN102682454 A CN 102682454A
Authority
CN
China
Prior art keywords
roi
particle
msub
mrow
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201210132913XA
Other languages
Chinese (zh)
Other versions
CN102682454B (en
Inventor
刘震
张冬
李厚强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Science and Technology of China USTC
Original Assignee
University of Science and Technology of China USTC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Science and Technology of China USTC filed Critical University of Science and Technology of China USTC
Priority to CN 201210132913 priority Critical patent/CN102682454B/en
Publication of CN102682454A publication Critical patent/CN102682454A/en
Application granted granted Critical
Publication of CN102682454B publication Critical patent/CN102682454B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种视频中的感兴趣区域跟踪方法及装置,包括:首先,获取当前帧中像素或宏块的运动矢量,并根据所述运动矢量确定感兴趣区域ROI的移动速度分布参数,还根据参考帧中ROI的状态信息确定ROI缩放参数;之后,利用所述ROI的移动速度分布参数和缩放参数对当前帧中采样获得的粒子进行状态转移处理,并根据状态转移后的粒子确定当前帧的ROI位置及大小。本发明实施例可以利用存在于压缩码流中或者编码时产生的运动矢量信息指导粒子状态转移过程,从而可以在保证跟踪效果的情况下,减少跟踪过程中所需的粒子数目,进而降低跟踪处理的复杂程度,并可以获得较佳的跟踪效果。

Figure 201210132913

The invention discloses a method and device for tracking a region of interest in a video, comprising: firstly, obtaining a motion vector of a pixel or a macroblock in a current frame, and determining a moving speed distribution parameter of a region of interest ROI according to the motion vector, Also determine the ROI scaling parameter according to the state information of the ROI in the reference frame; then, use the moving speed distribution parameter and the scaling parameter of the ROI to perform state transition processing on the particles obtained by sampling in the current frame, and determine the current state according to the particles after the state transition The ROI position and size of the frame. The embodiment of the present invention can use the motion vector information existing in the compressed code stream or generated during encoding to guide the particle state transfer process, thereby reducing the number of particles required in the tracking process while ensuring the tracking effect, thereby reducing the tracking process. complexity, and better tracking results can be obtained.

Figure 201210132913

Description

一种视频中的感兴趣区域跟踪方法及装置Method and device for tracking region of interest in video

技术领域 technical field

本发明涉及一种视频处理技术领域,尤其涉及一种视频处理过程中感兴趣区域跟踪的方法及装置。The present invention relates to the technical field of video processing, in particular to a method and device for tracking a region of interest during video processing.

背景技术 Background technique

随着通信技术的普及和发展,相应的移动电视,视频会议以及视频监控等视频服务也飞速发展起来。在用户通过各种各样的终端及不同的接入方式访问开展相应的视频服务的过程中,用户终端的多样性和网络环境的复杂性,使得如何有效传输视频内容成为设计视频服务系统的巨大挑战。With the popularization and development of communication technology, corresponding video services such as mobile TV, video conferencing, and video surveillance have also developed rapidly. In the process of users accessing and developing corresponding video services through various terminals and different access methods, the diversity of user terminals and the complexity of the network environment make how to effectively transmit video content a huge challenge in the design of video service systems. challenge.

目前,SVC(可伸缩视频编码)技术能够在一定程度上有效传输相应的视频内容。SVC技术是通过在一段码流中同时编码多种码率、分辨率、帧率的子码流,在传输节点根据网络状况以及用户或者用户设备的需求进行简单的抽取操作就可以生成相应得适配码流。SVC技术相对于单一码流技术,其能提供一个空间、时间、质量可伸缩的码流,即从这个码流中可以抽取一些子码流。相应的子码流能满足网络传输速率以及终端用户对视频在空间、时间和信噪比等方面的需求,因此,SVC技术使得视频流能够更好地适应各种不同的网络环境和用户终端。At present, SVC (Scalable Video Coding) technology can effectively transmit corresponding video content to a certain extent. SVC technology is to simultaneously encode sub-streams of various code rates, resolutions, and frame rates in a code stream, and perform a simple extraction operation at the transmission node according to the network conditions and the needs of users or user equipment to generate correspondingly suitable sub-streams. Match code flow. Compared with single code stream technology, SVC technology can provide a code stream with scalable space, time and quality, that is, some sub-code streams can be extracted from this code stream. The corresponding sub-code stream can meet the network transmission rate and the requirements of end users for video space, time and signal-to-noise ratio. Therefore, SVC technology enables video streams to better adapt to various network environments and user terminals.

在SVC技术中,能提供的最低质量编码层被称作BL(基本层),能增强空间分辨率、时间分辨率或者信噪比强度的编码层被称作EL(增强层)。其中,空间可伸缩性使用分层编码(Layered Coding)的方法,利用层间的运动、纹理和残差信息;时间可伸缩性采用分级双向预测帧(Hierarchical B)编码技术;对于信噪比的可伸缩性,可以采用CGS(粗粒度质量可伸缩)和MGS(中等粒度质量可伸缩)的方法。In SVC technology, the lowest quality coding layer that can be provided is called BL (base layer), and the coding layer that can enhance spatial resolution, time resolution or signal-to-noise ratio strength is called EL (enhancement layer). Among them, the spatial scalability uses the method of layered coding (Layered Coding), which uses the motion, texture and residual information between layers; the temporal scalability uses hierarchical bidirectional predictive frame (Hierarchical B) coding technology; for the signal-to-noise ratio For scalability, the methods of CGS (coarse-grained quality scalable) and MGS (medium-grained quality scalable) can be used.

相应的SVC技术还提供了对ROI(感兴趣区域)编码的支持。ROI通常是指视频帧中对于浏览者而言包含具有明确高层语义的物体的区域,如某人,某物体等。在用户进行视频浏览的过程中,如果其设备的显示尺寸小,或者其可用带宽降低,则可以尽量保持感兴趣区域的清晰度,以不影响用户对该视频的观赏体验。例如,当接入带宽不足时,可以删除部分非感兴趣区域以适应带宽需求对视频主观质量的影响,即当带宽不足以传输基本层和增强层的编码码流时,可以传输基本层和ROI的编码码流以充分利用带宽,在一定程度上可以保持视频质量,保证用户的主观体验感受。The corresponding SVC technology also provides support for ROI (Region of Interest) encoding. ROI usually refers to a region in a video frame that contains objects with clear high-level semantics for viewers, such as a person, an object, and so on. When a user browses a video, if the display size of the device is small, or the available bandwidth is reduced, the definition of the region of interest can be kept as clear as possible so as not to affect the user's viewing experience of the video. For example, when the access bandwidth is insufficient, some non-interest regions can be deleted to adapt to the impact of bandwidth requirements on the subjective video quality, that is, when the bandwidth is not enough to transmit the coded streams of the base layer and enhancement layer, the base layer and ROI can be transmitted The encoded bit stream can make full use of the bandwidth, which can maintain the video quality to a certain extent and ensure the subjective experience of users.

为了实现利用ROI编码技术以适应各种不同的应用,则需要确定视频各帧中ROI的位置和大小,通常可以采用视频跟踪技术以确定视频各帧中ROI的大小和位置。In order to use the ROI coding technology to adapt to various applications, it is necessary to determine the position and size of the ROI in each frame of the video. Usually, video tracking technology can be used to determine the size and position of the ROI in each frame of the video.

下面将对目前采用的通过视频跟踪技术确定视频各帧中ROI的实现方案进行描述。The implementation scheme of determining the ROI in each frame of the video by using the video tracking technology currently adopted will be described below.

目前采用的一种ROI跟踪方式为基于粒子滤波算法实现,具体是将跟踪的区域表示成一个粒子(矩形或椭圆形等),粒子可以包括各种状态,如运动速度、方向,区域大小等。在跟踪时,在当前帧中通过重要性采样生成一定数量的粒子,并根据该一定数量的粒子与参考帧中待跟踪区域的粒子的相关性,通过加权得到当前帧中粒子的稳定状态,从而获得当前帧中的待跟踪区域。A currently used ROI tracking method is based on a particle filter algorithm. Specifically, the tracked area is represented as a particle (rectangle or ellipse, etc.), and the particle can include various states, such as motion speed, direction, and area size. During tracking, a certain number of particles are generated by importance sampling in the current frame, and according to the correlation between the certain number of particles and the particles in the area to be tracked in the reference frame, the stable state of the particles in the current frame is obtained by weighting, thus Get the area to be tracked in the current frame.

相应的,具体的基于粒子滤波算法获得当前帧中的待跟踪区域的处理方式包括:Correspondingly, the specific processing methods for obtaining the region to be tracked in the current frame based on the particle filter algorithm include:

(1)初始化:取k=0(即初始时刻),按p(x0)抽取N个样本点

Figure BDA0000158966610000021
i=1,…,N,其中p(x0)是指初始化的目标概率分布,具体地,可以设定为第一帧中以目标的位置大小为均值的高斯分布。(1) Initialization: take k=0 (that is, the initial moment), and draw N sample points according to p(x 0 )
Figure BDA0000158966610000021
i=1, . . . , N, where p(x 0 ) refers to the initialized target probability distribution, specifically, it can be set as a Gaussian distribution with the position and size of the target as the mean value in the first frame.

(2)重要性采样:

Figure BDA0000158966610000022
Figure BDA0000158966610000023
其中i=1,…,N,其中,
Figure BDA0000158966610000024
表示k时刻第i个粒子的状态,
Figure BDA0000158966610000025
表示从0时刻(初始时刻)到k时刻为止粒子的状态,z1:k表示从1时刻(初始跟踪时刻)到k时刻为止目标的观测值(一般指跟踪目标的颜色直方图),
Figure BDA0000158966610000026
是指,
Figure BDA0000158966610000027
是指有了1至k帧的观测值和第i个粒子至k-1帧的状态的条件下,第k帧中粒子的状态分布的估计,即重要性函数。(2) Importance sampling:
Figure BDA0000158966610000022
make
Figure BDA0000158966610000023
where i=1,...,N, where,
Figure BDA0000158966610000024
Indicates the state of the i-th particle at time k,
Figure BDA0000158966610000025
Represents the state of the particle from time 0 (initial time) to time k, z 1:k represents the observed value of the target from time 1 (initial tracking time) to time k (generally refers to the color histogram of the tracking target),
Figure BDA0000158966610000026
Refers to,
Figure BDA0000158966610000027
It refers to the estimation of the state distribution of the particle in the kth frame under the condition that there are observation values from 1 to k frames and the state of the i-th particle to k-1 frame, that is, the importance function.

(3)计算权值 若采用一步转移后验状态分布,该式可简化为:

Figure BDA00001589666100000210
其中,
Figure BDA00001589666100000211
是指观测模型,即表示粒子是所跟踪目标的概率,
Figure BDA00001589666100000213
是指状态转移模型,即目标由k-1帧向k帧运动的概率分布模型。(3) Calculate the weight If one-step transfer posterior state distribution is adopted, the formula can be simplified as:
Figure BDA00001589666100000210
in,
Figure BDA00001589666100000211
refers to the observation model, that is, the particle is the probability of the tracked target,
Figure BDA00001589666100000213
It refers to the state transition model, that is, the probability distribution model of the target moving from frame k-1 to frame k.

(4)归一化权值:

Figure BDA00001589666100000214
(4) Normalized weights:
Figure BDA00001589666100000214

(5)重采样:根据各自归一化权值

Figure BDA00001589666100000215
的大小复制或舍弃样本
Figure BDA00001589666100000216
得到N个近似服从
Figure BDA00001589666100000217
分布的样本 ω k ( i ) = ω ~ k ( i ) = 1 / N , i=1,…,N。(5) Resampling: according to the respective normalized weights
Figure BDA00001589666100000215
Replicate or discard samples of size
Figure BDA00001589666100000216
get N approximate obedience
Figure BDA00001589666100000217
Sample of the distribution make ω k ( i ) = ω ~ k ( i ) = 1 / N , i=1,...,N.

(6)输出结果:算法的输出是粒子集用它可以近似表示后验概率和函数x0:k的期望,其中:(6) Output result: the output of the algorithm is the particle set It can be used to approximate the posterior probability and the expectation of the function x 0:k , where:

后验概率: p ^ ( x 0 : k | z 1 : k ) = 1 N Σ i = 1 N δ x 0 : k ( i ) ( dx 0 : k ) ; Posterior probability: p ^ ( x 0 : k | z 1 : k ) = 1 N Σ i = 1 N δ x 0 : k ( i ) ( dx 0 : k ) ;

函数x0:k的期望: E ( x 0 : k ) = 1 N Σ i = 1 N x 0 : k i . The expectation of the function x 0:k : E. ( x 0 : k ) = 1 N Σ i = 1 N x 0 : k i .

(7)令k=k+1,重复上述过程(2)至过程(6)。(7) Let k=k+1, repeat the above process (2) to process (6).

在上述实现方案中,若要获得稳定的跟踪效果,则需较多的粒子数目,而粒子数目越多,则跟踪所需的计算量越大,导致处理复杂程度大大增加。In the above implementation scheme, to obtain a stable tracking effect, a larger number of particles is required, and the larger the number of particles, the greater the amount of calculation required for tracking, resulting in a greatly increased processing complexity.

发明内容 Contents of the invention

本发明的目的是提供一种视频中的感兴趣区域跟踪方法及装置,以在保证跟踪效果的前提下减少跟踪过程中的处理复杂度。The object of the present invention is to provide a method and device for tracking a region of interest in a video, so as to reduce the processing complexity in the tracking process under the premise of ensuring the tracking effect.

本发明的目的是通过以下技术方案实现的:The purpose of the present invention is achieved through the following technical solutions:

一种视频中的感兴趣区域跟踪方法,包括:A region of interest tracking method in a video, comprising:

获取当前帧中像素或宏块的运动矢量,并根据所述运动矢量确定感兴趣区域ROI的移动速度分布参数,还根据参考帧中ROI的状态信息确定ROI缩放参数;Obtain the motion vector of the pixel or macroblock in the current frame, and determine the moving speed distribution parameter of the region of interest ROI according to the motion vector, and determine the ROI scaling parameter according to the state information of the ROI in the reference frame;

利用所述ROI的移动速度分布参数和缩放参数对当前帧中采样获得的粒子进行状态转移处理,并根据状态转移后的粒子确定当前帧的ROI位置及大小。Using the moving speed distribution parameters and scaling parameters of the ROI to perform state transition processing on the particles sampled in the current frame, and determine the ROI position and size in the current frame according to the state-transferred particles.

可选地,所述确定ROI的移动速度分布参数的步骤包括:Optionally, the step of determining the moving speed distribution parameters of the ROI includes:

根据当前帧中像素或宏块的运动矢量确定当前帧中像素或宏块对应的参考像素或宏块在参考帧中的位置,并在当前帧中像素或宏块的运动矢量中选取所述位置位于参考帧中ROI内的参考像素或宏块对应的当前帧中像素或宏块的运动矢量;根据选取获得的当前帧中像素或宏块的运动矢量确定所述ROI的移动速度分布参数;Determine the position in the reference frame of the reference pixel or macroblock corresponding to the pixel or macroblock in the current frame according to the motion vector of the pixel or macroblock in the current frame, and select the position from the motion vector of the pixel or macroblock in the current frame The motion vector of the pixel or macroblock in the current frame corresponding to the reference pixel or macroblock in the ROI in the reference frame; determine the moving speed distribution parameter of the ROI according to the motion vector of the pixel or macroblock in the current frame selected and obtained;

可选地,所述确定ROI缩放参数的步骤包括:Optionally, the step of determining ROI scaling parameters includes:

根据选取获得的当前帧中像素或宏块的运动矢量确定对应的当前帧中像素或宏块,并根据该当前帧中像素或宏块和对应的参考帧中的像素或宏块确定所述ROI缩放参数。Determine the corresponding pixel or macroblock in the current frame according to the motion vector of the selected pixel or macroblock in the current frame, and determine the ROI according to the pixel or macroblock in the current frame and the pixel or macroblock in the corresponding reference frame scaling parameter.

可选地,所述ROI的移动速度分布参数包括:Optionally, the moving speed distribution parameters of the ROI include:

P ( MV ROI ) = Σ i = 0 | G | - 1 δ ( MV i - MV ROI ) / | G | , 其中,δ为狄拉克函数,G为所述位置位于参考帧中ROI内的参考像素或宏块对应的当前帧中像素或宏块的运动矢量集合,MVi是指G中的第i个运动矢量,MVROI为ROI由前一帧向当前帧的移动速度;所述ROI缩放参数包括:

Figure BDA0000158966610000041
其中,a为,b为为仿射参数,该仿射参数采用最小二乘法结合四参数变换模型求解,相应的四参数变换模块为根据该当前帧中像素或宏块和对应的参考帧中的像素或宏块建立。 P ( MV ROI ) = Σ i = 0 | G | - 1 δ ( MV i - MV ROI ) / | G | , Among them, δ is a Dirac function, G is the motion vector set of pixels or macroblocks in the current frame corresponding to the reference pixels or macroblocks in the ROI in the reference frame, and MV i refers to the i-th motion in G Vector, MV ROI is the moving speed of the ROI from the previous frame to the current frame; the ROI scaling parameters include:
Figure BDA0000158966610000041
Among them, a is, b is an affine parameter, and the affine parameter is solved by the least square method combined with the four-parameter transformation model, and the corresponding four-parameter transformation module is based on the pixel or macroblock in the current frame and the corresponding reference frame. Pixel or macroblock build.

可选地,所述对当前帧中采样获得的粒子进行状态转移处理的步骤包括:Optionally, the step of performing state transition processing on the particles obtained by sampling in the current frame includes:

根据所述ROI的移动速度分布参数确定粒子状态转移的速度v1、v2,包括;以0~1的均匀分布产生随机数μ,如果μ<α,则令

Figure BDA0000158966610000042
Figure BDA0000158966610000043
标志变量
Figure BDA0000158966610000044
否则,以分布P(MVROI)选取在上一模块中统计的运动矢量集合G中的一个元素对应的两个分量(MV′x,MV′y)分别作为v1、v2的值,即令v1=MV′x、v2=MV′y,并记
Figure BDA0000158966610000045
α为状态转移参数,其初始值为预先设定,在后续的粒子更新过程中更新该值的方式包括:
Figure BDA0000158966610000046
为k-1帧中粒子n中的vx分量,
Figure BDA0000158966610000048
为k-1帧中粒子n中的vy分量;Determine the speed v 1 and v 2 of the particle state transition according to the moving speed distribution parameters of the ROI, including; generate a random number μ with a uniform distribution of 0 to 1, if μ<α, then set
Figure BDA0000158966610000042
Figure BDA0000158966610000043
flag variable
Figure BDA0000158966610000044
Otherwise, select the two components (MV′ x , MV′ y ) corresponding to an element in the motion vector set G counted in the previous module as the values of v 1 and v 2 respectively by distribution P(MV ROI ), that is, v 1 =MV′ x , v 2 =MV′ y , and record
Figure BDA0000158966610000045
α is a state transition parameter, its initial value is preset, and the way to update this value in the subsequent particle update process includes:
Figure BDA0000158966610000046
is the v x component in particle n in frame k-1,
Figure BDA0000158966610000048
is the v y component of particle n in frame k-1;

根据所述ROI缩放参数确定粒子缩放参数η,包括;以0~1的均匀分布产生随机数γ,如果γ<β,则令η=ρ,否则令η=1,其中,β为目标大小变化程度参数,其值为预先设定,ρ为所述缩放参数;Determine the particle scaling parameter η according to the ROI scaling parameter, including; generate a random number γ with a uniform distribution of 0 to 1, if γ<β, then make η=ρ, otherwise let η=1, where β is the target size change A degree parameter, whose value is preset, and ρ is the scaling parameter;

根据所述粒子状态转移的速度和粒子缩放参数进行粒子状态转移处理,获得第k帧中的第n个粒子的粒子状态转移后的结果包括:该粒子的位置( s k n { x } = s k - 1 n { x } + v 1 + &epsiv; x , s k n { y } = s k - 1 n { y } + v 2 + &epsiv; y ),该粒子的x、y方向的移动速度分别为: s k n { v x } = v 1 + &epsiv; v x s k n { v y } = v 2 + &epsiv; v y , 该粒子在所述位置上对应的椭圆的长半轴为 s k n { a } = &eta; &times; s k - 1 n { a } + &epsiv; a , 短半轴为 s k n { b } = &eta; &times; s k - 1 n { b } + &epsiv; b , 其中εx、εy是服从N(0,0.2)分布的随机变量,是服从N(0,0.25)的随机变量,εa、εb是服从N(0,0.1)的随机变量。Particle state transfer processing is performed according to the speed of the particle state transfer and the particle scaling parameter, and the result after obtaining the particle state transfer of the nth particle in the kth frame includes: the position of the particle ( the s k no { x } = the s k - 1 no { x } + v 1 + &epsiv; x , the s k no { the y } = the s k - 1 no { the y } + v 2 + &epsiv; the y ), the moving speed of the particle in the x and y directions are respectively: the s k no { v x } = v 1 + &epsiv; v x and the s k no { v the y } = v 2 + &epsiv; v the y , The semi-major axis of the ellipse corresponding to the particle at the position is the s k no { a } = &eta; &times; the s k - 1 no { a } + &epsiv; a , semi minor axis is the s k no { b } = &eta; &times; the s k - 1 no { b } + &epsiv; b , Where ε x , ε y are random variables that obey the N(0, 0.2) distribution, is a random variable subject to N(0, 0.25), and ε a and ε b are random variables subject to N(0, 0.1).

可选地,所述根据状态转移后的粒子确定当前帧的ROI的步骤包括:Optionally, the step of determining the ROI of the current frame according to the particles after the state transition includes:

对进行状态转移处理后的粒子执行各粒子区域颜色直方图统计处理,并根据各粒子区域颜色直方图统计处理结果进行粒子更新处理;Perform the statistical processing of the color histogram of each particle area on the particles after the state transition processing, and perform particle update processing according to the statistical processing results of the color histogram of each particle area;

根据粒子更新处理获得的结果计算ROI位置大小。Calculate the ROI position size based on the results obtained from the particle update process.

一种视频中的感兴趣区域跟踪装置,包括:A device for tracking a region of interest in a video, comprising:

移动速度分布参数及缩放参数确定模块,用于获取当前帧中像素或宏块的运动矢量,并根据所述运动矢量确定感兴趣区域ROI的移动速度分布参数,,还用于根据参考帧中ROI的状态信息确定缩放参数;The moving speed distribution parameter and scaling parameter determination module is used to obtain the motion vector of the pixel or macroblock in the current frame, and determine the moving speed distribution parameter of the region of interest ROI according to the motion vector, and is also used to determine the moving speed distribution parameter of the ROI in the reference frame according to the motion vector The state information of determines the scaling parameters;

粒子状态转移模块,用于利用所述移动速度分布参数及缩放参数确定模块确定的ROI的移动速度分布参数和缩放参数对当前帧中采样获得的粒子进行状态转移处理;The particle state transfer module is used to use the moving speed distribution parameter and the scaling parameter of the ROI determined by the moving speed distribution parameter and the scaling parameter determination module to perform state transfer processing on the particles obtained by sampling in the current frame;

ROI确定模块,用于根据所述粒子状态转移模块进行状态转移后的粒子,确定当前帧的ROI位置及大小。The ROI determination module is used to determine the position and size of the ROI of the current frame according to the particles after the state transfer by the particle state transfer module.

可选地,所述移动速度分布参数及缩放参数确定模块具体包括:Optionally, the moving speed distribution parameter and scaling parameter determination module specifically includes:

运动矢量获取模块,用于根据当前帧中像素或宏块的运动矢量确定当前帧中像素或宏块对应的参考像素或宏块在参考帧中的位置,并在当前帧中像素或宏块的运动矢量中,选取所述位置位于参考帧中ROI内的参考像素或宏块对应的当前帧中像素或宏块的运动矢量;The motion vector acquisition module is used to determine the position of the reference pixel or macroblock corresponding to the pixel or macroblock in the current frame in the reference frame according to the motion vector of the pixel or macroblock in the current frame, and determine the position of the pixel or macroblock in the current frame In the motion vector, the motion vector of the pixel or macroblock in the current frame corresponding to the reference pixel or macroblock corresponding to the position in the ROI in the reference frame is selected;

参数确定模块,用于根据所述运动矢量获取模块选取获得的当前帧中像素或宏块的运动矢量确定所述ROI的移动速度分布参数和缩放参数;还根据选取获得的当前帧中像素或宏块的运动矢量确定对应的当前帧中像素或宏块,并根据该当前帧中像素或宏块和对应的参考帧中的像素或宏块确定所述ROI缩放参数。The parameter determination module is used to determine the moving speed distribution parameter and scaling parameter of the ROI according to the motion vector of the pixels or macroblocks in the current frame selected and obtained by the motion vector acquisition module; The motion vector of the block determines the corresponding pixel or macroblock in the current frame, and the ROI scaling parameter is determined according to the pixel or macroblock in the current frame and the corresponding pixel or macroblock in the reference frame.

可选地,所述参数确定模块包括:Optionally, the parameter determination module includes:

ROI的移动速度分布参数估计模块,用于估计ROI的移动速度分布参数,且估计获得的所述ROI的移动速度分布参数包括: P ( MV ROI ) = &Sigma; i = 0 | G | - 1 &delta; ( MV i - MV ROI ) / | G | , 其中,δ为狄拉克函数,G为所述位置位于参考帧中ROI内的参考像素或宏块对应的当前帧中像素或宏块的运动矢量集合,MVi是指G中的第i个运动矢量,MVROI为ROI由前一帧向当前帧的移动速度;The moving speed distribution parameter estimation module of ROI is used for estimating the moving speed distribution parameter of ROI, and the moving speed distribution parameter of the ROI obtained by estimation includes: P ( MV ROI ) = &Sigma; i = 0 | G | - 1 &delta; ( MV i - MV ROI ) / | G | , Among them, δ is a Dirac function, G is the motion vector set of pixels or macroblocks in the current frame corresponding to the reference pixels or macroblocks in the ROI in the reference frame, and MV i refers to the i-th motion in G Vector, MV ROI is the moving speed of ROI from the previous frame to the current frame;

ROI缩放参数估计模块,用于估计ROI缩放参数,且估计获得的所述ROI缩放参数包括:

Figure BDA0000158966610000052
其中,a为,b为仿射参数,该仿射参数为采用最小二乘法结合四参数变换模型求解,相应的四参数变换模块为根据该当前帧中像素或宏块和对应的参考帧中的像素或宏块建立。ROI scaling parameter estimation module, for estimating ROI scaling parameters, and the estimated ROI scaling parameters obtained include:
Figure BDA0000158966610000052
Among them, a is, b is an affine parameter, and the affine parameter is solved by using the least squares method combined with a four-parameter transformation model, and the corresponding four-parameter transformation module is based on the pixel or macroblock in the current frame and the corresponding reference frame. Pixel or macroblock build.

可选地,所述粒子状态转移模块包括:Optionally, the particle state transfer module includes:

粒子位置速度转移模块,用于根据所述ROI的移动速度分布参数估计模块获得的ROI的移动速度分布参数确定粒子状态转移的速度v1、v2,包括;以0~1的均匀分布产生随机数μ,如果μ<α,则令

Figure BDA0000158966610000061
Figure BDA0000158966610000062
标志变量
Figure BDA0000158966610000063
否则,以分布P(MVROI)选取在上一模块中统计的运动矢量集合G中的一个元素对应的两个分量(MV′x,MV′y)分别作为v1、v2的值,即令v1=MV′x、v2=MV′y,并记
Figure BDA0000158966610000064
α为状态转移参数,其初始值为预先设定,在后续的粒子更新过程中更新该值的方式包括:
Figure BDA0000158966610000065
为k-1帧中粒子n中的vx分量,
Figure BDA0000158966610000067
为k-1帧中粒子n中的vy分量;The particle position and speed transfer module is used to determine the speed v 1 and v 2 of the particle state transfer according to the ROI moving speed distribution parameter obtained by the ROI moving speed distribution parameter estimation module, including: generating random number μ, if μ<α, then let
Figure BDA0000158966610000061
Figure BDA0000158966610000062
flag variable
Figure BDA0000158966610000063
Otherwise, select the two components (MV′ x , MV′ y ) corresponding to an element in the motion vector set G counted in the previous module as the values of v 1 and v 2 respectively by distribution P(MV ROI ), that is, v 1 =MV′ x , v 2 =MV′ y , and record
Figure BDA0000158966610000064
α is a state transition parameter, its initial value is preset, and the way to update this value in the subsequent particle update process includes:
Figure BDA0000158966610000065
is the v x component in particle n in frame k-1,
Figure BDA0000158966610000067
is the v y component of particle n in frame k-1;

粒子大小转移模块,用于根据所述ROI缩放参数估计模块获得的ROI缩放参数确定粒子缩放参数η,包括;以0~1的均匀分布产生随机数γ,如果γ<β,则令η=ρ,否则令η=1,其中,β为目标大小变化程度参数,其值为预先设定,ρ为所述ROI缩放参数;The particle size transfer module is used to determine the particle scaling parameter η according to the ROI scaling parameter obtained by the ROI scaling parameter estimation module, including; generating a random number γ with a uniform distribution of 0 to 1, if γ<β, then let η=ρ , otherwise let η=1, wherein, β is the target size change degree parameter, and its value is preset, and ρ is the ROI scaling parameter;

粒子状态转移结果确定模块,用于根据所述粒子位置速度转移模块确定的粒子状态转移的速度和所述粒子大小转移模块确定的粒子缩放参数进行粒子状态转移处理,获得第k帧中的第n个粒子的粒子状态转移后的结果包括:该粒子的位置( s k n { x } = s k - 1 n { x } + v 1 + &epsiv; x , s k n { y } = s k - 1 n { y } + v 2 + &epsiv; y ),该粒子的x、y方向的移动速度分别为: s k n { v x } = v 1 + &epsiv; v x s k n { v y } = v 2 + &epsiv; v y , 该粒子在所述位置上对应的椭圆的长半轴为 s k n { a } = &eta; &times; s k - 1 n { a } + &epsiv; a , 短半轴为 s k n { b } = &eta; &times; s k - 1 n { b } + &epsiv; b , 其中εx、εy是服从N(0,0.2)分布的随机变量,是服从N(0,0.25)的随机变量,εa、εb是服从N(0,0.1)的随机变量。The particle state transfer result determination module is used to perform particle state transfer processing according to the particle state transfer speed determined by the particle position speed transfer module and the particle scaling parameter determined by the particle size transfer module, to obtain the nth frame in the kth frame The result after the particle state transfer of a particle includes: the position of the particle ( the s k no { x } = the s k - 1 no { x } + v 1 + &epsiv; x , the s k no { the y } = the s k - 1 no { the y } + v 2 + &epsiv; the y ), the moving speed of the particle in the x and y directions are respectively: the s k no { v x } = v 1 + &epsiv; v x and the s k no { v the y } = v 2 + &epsiv; v the y , The semi-major axis of the ellipse corresponding to the particle at the position is the s k no { a } = &eta; &times; the s k - 1 no { a } + &epsiv; a , semi minor axis is the s k no { b } = &eta; &times; the s k - 1 no { b } + &epsiv; b , Where ε x , ε y are random variables that obey the N(0, 0.2) distribution, is a random variable subject to N(0, 0.25), and ε a and ε b are random variables subject to N(0, 0.1).

可选地,所述ROI确定模块包括:Optionally, the ROI determination module includes:

各粒子区域颜色直方图统计处理模块,用于对进行状态转移处理后的粒子执行各粒子区域颜色直方图统计处理;The statistical processing module of the color histogram of each particle area is used for performing the statistical processing of the color histogram of each particle area on the particles after the state transition processing;

粒子更新模块,用于根据各粒子区域颜色直方图统计处理结果进行粒子更新处理;The particle update module is used to perform particle update processing according to the statistical processing results of the color histogram of each particle area;

ROI位置大小计算模块,用于根据粒子更新处理获得的结果计算ROI位置大小。The ROI position and size calculation module is used to calculate the ROI position and size according to the result obtained by particle update processing.

由上述本发明提供的技术方案可以看出,本发明实施例提供的ROI跟踪技术,可以利用存在于压缩码流中或者编码时产生的运动矢量信息指导粒子状态转移过程,从而可以在保证跟踪效果的情况下,减少跟踪过程中所需的粒子数目,进而降低跟踪处理的复杂程度,并可以获得较佳的跟踪效果。It can be seen from the above-mentioned technical solution provided by the present invention that the ROI tracking technology provided by the embodiment of the present invention can use the motion vector information existing in the compressed code stream or generated during encoding to guide the particle state transfer process, thereby ensuring the tracking effect In the case of , the number of particles required in the tracking process is reduced, thereby reducing the complexity of the tracking process and obtaining a better tracking effect.

附图说明 Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在s不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings on the premise that s does not pay creative efforts.

图1为本发明实施例提供的方法的处理过程示意图;Fig. 1 is a schematic diagram of the processing process of the method provided by the embodiment of the present invention;

图2为本发明实施例提供的装置的结构示意图一;Fig. 2 is a structural schematic diagram 1 of the device provided by the embodiment of the present invention;

图3为本发明实施例提供的装置的结构示意图二;Fig. 3 is a schematic structural diagram II of the device provided by the embodiment of the present invention;

图4为本发明实施例提供的装置的结构示意图三;Fig. 4 is a schematic structural diagram III of the device provided by the embodiment of the present invention;

图5为本发明实施例提供的装置的结构示意图四;Fig. 5 is a structural schematic diagram 4 of the device provided by the embodiment of the present invention;

图6为本发明实施例提供的MV分布直方图;Fig. 6 is the MV distribution histogram provided by the embodiment of the present invention;

图7为本发明实施例提供的粒子状态转移示意图;Fig. 7 is a schematic diagram of particle state transition provided by the embodiment of the present invention;

图8为本发明实施例提供的装置的结构示意图五;Fig. 8 is a schematic diagram five of the structure of the device provided by the embodiment of the present invention;

图9为本发明实施例提供的粒子区域颜色直方图;Fig. 9 is a histogram of particle region colors provided by an embodiment of the present invention;

图10为本发明实施例提供的粒子更新过程示意图;Fig. 10 is a schematic diagram of the particle update process provided by the embodiment of the present invention;

图11为本发明实施例的应用效果示意图一;Fig. 11 is a schematic diagram of the application effect of the embodiment of the present invention;

图12为本发明实施例的应用效果示意图二;Fig. 12 is a second schematic diagram of the application effect of the embodiment of the present invention;

图13为本发明实施例的应用环境示意图一;FIG. 13 is a first schematic diagram of the application environment of the embodiment of the present invention;

图14为本发明实施例的应用环境示意图二。FIG. 14 is a second schematic diagram of the application environment of the embodiment of the present invention.

具体实施方式 Detailed ways

下面结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明的保护范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

下面将结合附图对本发明实施例作进一步地详细描述。Embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings.

本发明实施例提供了一种视频中的感兴趣区域跟踪方法,其具体实现方式如图1所示,可以包括以下步骤:An embodiment of the present invention provides a method for tracking a region of interest in a video, and its specific implementation is shown in Figure 1, which may include the following steps:

步骤11,获取当前帧中像素(或宏块)的运动矢量,并根据相应的运动矢量确定ROI的移动速度分布参数,还根据参考帧中ROI的状态信息确定ROI缩放参数;Step 11, obtaining the motion vector of the pixel (or macroblock) in the current frame, and determining the moving speed distribution parameter of ROI according to the corresponding motion vector, and also determining the ROI scaling parameter according to the status information of the ROI in the reference frame;

其中,相应的ROI位置待确定的当前帧简称为当前帧,当前帧在编码结构上的参考帧简称为参考帧,参考帧中ROI位置已知;Wherein, the current frame whose corresponding ROI position is to be determined is referred to as the current frame for short, and the reference frame of the current frame on the encoding structure is referred to as the reference frame for short, and the ROI position in the reference frame is known;

具体地,在该步骤中,确定ROI的移动速度分布参数的过程具体可以但不限于包括:Specifically, in this step, the process of determining the moving speed distribution parameters of the ROI may specifically include, but is not limited to:

首先,根据当前帧中像素或宏块的运动矢量确定当前帧中像素或宏块对应的参考像素或宏块在参考帧中的位置;之后,在当前帧中像素或宏块的运动矢量中选取相应的位置位于参考帧中ROI内的参考像素或宏块,并获取该参考像素或宏块对应的当前帧中像素或宏块的运动矢量;之后,则可以根据选取获得的当前帧中像素或宏块的运动矢量确定相应的ROI的移动速度分布参数;First, determine the position of the reference pixel or macroblock corresponding to the pixel or macroblock in the current frame in the reference frame according to the motion vector of the pixel or macroblock in the current frame; The corresponding position is located in the reference pixel or macroblock in the ROI in the reference frame, and the motion vector of the pixel or macroblock in the current frame corresponding to the reference pixel or macroblock is obtained; after that, the pixel or macroblock in the current frame can be obtained according to the selection. The motion vector of the macroblock determines the moving speed distribution parameter of the corresponding ROI;

根据参考帧中ROI的状态信息确定ROI缩放参数的步骤可以但不限于包括:The step of determining ROI scaling parameters according to the status information of the ROI in the reference frame may include, but is not limited to:

首先,根据上述选取的当前帧中像素或宏块的运动矢量确定对应的当前帧中像素或宏块;之后,可以根据该当前帧中像素或宏块和对应的参考帧中的像素或宏块确定所述ROI缩放参数。First, determine the corresponding pixel or macroblock in the current frame according to the motion vector of the selected pixel or macroblock in the current frame; then, according to the pixel or macroblock in the current frame and the pixel or macroblock in the corresponding reference frame Determine the ROI scaling parameters.

其中,上述ROI的移动速度分布参数和ROI缩放参数的计算方式可以但不限于包括:Wherein, the calculation methods of the above-mentioned ROI moving speed distribution parameters and ROI scaling parameters may include, but are not limited to:

ROI的移动速度分布参数 P ( MV ROI ) = &Sigma; i = 0 | G | - 1 &delta; ( MV i - MV ROI ) / | G | , 其中,δ为狄拉克函数,G为所述位置位于参考帧中ROI内的参考像素或宏块对应的当前帧中像素或宏块的运动矢量集合,MVi是指G中的第i个运动矢量,MVROI为ROI由前一帧(即参考帧)向当前帧的移动速度;ROI moving speed distribution parameters P ( MV ROI ) = &Sigma; i = 0 | G | - 1 &delta; ( MV i - MV ROI ) / | G | , Among them, δ is a Dirac function, G is the motion vector set of pixels or macroblocks in the current frame corresponding to the reference pixels or macroblocks in the ROI in the reference frame, and MV i refers to the i-th motion in G Vector, MV ROI is the moving speed of ROI from the previous frame (ie reference frame) to the current frame;

ROI缩放参数

Figure BDA0000158966610000082
其中,a为,b为仿射参数,该仿射参数采用最小二乘法结合四参数变换模型求解,相应的四参数变换模块为根据该当前帧中像素或宏块和对应的参考帧中的像素或宏块建立。ROI scaling parameters
Figure BDA0000158966610000082
Among them, a is, b is an affine parameter, and the affine parameter is solved by using the least squares method combined with the four-parameter transformation model, and the corresponding four-parameter transformation module is based on the pixel or macroblock in the current frame and the pixel in the corresponding reference frame or macroblock build.

步骤12,利用确定的ROI的移动速度分布参数和ROI缩放参数对当前帧中采样获得的粒子进行状态转移处理;Step 12, using the determined ROI moving speed distribution parameters and ROI scaling parameters to perform state transition processing on the particles obtained by sampling in the current frame;

该步骤的具体实现方式可以包括:The specific implementation of this step may include:

首先,根据上述ROI的移动速度分布参数确定粒子状态转移的速度v1、v2,包括;以0~1的均匀分布产生随机数μ,如果μ<α,则令

Figure BDA0000158966610000084
标志变量
Figure BDA0000158966610000085
否则,以分布P(MVROI)选取在上一模块中统计的运动矢量集合G中的一个元素对应的两个分量(MV′x,MV′y)分别作为v1、v2的值,即令v1=MV′x、v2=MV′y,并记
Figure BDA0000158966610000091
α为状态转移参数,其初始值为预先设定,在后续的粒子更新过程中更新该值的方式包括:
Figure BDA0000158966610000092
Figure BDA0000158966610000093
为k-1帧中粒子n中的vx分量,
Figure BDA0000158966610000094
为k-1帧中粒子n中的vy分量,且当前帧为第k帧,参考帧为第k-1帧;Firstly, according to the moving velocity distribution parameters of the above ROI, the velocity v 1 and v 2 of particle state transition are determined, including: generating a random number μ with a uniform distribution of 0 to 1, if μ<α, then set
Figure BDA0000158966610000084
flag variable
Figure BDA0000158966610000085
Otherwise, select the two components (MV′ x , MV′ y ) corresponding to an element in the motion vector set G counted in the previous module as the values of v 1 and v 2 respectively by distribution P(MV ROI ), that is, v 1 =MV′ x , v 2 =MV′ y , and record
Figure BDA0000158966610000091
α is a state transition parameter, its initial value is preset, and the way to update this value in the subsequent particle update process includes:
Figure BDA0000158966610000092
Figure BDA0000158966610000093
is the v x component in particle n in frame k-1,
Figure BDA0000158966610000094
is the v y component of particle n in frame k-1, and the current frame is frame k, and the reference frame is frame k-1;

之后,根据上述ROI缩放参数确定粒子缩放参数η,包括;以0~1的均匀分布产生随机数γ,如果γ<β,则令η=ρ,否则令η=1,其中,β为目标大小变化程度参数,其值为预先设定,ρ为所述缩放参数;Afterwards, determine the particle scaling parameter η according to the above-mentioned ROI scaling parameters, including; generate a random number γ with a uniform distribution of 0 to 1, if γ<β, then make η=ρ, otherwise let η=1, where β is the target size The degree of change parameter, its value is preset, and ρ is the scaling parameter;

最后,根据上述粒子状态转移的速度和粒子缩放参数进行粒子状态转移处理,获得第k帧中的第n个粒子的粒子状态转移后的结果包括:该粒子的位置( s k n { x } = s k - 1 n { x } + v 1 + &epsiv; x , s k n { y } = s k - 1 n { y } + v 2 + &epsiv; y ),该粒子的x、y方向的移动速度分别为: s k n { v x } = v 1 + &epsiv; v x s k n { v y } = v 2 + &epsiv; v y , 该粒子在所述位置上对应的椭圆的长半轴为 s k n { a } = &eta; &times; s k - 1 n { a } + &epsiv; a , 短半轴为 s k n { b } = &eta; &times; s k - 1 n { b } + &epsiv; b , 其中εx、εy是服从N(0,0.2)分布的随机变量,

Figure BDA00001589666100000911
是服从N(0,0.25)的随机变量,εa、εb是服从N(0,0.1)的随机变量。Finally, the particle state transfer process is performed according to the speed of the above-mentioned particle state transfer and the particle scaling parameter, and the result after obtaining the particle state transfer of the nth particle in the kth frame includes: the position of the particle ( the s k no { x } = the s k - 1 no { x } + v 1 + &epsiv; x , the s k no { the y } = the s k - 1 no { the y } + v 2 + &epsiv; the y ), the moving speed of the particle in the x and y directions are respectively: the s k no { v x } = v 1 + &epsiv; v x and the s k no { v the y } = v 2 + &epsiv; v the y , The semi-major axis of the ellipse corresponding to the particle at the position is the s k no { a } = &eta; &times; the s k - 1 no { a } + &epsiv; a , semi minor axis is the s k no { b } = &eta; &times; the s k - 1 no { b } + &epsiv; b , Where ε x , ε y are random variables that obey the N(0, 0.2) distribution,
Figure BDA00001589666100000911
is a random variable subject to N(0, 0.25), and ε a and ε b are random variables subject to N(0, 0.1).

步骤13,根据状态转移后的粒子确定当前帧的ROI位置及大小,实现针对视频中的ROI的跟踪处理;Step 13, determine the ROI position and size of the current frame according to the particles after the state transition, and realize the tracking processing for the ROI in the video;

具体地,该步骤的具体实现方式可以包括:Specifically, the specific implementation of this step may include:

对进行状态转移处理后的粒子执行各粒子区域颜色直方图统计处理,并根据各粒子区域颜色直方图统计处理结果进行粒子更新处理;Perform the statistical processing of the color histogram of each particle area on the particles after the state transition processing, and perform particle update processing according to the statistical processing results of the color histogram of each particle area;

根据粒子更新处理获得的结果计算ROI位置大小。Calculate the ROI position size based on the results obtained from the particle update process.

本发明实施例主要是利用码流中或者编码时产生的附加信息指导粒子状态转移,从而可以保证针对ROI的跟踪效果,且可以降低跟踪过程的处理复杂度。具体地,本发明利用了存在于压缩码流中或者编码时产生的MV信息指导粒子滤波算法中粒子状态转移过程,从而能在保证跟踪效果的情况下,减少所需的粒子数目,进而降低跟踪处理过程的复杂程度;或者,本发明在采用相同粒子数目进行跟踪处理的情况下,能够获得更加稳定的跟踪效果。而且,本发明还利用了粒子滤波理论对噪声的稳定性来获得跟踪算法的鲁棒性,进一步保证了本发明实施例提供的跟踪技术方案的跟踪效果。The embodiments of the present invention mainly use the additional information in the code stream or generated during encoding to guide particle state transition, thereby ensuring the tracking effect on the ROI and reducing the processing complexity of the tracking process. Specifically, the present invention utilizes the MV information existing in the compressed code stream or generated during encoding to guide the particle state transition process in the particle filter algorithm, thereby reducing the number of particles required while ensuring the tracking effect, thereby reducing tracking The complexity of the processing process; or, the present invention can obtain a more stable tracking effect under the condition that the same number of particles is used for tracking processing. Moreover, the present invention also utilizes the stability of the particle filter theory to noise to obtain the robustness of the tracking algorithm, which further ensures the tracking effect of the tracking technical solution provided by the embodiment of the present invention.

本发明实施例还提供了一种视频中的感兴趣区域跟踪装置,其具体实现结构如图2所示,可以包括:The embodiment of the present invention also provides a device for tracking a region of interest in a video, and its specific implementation structure is shown in Figure 2, which may include:

(1)移动速度分布参数及缩放参数确定模块21,用于获取当前帧中像素或宏块的运动矢量,并根据所述运动矢量确定感兴趣区域ROI的移动速度分布参数,还根据参考帧中ROI的状态信息确定ROI缩放参数;(1) Moving speed distribution parameter and scaling parameter determining module 21, used to obtain the motion vector of the pixel or macroblock in the current frame, and determine the moving speed distribution parameter of the region of interest ROI according to the motion vector, and also according to the moving speed distribution parameter in the reference frame The status information of the ROI determines the ROI scaling parameter;

进一步地,如图3所示,该移动速度分布参数及缩放参数确定模块21具体可以包括:Further, as shown in FIG. 3 , the moving speed distribution parameter and scaling parameter determination module 21 may specifically include:

运动矢量获取模块211,用于根据当前帧中像素或宏块的运动矢量确定当前帧中像素或宏块对应的参考像素或宏块在参考帧中的位置,并在当前帧中像素或宏块的运动矢量中选取所述位置位于参考帧中ROI内的参考像素或宏块,再获取该参考像素或宏块对应的当前帧中像素或宏块的运动矢量;The motion vector acquisition module 211 is configured to determine the position of the reference pixel or macroblock corresponding to the pixel or macroblock in the current frame in the reference frame according to the motion vector of the pixel or macroblock in the current frame, and determine the position of the pixel or macroblock in the current frame Select the reference pixel or macroblock whose position is located in the ROI in the reference frame from the motion vector, and then obtain the motion vector of the pixel or macroblock in the current frame corresponding to the reference pixel or macroblock;

参数确定模块212,用于根据上述运动矢量获取模块211选取获得的当前帧中像素或宏块的运动矢量确定相应的ROI的移动速度分布参数;还根据选取获得的当前帧中像素或宏块的运动矢量确定对应的当前帧中像素或宏块,并根据该当前帧中像素或宏块和对应的参考帧中的像素或宏块确定相应的ROI缩放参数;The parameter determining module 212 is used to determine the moving speed distribution parameter of the corresponding ROI according to the motion vector of the pixel or macroblock in the current frame selected and obtained by the above-mentioned motion vector obtaining module 211; The motion vector determines the corresponding pixel or macroblock in the current frame, and determines the corresponding ROI scaling parameter according to the pixel or macroblock in the current frame and the pixel or macroblock in the corresponding reference frame;

该参数确定模块212具体可以包括ROI的移动速度分布参数估计模块2121和ROI缩放参数估计模块2122,其中:The parameter determination module 212 may specifically include an ROI moving speed distribution parameter estimation module 2121 and an ROI scaling parameter estimation module 2122, wherein:

ROI的移动速度分布参数估计模块2121,用于估计ROI的移动速度分布参数,且估计获得的所述ROI的移动速度分布参数包括: P ( MV ROI ) = &Sigma; i = 0 | G | - 1 &delta; ( MV i - MV ROI ) / | G | , 其中,δ为狄拉克函数,G为所述位置位于参考帧中ROI内的参考像素或宏块对应的当前帧中像素或宏块的运动矢量集合,MVi是指G中的第i个运动矢量,MVROI为ROI由前一帧(即参考帧)向当前帧的移动速度;The ROI moving speed distribution parameter estimation module 2121 is used to estimate the ROI moving speed distribution parameter, and the estimated moving speed distribution parameter of the ROI includes: P ( MV ROI ) = &Sigma; i = 0 | G | - 1 &delta; ( MV i - MV ROI ) / | G | , Among them, δ is a Dirac function, G is the motion vector set of pixels or macroblocks in the current frame corresponding to the reference pixels or macroblocks in the ROI in the reference frame, and MV i refers to the i-th motion in G Vector, MV ROI is the moving speed of ROI from the previous frame (ie reference frame) to the current frame;

ROI缩放参数估计模块2122,用于估计ROI缩放参数,且估计获得的所述ROI缩放参数包括:

Figure BDA0000158966610000102
其中,a为,b为为仿射参数,该仿射参数采用最小二乘法结合四参数变换模型求解,相应的四参数变换模块为根据该当前帧中像素或宏块和对应的参考帧中的像素或宏块建立。The ROI scaling parameter estimation module 2122 is configured to estimate the ROI scaling parameter, and the estimated ROI scaling parameter includes:
Figure BDA0000158966610000102
Among them, a is, b is an affine parameter, and the affine parameter is solved by the least square method combined with the four-parameter transformation model, and the corresponding four-parameter transformation module is based on the pixel or macroblock in the current frame and the corresponding reference frame. Pixel or macroblock build.

(2)粒子状态转移模块22,用于利用上述移动速度分布参数及缩放参数确定模块21确定的ROI的移动速度分布参数和缩放参数对当前帧中采样获得的粒子进行状态转移处理;(2) particle state transfer module 22, for utilizing the moving speed distribution parameter and the scaling parameter of the ROI determined by the above-mentioned moving speed distribution parameter and scaling parameter determining module 21 to carry out state transition processing to the particles sampled and obtained in the current frame;

进一步地,参照图8所示,相应的粒子状态转移模块可以包括:Further, as shown in FIG. 8, the corresponding particle state transfer module may include:

粒子位置速度转移模块221,用于根据上述ROI的移动速度分布参数估计模块2121获得的ROI的移动速度分布参数确定粒子状态转移的速度v1、v2,包括;以0~1的均匀分布产生随机数μ,如果μ<α,则令

Figure BDA0000158966610000111
Figure BDA0000158966610000112
标志变量
Figure BDA0000158966610000113
否则,以分布P(MVROI)选取在上一模块中统计的运动矢量集合G中的一个元素对应的两个分量(MV′x,MV′y)分别作为v1、v2的值,即令v1=MV′x、v2=MV′y,并记α为状态转移参数,其初始值为预先设定,在后续的粒子更新过程中更新该值的方式包括:
Figure BDA0000158966610000115
Figure BDA0000158966610000116
为k-1帧中粒子n中的vx分量,
Figure BDA0000158966610000117
为k-1帧中粒子n中的vy分量;The particle position and velocity transfer module 221 is used to determine the velocity v 1 and v 2 of the particle state transition according to the ROI moving velocity distribution parameter obtained by the above ROI moving velocity distribution parameter estimation module 2121, including; Random number μ, if μ<α, then let
Figure BDA0000158966610000111
Figure BDA0000158966610000112
flag variable
Figure BDA0000158966610000113
Otherwise, select the two components (MV′ x , MV′ y ) corresponding to an element in the motion vector set G counted in the previous module as the values of v 1 and v 2 respectively by distribution P(MV ROI ), that is, v 1 =MV′ x , v 2 =MV′ y , and record α is a state transition parameter, its initial value is preset, and the way to update this value in the subsequent particle update process includes:
Figure BDA0000158966610000115
Figure BDA0000158966610000116
is the v x component in particle n in frame k-1,
Figure BDA0000158966610000117
is the v y component of particle n in frame k-1;

粒子大小转移模块222,用于根据上述ROI缩放参数估计模块2122获得的ROI缩放参数确定粒子缩放参数η,具体可以包括;以0~1的均匀分布产生随机数γ,如果γ<β,则令η=ρ,否则令η=1,其中,β为目标大小变化程度参数,其值为预先设定,ρ为上述ROI缩放参数;The particle size transfer module 222 is used to determine the particle scaling parameter η according to the ROI scaling parameter obtained by the above-mentioned ROI scaling parameter estimation module 2122, which may specifically include: generating a random number γ with a uniform distribution of 0 to 1, if γ<β, then set η=ρ, otherwise make η=1, wherein, β is the target size change degree parameter, and its value is preset, and ρ is the above-mentioned ROI scaling parameter;

粒子状态转移结果确定模块223,用于根据相应的粒子位置速度转移模块221确定的粒子状态转移的速度和所述粒子大小转移模块222确定的粒子缩放参数进行粒子状态转移处理,获得第k帧中的第n个粒子的粒子状态转移后的结果包括:该粒子的位置( s k n { x } = s k - 1 n { x } + v 1 + &epsiv; x , s k n { y } = s k - 1 n { y } + v 2 + &epsiv; y ),该粒子的x、y方向的移动速度分别为: s k n { v x } = v 1 + &epsiv; v x s k n { v y } = v 2 + &epsiv; v y , 该粒子在所述位置上对应的椭圆的长半轴为 s k n { a } = &eta; &times; s k - 1 n { a } + &epsiv; a , 短半轴为 s k n { b } = &eta; &times; s k - 1 n { b } + &epsiv; b , 其中εx、εy是服从N(0,0.2)分布的随机变量,

Figure BDA00001589666100001114
是服从N(0,0.25)的随机变量,εa、εb是服从N(0,0.1)的随机变量。Particle state transfer result determination module 223, for performing particle state transfer processing according to the particle state transfer speed determined by the corresponding particle position speed transfer module 221 and the particle scaling parameter determined by the particle size transfer module 222, to obtain the kth frame The results of the particle state transfer of the nth particle include: the position of the particle ( the s k no { x } = the s k - 1 no { x } + v 1 + &epsiv; x , the s k no { the y } = the s k - 1 no { the y } + v 2 + &epsiv; the y ), the moving speed of the particle in the x and y directions are respectively: the s k no { v x } = v 1 + &epsiv; v x and the s k no { v the y } = v 2 + &epsiv; v the y , The semi-major axis of the ellipse corresponding to the particle at the position is the s k no { a } = &eta; &times; the s k - 1 no { a } + &epsiv; a , semi minor axis is the s k no { b } = &eta; &times; the s k - 1 no { b } + &epsiv; b , Where ε x , ε y are random variables that obey the N(0, 0.2) distribution,
Figure BDA00001589666100001114
is a random variable subject to N(0, 0.25), and ε a and ε b are random variables subject to N(0, 0.1).

(3)ROI确定模块23,用于根据上述粒子状态转移模块22进行状态转移后的粒子,确定当前帧的ROI位置及大小;(3) ROI determination module 23, used for determining the ROI position and size of the current frame according to the particle after the state transfer of the above-mentioned particle state transfer module 22;

具体地,如图4所示,该ROI确定模块具体可以包括:Specifically, as shown in Figure 4, the ROI determination module may specifically include:

各粒子区域颜色直方图统计处理模块231,用于对进行状态转移处理后的粒子执行各粒子区域颜色直方图统计处理;The statistical processing module 231 of the color histogram of each particle area is used for performing the statistical processing of the color histogram of each particle area on the particles after the state transition process;

粒子更新模块232,用于根据上述各粒子区域颜色直方图统计处理模块231执行各粒子区域颜色直方图统计处理获得的结果进行粒子更新处理;The particle update module 232 is used to perform particle update processing according to the results obtained by performing the statistical processing of the color histogram of each particle area by the above-mentioned color histogram statistical processing module 231 of each particle area;

ROI位置大小计算模块233,用于根据上述粒子更新模块232执行粒子更新处理获得的结果计算ROI位置大小。The ROI position and size calculation module 233 is configured to calculate the ROI position and size according to the results obtained by the above particle update module 232 executing particle update processing.

同样,上述装置中,利用了存在于压缩码流中或者编码时产生的MV信息指导粒子状态转移过程,从而能够在保证跟踪效果的情况下,减少所需粒子数目,或者,在采用相同粒子数目进行跟踪处理的情况下,能够获得更加稳定的跟踪效果。Similarly, in the above-mentioned device, the MV information existing in the compressed code stream or generated during encoding is used to guide the particle state transfer process, so that the number of required particles can be reduced while ensuring the tracking effect, or, when using the same number of particles In the case of tracking processing, a more stable tracking effect can be obtained.

也就是说,为了提高ROI跟踪的精确度并且降低跟踪的复杂度,本发明实施例中采用了利用相应的编码过程中产生的或码流中已经存在的MV信息指导粒子滤波算法中粒子的状态转移的实现方式,以获得更加优越的跟踪效果。That is to say, in order to improve the accuracy of ROI tracking and reduce the complexity of tracking, the embodiment of the present invention uses MV information generated in the corresponding encoding process or existing in the code stream to guide the state of particles in the particle filter algorithm. The implementation of the transfer to obtain a more superior tracking effect.

为便于更好地理解本发明实施例,下面将结合附图及具体应用过程对本发明实施例进行详细的阐述。In order to facilitate a better understanding of the embodiments of the present invention, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings and specific application processes.

本发明实施例中,具体是根据粒子滤波理论,利用编码过程中产生的或者码流中已经存在的MV信息实现对ROI的跟踪。其中,ROI是逐帧获取的,当前帧中ROI的位置、大小等数据是根据其参考帧中ROI的信息获得。相应的跟踪过程主要可以包括:In the embodiment of the present invention, specifically, according to the particle filter theory, the tracking of the ROI is realized by utilizing the MV information generated during the encoding process or already existing in the code stream. Wherein, the ROI is obtained frame by frame, and data such as the position and size of the ROI in the current frame is obtained according to the information of the ROI in the reference frame. The corresponding tracking process mainly includes:

首先,从参考帧的缓存中取得当前帧的参考帧,根据参考帧中ROI的状态信息和像素(或宏块)的MV,由ROI移动速度分布参数和缩放参数估计模块,估计ROI向当前帧移动的速度分布和缩放参数;First, obtain the reference frame of the current frame from the cache of the reference frame, and estimate the direction of the ROI to the current frame by the ROI moving speed distribution parameter and the scaling parameter estimation module according to the state information of the ROI in the reference frame and the MV of the pixel (or macroblock). Speed distribution and scaling parameters for movement;

其次,由粒子状态转移模块估计当前帧中的ROI位置和大小信息分布;Secondly, the ROI position and size information distribution in the current frame is estimated by the particle state transfer module;

第三,利用各粒子覆盖区域颜色直方图统计模块统计得到的各粒子区域的颜色直方图,经粒子更新模块对由粒子状态转移模块得到的ROI的信息分布做进一步修正,计算输出当前帧中ROI的位置大小信息,并将其和当前帧一起存入参考帧缓存,以便估计后续帧中的ROI信息。Third, use the color histogram of each particle area obtained by statistics of the color histogram statistical module of each particle coverage area, and further correct the information distribution of the ROI obtained by the particle state transfer module through the particle update module, and calculate and output the ROI in the current frame The location and size information of the current frame is stored in the reference frame buffer together with the current frame, so as to estimate the ROI information in the subsequent frame.

具体地,如图4所示,本发明实施例提供的装置具体可以包括:Specifically, as shown in Figure 4, the device provided by the embodiment of the present invention may specifically include:

(1)参考帧获取模块(1) Reference frame acquisition module

该模块用于获取当前帧的参考帧,与传统编码方法中获取参考帧的方法相同,图中未示出。This module is used to obtain the reference frame of the current frame, which is the same as the method of obtaining the reference frame in the traditional coding method, which is not shown in the figure.

(2)R0I移动速度分布参数和缩放参数估计模块(2) R0I moving speed distribution parameter and scaling parameter estimation module

该模块即为移动速度分布参数及缩放参数确定模块,其用于获得ROI区域的移动速度分布参数分布估计和缩放参数估计,如图5所示,该模块进一步可以包括MV获取模块、ROI移动速度分布参数估计模块和ROI缩放参数估计模块,下面将分别对各个模块完成的处理功能进行描述:This module is the moving speed distribution parameter and scaling parameter determination module, which is used to obtain the moving speed distribution parameter distribution estimation and scaling parameter estimation of the ROI area, as shown in Figure 5, this module can further include MV acquisition module, ROI moving speed The distribution parameter estimation module and the ROI scaling parameter estimation module, the following will describe the processing functions completed by each module respectively:

(21)MV获取模块,即运动矢量获取模块,用于统计参考像素(或宏块,以下描述中出现的像素均可以替换为宏块)位于参考帧中ROI区域内的像素的MV,相应的MV为一个二维向量(MVx,MVy),即像素的MV在x、y方向的分量;(21) The MV acquisition module, that is, the motion vector acquisition module, is used to count the reference pixels (or macroblocks, the pixels appearing in the following descriptions can be replaced by macroblocks) MV of pixels located in the ROI area of the reference frame, corresponding MV is a two-dimensional vector (MV x , MV y ), that is, the component of the MV of the pixel in the x and y directions;

具体地,根据H.264/SVC编码标准易知,由当前帧中像素的MV可以得到其参考像素在参考帧中的位置,因此,若当前帧中某个像素的参考像素若处于参考帧中的ROI区域内,则获取当前帧中该像素的MV,将其参考像素处于参考帧中ROI区域的当前帧中的多个像素记为集合G,该集合G中的元素个数为|G|,第i个元素为gi,gi的MV记为

Figure BDA0000158966610000131
i=0,1,…,|G|-1;进一步,将G中各元素MV的集合记为M;Specifically, according to the H.264/SVC coding standard, it is easy to know that the position of its reference pixel in the reference frame can be obtained from the MV of the pixel in the current frame. Therefore, if the reference pixel of a certain pixel in the current frame is in the reference frame In the ROI area of the current frame, the MV of the pixel in the current frame is obtained, and the multiple pixels in the current frame whose reference pixels are in the ROI area in the reference frame are recorded as a set G, and the number of elements in the set G is |G| , the i-th element is g i , and the MV of g i is recorded as
Figure BDA0000158966610000131
i=0, 1, ..., |G|-1; further, the set of each element MV in G is recorded as M;

例如,如图6所示,相应的MV1、MV2、MV3所关联的参考像素位于参考帧中的ROI区域内,因此,该MV1、MV2、MV3对应的当前帧中的像素在统计之列,即需要将对应的像素记录在集合G中;而MV0所关联的参考像素位于参考帧中ROI之外,因此,该MV0对应的当前帧中的像素不在统计之列。For example, as shown in Figure 6, the reference pixels associated with the corresponding MV1, MV2, and MV3 are located in the ROI region in the reference frame, so the pixels in the current frame corresponding to the MV1, MV2, and MV3 are included in the statistics, that is The corresponding pixels need to be recorded in the set G; and the reference pixels associated with the MVO are located outside the ROI in the reference frame, therefore, the pixels in the current frame corresponding to the MVO are not included in the statistics.

(22)移动速度分布估计模块,用于统计参考像素位于参考帧中ROI区域内的当前帧中像素的(-MV)分布直方图,其中-MV是对MV的两个分量分别取负号得到,即MV获取模块得到的集合G中的像素的-MV分布直方图,并对其用L1范数归一化,用来作为ROI区域由参考帧向当前帧的移动速度概率分布的估计,具体地可以将其记为移动速度分布参数P(MVROI),即:(22) The moving speed distribution estimation module is used to count the (-MV) distribution histogram of the pixels in the current frame where the reference pixels are located in the ROI region in the reference frame, wherein -MV is obtained by taking the negative sign of the two components of the MV respectively , that is, the -MV distribution histogram of the pixels in the set G obtained by the MV acquisition module, and normalized by the L1 norm, used as an estimate of the probability distribution of the moving speed of the ROI area from the reference frame to the current frame, specifically It can be recorded as the moving velocity distribution parameter P(MV ROI ), that is:

P ( MV ROI ) = &Sigma; i = 0 | G | - 1 &delta; ( MV i - MV ROI ) / | G | , 其中,δ为狄拉克函数,G为所述位置位于参考帧中ROI内的参考像素对应的当前帧中像素或宏块的运动矢量集合,MVi是指G中的第i个运动矢量,MVROI为ROI由前一帧(即参考帧)向当前帧的移动速度。 P ( MV ROI ) = &Sigma; i = 0 | G | - 1 &delta; ( MV i - MV ROI ) / | G | , Among them, δ is a Dirac function, G is the motion vector set of the pixel or macroblock in the current frame corresponding to the reference pixel in the ROI where the position is located in the reference frame, MV i refers to the i-th motion vector in G, MV The ROI is the moving speed of the ROI from the previous frame (ie, the reference frame) to the current frame.

图6中仅给出了统计P(MVROI)的一个示例,其中‘+’代表像素,如虚线箭头尾部对应的像素参考像素不位于参考帧中的ROI区域内,其运动矢量MV0不在统计之列;其他的运动矢量如MV1,MV2等均在统计之列。Figure 6 only gives an example of statistics P(MV ROI ), where '+' represents a pixel, such as the pixel reference pixel corresponding to the tail of the dotted arrow is not located in the ROI area in the reference frame, and its motion vector MV 0 is not included in the statistics list; other motion vectors such as MV 1 , MV 2 etc. are included in the statistics.

(23)ROI区域的缩放参数估计模块,用于估计获得ROI区域的缩放参数,该缩放参数用于指示参考帧中的ROI区域与当前帧中的ROI区域间的缩放关系,具体地,可以基于仿射变换的方式获得该缩放参数,该缩放参数可以为:

Figure BDA0000158966610000141
其中,a、b为仿射变换参数;(23) The scaling parameter estimation module of the ROI area is used to estimate and obtain the scaling parameter of the ROI area. The scaling parameter is used to indicate the scaling relationship between the ROI area in the reference frame and the ROI area in the current frame. Specifically, it can be based on The scaling parameter is obtained by means of affine transformation, and the scaling parameter can be:
Figure BDA0000158966610000141
Among them, a and b are affine transformation parameters;

具体地获得该ROI缩放参数的方式可以包括:Specifically, the manner of obtaining the ROI scaling parameter may include:

设G中第i个元素gi的坐标为(xi,yi),则其对应的参考像素的坐标为

Figure BDA0000158966610000142
采用仿射变换的一种特例,即四参数变换模型作为目标的移动变换模型,即:Let the coordinates of the i-th element g i in G be (x i , y i ), then the coordinates of its corresponding reference pixel are
Figure BDA0000158966610000142
A special case of using affine transformation, that is, a four-parameter transformation model as the moving transformation model of the target, namely:

x i y i = a - b b a &times; u i v i + c d , 其中a、b、c、d是仿射变换参数; x i the y i = a - b b a &times; u i v i + c d , Where a, b, c, and d are affine transformation parameters;

采用最小二乘准则对上述集合G中的所有像素估计ROI统一的四参数变换模型,则可以构造如下矩阵A、B、C,即:Using the least squares criterion to estimate a four-parameter transformation model with a unified ROI for all pixels in the above set G, the following matrices A, B, and C can be constructed, namely:

AA == aa bb cc dd ,, BB == .. .. .. uu ii (( -- vv ii )) 11 00 vv ii uu ii 00 11 .. .. .. ,, CC == .. .. .. xx ii ythe y ii .. .. .. ;;

这样,相应的目标的移动变换模型可以转化为C=B×A,由最小二乘准则可解得A=(BTB)-1BTC,其中BT为B的转置矩阵,仿射变换参数a、b是矩阵A中的a、b分量,由于矩阵B和C为已知量,故可以获得仿射变换参数a、b的值,进而可以计算获得相应的缩放参数的值ρ。In this way, the mobile transformation model of the corresponding target can be converted into C=B×A, and A=(B T B) -1 B T C can be solved by the least square criterion, where B T is the transposition matrix of B, as The projection transformation parameters a and b are the a and b components in the matrix A. Since the matrices B and C are known quantities, the values of the affine transformation parameters a and b can be obtained, and then the value of the corresponding scaling parameter ρ can be calculated. .

(3)粒子转移模块(3) Particle transfer module

该模块即粒子状态转移模块,其可以用于根据ROI移动速度分布参数和缩放参数估计模块得到的ROI区域由参考帧向当前帧的移动速度概率分布的估计P(MVROI)和缩放参数的估计ρ,对粒子的状态转移做指导,以达到更好的跟踪结果。This module is the particle state transfer module, which can be used to estimate the probability distribution of the moving speed of the ROI area from the reference frame to the current frame according to the ROI moving speed distribution parameter and the scaling parameter estimation module P(MV ROI ) and the estimation of the scaling parameter ρ, to guide the state transition of particles to achieve better tracking results.

具体地,该模块的目的是对当前帧的ROI分布做初步估计,如图7所示,每个圆圈代表一个粒子(包含ROI的位置大小等信息),参考帧中的粒子集合表示参考帧中ROI的状态信息分布,参考帧中的粒子集合经过粒子状态转移后获得当前帧中的粒子集合,该当前帧中的粒子集合代表了当前帧中ROI的状态信息分布;Specifically, the purpose of this module is to make a preliminary estimate of the ROI distribution of the current frame. As shown in Figure 7, each circle represents a particle (including information such as the position and size of the ROI), and the particle set in the reference frame represents the particle set in the reference frame. The state information distribution of the ROI, the particle set in the reference frame is transferred through the particle state to obtain the particle set in the current frame, and the particle set in the current frame represents the state information distribution of the ROI in the current frame;

在进行粒子状态转移的处理过程中,该模块需要利用到的信息包括:参考帧中表示ROI分布的粒子状态、状态转移参数α,以及P(MVROI)和ρ,其中,α初始值可以但不限定设置为0.5,在后续的处理过程中还会自动更新该状态转移参数α的值。During the process of particle state transfer, the information that this module needs to use includes: the particle state representing the ROI distribution in the reference frame, the state transfer parameter α, and P(MV ROI ) and ρ, where the initial value of α can be The setting is not limited to 0.5, and the value of the state transition parameter α will be automatically updated in the subsequent processing.

具体地,需要针对每个粒子均执行同样的处理,这里仅以针对第n个粒子的状态转移处理为例进行说明说明,如图8所示,针对第n个粒子的状态转移处理过程可以包括:Specifically, it is necessary to perform the same processing for each particle. Here, only the state transition processing for the nth particle is taken as an example for illustration. As shown in FIG. 8, the state transition processing process for the nth particle may include :

首先,确定粒子状态转移的速度,具体可以包括:以0~1的均匀分布产生随机数μ,如果μ<α,则令

Figure BDA0000158966610000151
(即k-1帧中粒子n中的vx分量,以下此类表达式含义类似)、
Figure BDA0000158966610000153
否则,以根据ROI区域由参考帧向当前帧的移动速度概率分布的估计结果P(MVROI)在之前获得的运动矢量集合M中选取一个元素对应的两个分量(MV′x,MV′y)分别作为v1、v2的值,即令v1=MV′x、v2=Mv′y,并记
Figure BDA0000158966610000154
其中,v1、v2临时变量;First, determine the speed of particle state transfer, which may specifically include: generating a random number μ with a uniform distribution of 0 to 1, if μ<α, then let
Figure BDA0000158966610000151
(that is, the v x component in particle n in frame k-1, the following expressions have similar meanings),
Figure BDA0000158966610000153
Otherwise, according to the estimation result P(MV ROI ) of the probability distribution of the moving speed of the ROI area from the reference frame to the current frame, select two components (MV′ x , MV′ y ) corresponding to an element in the previously obtained motion vector set M ) as the values of v 1 and v 2 respectively, that is, set v 1 =MV′ x , v 2 =Mv′ y , and record
Figure BDA0000158966610000154
Among them, v 1 and v 2 are temporary variables;

其次,确定粒子缩放参数,具体可以包括:以0~1的均匀分布产生随机数γ,如果γ<β,则令η=ρ,否则令η=1,其中,η是临时变量,β是目标大小变化程度参数,其为一常量参数,用于控制目标大小的变化程度,如果目标的大小变化速度比较快,β取值较大,否则,β取值较小,一般相邻两帧中目标大小变化通常不是很剧烈,所以可以但不限于设置参数β为0.2;Secondly, determine the particle scaling parameters, which may specifically include: generating a random number γ with a uniform distribution of 0 to 1, if γ<β, then set η=ρ, otherwise set η=1, where η is a temporary variable, and β is the target Size change degree parameter, which is a constant parameter, used to control the change degree of the target size, if the size of the target changes faster, the value of β is larger, otherwise, the value of β is smaller, generally the target in two adjacent frames The size change is usually not very drastic, so you can but not limited to set the parameter β to 0.2;

第三,粒子状态转移,根据之前确定的临时变量v1、v2和η进行粒子状态转移处理,具体地,计算第k帧中的第n个粒子的对应的粒子的状态转移结果为:该粒子在x轴方向上的位置该粒子在y轴方向上的位置 s k n { y } = s k - 1 n { y } + v 2 + &epsiv; y , 该粒子在x轴方向上的移动速度 s k n { v x } = v 1 + &epsiv; v x , 该粒子在y轴方向上的移动速度

Figure BDA0000158966610000159
该粒子在相应位置上对应的椭圆的长半轴该粒子在相应位置上对应的椭圆的短半轴
Figure BDA00001589666100001511
其中εx、εy是服从N(0,0.2)分布的随机变量,
Figure BDA00001589666100001512
是服从N(0,0.25)的随机变量,εa、εb是服从N(0,0.1)的随机变量。其中,
Figure BDA0000158966610000161
表示第k帧中的第n个粒子,其含义为:第k帧中ROI以概率
Figure BDA0000158966610000162
出现在(x,y)处,长半轴和短半轴分别为a、b,并以(vx,vy)的速度向下一帧移动;Third, particle state transfer, according to the previously determined temporary variables v 1 , v 2 and η, perform particle state transfer processing, specifically, calculate the state transfer result of the particle corresponding to the nth particle in the kth frame is: the position of the particle in the x-axis direction The position of the particle in the y-axis direction the s k no { the y } = the s k - 1 no { the y } + v 2 + &epsiv; the y , The moving speed of the particle in the x-axis direction the s k no { v x } = v 1 + &epsiv; v x , The moving speed of the particle in the y-axis direction
Figure BDA0000158966610000159
The semi-major axis of the ellipse corresponding to the particle at the corresponding position The semi-minor axis of the ellipse corresponding to the particle at the corresponding position
Figure BDA00001589666100001511
Where ε x , ε y are random variables that obey the N(0, 0.2) distribution,
Figure BDA00001589666100001512
is a random variable subject to N(0, 0.25), and ε a and ε b are random variables subject to N(0, 0.1). in,
Figure BDA0000158966610000161
Represents the nth particle in the kth frame, which means: the ROI in the kth frame is calculated with probability
Figure BDA0000158966610000162
Appears at (x, y), the semi-major axis and semi-minor axis are a and b respectively, and moves to the next frame at the speed of (v x , v y );

(4)各粒子区域颜色直方图统计模块(4) The color histogram statistical module of each particle area

该模块用于计算粒子滤波理论的观测模型,针对每个粒子均需要执行相同的操作,下面以针对粒子n计算粒子滤波理论的观测模型为例进行说明。This module is used to calculate the observation model of the particle filter theory, and the same operation needs to be performed for each particle. The following uses the calculation of the observation model of the particle filter theory for particle n as an example to illustrate.

当前帧中粒子n,状态为

Figure BDA0000158966610000163
其在当前帧的图像上可对应于以(x,y)为中心,以a、b为半长轴的椭圆形,记为
Figure BDA0000158966610000164
如图9所示,该模块即用于统计图中椭圆形区域的颜色直方图,并用L1范数归一化,可记为
Figure BDA0000158966610000165
其计算方式如下:Particle n in the current frame, the state is
Figure BDA0000158966610000163
It can correspond to an ellipse with (x, y) as the center and a, b as the semi-major axis on the image of the current frame, denoted as
Figure BDA0000158966610000164
As shown in Figure 9, this module is used for the color histogram of the elliptical area in the statistical graph, and normalized by the L1 norm, which can be recorded as
Figure BDA0000158966610000165
It is calculated as follows:

PP (( sbsb kk nno == bb )) == &Sigma;&Sigma; tt == 00 tt == || RR kk nno || -- 11 &delta;&delta; (( bb YY tt &times;&times; NN Uu &times;&times; NN VV ++ bb Uu tt &times;&times; NN vv ++ bb VV tt -- bb )) // || RR kk nno || ;;

其中,假设视频输入为YUV颜色空间,NY、NU、NV是各颜色通道划分bin的数目(通过对YUV空间进行量化得到,如将YUV空间每一维都等分为10份,则NY、NU、NV都等于10);

Figure BDA0000158966610000167
是落在
Figure BDA0000158966610000168
中的第t个像素在各颜色通道上落入的bin的序号(相应的每个颜色通道的bin的序号从0开始递增,直到9);
Figure BDA0000158966610000169
表示椭圆
Figure BDA00001589666100001610
中的像素个数。Among them, assuming that the video input is YUV color space, N Y , N U , and N V are the number of bins divided by each color channel (obtained by quantizing the YUV space, such as dividing each dimension of the YUV space into 10 parts, then N Y , N U , N V are all equal to 10);
Figure BDA0000158966610000167
is falling on
Figure BDA0000158966610000168
The serial number of the bin that the tth pixel in each color channel falls into (the corresponding serial number of the bin of each color channel increases from 0 to 9);
Figure BDA0000158966610000169
Represents an ellipse
Figure BDA00001589666100001610
The number of pixels in .

具体地,在该模块中计算粒子滤波理论的观测模型所采用的实现方式与现有技术相同,只是该模块的输入为依据本发明方法获得的粒子的状态转移结果 s k n = { x , v x , y , v y , a , b } . Specifically, the realization method used to calculate the observation model of particle filter theory in this module is the same as that of the prior art, except that the input of this module is the state transition result of particles obtained according to the method of the present invention the s k no = { x , v x , the y , v the y , a , b } .

(5)粒子更新模块(5) Particle update module

该模块用于进行相应的粒子更新处理,具体用于对经过状态转移得到的表示当前帧中ROI状态分布的粒子(即粒子转移模块的输出),计算其权重,并经重采样得到当前帧中ROI的分布估计,并更新状态转移参数α。This module is used to perform corresponding particle update processing, specifically for calculating the weight of the particles (that is, the output of the particle transfer module) that represent the ROI state distribution in the current frame obtained through state transfer, and obtain the weight of the particles in the current frame through resampling. The distribution of ROIs is estimated, and the state transition parameter α is updated.

具体地,如图10所示,相应的粒子更新处理过程可以包括:Specifically, as shown in Figure 10, the corresponding particle update process may include:

首先,更新各粒子的权重 &pi; k n = &pi; k - 1 n &times; exp { - { 1 - &Sigma; i = 1 N P ( sb 0 ) [ j ] &times; P ( sb k n ) [ j ] } 2 / &sigma; } , 其中,

Figure BDA00001589666100001613
表示第k帧中第n个粒子的权重(粒子所代表的区域是ROI区域的概率),这里的N则表示所用颜色直方图的bin数目,N=NYNUNV
Figure BDA00001589666100001614
表示在上一模块(统计各粒子区域颜色直方图模块)中统计得到的粒子n的颜色直方图第j个bin的值;P(sb0)是指初始化的ROI区域的颜色直方图;参数σ为常数,可以但不限于设置为0.25;归一化各粒子权重 &pi; k n = &pi; k n / &Sigma; n = 1 N &pi; k n . First, update the weight of each particle &pi; k no = &pi; k - 1 no &times; exp { - { 1 - &Sigma; i = 1 N P ( sb 0 ) [ j ] &times; P ( sb k no ) [ j ] } 2 / &sigma; } , in,
Figure BDA00001589666100001613
Represents the weight of the nth particle in the kth frame (the region represented by the particle is the probability of the ROI region), where N represents the number of bins in the color histogram used, N=N Y N U N V ;
Figure BDA00001589666100001614
Indicates the value of the jth bin of the color histogram of particle n obtained in the previous module (statistical color histogram module of each particle area); P(sb 0 ) refers to the color histogram of the initialized ROI area; parameter σ is a constant, it can be set to 0.25 but not limited to; normalize the weight of each particle &pi; k no = &pi; k no / &Sigma; no = 1 N &pi; k no .

其次,进行重采样操作,具体可以包括:首先,计算有效粒子数

Figure BDA0000158966610000172
之后判断
Figure BDA0000158966610000173
如果有效粒子数
Figure BDA0000158966610000174
则进行相应的重采样操作,否则不执行重采样操作,直接执行后面第三步更新状态转移参数α,其中,N为粒子数目,λ是一常数参数,可以预先设定;具体地,相应的重采样操作包括:对当前帧的粒子集合
Figure BDA0000158966610000175
按照权重
Figure BDA0000158966610000176
进行采样,放入新的粒子集合
Figure BDA0000158966610000177
中,即粒子
Figure BDA0000158966610000178
Figure BDA0000158966610000179
的可能性加入新的粒子集合S′中,重采样后更新S′中各粒子权重
Figure BDA00001589666100001710
令S=S′,以完成相应的重采样操作过程。Secondly, perform a resampling operation, which may specifically include: First, calculate the number of effective particles
Figure BDA0000158966610000172
judge later
Figure BDA0000158966610000173
If the effective number of particles
Figure BDA0000158966610000174
Then perform the corresponding resampling operation, otherwise do not perform the resampling operation, and directly execute the third step to update the state transition parameter α, where N is the number of particles, and λ is a constant parameter, which can be set in advance; specifically, the corresponding The resampling operation includes: collection of particles for the current frame
Figure BDA0000158966610000175
according to weight
Figure BDA0000158966610000176
Sampling, into a new collection of particles
Figure BDA0000158966610000177
in the particle
Figure BDA0000158966610000178
have
Figure BDA0000158966610000179
The possibility of adding the new particle set S′, update the weight of each particle in S′ after resampling
Figure BDA00001589666100001710
Let S=S' to complete the corresponding resampling operation process.

第三,更新状态转移参数α:

Figure BDA00001589666100001711
Third, update the state transition parameter α:
Figure BDA00001589666100001711

(6)计算ROI位置大小模块(6) Calculate ROI position size module

经过以上各模块的计算后,已经得到了当前帧中的粒子集合

Figure BDA00001589666100001712
现在可以计算当前帧中的ROI的位置大小,ROI中心的位置 ( x , y ) = ( &Sigma; n = 1 n &pi; k n &times; s k n { x } , &Sigma; n = 1 n &pi; k n &times; s k n { y } ) , ROI的边长 a = &Sigma; n = 1 n &pi; k n &times; s k n { a } , b = &Sigma; n = 1 n &pi; k n &times; s k n { b } . After the calculation of the above modules, the particle set in the current frame has been obtained
Figure BDA00001589666100001712
Now it is possible to calculate the position size of the ROI in the current frame, and the position of the center of the ROI ( x , the y ) = ( &Sigma; no = 1 no &pi; k no &times; the s k no { x } , &Sigma; no = 1 no &pi; k no &times; the s k no { the y } ) , side length of ROI a = &Sigma; no = 1 no &pi; k no &times; the s k no { a } , b = &Sigma; no = 1 no &pi; k no &times; the s k no { b } .

然后,还需要将当前帧中表示ROI状态的粒子集合

Figure BDA00001589666100001716
存入参考帧的buffer(缓存)中,以便于后续的跟踪处理过程中应用。Then, it is also necessary to gather the particles representing the state of the ROI in the current frame
Figure BDA00001589666100001716
Stored in the buffer (cache) of the reference frame, so as to be applied in the subsequent tracking process.

上述本发明实施例的实现使得在跟踪ROI的过程中,能够以较低的复杂程度获得较佳的跟踪效果。The implementation of the above embodiments of the present invention makes it possible to obtain a better tracking effect with a lower complexity in the process of tracking the ROI.

具体地,将本发明实施例提供的ROI跟踪方案与现有技术中的跟踪方案,以coastguard、stephen序列作为输入进行对比实验发现:在coastguard序列中,现有技术中的跟踪方案从第49帧开始丢失跟踪结果,至56帧完全丢失跟踪结果,而本发明实施例提出的跟踪方案则显示跟踪结果良好;在stephen序列中,现有技术中的跟踪方案从第33帧开始丢失跟踪结果,至第78帧完全丢失跟踪结果,而本发明实施例提出的跟踪方案同样显示跟踪结果良好。Specifically, the ROI tracking scheme provided by the embodiment of the present invention is compared with the tracking scheme in the prior art, and the coastguard and stephen sequences are used as input to conduct a comparative experiment. It is found that: in the coastguard sequence, the tracking scheme in the prior art starts from the 49th frame Start to lose the tracking result, and completely lose the tracking result at frame 56, while the tracking solution proposed in the embodiment of the present invention shows that the tracking result is good; in the stephen sequence, the tracking solution in the prior art starts to lose the tracking result from the 33rd frame, to The tracking result is completely lost in the 78th frame, but the tracking solution proposed by the embodiment of the present invention also shows that the tracking result is good.

在粒子滤波理论中,用来衡量跟踪方案优劣的一个标准是有效粒子数随跟踪时间的变化情况。如图11和图12所示,其中分别显示了在序列coastguard、stephen中采用现有技术的跟踪方案和本发明实施例提出的跟踪方案中有效粒子数随跟踪时间变化的情况,两幅图中位于上方的线对应着本发明实施例提出的跟踪方案,下方的线则对应着现有技术的跟踪方案,可见本发明实施例提出的跟踪方案有效粒子数随跟踪时间减少更慢,即本发明实施例提出的跟踪方案明显优于现有技术中的跟踪方案。In particle filter theory, a standard used to measure the quality of the tracking scheme is the change of the number of effective particles with the tracking time. As shown in Fig. 11 and Fig. 12, the situation that the number of effective particles changes with the tracking time in the tracking scheme of the prior art and the tracking scheme proposed in the embodiment of the present invention are respectively shown in the sequence coastguard, stephen, in the two figures The upper line corresponds to the tracking scheme proposed by the embodiment of the present invention, and the lower line corresponds to the tracking scheme of the prior art. It can be seen that the number of effective particles in the tracking scheme proposed by the embodiment of the present invention decreases more slowly with the tracking time, that is, the present invention The tracking scheme proposed by the embodiment is obviously better than the tracking scheme in the prior art.

下面将将对本发明实施例提供一种视频中的感兴趣区域跟踪方法及装置可以应用的环境进行举例说明。The environment in which the method and apparatus for tracking a region of interest in a video provided by an embodiment of the present invention can be applied will be illustrated below.

应用实施例一Application Example 1

本发明实施例提供一种视频中的感兴趣区域跟踪方法及装置可以应用含有ROI可分级的SVC(Scalable Video Coding,可伸缩视频编码)编码中。Embodiments of the present invention provide a method and device for tracking a region of interest in a video, which can be applied to SVC (Scalable Video Coding, scalable video coding) encoding including ROI.

具体地,含有ROI可分级的SVC编码器的结构如图13所示,相应的SVC提供了对感兴趣区域编码的支持。ROI往往是视频帧中对于浏览者而言包含具有明确高层语义的物体的区域,如某人,某物体等。在用户进行视频浏览的过程中,如果其设备的显示尺寸小,或者其可用带宽降低,为了不影响其对该视频的观赏体验,需要尽可能保持感兴趣区域的清晰度。如图13所示,本发明提供一种视频中的感兴趣区域跟踪方法及装置可用于含有ROI可分级的SVC编码器中ROI区域的获取过程中,即可用于实现图13中所示的增强层ROI区域获取模块。模块的输入是当前帧已经编码好的基本层MV和视频数据信息,经过跟踪处理后,输出ROI在当前帧中的大小位置信息,以便于增强层的ROI区域编码。Specifically, the structure of an SVC encoder with ROI scalability is shown in Figure 13, and the corresponding SVC provides support for ROI encoding. ROI is often a region in a video frame that contains objects with clear high-level semantics for viewers, such as a person, an object, and so on. When a user browses a video, if the display size of the device is small, or the available bandwidth is reduced, in order not to affect the viewing experience of the video, it is necessary to maintain the clarity of the region of interest as much as possible. As shown in Figure 13, the present invention provides a method and device for tracking a region of interest in a video, which can be used in the acquisition process of the ROI region in the SVC encoder with scalable ROI, that is, it can be used to achieve the enhancement shown in Figure 13 Layer ROI area acquisition module. The input of the module is the encoded basic layer MV and video data information of the current frame. After tracking processing, the size and position information of the ROI in the current frame is output to facilitate the encoding of the ROI region of the enhancement layer.

应用实施例二Application Example 2

本发明实施例提供一种视频中的感兴趣区域跟踪方法及装置除可以应用于可伸缩视频编码技术中外,还可以应用于ROI区域的转码中。Embodiments of the present invention provide a method and device for tracking a region of interest in a video, which can be applied not only to scalable video coding technology, but also to transcoding of ROI regions.

由于视频终端显示屏尺寸和网络带宽等限制,经常需要将已有的压缩视频码流转码成为客户端需要的目标码流,为了保证视觉质量可以采用将原压缩码流转码成ROI码流,即丢弃对客户来说无关紧要的视觉信息,只保留ROI区域的高质量。相应的级联式转码器的结构如图14所示,本发明实施例提供一种视频中的感兴趣区域跟踪方法及装置可以放入图14中所示的级联型转码器的ROI跟踪模块用于获取ROI的位置大小信息,以将ROI编码成质量较高的码流。Due to the limitations of video terminal screen size and network bandwidth, it is often necessary to transcode the existing compressed video stream into the target stream required by the client. In order to ensure the visual quality, the original compressed stream can be transcoded into the ROI stream, that is, Discard visual information that is irrelevant to the customer, and only keep the high quality of the ROI area. The structure of the corresponding cascaded transcoder is shown in Figure 14. The embodiment of the present invention provides a method and device for tracking a region of interest in a video, which can be placed in the ROI of the cascaded transcoder shown in Figure 14 The tracking module is used to obtain the location and size information of the ROI, so as to encode the ROI into a high-quality code stream.

当然,本发明实施例提供一种视频中的感兴趣区域跟踪方法及装置还可以应用于其他类似的需要跟踪ROI的应用环境中。在此不再一一举例。Of course, the method and device for tracking a region of interest in a video provided by the embodiment of the present invention can also be applied to other similar application environments that need to track an ROI. No more examples here.

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明披露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求书的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person familiar with the technical field can easily conceive of changes or changes within the technical scope disclosed in the present invention. Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (10)

1. A method for tracking regions of interest in a video, comprising:
acquiring a motion vector of a pixel or a macro block in a current frame, determining a moving speed distribution parameter of an ROI (region of interest) according to the motion vector, and determining an ROI scaling parameter according to state information of the ROI in a reference frame;
and performing state transition processing on the particles obtained by sampling in the current frame by using the moving speed distribution parameter and the scaling parameter of the ROI, and determining the position and the size of the ROI of the current frame according to the particles after the state transition.
2. The method of claim 1,
the step of determining the moving speed distribution parameter of the ROI includes:
determining the position of a reference pixel or a macro block corresponding to the pixel or the macro block in the current frame in the reference frame according to the motion vector of the pixel or the macro block in the current frame, and selecting the motion vector of the pixel or the macro block in the current frame, wherein the position of the reference pixel or the macro block is positioned in the ROI in the reference frame, in the motion vector of the pixel or the macro block in the current frame; determining the moving speed distribution parameter of the ROI according to the selected motion vector of the pixel or the macro block in the current frame;
the step of determining ROI scaling parameters comprises:
and determining the corresponding pixel or macro block in the current frame according to the selected motion vector of the pixel or macro block in the current frame, and determining the ROI scaling parameter according to the pixel or macro block in the current frame and the pixel or macro block in the corresponding reference frame.
3. The method of claim 2, wherein the moving speed distribution parameters of the ROI comprise:wherein δ is a dirac function, G is a motion vector set of pixels or macroblocks in the current frame corresponding to the reference pixel or macroblock whose position is located in the ROI in the reference frame, and MV isiRefers to the ith motion vector, MV, in GROIMoving speed of ROI from previous frame to current frame; the ROI scaling parameters include:
Figure FDA0000158966600000012
and a is, b is an affine parameter, the affine parameter is solved by combining a least square method and a four-parameter transformation model, and a corresponding four-parameter transformation module is established according to the pixel or the macro block in the current frame and the pixel or the macro block in the corresponding reference frame.
4. The method of claim 3, wherein the step of performing state transition processing on the sampled particles in the current frame comprises:
determining the velocity v of the particle state transition according to the moving velocity distribution parameter of the ROI1、v2Comprises the following steps of; generating a random number mu in a uniform distribution of 0-1, and if mu is less than alpha, making
Figure FDA0000158966600000014
Sign variable
Figure FDA0000158966600000015
Otherwise, with distribution P (MV)ROI) Selecting two components (MV ') corresponding to one element in the motion vector set G counted in the previous module'x,MV′y) Respectively as v1、v2Value of, i.e. order v1=MV′x、v2=MV′yTo and from
Figure FDA0000158966600000021
α is a state transition parameter, an initial value of which is preset, and a mode of updating the value in a subsequent particle updating process includes:
Figure FDA0000158966600000022
Figure FDA0000158966600000023
is v in particle n in the k-1 framexThe components of the first and second images are,is v in particle n in the k-1 frameyA component;
determining a particle scaling parameter η from the ROI scaling parameter, including; generating a random number gamma in a uniform distribution of 0-1, if gamma is less than beta, making eta equal to rho, otherwise making eta equal to 1, wherein beta is a target size change degree parameter, the value of beta is preset, and rho is the scaling parameter;
performing particle state transition processing according to the particle state transition speed and the particle scaling parameter, and obtaining a result after particle state transition of an nth particle in a kth frame includes: the position of the particle ( <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <mi>x</mi> <mo>}</mo> <mo>=</mo> <msubsup> <mi>s</mi> <mrow> <mi>k</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>n</mi> </msubsup> <mo>{</mo> <mi>x</mi> <mo>}</mo> <mo>+</mo> <msub> <mi>v</mi> <mn>1</mn> </msub> <mo>+</mo> <msub> <mi>&epsiv;</mi> <mi>x</mi> </msub> <mo>,</mo> </mrow> </math> <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <mi>y</mi> <mo>}</mo> <mo>=</mo> <msubsup> <mi>s</mi> <mrow> <mi>k</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>n</mi> </msubsup> <mo>{</mo> <mi>y</mi> <mo>}</mo> <mo>+</mo> <msub> <mi>v</mi> <mn>2</mn> </msub> <mo>+</mo> <msub> <mi>&epsiv;</mi> <mi>y</mi> </msub> </mrow> </math> ) The moving speeds of the particles in the x and y directions are respectively as follows: <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <msub> <mi>v</mi> <mi>x</mi> </msub> <mo>}</mo> <mo>=</mo> <msub> <mi>v</mi> <mn>1</mn> </msub> <mo>+</mo> <msub> <mi>&epsiv;</mi> <msub> <mi>v</mi> <mi>x</mi> </msub> </msub> </mrow> </math> and <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <msub> <mi>v</mi> <mi>y</mi> </msub> <mo>}</mo> <mo>=</mo> <msub> <mi>v</mi> <mn>2</mn> </msub> <mo>+</mo> <msub> <mi>&epsiv;</mi> <msub> <mi>v</mi> <mi>y</mi> </msub> </msub> <mo>,</mo> </mrow> </math> the major semi-axis of the ellipse corresponding to the particle at the position is <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <mi>a</mi> <mo>}</mo> <mo>=</mo> <mi>&eta;</mi> <mo>&times;</mo> <msubsup> <mi>s</mi> <mrow> <mi>k</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>n</mi> </msubsup> <mo>{</mo> <mi>a</mi> <mo>}</mo> <mo>+</mo> <msub> <mi>&epsiv;</mi> <mi>a</mi> </msub> <mo>,</mo> </mrow> </math> Short semi-axis is <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <mi>b</mi> <mo>}</mo> <mo>=</mo> <mi>&eta;</mi> <mo>&times;</mo> <msubsup> <mi>s</mi> <mrow> <mi>k</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>n</mi> </msubsup> <mo>{</mo> <mi>b</mi> <mo>}</mo> <mo>+</mo> <msub> <mi>&epsiv;</mi> <mi>b</mi> </msub> <mo>,</mo> </mrow> </math> Wherein epsilonx、εyIs a random variable obeying a distribution of N (0, 0.2),
Figure FDA00001589666000000211
is a random variable, ε, obeying N (0, 0.25)a、εbIs a random variable obeying N (0, 0.1)。
5. The method according to any of claims 1-4, wherein the step of determining the ROI of the current frame from the state-transferred particles comprises:
performing the statistical processing of the color histogram of each particle area on the particles subjected to the state transition processing, and performing particle updating processing according to the statistical processing result of the color histogram of each particle area;
the ROI position size is calculated based on the result obtained by the particle update process.
6. An apparatus for tracking regions of interest in a video, comprising:
a moving speed distribution parameter and scaling parameter determining module, for obtaining the motion vector of the pixel or macro block in the current frame, and determining the moving speed distribution parameter of the ROI according to the motion vector, and also for determining the scaling parameter according to the state information of the ROI in the reference frame;
the particle state transition module is used for carrying out state transition processing on the particles sampled and obtained in the current frame by utilizing the moving speed distribution parameters and the scaling parameters of the ROI determined by the moving speed distribution parameter and scaling parameter determining module;
and the ROI determining module is used for determining the position and the size of the ROI of the current frame according to the particles subjected to state transfer by the particle state transfer module.
7. The apparatus of claim 6, wherein the moving speed distribution parameter and scaling parameter determining module specifically comprises:
the motion vector acquisition module is used for determining the position of a reference pixel or a macro block corresponding to the pixel or the macro block in the current frame in the reference frame according to the motion vector of the pixel or the macro block in the current frame, and selecting the motion vector of the pixel or the macro block in the current frame corresponding to the reference pixel or the macro block of which the position is positioned in the ROI in the reference frame from the motion vector of the pixel or the macro block in the current frame;
the parameter determining module is used for determining the moving speed distribution parameter and the zooming parameter of the ROI according to the motion vector of the pixel or the macro block in the current frame selected and obtained by the motion vector obtaining module; and determining the corresponding pixel or macro block in the current frame according to the selected motion vector of the pixel or macro block in the current frame, and determining the ROI scaling parameter according to the pixel or macro block in the current frame and the pixel or macro block in the corresponding reference frame.
8. The apparatus of claim 7, wherein the parameter determination module comprises:
a moving speed distribution parameter estimation module of the ROI, configured to estimate a moving speed distribution parameter of the ROI, and the estimating of the obtained moving speed distribution parameter of the ROI includes: <math> <mrow> <mi>P</mi> <mrow> <mo>(</mo> <msup> <mi>MV</mi> <mi>ROI</mi> </msup> <mo>)</mo> </mrow> <mo>=</mo> <munderover> <mi>&Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mo>|</mo> <mi>G</mi> <mo>|</mo> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <mi>&delta;</mi> <mrow> <mo>(</mo> <msup> <mi>MV</mi> <mi>i</mi> </msup> <mo>-</mo> <msup> <mi>MV</mi> <mi>ROI</mi> </msup> <mo>)</mo> </mrow> <mo>/</mo> <mo>|</mo> <mi>G</mi> <mo>|</mo> <mo>,</mo> </mrow> </math> wherein δ is a dirac function, G is a motion vector set of pixels or macroblocks in the current frame corresponding to the reference pixel or macroblock whose position is located in the ROI in the reference frame, and MV isiRefers to the ith motion vector, MV, in GROIMoving speed of ROI from previous frame to current frame;
an ROI scaling parameter estimation module, configured to estimate an ROI scaling parameter, and estimating the obtained ROI scaling parameter includes:
Figure FDA0000158966600000032
and a is, b is an affine parameter, the affine parameter is solved by combining a least square method with a four-parameter transformation model, and a corresponding four-parameter transformation module is established according to the pixel or the macro block in the current frame and the pixel or the macro block in the corresponding reference frame.
9. The apparatus of claim 8, wherein the particle state transition module comprises:
a particle position and velocity transfer module for determining the velocity v of particle state transfer according to the ROI moving velocity distribution parameter obtained by the ROI moving velocity distribution parameter estimation module1、v2Comprises the following steps of; generating a random number mu in a uniform distribution of 0-1, and if mu is less than alpha, making
Figure FDA0000158966600000033
Figure FDA0000158966600000034
Sign variable
Figure FDA0000158966600000035
Otherwise, with distribution P (MV)ROI) Selecting two components (MV ') corresponding to one element in the motion vector set G counted in the previous module'x,MV′y) Respectively as v1、v2Value of, i.e. order v1=MV′x、v2=MV′yTo and fromα is a state transition parameter, an initial value of which is preset, and a mode of updating the value in a subsequent particle updating process includes:
Figure FDA0000158966600000042
Figure FDA0000158966600000043
is v in particle n in the k-1 framexThe components of the first and second images are,
Figure FDA0000158966600000044
is v in particle n in the k-1 frameyA component;
the particle size transfer module is used for determining a particle scaling parameter eta according to the ROI scaling parameter obtained by the ROI scaling parameter estimation module, and comprises the following steps of; generating a random number gamma in a uniform distribution of 0-1, if gamma is less than beta, making eta equal to rho, otherwise making eta equal to 1, wherein beta is a target size change degree parameter, the value of beta is preset, and rho is the ROI scaling parameter;
a particle state transition result determining module, configured to perform particle state transition processing according to the particle state transition speed determined by the particle position and speed transferring module and the particle scaling parameter determined by the particle size transferring module, where obtaining a result after particle state transition of an nth particle in a kth frame includes: the position of the particle ( <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <mi>x</mi> <mo>}</mo> <mo>=</mo> <msubsup> <mi>s</mi> <mrow> <mi>k</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>n</mi> </msubsup> <mo>{</mo> <mi>x</mi> <mo>}</mo> <mo>+</mo> <msub> <mi>v</mi> <mn>1</mn> </msub> <mo>+</mo> <msub> <mi>&epsiv;</mi> <mi>x</mi> </msub> <mo>,</mo> </mrow> </math> <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <mi>y</mi> <mo>}</mo> <mo>=</mo> <msubsup> <mi>s</mi> <mrow> <mi>k</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>n</mi> </msubsup> <mo>{</mo> <mi>y</mi> <mo>}</mo> <mo>+</mo> <msub> <mi>v</mi> <mn>2</mn> </msub> <mo>+</mo> <msub> <mi>&epsiv;</mi> <mi>y</mi> </msub> </mrow> </math> ) The moving speeds of the particles in the x and y directions are respectively as follows: <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <msub> <mi>v</mi> <mi>x</mi> </msub> <mo>}</mo> <mo>=</mo> <msub> <mi>v</mi> <mn>1</mn> </msub> <mo>+</mo> <msub> <mi>&epsiv;</mi> <msub> <mi>v</mi> <mi>x</mi> </msub> </msub> </mrow> </math> and <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <msub> <mi>v</mi> <mi>y</mi> </msub> <mo>}</mo> <mo>=</mo> <msub> <mi>v</mi> <mn>2</mn> </msub> <mo>+</mo> <msub> <mi>&epsiv;</mi> <msub> <mi>v</mi> <mi>y</mi> </msub> </msub> <mo>,</mo> </mrow> </math> the major semi-axis of the ellipse corresponding to the particle at the position is <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <mi>a</mi> <mo>}</mo> <mo>=</mo> <mi>&eta;</mi> <mo>&times;</mo> <msubsup> <mi>s</mi> <mrow> <mi>k</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>n</mi> </msubsup> <mo>{</mo> <mi>a</mi> <mo>}</mo> <mo>+</mo> <msub> <mi>&epsiv;</mi> <mi>a</mi> </msub> <mo>,</mo> </mrow> </math> Short semi-axis is <math> <mrow> <msubsup> <mi>s</mi> <mi>k</mi> <mi>n</mi> </msubsup> <mo>{</mo> <mi>b</mi> <mo>}</mo> <mo>=</mo> <mi>&eta;</mi> <mo>&times;</mo> <msubsup> <mi>s</mi> <mrow> <mi>k</mi> <mo>-</mo> <mn>1</mn> </mrow> <mi>n</mi> </msubsup> <mo>{</mo> <mi>b</mi> <mo>}</mo> <mo>+</mo> <msub> <mi>&epsiv;</mi> <mi>b</mi> </msub> <mo>,</mo> </mrow> </math> Wherein epsilonx、εyIs a random variable obeying a distribution of N (0, 0.2),
Figure FDA00001589666000000411
is a random variable, ε, obeying N (0, 0.25)a、εbIs a random variable obeying N (0, 0.1).
10. The apparatus of any one of claims 6-9, wherein the ROI determination module comprises:
each particle area color histogram statistical processing module is used for executing each particle area color histogram statistical processing on the particles after the state transition processing;
the particle updating module is used for performing particle updating processing according to the statistical processing result of the color histogram of each particle area;
and the ROI position size calculation module is used for calculating the ROI position size according to the result obtained by the particle updating processing.
CN 201210132913 2012-04-28 2012-04-28 Method and device for tracking region of interest in video Active CN102682454B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201210132913 CN102682454B (en) 2012-04-28 2012-04-28 Method and device for tracking region of interest in video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201210132913 CN102682454B (en) 2012-04-28 2012-04-28 Method and device for tracking region of interest in video

Publications (2)

Publication Number Publication Date
CN102682454A true CN102682454A (en) 2012-09-19
CN102682454B CN102682454B (en) 2013-05-08

Family

ID=46814319

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201210132913 Active CN102682454B (en) 2012-04-28 2012-04-28 Method and device for tracking region of interest in video

Country Status (1)

Country Link
CN (1) CN102682454B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103517073A (en) * 2013-07-12 2014-01-15 上海交通大学 Video encoding and decoding method, device and system
CN104185078A (en) * 2013-05-20 2014-12-03 华为技术有限公司 Video monitoring processing method, device and system thereof
WO2016029399A1 (en) * 2014-08-28 2016-03-03 Qualcomm Incorporated Object selection based on region of interest fusion
US9542751B2 (en) 2015-05-08 2017-01-10 Qualcomm Incorporated Systems and methods for reducing a plurality of bounding regions
US9865062B2 (en) 2016-02-12 2018-01-09 Qualcomm Incorporated Systems and methods for determining a region in an image
TWI613910B (en) * 2014-12-03 2018-02-01 安訊士有限公司 Method and encoder for video encoding of a sequence of frames
CN110933446A (en) * 2019-11-15 2020-03-27 网宿科技股份有限公司 Method, system and equipment for identifying region of interest
CN110996099A (en) * 2019-11-15 2020-04-10 网宿科技股份有限公司 Video coding method, system and equipment
CN111105442A (en) * 2019-12-23 2020-05-05 中国科学技术大学 Switched target tracking method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127121A (en) * 2007-09-13 2008-02-20 复旦大学 A Target Tracking Algorithm Based on Adaptive Initial Search Point Prediction
CN101894378A (en) * 2010-06-13 2010-11-24 南京航空航天大学 Method and system for visual tracking of moving target based on dual regions of interest
CN102124727A (en) * 2008-03-20 2011-07-13 无线电技术研究学院有限公司 Methods for adapting video images to small screen sizes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127121A (en) * 2007-09-13 2008-02-20 复旦大学 A Target Tracking Algorithm Based on Adaptive Initial Search Point Prediction
CN102124727A (en) * 2008-03-20 2011-07-13 无线电技术研究学院有限公司 Methods for adapting video images to small screen sizes
CN101894378A (en) * 2010-06-13 2010-11-24 南京航空航天大学 Method and system for visual tracking of moving target based on dual regions of interest

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徐力群,吴晓娟: "基于颜色概率模型的实时手势跟踪算法", 《计算机工程与科学》 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104185078A (en) * 2013-05-20 2014-12-03 华为技术有限公司 Video monitoring processing method, device and system thereof
CN103517073B (en) * 2013-07-12 2016-11-02 上海交通大学 Video encoding and decoding method, device and system
WO2015003573A1 (en) * 2013-07-12 2015-01-15 华为技术有限公司 Video codec method, device and system
CN103517073A (en) * 2013-07-12 2014-01-15 上海交通大学 Video encoding and decoding method, device and system
US10620826B2 (en) 2014-08-28 2020-04-14 Qualcomm Incorporated Object selection based on region of interest fusion
CN106575362A (en) * 2014-08-28 2017-04-19 高通股份有限公司 Object selection based on region of interest fusion
WO2016029399A1 (en) * 2014-08-28 2016-03-03 Qualcomm Incorporated Object selection based on region of interest fusion
TWI613910B (en) * 2014-12-03 2018-02-01 安訊士有限公司 Method and encoder for video encoding of a sequence of frames
US9936217B2 (en) 2014-12-03 2018-04-03 Axis Ab Method and encoder for video encoding of a sequence of frames
US9542751B2 (en) 2015-05-08 2017-01-10 Qualcomm Incorporated Systems and methods for reducing a plurality of bounding regions
US9865062B2 (en) 2016-02-12 2018-01-09 Qualcomm Incorporated Systems and methods for determining a region in an image
CN110933446A (en) * 2019-11-15 2020-03-27 网宿科技股份有限公司 Method, system and equipment for identifying region of interest
CN110996099A (en) * 2019-11-15 2020-04-10 网宿科技股份有限公司 Video coding method, system and equipment
CN110933446B (en) * 2019-11-15 2021-05-25 网宿科技股份有限公司 Method, system and equipment for identifying region of interest
CN110996099B (en) * 2019-11-15 2021-05-25 网宿科技股份有限公司 Video coding method, system and equipment
CN111105442A (en) * 2019-12-23 2020-05-05 中国科学技术大学 Switched target tracking method
CN111105442B (en) * 2019-12-23 2022-07-15 中国科学技术大学 Switching type target tracking method

Also Published As

Publication number Publication date
CN102682454B (en) 2013-05-08

Similar Documents

Publication Publication Date Title
CN102682454B (en) Method and device for tracking region of interest in video
US10666962B2 (en) Training end-to-end video processes
US11234006B2 (en) Training end-to-end video processes
CN109064507B (en) Multi-motion-stream deep convolution network model method for video prediction
US12148123B2 (en) Multi-stage multi-reference bootstrapping for video super-resolution
Liu et al. Learned video compression via joint spatial-temporal correlation exploration
US10887613B2 (en) Visual processing using sub-pixel convolutions
CN105247569B (en) Motion compensated frame interpolation using smoothing constraints
US20240098298A1 (en) Segmentation-based parameterized motion models
Liu et al. Adamask: Enabling machine-centric video streaming with adaptive frame masking for dnn inference offloading
Tom et al. Simultaneous reconstruction and moving object detection from compressive sampled surveillance videos
CN114363649A (en) Video processing method, apparatus, device and storage medium
CN109257584A (en) Prediction method of user viewing viewpoint sequence for 360-degree video transmission
CN113329226B (en) Data generation method and device, electronic equipment and storage medium
Lee et al. Scalable ROI algorithm for H. 264/SVC-based video streaming
CN115052187A (en) Super-resolution live broadcast system based on online training
Choe et al. An effective temporal error concealment in H. 264 video sequences based on scene change detection-PCA model
Sivam et al. Survey on video compression techniques for efficient transmission
Liu et al. Edge-assisted intelligent video compression for live aerial streaming
WO2023020492A1 (en) Video frame adjustment method and apparatus, and electronic device and storage medium
Sun et al. BiSwift: Bandwidth orchestrator for multi-stream video analytics on edge
CN118138768B (en) Video conference data processing method and device and electronic equipment
Yang et al. PIMnet: A quality enhancement network for compressed videos with prior information modulation
Zhang et al. Optimizing Mobile-Friendly Viewport Prediction for Live 360-Degree Video Streaming
He et al. A comparative study of super-resolution algorithms for video streaming application

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant