CN112288767A - Automatic detection and tracking method based on target adaptive projection - Google Patents
Automatic detection and tracking method based on target adaptive projection Download PDFInfo
- Publication number
- CN112288767A CN112288767A CN202011214459.3A CN202011214459A CN112288767A CN 112288767 A CN112288767 A CN 112288767A CN 202011214459 A CN202011214459 A CN 202011214459A CN 112288767 A CN112288767 A CN 112288767A
- Authority
- CN
- China
- Prior art keywords
- target
- mask
- roi
- tracking
- image
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/215—Motion-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/246—Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/254—Analysis of motion involving subtraction of images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
Abstract
The invention discloses an automatic detection and tracking method based on target adaptive projection, which comprises the following steps: reading video sequence information to be tracked, and performing RGB-Gray color space conversion on each frame of image; obtaining a foreground target mask in the previous M frames by using a weighted sliding variance method; adaptively selecting a mask with a maximum foreground target area; horizontally and vertically projecting the mask; searching the projection result in the vertical direction and the horizontal direction, and determining the center of the optimal target by accumulating pixels and the occupied proportion; starting from the central position, carrying out reciprocating detection in the vertical and horizontal directions, and determining the optimal target dimension by accumulating pixels and occupied proportion so as to determine an ROI (target region); and finally, tracking the target by using a centroid method to finish the automatic target detection and tracking process. The method is simple to implement, the flow is clear, and the process of extracting the ROI by the self-adaptive projection method can effectively avoid the influence of background noise.
Description
Technical Field
The invention belongs to the field of industrial computer vision, and relates to the problems of background modeling, target detection, target tracking and initial ROI calculation.
Background
In the field of computer vision, target detection and target tracking are two hot research problems, and the research process aiming at the two problems is slowly transited from a traditional method to a depth method. In most research works, target detection and target tracking are studied as two separate problems, and ideally, for a given video sequence, the algorithm can automatically frame the target and automatically track it. Although the deep learning method has achieved good results in recent years, the deep learning method requires a large amount of data sets to train the model, and in a real scene, the data acquisition is often difficult. Therefore, the conventional method still has its indispensable role, and in the conventional method, the method of background modeling is a very feasible solution for target detection, but the output of background modeling may contain noise, which may affect the accuracy of the extracted target ROI to some extent. Therefore, how to accurately extract the target ROI according to the foreground mask output by the background modeling method becomes a key problem.
Disclosure of Invention
The invention discloses an automatic detection and tracking method based on target self-adaptive projection, aiming at accurately extracting an ROI of a target to be detected and effectively tracking the ROI.
The invention relates to an automatic detection and tracking method based on target adaptive projection, which is characterized by comprising a target detection step near an initial frame, an adaptive mask selection step, an ROI extraction step and a target tracking step; the detection step of the target near the initial frame is a weighted sliding variance method; the self-adaptive mask selecting step is to select the optimal foreground mask; the ROI extraction step is a self-adaptive projection method; the target tracking step is a centroid method.
Preferably, reading the video sequence information to be tracked, and performing RGB-to-Gray color space conversion on each frame of image;
preferably, the step of calculating the image mask by the weighted moving average method is as follows:
step (1): for the k frame image FkCalculating the weighted mean image thereof according to the following formula
Step (2): computing weighted variance sum S of kth framekAs shown in the following formula:
Sk:=0.5Vk+0.3Vk-1+0.2Vk-2
wherein the content of the first and second substances,
and (3): calculating SkIs squared and normalized to [0,255 ]]Interval, getSetting a threshold value T, dividing the value according to TAnd obtaining a binary mask from the pixels in the image.
Preferably, a target mask of the previous M frames is obtained by using a weighted sliding variance method, and the optimal mask is the mask with the largest proportion of the foreground area.
Preferably, the adaptive projection is performed by using an optimal mask, and the steps are as follows:
step (1): performing horizontal and vertical projection on the mask, and counting the sum of horizontal and vertical pixels, which is Dh,Dv;
Step (2): calculating the center position (P) of the optimal targetx,Py):
And (3): setting the threshold Q to 0.97, avoiding the influence of noise, and calculating the optimum scale (R)w,Rh) The pseudo code is as follows:
preferably, the effective tracking is performed by using a centroid method, which comprises the following steps:
step (1): image I of the best mask obtained by weighted sliding variance method, and ROI (x, y, ROI) of the target obtained by adaptive projection methodW,roiH) Calculating the centroid position of the current frameInitializing a tracker;
step (2): inputting the next frame image, and converting it into grayscale image Inext;
And (3): the inter-frame difference D within the ROI is calculated using the following equation:
D(i-x,j-y):=|Inext(i,j)-I(i,j)|,x≤i≤x+roiW,y≤j≤y+roiH
and (4): calculating a segmentation threshold Th by adopting an OTSU method, and binarizing D by using the Th;
and (5): finding the centroid C byx,Cy:
And (6): the coordinates (x, y) of the ROI are updated with the following formula:
and (7): and (5) returning the updated ROI and repeating the step (2) until the video reading is finished.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is the result of adaptive projection method to calculate the target ROI (in the case of background noise);
FIG. 3 is the result of tracking by centroid method at frame 53;
fig. 4 algorithm pseudo code of the adaptive projection method.
Detailed Description
The specific implementation method is performed as the steps shown in fig. 1, first, reading the previous M frames of images, calculating a foreground mask by using a weighted sliding variance method, and obtaining an optimal mask, namely the mask with the largest proportion of foreground objects in the whole image; performing adaptive projection on the mask, calculating the center of the target, and adaptively determining the width and the height of the target by utilizing the algorithm shown in FIG. 4; the ROI is used for initializing the centroid tracker, and the optimal mask is not necessarily the Mth frame image, so that the ROI needs to be tracked and updated by a centroid method frame by frame aiming at the images from the optimal mask to the Mth frame image, so that the potential defect caused by directly tracking from the Mth frame image is prevented, namely the target of the Mth frame image can be greatly different from the target of the image where the optimal mask is located.
Results of the experiment
Fig. 2 shows a mask obtained by the weighted sliding variance method and an ROI obtained by the adaptive projection method, wherein the interference of background noise on the ROI can be effectively avoided by adjusting the threshold Q. Moreover, the background noise has small pixel sum compared with the foreground target, so the foreground target can be effectively extracted by adopting the self-adaptive projection method. Of course, although the background noise can be removed to a certain extent by using the morphological operation, the shape of the foreground object may be affected at the same time, and the extraction effect of the foreground object may be affected. Fig. 3 shows the result of tracking by centroid method at 53 frames, and it can be seen that the foreground object is stably nested by the tracking frame even if there is some deformation in the object.
Claims (6)
1. An automatic detection and tracking method based on target adaptive projection is characterized by comprising a target detection step near an initial frame, an adaptive mask selection step, an ROI extraction step and a target tracking step; the detection step of the target near the initial frame is a weighted sliding variance method; the self-adaptive mask selecting step is to select the optimal foreground mask; the ROI extraction step is a self-adaptive projection method; the target tracking step is a centroid method.
2. The automatic detection and tracking method of claim 1, wherein the video sequence information to be tracked is read and RGB to Gray color space conversion is performed for each frame of image.
3. The automatic detection and tracking method of claim 1 wherein the weighted moving average method finds the image mask by:
step (1): for the k frame image FkCalculating the weighted mean image thereof according to the following formula
Step (2): computing weighted variance sum S of kth framekAs shown in the following formula:
Sk:=0.5Vk+0.3Vk-1+0.2Vk-2
wherein the content of the first and second substances,
4. The automatic detection and tracking method of claim 1 wherein the target mask of the previous M frames is found by using a weighted sliding variance method, and the optimal mask is the mask with the largest proportion of foreground regions.
5. The automatic detection and tracking method of claim 1 wherein the adaptive projection is performed using an optimal mask, comprising the steps of:
step (1): performing horizontal and vertical projection on the mask, and counting the sum of horizontal and vertical pixels, which is Dh,Dv;
Step (2): calculating the center position (P) of the optimal targetx,Py):
And (3): setting the threshold Q to 0.97, avoiding the influence of noise, and calculating the optimum scale (R)w,Rh) The pseudo code is as follows:
6. the automatic detection and tracking method of claim 1 wherein the effective tracking is performed using a centroid method comprising the steps of:
step (1): image I of the best mask obtained by weighted sliding variance method, and ROI (x, y, ROI) of the target obtained by adaptive projection methodW,roiH) Calculating the centroid position of the current frameInitializing a tracker;
step (2): inputting the next frame image, and converting it into grayscale image Inext;
And (3): the inter-frame difference D within the ROI is calculated using the following equation:
D(i-x,j-y):=|Inext(i,j)-I(i,j)|,x≤i≤x+roiW,y≤j≤y+roiH
and (4): calculating a segmentation threshold Th by adopting an OTSU method, and binarizing D by using the Th;
and (5): finding the centroid C byx,Cy:
And (6): the coordinates (x, y) of the ROI are updated with the following formula:
and (7): and (5) returning the updated ROI and repeating the step (2) until the video reading is finished.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011214459.3A CN112288767A (en) | 2020-11-04 | 2020-11-04 | Automatic detection and tracking method based on target adaptive projection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011214459.3A CN112288767A (en) | 2020-11-04 | 2020-11-04 | Automatic detection and tracking method based on target adaptive projection |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112288767A true CN112288767A (en) | 2021-01-29 |
Family
ID=74352175
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011214459.3A Pending CN112288767A (en) | 2020-11-04 | 2020-11-04 | Automatic detection and tracking method based on target adaptive projection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112288767A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112991290A (en) * | 2021-03-10 | 2021-06-18 | 北京百度网讯科技有限公司 | Image stabilization method and device, road side equipment and cloud control platform |
CN113780254A (en) * | 2021-11-12 | 2021-12-10 | 阿里巴巴达摩院(杭州)科技有限公司 | Picture processing method and device, electronic equipment and computer storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090244309A1 (en) * | 2006-08-03 | 2009-10-01 | Benoit Maison | Method and Device for Identifying and Extracting Images of multiple Users, and for Recognizing User Gestures |
CN101739551A (en) * | 2009-02-11 | 2010-06-16 | 北京智安邦科技有限公司 | Method and system for identifying moving objects |
WO2018095082A1 (en) * | 2016-11-28 | 2018-05-31 | 江苏东大金智信息系统有限公司 | Rapid detection method for moving target in video monitoring |
US20180365843A1 (en) * | 2015-07-01 | 2018-12-20 | China University Of Mining And Technology | Method and system for tracking moving objects based on optical flow method |
CN109102523A (en) * | 2018-07-13 | 2018-12-28 | 南京理工大学 | A kind of moving object detection and tracking |
CN109902578A (en) * | 2019-01-25 | 2019-06-18 | 南京理工大学 | A kind of infrared target detection and tracking |
US20190236790A1 (en) * | 2018-01-26 | 2019-08-01 | Wipro Limited | Method and system for tracking objects within a video |
-
2020
- 2020-11-04 CN CN202011214459.3A patent/CN112288767A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090244309A1 (en) * | 2006-08-03 | 2009-10-01 | Benoit Maison | Method and Device for Identifying and Extracting Images of multiple Users, and for Recognizing User Gestures |
CN101739551A (en) * | 2009-02-11 | 2010-06-16 | 北京智安邦科技有限公司 | Method and system for identifying moving objects |
US20180365843A1 (en) * | 2015-07-01 | 2018-12-20 | China University Of Mining And Technology | Method and system for tracking moving objects based on optical flow method |
WO2018095082A1 (en) * | 2016-11-28 | 2018-05-31 | 江苏东大金智信息系统有限公司 | Rapid detection method for moving target in video monitoring |
US20190236790A1 (en) * | 2018-01-26 | 2019-08-01 | Wipro Limited | Method and system for tracking objects within a video |
CN109102523A (en) * | 2018-07-13 | 2018-12-28 | 南京理工大学 | A kind of moving object detection and tracking |
CN109902578A (en) * | 2019-01-25 | 2019-06-18 | 南京理工大学 | A kind of infrared target detection and tracking |
Non-Patent Citations (1)
Title |
---|
黄波,杨勇,王桥,吴乐南: "基于模糊聚类和时域跟踪的视频分割", 通信学报, no. 12 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112991290A (en) * | 2021-03-10 | 2021-06-18 | 北京百度网讯科技有限公司 | Image stabilization method and device, road side equipment and cloud control platform |
CN112991290B (en) * | 2021-03-10 | 2023-12-05 | 阿波罗智联(北京)科技有限公司 | Image stabilizing method and device, road side equipment and cloud control platform |
CN113780254A (en) * | 2021-11-12 | 2021-12-10 | 阿里巴巴达摩院(杭州)科技有限公司 | Picture processing method and device, electronic equipment and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10037610B1 (en) | Method for tracking and segmenting a target object in an image using Markov Chain, and device using the same | |
CN110866924B (en) | Line structured light center line extraction method and storage medium | |
CN105335986B (en) | Method for tracking target based on characteristic matching and MeanShift algorithm | |
CN104598883B (en) | Target knows method for distinguishing again in a kind of multiple-camera monitoring network | |
CN108537212B (en) | Student behavior detection method based on motion estimation | |
CN104200495A (en) | Multi-target tracking method in video surveillance | |
CN107967692A (en) | A kind of target following optimization method based on tracking study detection | |
CN112288767A (en) | Automatic detection and tracking method based on target adaptive projection | |
KR20160044316A (en) | Device and method for tracking people based depth information | |
CN109146918B (en) | Self-adaptive related target positioning method based on block | |
CN108846850B (en) | Target tracking method based on TLD algorithm | |
CN101908236B (en) | Public traffice passenger flow statistical method | |
CN115375733A (en) | Snow vehicle sled three-dimensional sliding track extraction method based on videos and point cloud data | |
CN109949344B (en) | Nuclear correlation filtering tracking method based on color probability target suggestion window | |
CN111754525A (en) | Industrial character detection process based on non-precise segmentation | |
Zhang et al. | Mean-shift algorithm integrating with SURF for tracking | |
CN116309780A (en) | Water gauge water level identification method based on target detection | |
CN110570450A (en) | Target tracking method based on cascade context-aware framework | |
CN113689365B (en) | Target tracking and positioning method based on Azure Kinect | |
Liu et al. | Mean shift fusion color histogram algorithm for nonrigid complex target tracking in sports video | |
CN114529715A (en) | Image identification method and system based on edge extraction | |
CN110322474B (en) | Image moving target real-time detection method based on unmanned aerial vehicle platform | |
Zhao et al. | Eye Tracking Based on the Template Matching and the Pyramidal Lucas-Kanade Algorithm | |
Wang et al. | Human tracking and segmentation supported by silhouette-based gait recognition | |
CN111476815B (en) | Moving target detection method based on color probability of moving area |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |