Image tracking method in audio and video control device

By combining HOG features, color histogram features and scale filters in audio and video control equipment, the problem of insufficient stability of the KCF filter is solved, and the LK optical flow method is added to Mask-RCNN to solve the time-consuming problem of video target tracking. The problem of being too long enables real-time tracking of video targets.

CN113920168BActive Publication Date: 2024-09-03HENAN XUNGU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111286698.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-02
Publication Date
2024-09-03
Estimated Expiration
2041-11-02

AI Technical Summary

Technical Problem

In the existing technology, the KCF filter has insufficient stability in the long-term tracking process and is prone to template distortion due to the accumulation of erroneous features, making it difficult to identify the correct target; the Mask-RCNN algorithm takes too long to track video targets and cannot achieve real-time tracking.

Method used

An image tracking method in audio and video control equipment is adopted. By acquiring the video stream and extracting HOG features and color histogram features, combined with a scale filter and an outlier detector, the position and scale prediction process is separated, and in the Mask-RCNN model Add the LK optical flow method to reduce background feature extraction time.

Benefits of technology

It effectively locates deformable targets, improves the accuracy and stability of scale prediction, shortens target detection time, and achieves real-time tracking of video targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113920168B
    Figure CN113920168B
Patent Text Reader

Abstract

The present invention proposes an image tracking method in an audio and video control device, and the steps are as follows: first, obtain a sequence frame image corresponding to a video stream, select a candidate area in the first frame image, and initialize the position and initial scale of the target image; second, use the HOG feature of the search area map extracted from the current frame image and the color histogram feature to calculate the response map of the search area map as the predicted target position area; finally, obtain the predicted scale of the predicted target position, and determine whether the feature response map of the current frame image is in an abnormal state according to the designed outlier detector. If so, use the improved MASK-RCNN to detect the current frame image to obtain the position information of the target, otherwise, output the position and predicted scale of the target of the current frame image to complete the tracking of the target. The present invention can effectively locate deformed targets, reduce background features, and improve detection efficiency by combining the improved KCF and the improved MASK-RCNN model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of video image processing and detection and recognition, and in particular to an image tracking method in an audio and video control device. Background Art

[0002] Image tracking is to track the target in the subsequent frame sequence and determine the target's motion trajectory given the target information in the first frame or the first few frames of a video. In video analysis, there are three important steps: target detection, target tracking, and behavior analysis. As an intermediate layer task, target tracking technology serves many high-level applications that require the position and scale of each frame of the target.

[0003] There are many target tracking algorithms currently in existence. Among them, Henriques proposed using ridge regression to regress to a two-dimensional Gaussian distribution in the input feature space to learn an optimal kernel correlation filter (KernelizedCorrelationFilters, KCF). Through dense sampling, KCF became the best target tracking algorithm at the time. KCF uses the property that the circulant matrix can be diagonalized in the Fourier domain, which greatly reduces the complexity of the algorithm and greatly improves the running speed of the algorithm. The correlation calculation of the correlation filter tracker can be converted into a dot product calculation in the frequency domain through discrete Fourier transform. KCF completes dense sampling through the circulant shift matrix, completes the filter training through the kernel function and the ridge regression function, and finally calculates the correlation between the sample image and the filter, and selects the area with the highest correlation to predict the position of the target object. In terms of correlation filter tracking, many algorithms are improved on the basis of KCF. For different problems, the improvement methods are also different. KCF has a faster processing speed while ensuring high tracking accuracy. The algorithm flow of KCF is as follows Figure 2 As shown in the figure. KCF uses a fixed-size template frame to process the feature template of the object, so when the object changes in scale, the template frame of the same size cannot accurately describe the object. Moreover, the KCF kernelized correlation filter can easily lose the target when the object undergoes a sharp deformation, especially in the case of occlusion. Since the template of the KCF filter is updated after the prediction of each frame, the occluded target part will be mixed with the background noise, causing the filter template to drift. If the wrong template is used for subsequent matching, it will naturally be difficult to find the correct target. The KCF filter is also not stable enough in the long-term tracking process. The online updated filter template is prone to gradual distortion due to the accumulation of erroneous features.

[0004] Mask-RCNN is an improvement of Faster-RCNN. Faster-RCNN improves RoI Pooling and proposes RoI Align. After this improvement, rounding is no longer performed, but bilinear interpolation is used to more accurately find the features corresponding to each block, so that the features obtained for each RoI can better align the RoI area on the original image. At the same time, the mask branch is added to predict the m*m binary mask output of K categories, and a mechanism for predicting K outputs is introduced, allowing each class to generate an independent mask to avoid inter-class competition. This decouples mask and category prediction and improves the segmentation effect. Although the Mask-RCNN algorithm can recognize the contour of the target, it takes a long time to segment an image and cannot track video targets in real time. Summary of the invention

[0005] In view of the deficiencies existing in the above-mentioned background technology, the present invention proposes an image tracking method in an audio and video control device, which solves the technical problems that the KCF filter is not stable enough in the long-term tracking process, the online updated filter template is prone to accumulation of erroneous features, the template gradually distorts, and it is difficult to identify the correct target; and the image segmentation in the Mask-RCNN algorithm takes too long and cannot track the video target in real time.

[0006] The technical solution of the present invention is achieved in this way:

[0007] An image tracking method in an audio and video control device, the steps of which are as follows:

[0008] Step 1: The camera control module obtains the video stream, and the video decoding module converts the video stream into a sequence frame image in Mat format;

[0009] Step 2: For the first frame image, select the candidate area and initialize the position and initial scale of the target image;

[0010] Step 3: Take the next frame image as the current frame image, obtain the search area map of the current frame image, and extract the HOG features and color histogram features of the search area map according to the position of the target image;

[0011] Step 4: Calculate the response map of the search area map according to the HOG features and color histogram features of the search area map, and use the response map of the search area map as the predicted target position area;

[0012] Step 5: Use the scale filter to extract multi-scale samples of the predicted target location area, and calculate the response values ​​of samples of different scales, and use the scale corresponding to the largest response value as the prediction scale;

[0013] Step 6: Design an outlier detector, and use the outlier detector to detect whether the feature response map of the current frame image is in an abnormal state. If the feature response map is abnormal, execute step 7. Otherwise, if the feature response map is normal, output the position and scale of the target of the current frame image, and return to step 3.

[0014] Step 7: Use the improved MASK-RCNN to detect the current frame image, obtain the location information of the target, and return to step 3.

[0015] Preferably, the method for calculating the response graph of the search area graph according to the HOG features and the color histogram features of the search area graph is:

[0016] Use filter f respectively hog and f cn Calculate the response map y of the HOG feature hog And the response map y based on the color histogram feature cn ;

[0017] Response map y based on HOG features hog Calculate the confidence of the response map corresponding to the HOG feature of the search area map:

[0018]

[0019] Among them, q hog is the confidence of the response map corresponding to the HOG feature, max(y hog ) is the response graph y hog The maximum value in y hog,r,c For the response graph y hog The value of the response point in the rth row and cth column, n hog For the response graph y hog The number of response points in the

[0020] According to the response graph y based on the color histogram feature cn Calculate the confidence of the response map corresponding to the color histogram feature of the search area map:

[0021]

[0022] Among them, q cn is the confidence of the response graph corresponding to the color histogram feature, max(y cn ) is the response graph y cn The maximum value in y cn,r′,c′ For the response graph y cn The value of the response point in the r′th row and c′th column, n cn For the response graph y cn The number of response points in the

[0023] Compute the response plot for the search area plot:

[0024]

[0025] Among them, y merg is the response map of the fused search area map, w hog is the weight of the HOG feature, w cn is the weight based on the color histogram feature, f hog (x) represents the initialization kernel correlation filter of HOG, f cn (x) represents the initialization kernel correlation filter of CN.

[0026] Preferably, the method for obtaining the prediction scale is:

[0027] Collect multi-scale sample sizes of the predicted target location area:

[0028]

[0029] Where M represents the width of the scale of the target in the previous frame image, N represents the height of the scale of the target in the previous frame image, c1 represents the scale factor, and S is the number of multi-scales;

[0030] Define the cost function ε:

[0031]

[0032] Among them, l represents the dimension, g represents the expected output of the scale filter, and h l represents the l-th dimension correlation filter, λ is the regularization coefficient, f l is the feature of the lth dimension of the input sample;

[0033] The correlation filter is expressed in the frequency domain as:

[0034]

[0035] Among them, H l represents the correlation filter in the frequency domain, F l is the input feature in the frequency domain, represents the frequency domain conjugate of the ideal output, ⊙ represents the logical operator XOR, F k represents the frequency domain features of k dimensions, Represents the k-dimensional frequency domain conjugate feature;

[0036] Update the scale correlation filter by updating the numerator and denominator of the correlation filter online:

[0037]

[0038] Among them, A tis the scale-dependent filter H of the t-th frame t The molecules is the scale-dependent filter H of the t-th frame t The molecule of the lth dimension, B t is the scale-dependent filter H of the t-th frame t The denominator of , η is the learning rate;

[0039] Use scale-dependent filters to calculate the predicted response values ​​of samples of different scales:

[0040]

[0041] The response value y is filled with 0 in the frequency domain. s Perform triangular interpolation to interpolate the number of scale response values ​​from S to S interp , taking the scale with the largest interpolated response value as the current prediction scale.

[0042] Preferably, the method of using an outlier detector to detect whether the feature response graph of the current frame image is in an abnormal state is:

[0043] Discard the first n0 frames and use the n0+1th to n1th frames to initialize the outlier detector. The calculation formula is:

[0044]

[0045] Among them, q t represents the confidence of the response graph of the feature in the tth frame, represents the mean, represents variance;

[0046] Start enabling the outlier detector from frame n1+1 of the video and update the parameters in the new frame:

[0047]

[0048] Among them, T t represents the outlier threshold of the response graph confidence at frame t, η e represents the update rate of the outlier detector, and β represents the parameter coefficient;

[0049] When the confidence q of the feature response map of the tth frame t <T t-1 When , the confidence of the feature response map of the tth frame is considered abnormal, otherwise, the confidence of the feature response map of the tth frame is normal.

[0050] Preferably, the characteristic response graph is normal, and the method for outputting the position and scale of the current frame image is:

[0051] Define the outlier threshold for the response graphcn With threshold hog , if qcn>threshol dcn And q hog >threshold hog , calculate the inter-frame similarity s t , and set the learning rate η:

[0052]

[0053]

[0054] in, The feature vector representing the color histogram feature of the tth frame of the predicted target location area, a and b are both empirical values, T s For t The threshold value, η max is the learning rate η t The maximum value, η t is the learning rate of the tth frame;

[0055] Use the learning rate η t Update filter f hog 、f cn and f scale , output the position of the target in each frame image (x t ,y t ) and scale sz t .

[0056] Preferably, the detection of the current frame image using the improved MASK-RCNN is as follows:

[0057] S71, performing image space conversion on the current frame image to obtain an image to be detected in the HSV space;

[0058] S72, using RPN to extract features from the image to be detected in step S71 to generate a series of feature maps;

[0059] S73, convert a series of feature maps into deep feature maps of consistent size through the RoI Align pooling layer;

[0060] S74, classifying the depth feature map through classification prediction to obtain the category of the target; at the same time, using the LK optical flow analysis method to extract feature points from the depth feature map to obtain the position of the feature area;

[0061] S75. Obtain the position and scale of the target in the current frame image according to the category of the target and the position of the feature area.

[0062] Preferably, the method for performing image space conversion on the current frame image is:

[0063] max=max(R,G,B),min=(R,G,B);

[0064]

[0065] V = max(R, G, B);

[0066]

[0067] Among them, R represents red (R, Red), G represents green (G, Green), B represents blue (B, Blue), max represents maximum value, min represents minimum value, H represents hue (H, Hue), V represents value (V, Value), and S represents saturation (S, Saturation).

[0068] Preferably, the method for generating the feature map is: using a convolutional neural network to extract features from the image to be detected in the HSV space, sending the obtained image features to the RPN, and using the RPN to generate a series of feature maps.

[0069] Preferably, the method of converting a series of feature maps into depth feature maps of uniform size through the RoI Align pooling layer is as follows: first, the feature map is converted into a feature map of fixed size through the RoI Align operation, and the fixed-size feature map is subjected to 4 convolution operations to generate a feature map of 14×14 size; then, the feature map of 14×14 size is upsampled to generate a feature map of 28×28 size; finally, a convolution operation is performed on the feature map of 28×28 size to generate a depth feature map of 28×28 size and 80 depth.

[0070] Preferably, the training loss function of Mask-RCNN is:

[0071] L=L cls +L box +L mas k;

[0072] Where: L is the total error; L mask is the segmentation error; is the classification error, N cls is the number of categories, p i is the predicted classification probability of the target box Anchor[i]. When Anchor[i] is a positive sample, When Anchor[i] is a negative sample, To detect errors, λ is the weight balance coefficient, N reg is the number of target locations, t iThe parameterized coordinates of the bounding box predicted for Anchor[i], are the parameterized coordinates of the actual bounding box.

[0073] Compared with the prior art, the present invention has the following beneficial effects:

[0074] 1) The present invention divides the prediction of KCF into two processes: position prediction and scale prediction. In position prediction, a tracking model based on color histogram is combined to effectively locate deformed targets. In scale prediction, a one-dimensional correlation filter is added to sample different scales around the predicted position to obtain the maximum scale response.

[0075] 2) The present invention adds the LK optical flow method after the MASK-RCNN model extracts the candidate area in adjacent frames, first extracts feature points in the corresponding area, effectively reduces background features, and greatly shortens the subsequent mask extraction and bounding box prediction time. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0077] Figure 1 It is a functional module diagram of the image tracking technology system in the audio and video control device of the present invention.

[0078] Figure 2 This is the flow chart of the KCF algorithm.

[0079] Figure 3 This is the improved Mask-RCNN network structure diagram.

[0080] Figure 4 Joint flow chart of detection and tracking algorithm. DETAILED DESCRIPTION

[0081] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0082] Embodiment 1, an image tracking method in an audio and video control device, such as Figure 4 As shown, the specific steps are as follows:

[0083] Step 1: The camera control module obtains the video stream, and the video decoding module converts the video stream into a sequence frame image in Mat format;

[0084] The purpose of image detection is to detect the image in the screen from the initial frame of the real-time video stream, and mark the target object if there is an object type that meets the observation and the credibility is above the set threshold; the purpose of target tracking is to be able to continuously track the target object in a complex scene and determine the position of the target through target tracking model matching. It includes steps 2 to 6.

[0085] Step 2: For the first frame image, select the candidate area and initialize the position (x1, y1) and initial scale sz1 of the target image; initialize the kernel correlation filter f according to the information of the initial target hog and f cn , scale-dependent filter f scale ;

[0086] Step 3: Take the next frame image as the current frame image, obtain the search area map of the current frame image, and extract the HOG features and color histogram features of the search area map according to the position of the target image;

[0087] Step 4: Calculate the response map of the search area map according to the HOG features and color histogram features of the search area map, and use the response map of the search area map as the predicted target position area;

[0088] Use filter f respectively hog and f cn Calculate the response map y of the HOG feature hog And the response map y based on the color histogram feature cn ;

[0089] Response map y based on HOG features hog Calculate the confidence of the response map corresponding to the HOG feature of the search area map:

[0090]

[0091] Among them, q hog is the confidence of the response map corresponding to the HOG feature, max(y hog ) is the response graph y hog The maximum value in y hog,r,c For the response graph y hog The value of the response point in the rth row and cth column, n hog For the response graph y hog The number of response points in the

[0092] According to the response graph y based on the color histogram feature cnCalculate the confidence of the response map corresponding to the color histogram feature of the search area map:

[0093]

[0094] Among them, q cn is the confidence of the response graph corresponding to the color histogram feature, max(y cn ) is the response graph y cn The maximum value in y cn,r′,c′ For the response graph y cn The value of the response point in the r′th row and c′th column, n cn For the response graph y cn The number of response points in the

[0095] Compute the response plot for the search area plot:

[0096]

[0097] Among them, y merg is the response map of the fused search area map, w hog is the weight of the HOG feature, w cn is the weight based on the color histogram feature, f hog (x) represents the initialization kernel correlation filter of HOG, f cn (x) represents the initialization kernel correlation filter of CN. So far, the target position prediction is completed through the position filter.

[0098] Step 5: Use the scale filter to extract multi-scale samples of the predicted target location area, and calculate the response values ​​of samples of different scales, and use the scale corresponding to the largest response value as the prediction scale;

[0099] Collect multi-scale sample sizes of the predicted target location area:

[0100]

[0101] Where M represents the width of the scale of the target in the previous frame image, N represents the height of the scale of the target in the previous frame image, c1 represents the scale factor, and S is the number of multi-scales;

[0102] Define the cost function ε:

[0103]

[0104] Among them, l represents the dimension, g represents the expected output of the scale filter, and h l represents the l-th dimension correlation filter, λ is the regularization coefficient, f l is the feature of the lth dimension of the input sample;

[0105] The correlation filter is expressed in the frequency domain as:

[0106]

[0107] Among them, H l represents the correlation filter in the frequency domain, F l is the input feature in the frequency domain, represents the frequency domain conjugate of the ideal output, ⊙ represents the logical operator XOR, F k represents the frequency domain features of k dimensions, Represents the k-dimensional frequency domain conjugate feature;

[0108] Update the scale correlation filter by updating the numerator and denominator of the correlation filter online:

[0109]

[0110] Among them, A t is the scale-dependent filter H of the t-th frame t The molecules is the scale-dependent filter H of the t-th frame t The molecule of the lth dimension, B t is the scale-dependent filter H of the t-th frame t The denominator of , η is the learning rate;

[0111] Use scale-dependent filters to calculate the predicted response values ​​of samples of different scales:

[0112]

[0113] In order to balance the accuracy and speed of the scaling filter, the response value y is padded with 0 in the frequency domain before the inverse discrete Fourier transform. s Perform triangular interpolation to interpolate the number of scale response values ​​from S to S interp , taking the scale with the largest interpolated response value as the current prediction scale.

[0114] Step 6: If the tracking target is blocked, the confidence of the feature response map will be significantly reduced. An outlier detector is designed to detect whether the feature response map of the current frame image is in an abnormal state. If the feature response map is abnormal, execute step 7. Otherwise, the feature response map is normal, output the position and scale of the target of the current frame image, and return to step 3.

[0115] Since the confidence of the response graphs of the first few frames of the video is not stable enough, the first n0 frames are discarded, and the n0+1 to n1 frames are used to initialize the outlier detector. The calculation formula is:

[0116]

[0117] Among them, q t represents the confidence of the response graph of the feature in the tth frame, represents the mean, represents variance;

[0118] Start enabling the outlier detector from frame n1+1 of the video and update the parameters in the new frame:

[0119]

[0120] Among them, T t represents the outlier threshold of the response graph confidence at frame t, η e represents the update rate of the outlier detector, and β represents the parameter coefficient;

[0121] When the confidence q of the feature response map of the tth frame t <T t-1 When , the confidence of the feature response map of the tth frame is considered abnormal, otherwise, the confidence of the feature response map of the tth frame is normal.

[0122] The characteristic response graph is normal, and the method for outputting the position and scale of the current frame image is:

[0123] Define the outlier threshold for the response graph cn With threshold hog , if q cn >threshold cn And q hog >threshold hog , calculate the inter-frame similarity s t , and set the learning rate η:

[0124]

[0125]

[0126] in, The feature vector representing the color histogram feature of the tth frame of the predicted target location area, a and b are both empirical values, which control the change of the learning rate, T s For t The threshold value, η max is the learning rate η t The maximum value, η t is the learning rate of the tth frame; T s For t The threshold value is t Less than the threshold T s Then, set the learning rate η t The maximum value of η max, this is to prevent the tracker from learning too much wrong information when the subsequent occlusion detection mechanism fails. In most video frames, η t The learning rate increases with s t changes linearly with the change of max .

[0127] Use the learning rate η t Update filter f hog 、f cn and f scale , output the position of the target in each frame image (x t ,y t ) and scale sz t .

[0128] Step 7: Use the improved MASK-RCNN to detect the current frame image, obtain the location information of the target, and return to step 3. Figure 3 As shown in the figure, using the improved MASK-RCNN to detect the current frame image is also called image re-detection: re-detection is to make a confidence judgment on the result of the target tracking service. If the target tracking result deviates from the correct target, the target detection service will be called again and the tracking module will be re-initialized. The specific steps are as follows:

[0129] S71, performing image space conversion on the current frame image, by taking color features as the main features, first converting the GRB color space into HSV, and obtaining the image to be detected in the HSV space;

[0130] The method for performing image space conversion on the current frame image is:

[0131] max=max(R,G,B),min=(R,G,B);

[0132]

[0133] V = max(R, G, B);

[0134]

[0135] Among them, R represents red (R, Red), G represents green (G, Green), B represents blue (B, Blue), max represents maximum value, min represents minimum value, H represents hue (H, Hue), V represents value (V, Value), and S represents saturation (S, Saturation).

[0136] S72, using RPN to extract features from the image to be detected in step S71, generating a series of feature maps; using convolutional neural network to extract features from the image to be detected in HSV space, sending the obtained image features to RPN, and using RPN to generate a series of feature maps. RPN relies on a window sliding on the shared feature map to generate a target box with a preset aspect ratio and area for each position, and extract the region of interest (RoI), that is, the feature map.

[0137] S73. Convert a series of feature maps into depth feature maps of the same size through the RoI Align pooling layer. First, convert the feature map into a fixed-size feature map through the RoI Align operation, and generate a 14×14 feature map after four convolution operations on the fixed-size feature map. Then, upsample the 14×14 feature map to generate a 28×28 feature map. Finally, perform a convolution operation on the 28×28 feature map to generate a depth feature map of 28×28 and 80 depth.

[0138] S74, classifying the depth feature map through classification prediction to obtain the category of the target; at the same time, using the LK optical flow analysis method to extract feature points from the depth feature map to obtain the position of the feature area;

[0139] S75. Obtain the position and scale of the target in the current frame image according to the category of the target and the position of the feature area. On the one hand, further classify the feature maps of the same size generated by the RoI Align pooling layer to determine which category the object belongs to, and the classification branch uses the Softmax activation function. On the other hand, LK optical flow analysis is performed in combination with the feature maps of the same size generated by the RoI Align pooling layer, and feature point extraction is performed first in the corresponding area to effectively reduce background features, so that the subsequent mask extraction and bounding box prediction time are shortened. Bounding box prediction is mainly the regression of the coordinates of the bounding box of the feature map, and fine-tuning the position of the feature area to obtain the final target detection result. The segmentation mask branch uses the FCN network to predict K m*m segmentation masks from each feature map, where K is the number of categories, m is the length and width of the mask, and each category corresponds to a segmentation mask (to suppress category competition between segmentation tasks), and each pixel is activated using the Sigmoid function.

[0140] The training loss function of Mask-RCNN is:

[0141] L=L cls +L box +L mask ;

[0142] Where: L is the total error; L mask is the segmentation error; Lcls is the classification error; L box To detect errors;

[0143]

[0144] Among them, N cls is the number of categories, p i is the predicted classification probability of the target box Anchor[i]. When Anchor[i] is a positive sample, When Anchor[i] is a negative sample,

[0145]

[0146]

[0147] Among them, λ is the weight balance coefficient (generally set to 10), N reg is the number of target locations, t i The parameterized coordinates of the bounding box predicted for Anchor[i], are the parameterized coordinates of the actual bounding box.

[0148] Embodiment 2, an image tracking system in an audio and video control device, its functional module diagram is as follows Figure 1As shown, it includes a video parsing module, an image detection and target tracking module, and a camera control module; the video parsing module completes the reading, decoding, storage, and playback functions of the video stream data; the purpose of the video stream parsing service is to receive the real-time video stream data transmitted by the camera and convert it into a standard input format that can be processed by subsequent algorithms, such as Mat format. The image detection and target tracking module detects the image target from the video stream data, extracts image features and tracks the target. The tracking module is implemented based on the proposed improved KCF algorithm. When the confidence judgment is unreliable, re-detection is performed. The re-detection module is based on the proposed improved Mask-RCNN detection algorithm. The camera control module completes the active tracking system of the camera, automatically marks suspicious objects in the real-time video stream, and can continuously complete tracking in subsequent video streams. Camera follow-up control module: In the monitoring scene, the moving target object will not always be in the center of the picture for a good observation position and is likely to move out of the field of view. The purpose of the camera follow-up service is to actively control the rotation angle and focal length of the camera to keep the target object in the central area of ​​the field of view and in a good observation state. It is also to solve the problem of the target completely escaping the detection area. According to the target tracking algorithm proposed in Example 1, the position information of the tracked object can be obtained, and the angle between the tracked object and the central axis of the camera can be obtained by comparing the coordinates of the tracked object with the parameters of the picture, and the rotation of the camera can be controlled to keep the target object in the center of the picture. This operation method can also provide some help in solving the problem of the target object being completely out of the picture and difficult to track at the algorithm level.

[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An image tracking method in an audio and video control device, characterized in that: The steps are as follows: Step 1: The camera control module obtains the video stream, and the video decoding module converts the video stream into a sequence frame image in Mat format; Step 2: For the first frame image, select the candidate area and initialize the position and initial scale of the target image; Step 3: Take the next frame image as the current frame image, obtain the search area map of the current frame image, and extract the HOG features and color histogram features of the search area map according to the position of the target image; Step 4: Calculate the response map of the search area map according to the HOG features and color histogram features of the search area map, and use the response map of the search area map as the predicted target position area; Step 5: Use the scale filter to extract multi-scale samples of the predicted target location area, and calculate the response values ​​of samples of different scales, and use the scale corresponding to the largest response value as the prediction scale; Step 6: Design an outlier detector, and use the outlier detector to detect whether the feature response map of the current frame image is in an abnormal state. If the feature response map is abnormal, execute step 7. Otherwise, if the feature response map is normal, output the position and scale of the target of the current frame image, and return to step 3. Step 7: Use the improved MASK-RCNN to detect the current frame image, obtain the location information of the target, and return to step 3; The improved MASK-RCNN is used to detect the current frame image: S71, performing image space conversion on the current frame image to obtain an image to be detected in the HSV space; S72, using RPN to extract features from the image to be detected in step S71 to generate a series of feature maps; S73, convert a series of feature maps into deep feature maps of consistent size through the RoIAlign pooling layer; S74, classifying the depth feature map through classification prediction to obtain the category of the target; at the same time, using the LK optical flow analysis method to extract feature points from the depth feature map to obtain the position of the feature area; S75, obtaining the position and scale of the target in the current frame image according to the type of the target and the position of the feature area; The training loss function of Mask-RCNN is: L=L cls +L box +L mask ; Where: L is the total error; L mask is the segmentation error; is the classification error, N cls is the number of categories, p i is the predicted classification probability of the target box Anchor[i]. When Anchor[i] is a positive sample, When Anchor[i] is a negative sample, To detect errors, λ′ is the weight balance coefficient, N reg is the number of target locations, t i The parameterized coordinates of the bounding box predicted for Anchor[i], are the parameterized coordinates of the actual bounding box.

2. The image tracking method in the audio and video control device according to claim 1, characterized in that: The method for calculating the response graph of the search area graph according to the HOG feature and the color histogram feature of the search area graph is: Use filter f respectively hog and f cn Calculate the response map y of the HOG feature hog And the response graph y based on the color histogram feature cn ; Response map y based on HOG features hog Calculate the confidence of the response map corresponding to the HOG feature of the search area map: Among them, q hog is the confidence of the response map corresponding to the HOG feature, max(y hog ) is the response graph y hog The maximum value in y hog,r,c For the response graph y hog The value of the response point in the rth row and cth column, n hog For the response graph y hog The number of response points in the According to the response graph y based on the color histogram feature cn Calculate the confidence of the response map corresponding to the color histogram feature of the search area map: Among them, q cn is the confidence of the response graph corresponding to the color histogram feature, max(y cn ) is the response graph y cn The maximum value in y cn,r′,c′ For the response graph y cn The value of the response point in the r′th row and c′th column, n cn For the response graph y cn The number of response points in the Compute the response plot for the search area plot: Among them, y merg is the response map of the fused search area map, w hog is the weight of the HOG feature, w cn is the weight based on the color histogram feature, f hog (x) represents the initialization kernel correlation filter of HOG, f cn (x) represents the initialization kernel correlation filter of CN.

3. The image tracking method in the audio and video control device according to claim 1 or 2, characterized in that: The method for obtaining the prediction scale is: Collect multi-scale sample sizes of the predicted target location area: Among them, M represents the width of the scale of the target in the previous frame image, and N represents the height of the scale of the target in the previous frame image. c1 represents the scale factor, and S is the number of multi-scales; Define the cost function ε: Among them, l represents the dimension, g represents the expected output of the scale filter, and h l represents the l-th dimension correlation filter, λ is the regularization coefficient, f l is the feature of the lth dimension of the input sample; The correlation filter is expressed in the frequency domain as: Among them, H l represents the correlation filter in the frequency domain, F l is the input feature in the frequency domain, represents the frequency domain conjugate of the ideal output, ⊙ represents the logical operator XOR, F k represents the frequency domain features of k dimensions, Represents the k-dimensional frequency domain conjugate feature; Update the scale correlation filter by updating the numerator and denominator of the correlation filter online: Among them, A t is the scale-dependent filter H of the t-th frame t The molecules, is the scale-dependent filter H of the t-th frame t The molecule of the lth dimension, B t is the scale-dependent filter H of the t-th frame t The denominator of , η is the learning rate; Use scale-dependent filters to calculate the predicted response values ​​of samples of different scales: The response value y is filled with 0 in the frequency domain. s Perform triangular interpolation to interpolate the number of scale response values ​​from S to S interp , taking the scale with the largest interpolated response value as the current prediction scale.

4. The image tracking method in the audio and video control device according to claim 1, characterized in that: The method of using an outlier detector to detect whether the feature response graph of the current frame image is in an abnormal state is: Discard the first n0 frames and use the n0+1th to n1th frames to initialize the outlier detector. The calculation formula is: Among them, q t represents the confidence of the response graph of the feature in the tth frame, represents the mean, represents variance; Start enabling the outlier detector from frame n1+1 of the video and update the parameters in the new frame: Among them, T t represents the outlier threshold of the response graph confidence at frame t, η e represents the update rate of the outlier detector, and β represents the parameter coefficient; When the confidence q of the feature response map of the tth frame t <T t-1 When , the confidence of the feature response map of the tth frame is considered abnormal, otherwise, the confidence of the feature response map of the tth frame is normal.

5. The image tracking method in the audio and video control device according to claim 4, characterized in that: The characteristic response graph is normal, and the method for outputting the position and scale of the current frame image is: Define the outlier threshold for the response graph cn With threshold hog , if q cn >threshold cn And q hog >threshold hog , calculate the inter-frame similarity s t , and set the learning rate η: in, The feature vector representing the color histogram feature of the tth frame of the predicted target location area, a and b are both empirical values, T s For t The threshold value, η max is the learning rate η t The maximum value, η t is the learning rate of the tth frame; Use the learning rate η t Update filter f hog 、f cn and f scale , output the position of the target in each frame image (x t ,y t ) and scale sz t .

6. The image tracking method in the audio and video control device according to claim 1, characterized in that: The method for performing image space conversion on the current frame image is: max=max(R,G,B), min=min(R,G,B); V = max(R, G, B); Among them, R represents red, G represents green, B represents blue, max represents maximum value, min represents minimum value, H represents hue, V represents brightness, and S represents saturation.

7. The image tracking method in the audio and video control device according to claim 1, characterized in that: The method for generating the feature map is as follows: using a convolutional neural network to extract features from an image to be detected in an HSV space, sending the obtained image features to an RPN, and using the RPN to generate a series of feature maps.

8. The image tracking method in the audio and video control device according to claim 1, characterized in that: The method for converting a series of feature maps into deep feature maps of the same size through the RoIAlign pooling layer is as follows: first, the feature map is converted into a fixed-size feature map through the RoIAlign operation, and the fixed-size feature map is subjected to 4 convolution operations to generate a 14×14 feature map; then, the 14×14 feature map is upsampled to generate a 28×28 feature map; finally, the 28×28 feature map is convolved to generate a deep feature map with a size of 28×28 and a depth of 80.