CN102142146B - Method for tracking video target area - Google Patents
Method for tracking video target area Download PDFInfo
- Publication number
- CN102142146B CN102142146B CN 201010108049 CN201010108049A CN102142146B CN 102142146 B CN102142146 B CN 102142146B CN 201010108049 CN201010108049 CN 201010108049 CN 201010108049 A CN201010108049 A CN 201010108049A CN 102142146 B CN102142146 B CN 102142146B
- Authority
- CN
- China
- Prior art keywords
- tracking
- point
- target area
- video target
- path
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Studio Circuits (AREA)
Abstract
本发明公开了一种对视频目标区域进行跟踪的方法,该方法通过对视频目标区域中与路径点对应的跟踪点进行跟踪,得到路径点的参数信息,然后对得到的路径点进行平滑处理,采用平滑曲线连接各路径点,覆盖视频目标区域,实现对视频目标区域的跟踪。利用本发明,克服了现有技术中存在的问题,利用一个模块实现大多数的跟踪功能,通过扩展的接口与其它模块间进行相互连接,并增加了路径点间的相互关系操作,方便用户操作,实现了对视频目标区域的准确跟踪。
The invention discloses a method for tracking a video target area. The method tracks the tracking points corresponding to the path points in the video target area to obtain parameter information of the path points, and then performs smoothing processing on the obtained path points. Use smooth curves to connect each path point, cover the video target area, and realize the tracking of the video target area. The present invention overcomes the problems existing in the prior art, uses one module to realize most of the tracking functions, connects with other modules through the extended interface, and increases the interrelationship operation between waypoints, which is convenient for users to operate , to achieve accurate tracking of the video target area.
Description
技术领域 technical field
本发明涉及视频处理技术领域,尤其是一种对视频目标区域进行跟踪的方法。The invention relates to the technical field of video processing, in particular to a method for tracking a video target area.
背景技术 Background technique
在大多数的视频处理软件中,都包括有跟踪模块,但大多跟踪模块存在跟踪时不能包含所有的跟踪情况,扩展不方便,操作模式固定等问题。Most of the video processing software includes tracking modules, but most tracking modules have problems such as not being able to cover all tracking situations during tracking, inconvenient expansion, and fixed operation modes.
现有软件中,跟踪得到的路径点间一般为孤立或简单的直线连接,不易实现对区域完整覆盖,且路径点间一般没有相互的关系,但在大多数视频中,路径点一般存在着互连的特性。In the existing software, the path points obtained by tracking are generally isolated or simple straight-line connections, and it is difficult to achieve complete coverage of the area, and there is generally no mutual relationship between the path points, but in most videos, the path points generally exist. connected characteristics.
在视频处理中,如果需要对某视频对象进行编辑,如做马赛克掩膜、颜色校正、粒子效果和贴图等,都需要准确地知道目标区域的路径,在视频后期软件中,一般都是采用在视频目标区域的边界处加上多个跟踪点,以实现对目标区域的覆盖。但在视频后期处理中,目标区域通常是不规则的视频对象,而且由于视频拍摄对象的运动或摄像机的抖动,经常会出现视频中目标区域的不稳定。当视频目标区域为规则的多边形或稳定区域,且边界处不发生太大的变量化时,现有技术可以满足需求。但在大多数情况下,视频目标区域为不规则形状或不稳定的区域,针对这一问题,现有技术还不能很好的实现对视频目标区域的跟踪。In video processing, if you need to edit a certain video object, such as mosaic masking, color correction, particle effects and textures, etc., you need to know the path of the target area accurately. Multiple tracking points are added to the boundary of the video target area to achieve coverage of the target area. But in video post-processing, the target area is usually an irregular video object, and due to the motion of the video shooting object or the shaking of the camera, the instability of the target area in the video often occurs. When the video target area is a regular polygon or a stable area, and the boundary does not change too much, the existing technology can meet the demand. But in most cases, the video target area is an irregular shape or unstable area. To solve this problem, the existing technology cannot realize the tracking of the video target area well.
在现有的视频跟踪操作中,经常会遇到下列问题:In existing video tracking operations, the following problems are often encountered:
1)、目标区域在屏幕中不稳定的处理。在跟踪视频中,经常遇到目标区域不稳定、被其它不同运动方向的物体遮盖或在屏幕显示以外的区域。在不稳定的目标区域,由于找不到很好的跟踪点而得不到目标区域。1) The target area is unstable on the screen. In the tracking video, it is often encountered that the target area is unstable, covered by other objects with different moving directions, or in an area outside the screen display. In the unstable target area, the target area cannot be obtained because no good tracking point can be found.
2)、任意目标区域跟踪。在已有跟踪软件中,目标区域一般为矩形、椭圆形或直接利用直线连接路径点得到目标区域,不能很好地实现对目标区域的覆盖。2), arbitrary target area tracking. In the existing tracking software, the target area is generally rectangular, elliptical or directly connected with the path points by a straight line to obtain the target area, which cannot cover the target area well.
3)、模块接口。在视频后期处理中,单独进行跟踪的功能单一或意义不大,但如果能与其它视频插件或特效模块相结合就能产生很好的效果,所以在跟踪模块与插件间的接口变得十分重要。在已有软件中,一般是先对视频跟踪然后保存路径点参数,再开启其它模块并导入跟踪数据,比较烦杂。3), module interface. In video post-processing, the function of tracking alone is single or meaningless, but if it can be combined with other video plug-ins or special effect modules, it can produce good results, so the interface between tracking modules and plug-ins becomes very important . In the existing software, it is generally cumbersome to first track the video and then save the path point parameters, and then open other modules and import the tracking data.
发明内容 Contents of the invention
(一)要解决的技术问题(1) Technical problems to be solved
针对上述视频目标区域区域不规则和不稳定的问题,本发明的主要目的在于提供一种对视频目标区域进行跟踪的方法,以实现对视频目标区域的准确跟踪。Aiming at the above-mentioned problem of irregularity and instability of the video target area, the main purpose of the present invention is to provide a method for tracking the video target area, so as to realize accurate tracking of the video target area.
(二)技术方案(2) Technical solution
为达到上述目的,本发明提供了一种对视频目标区域进行跟踪的方法,该方法通过对视频目标区域中与路径点对应的跟踪点进行跟踪,得到路径点的参数信息,然后对得到的路径点进行平滑处理,采用平滑曲线连接各路径点,覆盖视频目标区域,实现对视频目标区域的跟踪。In order to achieve the above object, the present invention provides a method for tracking the video target area, the method is by tracking the tracking point corresponding to the way point in the video target area, obtaining the parameter information of the way point, and then tracking the obtained path Points are smoothed, and smooth curves are used to connect each path point, covering the video target area, and realizing the tracking of the video target area.
上述方案中,所述路径点是视频目标区域边界上的位置点,所述跟踪点是跟踪过程中算法跟踪模块的位置点,跟踪点是路径点的参考点,唯一对应于视频目标区域中的一个路径点。In the above scheme, the waypoint is a position point on the boundary of the video target area, the tracking point is the position point of the algorithm tracking module in the tracking process, and the tracking point is the reference point of the waypoint, which uniquely corresponds to the position point in the video target area. a waypoint.
上述方案中,所述对视频目标区域中与路径点对应的跟踪点进行跟踪时,在跟踪点附近选取一跟踪区域块作为跟踪点区域,该跟踪点区域包含有跟踪点的信息。In the above solution, when tracking the tracking point corresponding to the waypoint in the video target area, a tracking area block is selected near the tracking point as the tracking point area, and the tracking point area contains the information of the tracking point.
上述方案中,所述对视频目标区域中与路径点对应的跟踪点进行跟踪采用模板跟踪的方法,将跟踪点区域做为参考模板,通过与视频目标区域中的每块区域都与参考模版进行匹配,在下一帧图像中搜索匹配得到最大相似度的区域做为新的跟踪点。In the above scheme, the template tracking method is used for tracking the tracking points corresponding to the waypoints in the video target area, and the tracking point area is used as a reference template, and each area in the video target area is compared with the reference template. Matching, search and match the area with the maximum similarity in the next frame of image as a new tracking point.
上述方案中,所述对视频目标区域中与路径点对应的跟踪点进行跟踪采用角点跟踪的方法,通过在下一帧图像的视频目标区域中检测角点,在检测到角点后在角点所在区域与跟踪点区域进行相似度计算,得到最大相似度处作为新的跟踪点。In the above scheme, the tracking point corresponding to the waypoint in the video target area is tracked using the method of corner point tracking, by detecting the corner point in the video target area of the next frame image, after the corner point is detected, the corner point Calculate the similarity between the area where it is located and the tracking point area, and get the maximum similarity as the new tracking point.
上述方案中,所述路径点的参数信息至少包括:跟踪类型、路径点与跟踪点、路径点与跟踪点是否分离、路径点之间的相互关系、跟踪区域块与搜索区域块大小、连接路径点的平滑曲线类型和路径处理。In the above solution, the parameter information of the waypoint at least includes: tracking type, waypoint and tracking point, whether the waypoint and tracking point are separated, the relationship between waypoints, the size of the tracking area block and the search area block, and the connection path Smooth curve type and path handling for points.
上述方案中,所述对得到的路径点进行平滑处理,采用平滑曲线连接各路径点时,采用的平滑曲线是贝塞尔曲线。In the above scheme, when smoothing the obtained path points and connecting each path point with a smooth curve, the smooth curve used is a Bezier curve.
上述方案中,所述贝塞尔曲线在每个路径点处有两个贝塞尔控制点,通过对贝塞尔控制点的调节,得以覆盖视频目标区域。In the above solution, the Bezier curve has two Bezier control points at each path point, and the video target area can be covered by adjusting the Bezier control points.
上述方案中,所述对得到的路径点进行平滑处理,采用平滑曲线连接各路径点时,采用的平滑曲线是B样条曲线。In the above solution, when the obtained path points are smoothed, and the smooth curves are used to connect the path points, the smooth curves used are B-spline curves.
上述方案中,对于视频仅发生平移或缩放但没有形变的情况,该方法进一步根据路径点之间的相互关系对视频目标区域进行跟踪,选择某个路径点与其它路径点相互之间的位置不变。In the above scheme, for the case where the video is only panned or zoomed but not deformed, the method further tracks the video target area according to the relationship between the waypoints, and selects a waypoint whose position is different from other waypoints. Change.
(三)有益效果(3) Beneficial effects
从上述技术方案可以看出,本发明具有以下有益效果:As can be seen from the foregoing technical solutions, the present invention has the following beneficial effects:
1、本发明提供的这种对视频目标区域进行跟踪的方法,通过对视频目标区域中与路径点对应的跟踪点进行跟踪,得到路径点的参数信息,然后对得到的路径点进行平滑处理,采用平滑曲线连接各路径点,覆盖视频目标区域,实现了对视频目标区域的准确跟踪。1. The method for tracking the video target area provided by the present invention is to obtain the parameter information of the way point by tracking the tracking point corresponding to the way point in the video target area, and then smoothing the obtained way point, A smooth curve is used to connect each path point to cover the video target area, and the accurate tracking of the video target area is realized.
2、本发明提供的这种对视频目标区域进行跟踪的方法,克服现有技术中存在的问题,利用一个模块实现大多数的跟踪功能,通过扩展的接口与其它模块间进行相互连接,并增加了路径点间的相互关系操作,方便用户操作。2. The method for tracking the video target area provided by the present invention overcomes the problems existing in the prior art, utilizes a module to realize most of the tracking functions, and connects with other modules through an expanded interface, and increases It clarifies the interrelationship operation between waypoints, which is convenient for users to operate.
3、本发明提供的这种对视频目标区域进行跟踪的方法,在一种视频目标区域的跟踪方法中,路径点间加入了贝塞尔曲线连接、可以设置路径点间的相互依赖关系和跟踪路径点和跟踪点分离等功能,使得当跟踪点由于图像的变化在某些帧的画面中被遮挡不可见时,也可根据该跟踪点与其他可见跟踪点之间的相对位置及跟踪点之间的相互关系得到路径点的位置,从而准确的确定跟踪区域。3. In the method for tracking the video target area provided by the present invention, in a tracking method of the video target area, Bezier curve connections are added between the path points, and the interdependence and tracking between the path points can be set. Functions such as separation of waypoints and tracking points, so that when the tracking point is blocked and invisible in some frames due to image changes, it can also be based on the relative position between the tracking point and other visible tracking points and the distance between the tracking points. The position of the waypoint can be obtained through the relationship between them, so as to accurately determine the tracking area.
附图说明 Description of drawings
图1为本发明提供的视频目标区域的跟踪方法对某帧进行跟踪的操作示意图;Fig. 1 is the operation schematic diagram of tracking a certain frame by the tracking method of the video target area provided by the present invention;
图2是本发明一个实施例的视频目标区域的跟踪方法流程图。Fig. 2 is a flowchart of a method for tracking a video target area according to an embodiment of the present invention.
具体实施方式 Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be described in further detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
针对上述视频目标区域区域不规则和不稳定的问题,本发明提供的这种对视频目标区域进行跟踪的方法,提出了跟踪点与路径点分离、利用平滑曲线实现目标区域的覆盖和设置路径点间的相互关系等得到视频目标区域的跟踪路径,实现对视频目标区域的准确跟踪。Aiming at the above-mentioned problem of irregularity and instability of the video target area, the method for tracking the video target area provided by the present invention proposes to separate the tracking point from the path point, use smooth curves to realize the coverage of the target area and set the path point The tracking path of the video target area can be obtained through the mutual relationship between them, and the accurate tracking of the video target area can be realized.
1)、跟踪点与路径点分离1), separation of tracking points and path points
跟踪点是跟踪算法运算时的参考点,路径点是最终输出的路径位置。一般的设置是跟踪点与路径点在同一位置,当由于视频及其对象的不稳定,很多情况下不能实现对目标区域的跟踪。比如目标区域部分路径点被其它物体遮挡或消失,在这种情况下,找到与路径点有稳定对应的跟踪点并设置相连关系,通过对跟踪点的跟踪即可得到路径点的参数。The tracking point is the reference point when the tracking algorithm operates, and the path point is the final output path position. The general setting is that the tracking point and the waypoint are at the same position. Due to the instability of the video and its objects, the tracking of the target area cannot be achieved in many cases. For example, some waypoints in the target area are blocked or disappeared by other objects. In this case, find a tracking point that has a stable correspondence with the waypoint and set up a connection relationship. By tracking the tracking point, the parameters of the waypoint can be obtained.
2)、平滑曲线覆盖目标区域2), the smooth curve covers the target area
由于跟踪目标一般为不规则区域,如果采用直线连接,就需要很多的路径点才能将其覆盖,但本方法采用平滑曲线对路径点进行连接,通过平滑曲线的控制点来得到需要的区域大小,在节省运算量的同时,也更好地满足需求。Since the tracking target is generally an irregular area, if a straight line connection is used, a lot of path points are needed to cover it, but this method uses a smooth curve to connect the path points, and the required area size is obtained through the control points of the smooth curve. While saving the amount of calculation, it also better meets the demand.
3)、设置路径点相互关系3), set the relationship between waypoints
在视频跟踪中,路径点间一般都有一定的相互关系。在视频仅发生平移和缩放时,可以通过设置路径点间的相互关系可以更准确及在较少的运算下实现跟踪。In video tracking, there is generally a certain relationship between waypoints. When the video only pans and zooms, you can track more accurately and with fewer calculations by setting the relationship between the waypoints.
本发明提供的这种对视频目标区域进行跟踪的方法,通过对视频目标区域中与路径点对应的跟踪点进行跟踪,得到路径点的参数信息,然后对得到的路径点进行平滑处理,采用平滑曲线连接各路径点,覆盖视频目标区域,实现对视频目标区域的准确跟踪。The method for tracking the video object area provided by the present invention obtains the parameter information of the path points by tracking the tracking points corresponding to the path points in the video object area, and then performs smoothing processing on the obtained path points. The curve connects each path point, covers the video target area, and realizes accurate tracking of the video target area.
其中,所述路径点是视频目标区域边界上的位置点,所述跟踪点是跟踪过程中算法跟踪模块的位置点,跟踪点是路径点的参考点,唯一对应于视频目标区域中的一个路径点。对视频目标区域中与路径点对应的跟踪点进行跟踪时,在跟踪点附近选取一跟踪区域块作为跟踪点区域,该跟踪点区域包含有跟踪点的信息。所述路径点的参数信息至少包括:跟踪类型、路径点与跟踪点、路径点与跟踪点是否分离、路径点之间的相互关系、跟踪区域块与搜索区域块大小、连接路径点的平滑曲线类型和路径处理。Wherein, the waypoint is a position point on the boundary of the video target area, the tracking point is the position point of the algorithm tracking module in the tracking process, and the tracking point is the reference point of the waypoint, uniquely corresponding to a path in the video target area point. When tracking the tracking point corresponding to the path point in the video target area, select a tracking area block near the tracking point as the tracking point area, and the tracking point area contains the information of the tracking point. The parameter information of the waypoint at least includes: tracking type, waypoint and tracking point, whether the waypoint and tracking point are separated, the relationship between waypoints, the size of the tracking area block and the search area block, and the smooth curve connecting the way points Type and path handling.
对视频目标区域中与路径点对应的跟踪点进行跟踪采用模板跟踪的方法,将跟踪点区域做为参考模板,通过与视频目标区域中的每块区域都与参考模版进行匹配,在下一帧图像中搜索匹配得到最大相似度的区域做为新的跟踪点。或者,对视频目标区域中与路径点对应的跟踪点进行跟踪采用角点跟踪的方法,通过在下一帧图像的视频目标区域中检测角点,在检测到角点后在角点所在区域与跟踪点区域进行相似度计算,得到最大相似度处作为新的跟踪点。The template tracking method is used to track the tracking points corresponding to the path points in the video target area, and the tracking point area is used as a reference template. By matching each area in the video target area with the reference template, the image in the next frame The region with the maximum similarity obtained by searching and matching is used as a new tracking point. Alternatively, the corner point tracking method is used to track the tracking point corresponding to the path point in the video target area. By detecting the corner point in the video target area of the next frame image, after the corner point is detected, the corner point is located in the area where the corner point is located and tracked. Calculate the similarity of the point area, and get the maximum similarity as the new tracking point.
对得到的路径点进行平滑处理,采用平滑曲线连接各路径点时,采用的平滑曲线是贝塞尔曲线。贝塞尔曲线在每个路径点处有两个贝塞尔控制点,通过对贝塞尔控制点的调节,得以覆盖视频目标区域。或者,对得到的路径点进行平滑处理,采用平滑曲线连接各路径点时,采用的平滑曲线是B样条曲线。The obtained path points are smoothed, and when smooth curves are used to connect the path points, the smooth curves used are Bezier curves. The Bezier curve has two Bezier control points at each path point. By adjusting the Bezier control points, the video target area can be covered. Alternatively, the obtained path points are smoothed, and when smooth curves are used to connect the path points, the smooth curves used are B-spline curves.
对于视频仅发生平移或缩放但没有形变的情况,该方法进一步根据路径点之间的相互关系对视频目标区域进行跟踪,选择某个路径点与其它路径点相互之间的位置不变。For the case where the video is only panned or zoomed but not deformed, the method further tracks the target area of the video according to the relationship between the waypoints, and the position between a certain waypoint and other waypoints remains unchanged.
本发明提供的这种对视频目标区域进行跟踪的方法,通过对视频目标区域跟踪得到该区域的路径参数,用于视频后期处理,如进行掩膜、2D变换和稳像等功能。路径参数包括:每帧单个或多个路径点的位置和每个路径点的贝塞尔控制点。每帧路径点通过贝塞尔曲线相连接,并将目标区域覆盖。图1所示,为某帧跟踪结果,图中包括4个路径点及各自贝塞尔曲线,线上的小方块代表路径点的位置,横线是贝塞尔控制点连接,所有的路径点和参数形成一圆形跟踪区域。通过调整路径点和贝塞尔控制点,得到贝塞尔曲线,通过贝塞尔曲线可以围绕跟踪区域从而实现对视频目标区域的跟踪。The method for tracking a video target area provided by the present invention obtains the path parameters of the area by tracking the video target area, and is used for video post-processing, such as masking, 2D transformation and image stabilization. Path parameters include: position of single or multiple waypoints per frame and Bezier control points for each waypoint. The path points of each frame are connected by Bezier curves and cover the target area. As shown in Figure 1, it is the tracking result of a certain frame. The figure includes 4 path points and their respective Bezier curves. The small squares on the line represent the position of the path points, and the horizontal line is the connection of the Bezier control points. All the path points and parameters form a circular tracking region. By adjusting the path points and Bezier control points, a Bezier curve is obtained, and the Bezier curve can surround the tracking area to realize the tracking of the video target area.
本发明提供的对视频目标区域进行跟踪的方法中,用到下列术语:In the method for tracking the video target area provided by the present invention, the following terms are used:
视频跟踪:对移动目标的整体或部分区域进行路径,获取目标区域的路径参数。Video tracking: path the whole or part of the moving target area, and obtain the path parameters of the target area.
贝塞尔曲线:根据2个行值点和2个控制点得到一条通过2个行值点的光滑曲线。Bezier curve: According to 2 row value points and 2 control points, a smooth curve passing through 2 row value points is obtained.
路径点和跟踪点:路径点是最近得到路径点的位置,跟踪点是跟踪过程中算法跟踪模块的位置。跟踪点是路径点的参考点。Waypoint and tracking point: the waypoint is the position where the waypoint was obtained recently, and the tracking point is the position of the algorithm tracking module during the tracking process. Trackpoints are reference points for waypoints.
相似度:用来衡量两个区域的相似成度。Similarity: It is used to measure the similarity between two regions.
模板跟踪:通过与搜索区域每块都进行模板匹配的方法,得到相似度都大的区域作为新的跟踪点。Template tracking: Through the method of template matching with each block of the search area, the area with a large similarity is obtained as a new tracking point.
角点跟踪:通过在搜索区域检测到角点,仅在角点区域与跟踪模板进行相似度计算并得到最大相似度处作为新的跟踪点。Corner tracking: By detecting corners in the search area, the similarity calculation between the corner area and the tracking template is performed and the maximum similarity is obtained as a new tracking point.
本发明提供的这种对视频目标区域进行跟踪的方法,固化在跟踪模块内,该跟踪模块主要供其它插件或模块调用。这些插件或模块需要将视频目标区域路径点信息作为参数,如在掩膜插件中,需要得到进行掩膜的区域;在颜色校正模块中,需要得到进行校正的区域等。启动时需要对跟踪模块进行初始的参数设置,如起始路径点的参数、路径点数是否固定、路径点间的相互关系和贝塞尔曲线信息等。进入跟踪模块后就可以进行视频目标的跟踪操作,完成后,将每个路径点参数和其贝塞尔曲线参数传递给插件模块进行操作。The method for tracking the video target area provided by the present invention is solidified in the tracking module, and the tracking module is mainly called by other plug-ins or modules. These plug-ins or modules need to take the path point information of the video target area as a parameter. For example, in the mask plug-in, the area to be masked needs to be obtained; in the color correction module, the area to be corrected needs to be obtained, etc. When starting up, it is necessary to set the initial parameters of the tracking module, such as the parameters of the starting path point, whether the number of path points is fixed, the relationship between path points and Bezier curve information, etc. After entering the tracking module, the video target tracking operation can be carried out. After completion, the parameters of each path point and its Bezier curve parameters are passed to the plug-in module for operation.
每个路径点都有自己的参数,比如跟踪类型、路径点与跟踪点分离和是否设为贝塞尔曲线等。以下为路径点的参数设置:Each path point has its own parameters, such as tracking type, separation of path point and track point, and whether to set it as Bezier curve, etc. The following are the parameter settings of the waypoint:
1)、跟踪类型选择。跟踪类型可以选择模板跟踪或角点跟踪。模板跟踪是将跟踪点区域做为参考模板,通过在下一帧图像中搜索找到最大相似度的区域做为新的跟踪点。角点跟踪是在下一帧图像中检测到角点位置,找到角点位置区域与跟踪区域相似度最大的点作为新的跟踪点。模板跟踪的优点在于匹配精确,但运算量较大,角点跟踪的优点在于运算量小、速度快和特征点明确。角点跟踪的前提是跟踪点必须处在稳定的角点上,用户可以通过显示视频中所有角点的操作,逐帧查看检测出的角点位置。选取稳定出现的角点做为跟踪点的位置。1), Tracking type selection. Tracking type can choose template tracking or corner tracking. Template tracking is to use the tracking point area as a reference template, and find the area with the greatest similarity in the next frame image as a new tracking point. Corner tracking is to detect the corner position in the next frame image, and find the point with the greatest similarity between the corner position area and the tracking area as a new tracking point. The advantage of template tracking is that it matches accurately, but it has a large amount of calculation. The advantage of corner point tracking is that it has a small amount of calculation, fast speed and clear feature points. The premise of corner tracking is that the tracking point must be on a stable corner, and the user can view the detected corner positions frame by frame by displaying all the corner points in the video. Select the corner point that appears stably as the location of the tracking point.
2)、跟踪块和搜索块大小。考虑到精确性和运算效率,一般选在跟踪点附近选取一跟踪块,包含了跟踪点的信息量,而在下一帧搜索的范围由搜索块大小决定。搜索块越大,即使运动量较大也能检测得到,但同时会引入更多的误差信息且运算量较大。一般会根据跟踪对象的不同选取合适的跟踪块和搜索块。可以初步地调整跟踪块和搜索块的大小,若跟踪点稳定且形变较小,可以选小的跟踪块;若区域发生的形变较大,则需要选取较大的跟踪块以包含更多的信息量。2), track block and search block size. Considering the accuracy and computing efficiency, a tracking block is generally selected near the tracking point, which contains the information of the tracking point, and the search range in the next frame is determined by the size of the search block. The larger the search block, the more motion can be detected, but at the same time, more error information will be introduced and the amount of calculation will be larger. Generally, appropriate tracking blocks and search blocks are selected according to different tracking objects. You can preliminarily adjust the size of the tracking block and the search block. If the tracking point is stable and the deformation is small, you can choose a small tracking block; if the deformation of the area is large, you need to select a larger tracking block to contain more information. quantity.
3)、路径点连接类型。在本发明的视频目标区域的跟踪方法模块中一般选取贝塞尔曲线对路径点进行连接,通过对每个贝塞尔控制点的调整,达到对目标区域的覆盖,也可以选择直线连接。对目标区域的覆盖如果选取直线连接一般需要更多的路径点,进而增加了运算量和不稳定性。通过对贝塞尔控制点的调整,可以在更少点的情况下对目标区域进行覆盖。而且直线连接只能覆盖棱边的多边形,利用贝塞尔曲线则可以实现对平滑边缘的区域覆盖。3) Waypoint connection type. In the tracking method module of the video target area of the present invention, Bezier curves are generally selected to connect the path points. By adjusting each Bezier control point, the coverage of the target area can be achieved, and a straight line connection can also be selected. If a straight-line connection is selected to cover the target area, more path points are generally required, which increases the amount of computation and instability. By adjusting the Bezier control points, the target area can be covered with fewer points. Moreover, the straight line connection can only cover the edge polygons, and the use of Bezier curves can achieve the area coverage of smooth edges.
4)、路径点间相互关系。可以选择某个路径点与其它路径点相互之间的位置不变,主要应用于如视频仅发生平移或缩放但没有形变的情况,可以减少运算量同时更为精确。如果视频跟踪区域发生扭曲或形变,路径点和跟踪点就需要设置在同一点上,以达到更精确的跟踪。4) Interrelationship between waypoints. You can choose that the positions of a certain path point and other path points remain unchanged. It is mainly used in situations where the video is only panned or zoomed without deformation, which can reduce the amount of computation and be more accurate. If the video tracking area is distorted or deformed, the waypoints and tracking points need to be set at the same point to achieve more accurate tracking.
5)、路径点与跟踪点。可以设置路径点与跟踪点不在同一位置,应用于路径点不稳定或消失的情况下,通过与跟踪点的相对位置及跟踪点之间的相互关系得到路径点的位置。通过多个跟踪点的位置变化可以判断视频是否发生了平移或缩放,如果平移,则跟踪点与路径点的相对位置不发生变化,如果发生了缩放,则相对位置也需要相应地缩放。5), waypoints and tracking points. It can be set that the waypoint and the tracking point are not in the same position. It is applied to the situation that the waypoint is unstable or disappears. The position of the waypoint can be obtained through the relative position with the tracking point and the relationship between the tracking points. The position changes of multiple tracking points can determine whether the video has been panned or zoomed. If panned, the relative position between the tracked point and the path point will not change. If zoomed, the relative position needs to be scaled accordingly.
6)、路径处理。得到路径点之后,可以对每帧的路径点进行平滑处理,防止抖动或修正出现的细微错误。6), path processing. After the waypoints are obtained, the waypoints of each frame can be smoothed to prevent jitter or correct minor errors that occur.
本发明提供的这种对视频目标区域进行跟踪的方法,提出了在现有模块中加入一控制按钮,通过控制按钮来调用跟踪模块,能够实时和方便地对目标进行跟踪,而不需要重新地进行数据的导出和导入。本发明的视频目标区域的跟踪方法模块的接口为路径点及其控制点的位置。The method for tracking the video target area provided by the present invention proposes to add a control button to the existing module, and call the tracking module through the control button, so that the target can be tracked in real time and conveniently without resetting Export and import data. The interface of the tracking method module of the video target area of the present invention is the position of the waypoint and its control point.
见图2所示,图2是本发明一个实施例的视频目标区域的跟踪方法流程图,包括步骤:See shown in Fig. 2, Fig. 2 is the tracking method flowchart of the video target area of an embodiment of the present invention, comprises steps:
A)启动控制按钮,调用本发明的视频目标区域的跟踪模块。A) Start the control button to call the tracking module of the video target area of the present invention.
B)设置参数:B) Setting parameters:
1)设置路径类型:跟踪类型可以选择模板跟踪或角点跟踪。1) Set the path type: the tracking type can choose template tracking or corner tracking.
2)设置跟踪块和搜索区域大小。2) Set the tracking block and search area size.
3)设置跟踪点间连接类型,选取贝塞尔曲线对路径点进行连接。3) Set the connection type between tracking points, and select the Bezier curve to connect the path points.
4)设置路径点间相互关系,选择某个路径点与其它路径点相互之间的位置不变。4) Set the mutual relationship between the waypoints, select a certain waypoint and other waypoints, and the position between each other remains unchanged.
5)设置路径点与跟踪点的关系。5) Set the relationship between the waypoint and the tracking point.
C)启动本发明的视频目标区域的跟踪模块进行跟踪。C) Start the tracking module of the video target area of the present invention to track.
D)路径处理:得到路径点之后,可以对每帧的路径点进行平滑处理。D) Path processing: After the path points are obtained, the path points of each frame can be smoothed.
E)退出跟踪模块,完成。E) Exit the tracking module, complete.
在对运动员的头像进行跟踪时,由于运动员的头像一直在发生变化,且背景也不同,通过选取运动员头像的边缘点做为跟踪点比较难实现跟踪。可以通过设置跟踪点在人脸区域,路径点在边缘区域,跟踪点与路径点分离实现头像的跟踪。When tracking the athlete's head portrait, since the athlete's head portrait is always changing and the background is also different, it is difficult to achieve tracking by selecting the edge point of the athlete's head portrait as the tracking point. Head portrait tracking can be achieved by setting the tracking point in the face area, the path point in the edge area, and the tracking point and path point separately.
在采用平滑曲线对路径点进行连接时,平滑曲线可以采用贝塞尔曲线、B样条曲线等方法。比如贝塞尔曲线对路径点的连接,每个路径点处有两个控制点,通过对控制点的调节,得以覆盖跟踪区域。When using a smooth curve to connect the path points, the smooth curve can use Bezier curve, B-spline curve and other methods. For example, the Bezier curve connects the path points. There are two control points at each path point. By adjusting the control points, the tracking area can be covered.
在考虑路径点的相互关系时,假如视频的区域仅有平移发生,可以仅跟踪一点而得到所有的路径点位置。在某些跟踪对象消失的情况下,可以设置该跟踪点与其它跟踪点的关系,通过其它跟踪点的位置得到该跟踪点。When considering the interrelationship of waypoints, if only translation occurs in the video area, all the waypoint positions can be obtained by tracking only one point. When some tracking objects disappear, you can set the relationship between this tracking point and other tracking points, and get this tracking point through the positions of other tracking points.
本发明提供的这种对视频目标区域进行跟踪的方法,引入路径点与跟踪点分离的方法可以很好地解决目标区域在屏幕中不稳定的问题,并加入了路径点的相互关系,即使在视频进行缩放时,也能很快地得到路径点的位置。跟踪点是路径点的参考点,通过直接或间接的相关得到路径点的位置。例如某视频中想得到某人头顶上方的路径点,由于人头顶上方的区域经常发生改变或消失,可以将人的眼睛设为跟踪点,再设置眼睛与头顶的相对关系。在此情况下头顶上方是路径点,眼睛是跟踪点,路径点与跟踪点相分离,当然路径点与跟踪点也可以在同一位置。The method for tracking the video target area provided by the present invention introduces the method of separating the waypoint and the tracking point, which can well solve the problem that the target area is unstable on the screen, and adds the relationship between the waypoints, even in the When the video is zoomed, the position of the waypoint can also be quickly obtained. The tracking point is the reference point of the waypoint, and the position of the waypoint is obtained through direct or indirect correlation. For example, in a video, you want to get the waypoint above someone's head. Since the area above the person's head often changes or disappears, you can set the person's eyes as the tracking point, and then set the relative relationship between the eyes and the top of the head. In this case, the top of the head is the waypoint, the eyes are the tracking points, and the waypoint and the tracking point are separated. Of course, the waypoint and the tracking point can also be in the same position.
本发明提供的这种对视频目标区域进行跟踪的方法,利用贝塞尔曲线对路径点进行连接,通过设置路径点处贝塞尔控制点的参数得到任意平滑的目标区域。The method for tracking a video target area provided by the present invention uses Bezier curves to connect path points, and obtains any smooth target area by setting parameters of Bezier control points at path points.
以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 201010108049 CN102142146B (en) | 2010-01-28 | 2010-01-28 | Method for tracking video target area |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 201010108049 CN102142146B (en) | 2010-01-28 | 2010-01-28 | Method for tracking video target area |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN102142146A CN102142146A (en) | 2011-08-03 |
| CN102142146B true CN102142146B (en) | 2013-04-17 |
Family
ID=44409630
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN 201010108049 Expired - Fee Related CN102142146B (en) | 2010-01-28 | 2010-01-28 | Method for tracking video target area |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102142146B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104574384B (en) * | 2014-12-26 | 2018-04-27 | 北京航天控制仪器研究所 | A kind of target based on MSER and SURF Feature Points Matchings loses catching method again |
| CN106056655B (en) * | 2016-09-06 | 2019-09-10 | 珠海金山网络游戏科技有限公司 | A kind of editable virtual camera system and method |
| CN112414428B (en) * | 2020-10-29 | 2023-06-27 | 汉海信息技术(上海)有限公司 | Navigation information display method and device, electronic equipment and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6295367B1 (en) * | 1997-06-19 | 2001-09-25 | Emtera Corporation | System and method for tracking movement of objects in a scene using correspondence graphs |
| CN101216885A (en) * | 2008-01-04 | 2008-07-09 | 中山大学 | A Pedestrian Face Detection and Tracking Algorithm Based on Video |
| CN101290681A (en) * | 2008-05-26 | 2008-10-22 | 华为技术有限公司 | Video target tracking method, device and automatic video tracking system |
-
2010
- 2010-01-28 CN CN 201010108049 patent/CN102142146B/en not_active Expired - Fee Related
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6295367B1 (en) * | 1997-06-19 | 2001-09-25 | Emtera Corporation | System and method for tracking movement of objects in a scene using correspondence graphs |
| CN101216885A (en) * | 2008-01-04 | 2008-07-09 | 中山大学 | A Pedestrian Face Detection and Tracking Algorithm Based on Video |
| CN101290681A (en) * | 2008-05-26 | 2008-10-22 | 华为技术有限公司 | Video target tracking method, device and automatic video tracking system |
Non-Patent Citations (5)
| Title |
|---|
| JP特开2008-165341A 2008.07.17 |
| 刘万春等.基于肤色的人脸实时跟踪方法.《北京理工大学学报》.2000,第20卷(第4期), |
| 刘明刚等.运动目标的自动分割与跟踪.《电子与信息学报》.2002,第24卷(第8期), |
| 基于肤色的人脸实时跟踪方法;刘万春等;《北京理工大学学报》;20000830;第20卷(第4期);全文 * |
| 运动目标的自动分割与跟踪;刘明刚等;《电子与信息学报》;20020815;第24卷(第8期);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102142146A (en) | 2011-08-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110622497B (en) | Device with cameras having different focal lengths and method of implementing a camera | |
| CN103607554B (en) | It is a kind of based on full-automatic face without the image synthesizing method being stitched into | |
| US9865062B2 (en) | Systems and methods for determining a region in an image | |
| TW497366B (en) | An apparatus and method for providing panoramic images | |
| US9396215B2 (en) | Search device, search method, recording medium, and program | |
| US9747870B2 (en) | Method, apparatus, and computer-readable medium for superimposing a graphic on a first image generated from cut-out of a second image | |
| US20140270540A1 (en) | Determining dimension of target object in an image using reference object | |
| CN107274346A (en) | Real-time panoramic video splicing system | |
| CN108537721A (en) | Processing method, device and the electronic equipment of panoramic picture | |
| CN106295512B (en) | Vision data base construction method and indoor orientation method in more correction lines room based on mark | |
| CN105678809A (en) | Handheld automatic follow shot device and target tracking method thereof | |
| WO2014145322A1 (en) | Systems and methods for tracking camera orientation and mapping frames onto a panoramic canvas | |
| CN103260081A (en) | Method and device of video image zooming processing | |
| CN103489219B (en) | 3D hair style effect simulation system based on depth image analysis | |
| CN103391430B (en) | Correlation tracking method and special device based on DSP | |
| CN107240120B (en) | Method and device for tracking moving target in video | |
| JP2013525906A (en) | Viewpoint detector based on skin color area and face area | |
| CN110648363A (en) | Camera posture determining method and device, storage medium and electronic equipment | |
| Zhao et al. | Adaptively meshed video stabilization | |
| US20200160560A1 (en) | Method, system and apparatus for stabilising frames of a captured video sequence | |
| CN105488760A (en) | Virtual image stitching method based on flow field | |
| Liu et al. | Robust autocalibration for a surveillance camera network | |
| CN102685371B (en) | Digital Video Image Stabilization Method Based on Multi-resolution Block Matching and PI Control | |
| CN104079800A (en) | Shaking preventing method for video image in video surveillance | |
| CN102142146B (en) | Method for tracking video target area |
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: 20130417 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |