CN102999921A - Pixel label propagation method based on directional tracing windows - Google Patents

Pixel label propagation method based on directional tracing windows Download PDF

Info

Publication number
CN102999921A
CN102999921A CN2012104524331A CN201210452433A CN102999921A CN 102999921 A CN102999921 A CN 102999921A CN 2012104524331 A CN2012104524331 A CN 2012104524331A CN 201210452433 A CN201210452433 A CN 201210452433A CN 102999921 A CN102999921 A CN 102999921A
Authority
CN
China
Prior art keywords
pixel
tracking
tracking window
label
window
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
CN2012104524331A
Other languages
Chinese (zh)
Other versions
CN102999921B (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.)
Shandong University
Original Assignee
Shandong University
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 Shandong University filed Critical Shandong University
Priority to CN201210452433.1A priority Critical patent/CN102999921B/en
Publication of CN102999921A publication Critical patent/CN102999921A/en
Application granted granted Critical
Publication of CN102999921B publication Critical patent/CN102999921B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

本发明公开了一种基于方向性狭长跟踪窗口的像素标号传播方法,具体步骤为:步骤一:确定目标图像中的待标记区域;步骤二:在目标图像中布置跟踪窗口,使跟踪窗口覆盖待标记区域;步骤三:以跟踪窗口在输入图像中覆盖的像素为样本,对每类标号建立高斯混合模型;步骤四:计算跟踪窗口所覆盖的每个待标记像素属于每个标号的概率密度;步骤五:计算跟踪窗口对每个待标记像素所估计概率的置信度;步骤六:处理所有方向上的所有跟踪窗口;步骤七:根据每个窗口所覆盖的待标记像素属于每种标号的概率和置信度,确定该待标记像素所属的标号。本发明具有有效利用空间下文关系和减少由二义特征导致的错误。

Figure 201210452433

The invention discloses a method for propagating pixel labels based on directional narrow and long tracking windows. The specific steps are as follows: Step 1: Determine the area to be marked in the target image; Step 2: Arrange the tracking window in the target image so that the tracking window covers the area to be marked Marking the area; step 3: taking the pixels covered by the tracking window in the input image as samples, and establishing a Gaussian mixture model for each type of label; step 4: calculating the probability density that each pixel to be marked covered by the tracking window belongs to each label; Step 5: Calculate the confidence of the estimated probability of each pixel to be marked by the tracking window; Step 6: Process all tracking windows in all directions; Step 7: According to the probability that the pixels to be marked covered by each window belong to each label and the confidence level to determine the label to which the pixel to be marked belongs. The invention has the advantages of effectively utilizing spatial context relations and reducing errors caused by ambiguous features.

Figure 201210452433

Description

基于方向性跟踪窗口的像素标号传播方法Pixel Label Propagation Method Based on Directional Tracking Window

技术领域technical field

本发明涉及一种像素标号传播方法,尤其涉及一种基于方向性跟踪窗口的像素标号传播方法。The invention relates to a pixel label propagation method, in particular to a pixel label propagation method based on a directional tracking window.

背景技术Background technique

视频帧间的标号传播是视频处理,尤其是视频编辑中常见的问题。标号通常可表示视频处理的结果,标号传播可以理解为已知某一帧的结果,对其它帧的结果进行求解的过程。比如在区域跟踪和前景分割中,用户可以通过交互获得某一帧的结果,再利用标号传播获得其它视频帧的结果。标号传播通常采用以下三种方法:Label propagation between video frames is a common problem in video processing, especially video editing. Labels can usually represent the results of video processing, and label propagation can be understood as the process of solving the results of other frames when the results of a certain frame are known. For example, in region tracking and foreground segmentation, users can obtain the results of a certain frame through interaction, and then use label propagation to obtain the results of other video frames. Label propagation generally adopts the following three methods:

1、基于图像匹配的方法1. Method based on image matching

基于图像匹配的方法首先将输入帧与目标的帧的图像进行配准,再依据像素的对应关系将输入帧的像素标号拷贝到目标帧。因此,这一类的标号传播方法等价于进行图像匹配。图像匹配是计算机视觉中的经典问题,一般采用光流跟踪进行。由于遮挡、边缘模糊等的影响,精确的图像匹配很难得到。基于局部特征的光流方法不适用于图像的平坦区域,而基于全局优化的方法又对遮挡等造成的视频不连续性很敏感。因此,虽然理论上标号传播可以等价于图像匹配,但实际上这一类方法较少被独立应用,通常都只是用于获得一个初始结果。The method based on image matching first registers the image of the input frame and the target frame, and then copies the pixel label of the input frame to the target frame according to the corresponding relationship of pixels. Therefore, this class of label propagation methods is equivalent to performing image matching. Image matching is a classic problem in computer vision, which is generally performed by optical flow tracking. Due to the effects of occlusion, edge blurring, etc., exact image matching is difficult to obtain. Optical flow methods based on local features are not suitable for flat areas of images, while methods based on global optimization are sensitive to video discontinuities caused by occlusions, etc. Therefore, although label propagation can be equivalent to image matching in theory, in practice this type of method is rarely applied independently, and is usually only used to obtain an initial result.

2、基于全局分类器的方法2. The method based on the global classifier

基于全局分类器的方法首先对每个像素提取其特征,并依据像素在特征空间的距离和邻接关系,在特征空间完成标号的传播。所谓全局分类器,是指目标帧的所有像素都共享同一分类器,而与像素的位置无关。这一类方法的一个典型例子是基于全局颜色分布的视频分割,该方法以像素颜色作为特征,首先以已知标号的前景和背景像素颜色为样本,获得前景和背景在颜色空间的分布函数,再基于分布函数对未知像素进行分类。基于全局分类器的方法忽略了像素的空间位置关系,而直接在特征空间对标号进行传播,这使得其在特征具有二义性的区域很容易出错,比如在前景和背景颜色相似的区域,基于全局颜色分布的视频分割方法会产生大量的错误。不过,由于忽略了像素的空间位置关系,并可以在较大范围进行采样,也使得基于全局特征分布的方法可以较好地处理视频中的时间不连续性(即由于遮挡、拓扑变化、快速运动等导致的新出现区域)。The method based on the global classifier first extracts the features of each pixel, and completes the label propagation in the feature space according to the distance and adjacency of the pixels in the feature space. The so-called global classifier means that all pixels of the target frame share the same classifier regardless of the position of the pixel. A typical example of this type of method is video segmentation based on global color distribution. This method uses pixel color as a feature. First, the foreground and background pixel colors with known labels are used as samples to obtain the distribution function of the foreground and background in the color space. The unknown pixels are then classified based on the distribution function. The method based on the global classifier ignores the spatial position relationship of the pixels, and directly propagates the label in the feature space, which makes it easy to make mistakes in areas where the features are ambiguous, such as in areas where the foreground and background colors are similar, based on Video segmentation methods with global color distributions generate a large number of errors. However, due to ignoring the spatial position relationship of pixels and sampling in a larger range, the method based on the global feature distribution can better deal with temporal discontinuities in the video (that is, due to occlusion, topological changes, fast motion etc. resulting in new areas).

3、基于局部分类器的方法3. Methods based on local classifiers

在Adobe After Effects 5中新引入的RotoBrush工具采用了局部分类器进行标号传播其目的是为了克服全局分类器在特征具有二义性的区域容易出错的缺点,与全局分类器不同,每个局部分类器只覆盖目标图像的一个局部区域,而训练局部分类器的样本则来自于输入图像的对应区域。这实际上是利用像素空间位置关系的一种方式。另一方面,由于局部分类器所覆盖的区域比全局分类器要小得多,因此特征分布也相对较为简单,从而进一步降低了其出错的可能性。The newly introduced RotoBrush tool in Adobe After Effects 5 uses a local classifier for label propagation. The classifier only covers a local region of the target image, while the samples for training the local classifier come from the corresponding region of the input image. This is actually a way of exploiting the spatial positional relationship of pixels. On the other hand, since the local classifier covers a much smaller area than the global classifier, the feature distribution is also relatively simple, which further reduces its possibility of error.

本发明所解决的技术问题有别于常见的视觉跟踪,一种非参数化模型的视觉跟踪方法,No.200910080381.8和视频目标标记实时多目标标记及质心运算方法,No.200510047785.9,以及特征点跟踪一种显微序列图像的多特征点跟踪方法,No.201010516768.6。视觉跟踪和目标标记都可归结为对区域的标记问题,而像素标号传播需要对每个像素进行标记,因此与视频分割关系更为紧密。本发明也可直接用于视频分割。特征点跟踪属于图像匹配的方法,但只处理视频中少部分易于跟踪的像素,不能被用于像素标号传播。本发明所采用的方向性窗口主要是为了更好地利用颜色分布,因此与特征跟踪和图像匹配都有本质的区别。The technical problem solved by the present invention is different from common visual tracking, a non-parametric model visual tracking method, No.200910080381.8 and video target marking real-time multi-target marking and centroid calculation method, No.200510047785.9, and feature point tracking A multi-feature point tracking method for microscopic sequence images, No.201010516768.6. Both visual tracking and object labeling can be attributed to the problem of labeling regions, while pixel label propagation needs to label each pixel, so it is more closely related to video segmentation. The invention can also be directly used for video segmentation. Feature point tracking belongs to the method of image matching, but it only processes a small number of pixels that are easy to track in the video, and cannot be used for pixel label propagation. The directional window adopted in the present invention is mainly to make better use of color distribution, so it is essentially different from feature tracking and image matching.

采用局部分类器的一个关键步骤是定义每个分类器的覆盖区域,即跟踪窗口。跟踪窗口越大,每个窗口内的特征分布就越复杂,且包含二义特征的可能性就越大,这将导致与全局分类器类似的问题;跟踪窗口越小,则对二义特征的鲁棒性会越好,但同时会导致对视频帧间的局部不连续性敏感,在快速运动和新出现的区域更容易出错;现有的局部分类器都采用规则形状的跟踪窗口即正方形或圆形跟踪窗口,但是在同时面临二义特征和帧间不连续问题时很难获得令人满意的效果;本发明所公开的方向性跟踪窗口,将有助于克服局部分类器的这一缺点。A critical step in employing local classifiers is to define the coverage area of each classifier, the tracking window. The larger the tracking window, the more complex the distribution of features in each window, and the greater the possibility of containing ambiguous features, which will lead to similar problems with the global classifier; The robustness will be better, but at the same time it will be sensitive to local discontinuities between video frames, and it is more prone to errors in fast motion and emerging areas; existing local classifiers use regular-shaped tracking windows, that is, square or Circular tracking window, but it is difficult to obtain satisfactory results when facing the problem of ambiguous features and inter-frame discontinuity at the same time; the directional tracking window disclosed by the present invention will help to overcome this shortcoming of the local classifier .

发明内容Contents of the invention

本发明的目的就是为了解决上述问题,提供一种基于方向性跟踪窗口的像素标号传播方法,它具有有效利用空间下文关系和减少由二义特征导致错误的优点。The object of the present invention is to solve the above-mentioned problems and provide a pixel label propagation method based on a directional tracking window, which has the advantages of effectively utilizing the spatial context relationship and reducing errors caused by ambiguous features.

为了实现上述目的,本发明采用如下技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:

一种基于方向性跟踪窗口的像素标号传播方法,具体步骤为A pixel label propagation method based on a directional tracking window, the specific steps are

步骤一:将输入图像中的待传播区域膨胀30-70像素,结果作为目标图像中的待标记区域;Step 1: expand the area to be propagated in the input image by 30-70 pixels, and the result is used as the area to be marked in the target image;

步骤二:对所有指定的方向,在目标图像中沿每个方向布置跟踪窗口,使每个方向上的跟踪窗口都完全覆盖待标记区域;Step 2: For all specified directions, arrange tracking windows along each direction in the target image, so that the tracking windows in each direction completely cover the area to be marked;

步骤三:对每个跟踪窗口,以跟踪窗口在输入帧中覆盖的像素为样本,以像素颜色为特征,对每一种标号L建立相应的高斯混合模型p(x|L)以表示其颜色分布,x为待标记像素的颜色;所述标号表示对像素分成的类的标记,每一类用一个标号来标记;Step 3: For each tracking window, take the pixels covered by the tracking window in the input frame as samples, and use the pixel color as a feature, and establish a corresponding Gaussian mixture model p(x|L) for each label L to represent its color Distribution, x is the color of the pixel to be marked; the label represents the mark of the class that the pixel is divided into, and each class is marked with a label;

步骤四:对每个跟踪窗口,计算其所覆盖的每个待标记像素属于每种标号的概率;Step 4: For each tracking window, calculate the probability that each pixel covered by it belongs to each label;

步骤五:对每个跟踪窗口,计算其对每个待标记像素所估计概率的置信度;Step 5: For each tracking window, calculate its confidence degree for the estimated probability of each pixel to be marked;

步骤六:依次处理所有方向上的所有跟踪窗口;Step 6: Process all tracking windows in all directions in turn;

步骤七:对每个待标记像素,记录覆盖该像素的所有跟踪窗口对其计算出的概率和置信度,以置信度最大的窗口所输出的概率确定该像素的标号。Step 7: For each pixel to be marked, record the probability and confidence calculated by all tracking windows covering the pixel, and determine the label of the pixel with the probability output by the window with the highest confidence.

所述跟踪窗口的宽度确定、长度可变的跟踪窗口,所述跟踪窗口的宽度为W个像素。The tracking window is a tracking window with a fixed width and variable length, and the width of the tracking window is W pixels.

步骤二的具体步骤为:The specific steps of step two are:

(2-1)首先布置水平跟踪窗口,自顶向下扫描到包含待标记区域的第一行,记为r0;分别以第r0行和第r0+W-1行为第一个跟踪窗口的上端和下端;计算这些行中待标记像素的起始列和结束列,即从左往右扫描,包含第一个待标记像素的列为起始列,包含最后一个待标记像素的列为结束列,并分别设为第一个跟踪窗口的左端和右端;以第r0+2W/3行为第2个跟踪窗口的起始行,以第r0+2(k-1)W/3为第k个跟踪窗口的起始行(相邻的跟踪窗口之间有W/3的重叠区域),采用同样的方式布置后续的跟踪窗口,直到所有待标记像素被完全覆盖为止,k为自然数;(2-1) First arrange the horizontal tracking window, scan from top to bottom to the first row containing the area to be marked, denoted as r 0 ; take r 0th row and r 0 + W-1 row as the first tracking The upper and lower ends of the window; calculate the start column and end column of the pixels to be marked in these rows, that is, scan from left to right, the column containing the first pixel to be marked is the start column, and the column containing the last pixel to be marked is the end column, and is set to the left end and right end of the first tracking window respectively; the r 0 +2W/3th line is the starting line of the second tracking window, and the r 0 +2(k-1)W/ 3 is the starting line of the kth tracking window (there is an overlapping area of W/3 between adjacent tracking windows), and the subsequent tracking windows are arranged in the same way until all pixels to be marked are completely covered, k is Natural number;

(2-2)对其它任意方向θ,可先将目标图像顺时针旋转θ度,按照步骤(2-1)中布置水平跟踪窗口的方法布置跟踪窗口,再将目标图像逆时针旋转θ度,获得θ方向上的跟踪窗口。(2-2) For any other direction θ, first rotate the target image clockwise by θ degrees, arrange the tracking window according to the method of arranging the horizontal tracking window in step (2-1), and then rotate the target image counterclockwise by θ degrees, Get the tracking window in the θ direction.

步骤三的高斯混合模型p(x|L)的具体形式为

Figure BDA00002380402500031
其中N为正态分布,πkk分别为其均值和方差,ωk为第k项的权重,K为高斯项的个数,一般取为3-5之间,参数πkkk都可以通过期望值最大化(Expectation-Maxmization)算法得到。The specific form of the Gaussian mixture model p(x|L) in step 3 is
Figure BDA00002380402500031
Among them, N is a normal distribution, π k , σ k are their mean and variance respectively, ω k is the weight of the kth item, K is the number of Gaussian items, generally between 3-5, the parameters π k , σ Both k and ω k can be obtained through the Expectation-Maximization algorithm.

步骤四的具体步骤为:The specific steps of step four are:

(4-1)记跟踪窗口内标号l的像素颜色分布为p(x|L=l),由步骤三所得的高斯混合模型来计算;(4-1) Record the color distribution of the pixel labeled l in the tracking window as p(x|L=l), which is calculated by the Gaussian mixture model obtained in step 3;

(4-2)设标号的个数为M,则待标记像素i属于标号l的概率为:(4-2) Suppose the number of labels is M, then the probability that the pixel i to be marked belongs to the label l is:

pp (( xx ii )) == pp (( xx ii || LL == ll )) ΣΣ jj == 11 Mm pp (( xx ii || LL == jj ))

步骤五的具体方法为:跟踪窗口所覆盖的每个待标记像素i所估计属于跟踪窗口内标号l概率的置信度为:The specific method of step five is: the confidence degree of the probability of label l in the tracking window estimated by each pixel i to be marked covered by the tracking window is:

cc (( xx ii )) == pp maxmax (( xx ii )) -- pp minmin (( xx ii )) pp maxmax (( xx ii )) ++ pp minmin (( xx ii )) ++ ϵϵ

其中pmax(xi)和pmin(xi)分别为p(xi|L=j),j=1,...,M中的最大值和最小值,j指跟踪窗口内的某个标号;ε为常数,通常取值为1e-3;当像素i的概率密度最大值和最小值都很大或者都很小时,其将被赋与较低的置信度,像素i属于跟踪窗口内每一个标号的概率密度都很大对应于跟踪窗口内标号的颜色相似的情况,而像素i属于跟踪窗口内每一个标号的概率密度都很小对应于时间不连续区域,在输入帧中找不到关联的样本;Where p max ( xi ) and p min ( xi ) are the maximum value and minimum value in p( xi |L=j),j=1,...,M respectively, and j refers to a certain value in the tracking window a label; ε is a constant, usually the value is 1e-3; when the maximum value and the minimum value of the probability density of pixel i are very large or very small, it will be assigned a lower confidence, and pixel i belongs to the tracking window The probability density of each label in the tracking window is very large, which corresponds to the case that the color of the label in the tracking window is similar, and the probability density of each label in the tracking window for pixel i is very small, corresponding to the temporal discontinuity area, find in the input frame Less than associated samples;

步骤七的具体方法为:每个跟踪窗口都会对其所覆盖的像素输出一个属于每一标号l的概率p(xi|L=l)和置信度c(xi),记p′(xi|L=l)为覆盖像素i的所有跟踪窗口中置信度最大的一个所对应的概率,则像素i的标号为

Figure BDA00002380402500042
j指跟踪窗口内的某个标号,即使用最大概率值所对应的标号来标记像素i。The specific method of step seven is: each tracking window will output a probability p(x i |L=l) and confidence c(x i ) belonging to each label l to the pixels covered by each tracking window, denote p′(x i i |L=l) is the probability corresponding to the one with the highest confidence in all tracking windows covering pixel i, then the label of pixel i is
Figure BDA00002380402500042
j refers to a label in the tracking window, that is, the label corresponding to the maximum probability value is used to mark pixel i.

本发明的有益效果:本发明采用长方形的跟踪窗口,在保证足够大跨度的同时,又保持了相对较小的覆盖面积。足够大的跨度可以有较利用相距较远的图像关联信息,从而实现有帧间不连续性的处理;而较小的覆盖面积,减少二义特征,且能够保持相对简单的特征分布,从而降低分类器的错误率。跟踪窗口沿不同方向排列,可以实现对不同方向运动、以及不同形状待标记区域的有效处理,并可以更有效地利用空间下文关系,进一步减少由二义特征导致的错误。Beneficial effects of the present invention: the present invention adopts a rectangular tracking window, which maintains a relatively small coverage area while ensuring a sufficiently large span. A sufficiently large span can make use of image correlation information that is far apart, thereby achieving processing with discontinuity between frames; while a small coverage area reduces ambiguous features and can maintain a relatively simple feature distribution, thereby reducing The error rate of the classifier. The tracking windows are arranged in different directions, which can realize effective processing of different directions of motion and different shapes of regions to be marked, and can more effectively use the spatial context relationship to further reduce errors caused by ambiguous features.

附图说明Description of drawings

图1为基于像素标号传播的视频前景分割示意图,其中问号表示待求解的分割结果;Figure 1 is a schematic diagram of video foreground segmentation based on pixel label propagation, where the question mark represents the segmentation result to be solved;

图2为是传统正方形跟踪窗口的示意图;Fig. 2 is a schematic diagram of a traditional square tracking window;

图3(a)为本发明提供的方向性水平跟踪窗口;Fig. 3 (a) is the directional horizontal tracking window provided by the present invention;

图3(b)为本发明提供的方向性45度跟踪窗口;Figure 3(b) is the directional 45-degree tracking window provided by the present invention;

图3(c)为本发明提供的以同一像素为中心的不同方向的跟踪窗口;Figure 3(c) is the tracking window in different directions centered on the same pixel provided by the present invention;

图4(a)为本发明利用长距离的图像关联来处理帧间不连续的示意图;Figure 4(a) is a schematic diagram of the present invention using long-distance image association to process discontinuity between frames;

图4(b)为本发明利用方向性处理不同情况及目标图像每个位置所在处的最佳跟踪窗口示意图;Figure 4(b) is a schematic diagram of the best tracking window where the present invention uses directionality to deal with different situations and where each position of the target image is located;

图5(a)为水平跟踪窗口所得结果合并的示意图;Figure 5(a) is a schematic diagram of the combination of results obtained by the horizontal tracking window;

图5(b)为45°跟踪窗口所得结果合并的示意图;Figure 5(b) is a schematic diagram of the merging of the results obtained by the 45° tracking window;

图5(c)为90°跟踪窗口所得结果合并的示意图;Figure 5(c) is a schematic diagram of the merging of the results obtained by the 90° tracking window;

图5(d)为135°跟踪窗口所得结果合并的示意图;Figure 5(d) is a schematic diagram of the merging of the results obtained by the 135° tracking window;

图5(e)为所有方向上的跟踪窗口所得结果最终输出的示意图;Figure 5(e) is a schematic diagram of the final output of the results of the tracking window in all directions;

图5(f)为在每个像素处选择的方向示意图;Figure 5(f) is a schematic diagram of the direction selected at each pixel;

图6(a)为输入帧图像;Figure 6(a) is the input frame image;

图6(b)为目标帧图像;Figure 6(b) is the target frame image;

图6(c)为正方形窗口用于视频抠图的效果图;Figure 6(c) is the rendering of a square window used for video matting;

图6(d)为方向性跟踪窗口用于视频抠图的效果图。Figure 6(d) is the rendering of the directional tracking window used for video matting.

具体实施方式Detailed ways

下面结合附图与实施例对本发明作进一步说明。The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

如图1所示,下面以视频分割为例,其中问号表示待求解的结果,结合附图对本发明作进一步说明。As shown in FIG. 1 , video segmentation is taken as an example below, where the question mark represents the result to be solved, and the present invention will be further described in conjunction with the accompanying drawings.

基于标号传播的视频分割,需要解决的关键问题是利用前一帧(输入帧)的分割结果,对当前帧(目标帧)进行分割。分割结果以二值图像表示,前景像素值为255,背景像素值为0。在此过程中面临的主要困难是克服前、背景间的颜色相似性和视频时间不连续性的矛盾。采用方向性跟踪窗口进行前背景分割的方法如下:For video segmentation based on label propagation, the key problem to be solved is to use the segmentation result of the previous frame (input frame) to segment the current frame (target frame). The segmentation result is expressed as a binary image, the foreground pixel value is 255, and the background pixel value is 0. The main difficulty in this process is to overcome the contradiction between the color similarity between the foreground and the background and the temporal discontinuity of the video. The method of foreground and background segmentation using directional tracking window is as follows:

1)将输入帧的分割结果膨胀30-70像素(可根据前景运动速度适当调整),将膨胀后的前景区域作为目标图像中的待标记区域,其它区域被认为是背景;1) Expand the segmentation result of the input frame by 30-70 pixels (can be adjusted appropriately according to the speed of the foreground movement), and use the expanded foreground area as the area to be marked in the target image, and other areas are considered as the background;

2)设定跟踪窗口的宽度为W像素(W一般取为15),首先布置水平跟踪窗口,具体方法为:自顶向下扫描到包含待标记区域的第一行,记为r0;分别以第r0行和第r0+W-1行为第一个跟踪窗口的上端和下端;计算这些行中待标记像素的起始和结束列,并分别设为第一个跟踪窗口的左端和右端;以第r0+2W/3行为第2个跟踪窗口的起始行,以第r0+2(k-1)W/3为第k个跟踪窗口的起始行(相邻的跟踪窗口之间有W/3的重叠区域),采用同样的方式布置后续的跟踪窗口,直到所有待标记像素被完全覆盖为止;所得到的水平跟踪窗口如图3(a)所示;2) Set the width of the tracking window to W pixels (W is generally taken as 15), and first arrange the horizontal tracking window. The specific method is: scan from top to bottom to the first row containing the region to be marked, denoted as r 0 ; respectively Take the r 0th line and the r 0 +W-1th line as the upper and lower ends of the first tracking window; calculate the start and end columns of the pixels to be marked in these lines, and set them as the left end and the end of the first tracking window respectively Right end; take r 0 +2W/3 as the starting line of the second tracking window, and take r 0 +2(k-1)W/3 as the starting line of the kth tracking window (adjacent tracking There is an overlapping area of W/3 between the windows), and the subsequent tracking windows are arranged in the same way until all pixels to be marked are completely covered; the resulting horizontal tracking window is shown in Figure 3(a);

3)将目标图像顺时针旋转45度,以2)的方法布置水平跟踪窗口,之后逆时针旋转45度,获得45度方向上的跟踪窗口,结果如图3(b)中所示;3) Rotate the target image 45 degrees clockwise, arrange the horizontal tracking window in the method of 2), and then rotate 45 degrees counterclockwise to obtain the tracking window in the direction of 45 degrees, the result is shown in Figure 3(b);

4)以3)的方式布置90度和135度的跟踪窗口如图3(c);4) Arrange tracking windows of 90 degrees and 135 degrees in the manner of 3) as shown in Figure 3(c);

5)对每个跟踪窗口,分别以其在输入帧中覆盖的前景和背景像素的RGB颜色为样本,训练前景和背景颜色分布的高斯混合模型(Gaussian Mixtu re Model,GMM)p(x|F)和p(x|B),其中x为待标记像素的颜色;5) For each tracking window, use the RGB colors of the foreground and background pixels covered in the input frame as samples, and train the Gaussian Mixture Model (GMM) p(x|F) of the foreground and background color distribution ) and p(x|B), where x is the color of the pixel to be marked;

6)对每个跟踪窗口,计算其所覆盖的每个待标记像素i在前景和背景GMM中的概率密度p(xi|F)和p(xi|B),进而计算其属于前景的概率:6) For each tracking window, calculate the probability density p( xi |F) and p( xi |B) of each pixel i covered by it in the foreground and background GMM, and then calculate its foreground Probability:

pp (( xx ii )) == pp (( xx ii || Ff )) pp (( xx ii || Ff )) ++ pp (( xx ii || BB ))

7)对每个跟踪窗口,计算其对每个待标记像素i所估计概率的置信度:7) For each tracking window, calculate its confidence for the estimated probability of each pixel i to be marked:

cc (( xx ii )) == || pp (( xx ii || Ff )) -- pp (( xx ii || BB )) || pp (( xx ii || Ff )) ++ pp (( xx ii || BB )) ++ ϵϵ

其中ε为一常数,通常可取为1e-3。上式表示,当像素i的颜色在前景和背景分布中的概率密度都很大或者都很小时,其将被赋与较低的置信度,像素i的颜色在前景和背景的概率密度都很大对应于前景和背景颜色相似的情况,而像素i的颜色在前景和背景的概率密度都很小对应于时间不连续区域,在输入帧中找不到关联的样本;Where ε is a constant, usually 1e-3. The above formula means that when the probability density of the color of pixel i in the foreground and background distributions is very large or very small, it will be assigned a lower confidence level, and the probability density of the color of pixel i in the foreground and background distributions is very high Large corresponds to the case where the foreground and background colors are similar, while the color of pixel i has a small probability density in both the foreground and background corresponds to a temporal discontinuity region where no associated samples are found in the input frame;

8)依次处理所有方向上的所有跟踪窗口;8) Process all tracking windows in all directions sequentially;

9)由于每个像素会被多个跟踪窗口覆盖,每个窗口的分类器都会对像素输出一个属于前景的概率p(xi)和置信度c(xi),因此需要从中选择一个作为最终的输出,如图5所示。记p′(xi)为覆盖像素i的所有跟踪窗口中置信度最大的一个所对应的概率,则如果p′(xi)>0.5,则将像素i标记为前景;否则将其标记为背景。9) Since each pixel will be covered by multiple tracking windows, the classifier of each window will output a probability p( xi ) and confidence c(xi ) belonging to the foreground for the pixel, so one of them needs to be selected as the final output, as shown in Figure 5. Denote p′(xi ) as the probability corresponding to the one with the highest confidence among all tracking windows covering pixel i, then if p′(xi ) >0.5, mark pixel i as foreground; otherwise, mark it as background.

图4(a)是长方形跟踪如何利用长距离的图像关联来处理帧间不连续,图4(b)为如何利用方向性处理不同情况的示意图,图4(b)所示为每个位置所在处的最佳跟踪窗口。Figure 4(a) is a schematic diagram of how rectangular tracking uses long-distance image correlation to deal with inter-frame discontinuity. Figure 4(b) is a schematic diagram of how to use directionality to deal with different situations. Figure 4(b) shows where each position is The best tracking window at .

对不同方向跟踪窗口所得结果进行合并的示意图,如图5(a)、图5(b)、图5(c)、图5(d),如图5(e)所示,为所有方向上的跟踪窗口所得结果最终输出的示意图;如图5(f)所示为在每个像素处选择的方向示意图;Schematic diagram of merging the results of tracking windows in different directions, as shown in Figure 5(a), Figure 5(b), Figure 5(c), Figure 5(d), as shown in Figure 5(e), for all directions The schematic diagram of the final output of the results obtained by the tracking window of ; Figure 5(f) is a schematic diagram of the direction selected at each pixel;

长方形跟踪窗口与正方形窗口用于视频抠图的效果对比,长方形窗口能够正确识别出两腿间的新出现区域,而正方形窗口则将该区域错误地识别为前景,如图6(a)、图6(b)、图6(c)、图6(d)所示。Comparing the effects of rectangular tracking window and square window for video matting, the rectangular window can correctly identify the newly-appeared area between the legs, while the square window can wrongly identify the area as the foreground, as shown in Figure 6(a), Fig. 6(b), Figure 6(c), and Figure 6(d).

如图2所示,是传统的正方形跟踪窗口,以及其在处理视频帧间不连续性时存在的问题。As shown in Figure 2, it is a traditional square tracking window and its problems when dealing with discontinuities between video frames.

上述虽然结合附图对本发明的具体实施方式进行了描述,但并非对本发明保护范围的限制,所属领域技术人员应该明白,在本发明的技术方案的基础上,本领域技术人员不需要付出创造性劳动即可做出的各种修改或变形仍在本发明的保护范围以内。Although the specific implementation of the present invention has been described above in conjunction with the accompanying drawings, it does not limit the protection scope of the present invention. Those skilled in the art should understand that on the basis of the technical solution of the present invention, those skilled in the art do not need to pay creative work Various modifications or variations that can be made are still within the protection scope of the present invention.

Claims (8)

1.一种基于方向性跟踪窗口的像素标号传播方法,其特征是,具体步骤为:1. A pixel label propagation method based on directional tracking window, characterized in that, the concrete steps are: 步骤一:将输入图像中的待传播区域膨胀30-70像素,结果作为目标图像中的待标记区域;Step 1: expand the area to be propagated in the input image by 30-70 pixels, and the result is used as the area to be marked in the target image; 步骤二:对所有指定的方向,在目标图像中沿每个方向布置跟踪窗口,使每个方向上的跟踪窗口都完全覆盖待标记区域;Step 2: For all specified directions, arrange tracking windows along each direction in the target image, so that the tracking windows in each direction completely cover the area to be marked; 步骤三:对每个跟踪窗口,以跟踪窗口在输入帧中覆盖的像素为样本,以像素颜色为特征,对每一种标号L建立相应的高斯混合模型p(x|L)以表示其颜色分布;Step 3: For each tracking window, take the pixels covered by the tracking window in the input frame as samples, and use the pixel color as a feature, and establish a corresponding Gaussian mixture model p(x|L) for each label L to represent its color distributed; 步骤四:对每个跟踪窗口,计算其所覆盖的每个待标记像素属于每种标号的概率;Step 4: For each tracking window, calculate the probability that each pixel covered by it belongs to each label; 步骤五:对每个跟踪窗口,计算其对每个待标记像素所估计概率的置信度;Step 5: For each tracking window, calculate its confidence degree for the estimated probability of each pixel to be marked; 步骤六:依次处理所有方向上的所有跟踪窗口;Step 6: Process all tracking windows in all directions in turn; 步骤七:对每个待标记像素,记录覆盖该像素的所有跟踪窗口对其计算出的概率和置信度,以置信度最大的窗口所输出的概率确定该像素的标号。Step 7: For each pixel to be marked, record the probability and confidence calculated by all tracking windows covering the pixel, and determine the label of the pixel with the probability output by the window with the highest confidence. 2.如权利要求1所述基于方向性跟踪窗口的像素标号传播方法,其特征是,所述跟踪窗口的宽度确定、长度可变的方向性窗口,所述跟踪窗口的宽度为W个像素。2. the pixel label propagation method based on directional tracking window as claimed in claim 1, is characterized in that, the width of described tracking window is determined, the directional window of variable length, and the width of described tracking window is W pixels. 3.如权利要求1所述基于方向性跟踪窗口的像素标号传播方法,其特征是,所述步骤二的具体步骤为:3. the pixel label propagating method based on directional tracking window as claimed in claim 1, is characterized in that, the concrete steps of described step 2 are: (2-1)首先布置水平跟踪窗口,自顶向下扫描到包含待标记区域的第一行,记为r0;分别以第r0行和第r0+W-1行为第一个跟踪窗口的上端和下端;计算这些行中待标记像素的起始列和结束列,即从左往右扫描,包含第一个待标记像素的列为起始列,包含最后一个待标记像素的列为结束列,并分别设为第一个跟踪窗口的左端和右端;以第r0+2W/3行为第2个跟踪窗口的起始行,以第r0+2(k-1)W/3为第k个跟踪窗口的起始行,相邻的跟踪窗口之间有W/3的重叠区域,采用同样的方式布置后续的跟踪窗口,直到所有待标记像素被完全覆盖为止,k为自然数;(2-1) First arrange the horizontal tracking window, scan from top to bottom to the first row containing the area to be marked, denoted as r 0 ; take r 0th row and r 0 + W-1 row as the first tracking The upper and lower ends of the window; calculate the start column and end column of the pixels to be marked in these rows, that is, scan from left to right, the column containing the first pixel to be marked is the start column, and the column containing the last pixel to be marked is the end column, and is set to the left end and right end of the first tracking window respectively; the r 0 +2W/3th line is the starting line of the second tracking window, and the r 0 +2(k-1)W/ 3 is the starting line of the k-th tracking window, and there is an overlapping area of W/3 between adjacent tracking windows. Follow-up tracking windows are arranged in the same way until all pixels to be marked are completely covered, and k is a natural number ; (2-2)对其它任意方向θ,可先将目标图像顺时针旋转θ度,按照步骤(2-1)中布置水平跟踪窗口的方法布置跟踪窗口,再将目标图像逆时针旋转θ度,获得θ方向上的跟踪窗口。(2-2) For any other direction θ, first rotate the target image clockwise by θ degrees, arrange the tracking window according to the method of arranging the horizontal tracking window in step (2-1), and then rotate the target image counterclockwise by θ degrees, Get the tracking window in the θ direction. 3.如权利要求1所述基于方向性跟踪窗口的像素标号传播方法,其特征是,所述步骤三的高斯混合模型p(x|L)的具体形式为
Figure FDA00002380402400011
其中N为正态分布,πkk分别为其均值和方差,ωk为第k项的权重,K为高斯项的个数,参数πkkk都通过期望值最大化算法得到。
3. the pixel label propagation method based on directional tracking window as claimed in claim 1, is characterized in that, the specific form of the Gaussian mixture model p(x|L) of described step 3 is
Figure FDA00002380402400011
Where N is a normal distribution, π k , σ k are their mean and variance respectively, ω k is the weight of the kth item, K is the number of Gaussian items, and the parameters π k , σ k , ω k are all maximized by the expected value Algorithm to get.
4.如权利要求1所述基于方向性跟踪窗口的像素标号传播方法,其特征是,所述步骤四的具体步骤为:4. the pixel label propagation method based on directional tracking window as claimed in claim 1, is characterized in that, the concrete steps of described step 4 are: (4-1)记跟踪窗口内标号l的像素颜色分布的高斯混合模型为p(x|L=l);(4-1) Record the Gaussian mixture model of the color distribution of the pixel labeled l in the tracking window as p(x|L=l); (4-2)设标号的个数为M,则待标记像素i属于标号l的概率为:(4-2) Suppose the number of labels is M, then the probability that the pixel i to be marked belongs to the label l is: pp (( xx ii )) == pp (( xx ii || LL == ll )) ΣΣ jj == 11 Mm pp (( xx ii || LL == jj )) 5.如权利要求1所述基于方向性跟踪窗口的像素标号传播方法,其特征是,所述步骤五的具体方法为:跟踪窗口所覆盖的每个待标记像素i所估计属于跟踪窗口内标号l概率的置信度为:5. The pixel label propagation method based on directional tracking window as claimed in claim 1, characterized in that, the specific method of said step 5 is: each pixel i to be marked that is covered by the tracking window is estimated to belong to the label in the tracking window The confidence level of the probability is: cc (( xx ii )) == pp maxmax (( xx ii )) -- pp minmin (( xx ii )) pp maxmax (( xx ii )) ++ pp minmin (( xx ii )) ++ ϵϵ 其中pmax(xi)和pmin(xi)分别为p(xi|L=j),j=1,...,M中的最大值和最小值;ε为常数,通常取值为1e-3;当像素i的概率密度最大值和最小值都很大或者都很小时,其将被赋与较低的置信度,像素i属于跟踪窗口内每一个标号的概率密度都很大对应于跟踪窗口内标号的颜色相似的情况,而像素i属于跟踪窗口内每一个标号的概率密度都很小对应于时间不连续区域,在输入帧中找不到关联的样本。Where p max ( xi ) and p min ( xi ) are the maximum and minimum values in p( xi |L=j),j=1,...,M respectively; ε is a constant, usually taking the value is 1e-3; when the maximum value and the minimum value of the probability density of pixel i are both very large or very small, it will be given a lower confidence, and the probability density of each label in the tracking window belonging to pixel i is very large Corresponds to the case where the labels in the tracking window have similar colors, and the probability density of pixel i belonging to each label in the tracking window is small. Corresponds to temporally discontinuous regions, and no associated samples can be found in the input frame. 6.如权利要求1所述基于方向性跟踪窗口的像素标号传播方法,其特征是,所述步骤七的具体方法为:每个跟踪窗口都会对其所覆盖的像素输出一个属于每一标号l的概率p(xi|L=l)和置信度c(xi),记p′(xi|L=l)为覆盖像素i的所有跟踪窗口中置信度最大的一个所对应的概率,则像素i的标号为
Figure FDA00002380402400023
即使用最大概率值所对应的标号来标记像素i。
6. The pixel label propagation method based on directional tracking window as claimed in claim 1, characterized in that, the specific method of said step 7 is: each tracking window will output a pixel label belonging to each label l to its covered pixel. The probability p( xi |L=l) and the degree of confidence c( xi ), denote p′( xi |L=l) as the probability corresponding to the one with the highest confidence degree among all the tracking windows covering pixel i, Then the label of pixel i is
Figure FDA00002380402400023
That is, the pixel i is marked with the label corresponding to the maximum probability value.
7.如权利要求1所述基于方向性跟踪窗口的像素标号传播方法,其特征是,所述同一方向的窗口相互平行。7. The method for propagating pixel labels based on directional tracking windows according to claim 1, wherein the windows in the same direction are parallel to each other. 8.如权利要求1所述基于方向性跟踪窗口的像素标号传播方法,其特征是,所述同一方向的相邻窗口之间没有间隙且有一定的重叠区域。8. The pixel label propagation method based on directional tracking windows as claimed in claim 1, wherein there is no gap between adjacent windows in the same direction and there is a certain overlapping area.
CN201210452433.1A 2012-11-09 2012-11-09 Pixel label propagation method based on directional tracing windows Expired - Fee Related CN102999921B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210452433.1A CN102999921B (en) 2012-11-09 2012-11-09 Pixel label propagation method based on directional tracing windows

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210452433.1A CN102999921B (en) 2012-11-09 2012-11-09 Pixel label propagation method based on directional tracing windows

Publications (2)

Publication Number Publication Date
CN102999921A true CN102999921A (en) 2013-03-27
CN102999921B CN102999921B (en) 2015-01-21

Family

ID=47928454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210452433.1A Expired - Fee Related CN102999921B (en) 2012-11-09 2012-11-09 Pixel label propagation method based on directional tracing windows

Country Status (1)

Country Link
CN (1) CN102999921B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874845A (en) * 2016-12-30 2017-06-20 东软集团股份有限公司 The method and apparatus of image recognition
CN111833398A (en) * 2019-04-16 2020-10-27 杭州海康威视数字技术股份有限公司 Method and device for marking pixel points in image

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101142593A (en) * 2005-03-17 2008-03-12 英国电讯有限公司 Method for tracking objects in video sequences
CN101216943A (en) * 2008-01-16 2008-07-09 湖北莲花山计算机视觉和信息科学研究院 A method for video moving object subdivision
CN101676953A (en) * 2008-08-22 2010-03-24 奥多比公司 Automatic video image segmentation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101142593A (en) * 2005-03-17 2008-03-12 英国电讯有限公司 Method for tracking objects in video sequences
CN101216943A (en) * 2008-01-16 2008-07-09 湖北莲花山计算机视觉和信息科学研究院 A method for video moving object subdivision
CN101676953A (en) * 2008-08-22 2010-03-24 奥多比公司 Automatic video image segmentation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XUE BAI ET AL.: "Dynamic Color Flow: A Motion-adaptive Color Model for Object Segmentation in Video", 《PROCEEDINGS 11TH EUROPEAN CONFERENCE ON COMPUTER VISION-ECCV 2010》 *
钟凡 等: "在线视频分割实时后处理", 《计算机学报》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874845A (en) * 2016-12-30 2017-06-20 东软集团股份有限公司 The method and apparatus of image recognition
CN111833398A (en) * 2019-04-16 2020-10-27 杭州海康威视数字技术股份有限公司 Method and device for marking pixel points in image
CN111833398B (en) * 2019-04-16 2023-09-08 杭州海康威视数字技术股份有限公司 Pixel point marking method and device in image

Also Published As

Publication number Publication date
CN102999921B (en) 2015-01-21

Similar Documents

Publication Publication Date Title
CN103559237B (en) Semi-automatic image annotation sample generating method based on target tracking
CN102129695B (en) Target tracking method based on modeling of occluder under condition of having occlusion
CN103218827B (en) Contour Tracking Method Based on Shape Transfer Joint Segmentation and Graph Matching Correction
CN102129690B (en) Tracking method of human body moving object with environmental disturbance resistance
CN112712546A (en) Target tracking method based on twin neural network
CN103413324A (en) Automatic target tracking method for aerially photographed videos
CN104700415B (en) The choosing method of matching template in a kind of images match tracking
CN110276264A (en) A Crowd Density Estimation Method Based on Foreground Segmentation Map
CN103942793B (en) Detection method of uniform motion region in video based on thermal diffusion
CN113920170A (en) Pedestrian trajectory prediction method, system and storage medium combining scene context and pedestrian social relationship
CN104063880B (en) PSO based multi-cell position outline synchronous accurate tracking system
CN106447662A (en) Combined distance based FCM image segmentation algorithm
CN106780564A (en) A kind of anti-interference contour tracing method based on Model Prior
CN116503818A (en) A multi-lane vehicle speed detection method and system
CN103824305A (en) Improved Meanshift target tracking method
CN110555122A (en) Building plan wall vectorization method based on segmented rectangles
Qin et al. RSO-SLAM: A robust semantic visual SLAM with optical flow in complex dynamic environments
Liang et al. DIG-SLAM: an accurate RGB-D SLAM based on instance segmentation and geometric clustering for dynamic indoor scenes
CN103093211B (en) Based on the human body motion tracking method of deep nuclear information image feature
Wang et al. Fast vanishing point detection method based on road border region estimation
CN107292914A (en) Visual target tracking method based on small-sized single branch convolutional neural networks
Choi et al. Regression with residual neural network for vanishing point detection
Mu et al. Visual prompt multibranch fusion network for RGB-thermal crowd counting
CN102999921B (en) Pixel label propagation method based on directional tracing windows
CN102509289A (en) Characteristic matching cell division method based on Kalman frame

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150121

Termination date: 20151109

EXPY Termination of patent right or utility model