Target positioning method and system based on video surveillance
The video surveillance target positioning method through multi-channel feature extraction and motion blur kernel optimization solves the problems of inaccurate target positioning and high equipment requirements in the existing technology, and achieves efficient and low-cost target tracking and positioning.
Patent Information
- Application Number
- CN202410123391.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-01-29
AI Technical Summary
Existing video surveillance target positioning methods have problems such as target occlusion, interference, and disappearance, resulting in inaccurate positioning results. Moreover, methods based on artificial intelligence algorithms have high requirements on equipment configuration and computing power, and are not suitable for large-scale popularization.
Using a target positioning method based on video surveillance, through partitioned extraction of multi-channel gradient features and multi-channel color features, the intersection ratio between target detection frames is calculated, the target feature map is generated, and through the optimization and inversion of the motion blur kernel The convolution filter performs the deblurring operation and is combined with the correlation filter for target tracking and positioning.
It improves the accuracy of feature extraction and image quality, achieves accurate target positioning, reduces computing costs and equipment requirements, and is suitable for large-area video surveillance equipment.
Smart Images

Figure CN118071826B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video monitoring and target positioning, and in particular to a target positioning method and system based on video monitoring. Background Art
[0002] Using video surveillance for target positioning is one of the most common positioning methods. For example, surveillance is usually required in shopping malls, underground garages, hospitals, and residences. Once an abnormal target appears, the surveillance can be retrieved immediately for target tracking to assist monitoring management. However, there are still many difficulties in dynamic target positioning based on video surveillance, such as target occlusion, target interference, target disappearance, etc. Due to the emergence of these problems, the accuracy of target positioning results is often not guaranteed. Although artificial intelligence algorithms have been combined with target positioning in recent years and have achieved certain results, this method has high requirements for equipment configuration and computing power, and is not suitable for widely popularized video surveillance equipment. Summary of the invention
[0003] In order to solve at least one of the above-mentioned technical problems, the present invention provides a target positioning method and system based on video surveillance.
[0004] In a first aspect, the present invention provides a target positioning method based on video surveillance, the method comprising:
[0005] Acquire video stream data, wherein the video stream data includes a plurality of continuous frame video images;
[0006] Establishing multiple target detection frames, using each target detection frame to extract multi-channel gradient features and multi-channel color features from different target areas of the video image, and generating multiple feature sub-maps;
[0007] Calculate the intersection-and-union ratio between any two target detection frames as the correlation between the any two target detection frames; splice multiple feature sub-maps according to the correlation to obtain a target feature map;
[0008] Calculate the motion blur kernel of the target feature map, and obtain the blurriness of the target feature map according to the motion blur kernel;
[0009] Determine whether the blur reaches a preset value, if the blur does not reach the preset value, compensate and tune the motion blur kernel until the blur reaches the preset value, output the current motion blur kernel, and determine the parameters of the deconvolution filter according to the current motion blur kernel, and perform a deblurring operation on the target feature map through the deconvolution filter;
[0010] The deblurred target feature map is subjected to circular convolution calculation using a correlation filter to determine the position coordinates of the target in the current frame image; based on all the position coordinates of the target in the continuous frame video images, the motion trajectory of the target is obtained to complete the target tracking and positioning.
[0011] Preferably, establishing multiple target detection frames includes:
[0012] Use the fully convolutional neural network FCN to perform instance segmentation on the target image and obtain the initial rectangular detection frame and the corresponding polygon outline;
[0013] Calculate the first IOU value between the initial detection box and the polygon outline. When the first IOU value reaches the first preset threshold, calculate the second IOU value between the polygon outline and the actual target outline. When the second IOU value reaches the second preset threshold, select the corresponding initial detection box as the target detection box.
[0014] Preferably, the calculation of the motion blur kernel of the target feature map includes:
[0015] Initialize the blur radius R, and use the blur radius R to construct a motion vector diagram, where the motion vector diagram is a straight line with a length of R, an angle of 0, and a width of 1 pixel;
[0016] Based on the blur radius R, establish the affine transformation matrix K:
[0017]
[0018]
[0019]
[0020] Where, θ is the moving angle of the video surveillance device;
[0021] The motion vector map is mapped using the affine transformation matrix K to obtain a motion blur kernel.
[0022] Preferably, the method further comprises calculating the moving angle of the video surveillance device, comprising:
[0023] Based on n consecutive video frames, m feature points are randomly selected from the first video frame, and matching points of the m feature points are searched from consecutive frames in turn:
[0024] X 11 ,X 12 ,...,X 1m
[0025] X 21 ,X 22 ,...,X 2m ......
[0027] X n1 ,X n2 ,...,X nm
[0028] Where, X 1m is the mth feature point in the first frame of the video image, X 2m For X 1m The matching point in the second frame video image, X nm For X (n-1)m Matching points in the nth frame of the video image;
[0029] Calculate the movement angle of the video surveillance device:
[0030]
[0031]
[0032]
[0033] In the formula, (x ij ,y ij ) is the jth feature point X in the i-th frame video image ij The coordinate value of the video surveillance device; θ is the moving angle of the video surveillance device.
[0034] Preferably, obtaining the blurriness of the target feature map according to the motion blur kernel includes:
[0035] Determine the pixel value of each point in the video image using the motion blur kernel;
[0036] Calculate the blur of the video image according to the pixel value:
[0037]
[0038] Where L is the width of the image, H is the height of the image, and P lh is the pixel value of the image at pixel (l,h).
[0039] Preferably, the compensating and tuning the motion blur kernel includes:
[0040] If the blurriness does not reach the preset value, the blur radius is multiplied by the compensation coefficient and then brought back to the affine transformation matrix to recalculate the motion blur kernel and blurriness until the blurriness reaches the preset value; wherein the compensation coefficient has a value range of (1.1, 1.5).
[0041] Preferably, the step of performing a circular convolution calculation on the deblurred target feature map using a correlation filter to determine the position coordinates of the target in the current frame image includes:
[0042] Apply the correlation filter F to the target feature map D to obtain the response map C:
[0043] C=D*F
[0044] E(F)=||D*FY|| 2 +||F|| 2
[0045] Where * is circular convolution; E(F) is the objective function of the correlation filter F, Y represents the Gaussian distribution with the center point of the space as the highest value; || || represents the norm;
[0046] The correlation filter F is solved by using fast Fourier transform, and the coordinates of the position where the maximum value of the response map C is located are calculated, as well as the position coordinates of the target in the current frame image.
[0047] In a second aspect, the present invention provides a target positioning system based on video surveillance, the system comprising:
[0048] A video stream acquisition unit, used to acquire video stream data, wherein the video stream data includes a plurality of continuous frame video images;
[0049] A detection frame construction unit is used to establish multiple target detection frames, and use each target detection frame to perform feature extraction of multi-channel gradient features and multi-channel color features on different target areas of the video image to generate multiple feature sub-maps;
[0050] A feature map concatenation unit is used to calculate the intersection-over-union ratio between any two target detection frames as the correlation between any two target detection frames; and concatenate multiple feature sub-maps according to the correlation to obtain a target feature map;
[0051] A fuzziness calculation unit is used to calculate a motion blur kernel of a target feature map, and obtain the fuzziness of the target feature map according to the motion blur kernel;
[0052] A deblurring unit, used to determine whether the blur degree reaches a preset value, and if the blur degree does not reach the preset value, to compensate and tune the motion blur kernel until the blur degree reaches the preset value, to output the current motion blur kernel, and to determine the parameters of the deconvolution filter according to the current motion blur kernel, and to perform a deblurring operation on the target feature map through the deconvolution filter;
[0053] The tracking and positioning unit is used to perform circular convolution calculation on the deblurred target feature map using a correlation filter to determine the position coordinates of the target in the current frame image; based on all the position coordinates of the target in the continuous frame video image, the motion trajectory of the target is obtained to complete the target tracking and positioning.
[0054] In a third aspect, the present invention further provides an electronic device comprising: a processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code comprises computer instructions, and when the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation thereof.
[0055] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the method as described in the first aspect above and any possible implementation thereof.
[0056] Compared with the prior art, the present invention has the following beneficial effects:
[0057] 1) When performing feature extraction, the present invention establishes multiple target detection frames, and uses each target detection frame to extract multi-channel gradient features and multi-channel color features from different target areas of the video image to generate multiple feature sub-graphs; the intersection-and-union ratio between any two target detection frames is calculated as the correlation between any two target detection frames; the multiple feature sub-graphs are spliced according to the correlation to obtain a target feature graph. The present invention can extract more detailed image features through partitioned feature extraction; by considering the correlation between different target detection frames, invalid features can be effectively filtered out during feature splicing, noise interference can be reduced, and the feature quality of feature extraction can be improved.
[0058] 2) In video surveillance, unstable factors may cause motion blur in video images. Improper processing or over-processing will seriously affect the quality of the image. Therefore, on the premise of accurately and effectively extracting image features, the present invention further calculates the motion blur kernel of the feature map to evaluate the blurriness of the feature map. When it is determined that the blurriness does not reach the preset value, the motion blur kernel is supplemented and optimized until the blurriness meets the requirements, and then the deconvolution filter is used for deblurring, thereby greatly improving the image quality.
[0059] 3) For the dynamic positioning of the target in continuous frame images, the present invention uses a correlation filter to perform circular convolution calculation on the deblurred target feature map to determine the position coordinates of the target in each frame of the image, and finally the motion trajectory of the target in the continuous frames can be determined according to the arrangement order of the continuous frames, and finally the target tracking and positioning is accurately achieved; at the same time, compared with the general neural network, the algorithm provided by the present invention has a greatly reduced amount of calculation, which speeds up the calculation and reduces the positioning cost.
[0060] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0062] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0063] Figure 1 A schematic diagram of a process of a target positioning method based on video surveillance provided by an embodiment of the present invention;
[0064] Figure 2 The embodiment of the present invention provides Figure 1 Schematic diagram of the process of the sub-steps of step S20;
[0065] Figure 3 A schematic diagram of the structure of a target positioning system based on video surveillance provided by an embodiment of the present invention;
[0066] Figure 4 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0067] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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.
[0068] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0069] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0070] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0071] In addition, in order to better illustrate the present invention, numerous specific details are provided in the following specific embodiments. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.
[0072] At present, the common methods of video surveillance target positioning are as follows:
[0073] Background difference method: It is necessary to construct a background image, then subtract the current image from the background image, and then process the difference image to obtain the final foreground image. The key to this method is to build a suitable background model. Due to weather, light, camera shake and other reasons, it will bring great difficulty to the process of building a background model.
[0074] Time difference method: also known as the adjacent frame difference method, it mainly uses two or several adjacent frames to make a difference, and the difference image obtained is the detection result. This method is only applicable to the case where the adjacent frames do not change much. For video surveillance over a relatively long period of time, it is impossible to accurately locate.
[0075] Methods based on deep learning: such as Faster R-CNN, YOLO and other target detection methods. Due to the large computing power, these methods have high requirements for the equipment itself, high cost and poor universality. In addition, since the training data is not comprehensive enough, there are problems such as missing, occlusion, change, background interference, etc. during target recognition, and the accuracy of target positioning cannot be guaranteed.
[0076] In view of the problems of great positioning difficulty, low positioning result accuracy and high cost in the existing methods, the present invention provides a target positioning method based on video surveillance, which greatly improves the image quality through refined partition feature extraction and splicing, combined with fuzzy tuning and deblurring operations, and ultimately can locate the target's action coordinates in continuous frames to track the target's motion trajectory, thereby achieving accurate positioning of dynamic targets, and has the advantages of high efficiency, low cost, high accuracy and strong universality.
[0077] See also Figure 1 , Figure 1 A flowchart of a target positioning method based on video surveillance provided in Embodiment (I) of the present invention.
[0078] A target positioning method based on video monitoring, the method comprising:
[0079] S10. Acquire video stream data, where the video stream data includes a plurality of continuous frame video images.
[0080] In this embodiment, a network camera can be used to obtain video stream data through a network connection. Usually, the network camera will encapsulate the video stream data into a data packet in a specific format and send it to the receiving end, and the receiving end needs to parse and process these data packets, such as performing decoding operations and format processing operations on the data to obtain the required video frame images. In addition, the video stream data can also be obtained by accessing a network video server, which can capture the video signal from the video source and transmit it to the receiving end through the network, and usually supports multiple video formats and resolutions.
[0081] S20, establishing a plurality of target detection frames, and using each target detection frame to extract multi-channel gradient features and multi-channel color features from different target areas of the video image to generate a plurality of feature sub-maps.
[0082] An object detection box is a rectangular box used to mark the location of the detected object in an image or video frame. Object detection boxes are usually automatically generated by a detection algorithm. The algorithm searches and locates the location and size of the target in the image, and then generates one or more detection boxes to mark the detected target location. These detection boxes usually contain information such as the location, size, and category of the detection box, and can be used for subsequent tasks such as target tracking, target recognition, and classification. Object detection boxes are usually composed of shapes such as rectangular boxes, circular boxes, and polygonal boxes. The specific shape depends on the implementation of the detection algorithm and the task requirements. For example, in some tasks that require the detection of multiple targets, multiple detection boxes may be used to mark different target locations.
[0083] The multi-channel gradient feature HOG and the multi-channel color feature CN are a kind of feature information extracted from the image, which is usually represented by a vector or a matrix. Therefore, when associating these features with the position coordinates of the positioning features, it is necessary to map these features to the corresponding coordinate system. By mapping the gradient or color feature vector to the pixel coordinate system, a pixel coordinate representation is obtained. In this way, the gradient or color feature can be associated with the position coordinates of the positioning feature, thereby realizing the description and analysis of the position, shape, texture and other information of the object in the image.
[0084] It should be noted that simply extracting gradient features or color features will affect the subsequent recognition process due to the single extracted features. Therefore, in this embodiment, by simultaneously extracting the multi-channel gradient features HOG and the multi-channel color features CN, the multi-channel gradient features HOG and the multi-channel color features CN can achieve a complementary effect through feature combination, thereby ensuring the effectiveness of the feature extraction link.
[0085] It is understandable that when extracting features, if the overall features of a target are extracted, the accuracy of the final feature recognition will be easily disturbed due to the large range of the overall extraction and the insufficient granularity. To this end, this embodiment first generates multiple target detection frames according to the detection algorithm, and then uses each target detection frame to perform feature extraction on different target areas of the video image, and then splices multiple feature sub-maps to obtain the feature extraction map of the target. In this way, compared with the overall extraction of the target, the feature granularity is finer and the feature recognition result will be more accurate.
[0086] For example, in a surveillance video, if four persons A, B, C, and D are monitored, and the appearance features of these four persons are relatively similar, including height, weight, standing posture and other behavioral states, etc., and the target object is A, if only one detection frame is used to extract A, it is easy to be interfered by the other three persons because the contour features of the persons are very similar. If four detection frames are used to extract features of the four persons respectively, and the target information is obtained by comparison, the comparison process will be very cumbersome and the feature extraction will take a long time. For the above situation, in this embodiment, multiple target detection frames can be set to extract features of A in different regions, for example, extract the facial features, hand features, and leg features of A respectively, and finally lock the final feature map of A through feature splicing, which greatly improves the accuracy of feature extraction.
[0087] S30, calculating the intersection-over-union ratio between any two target detection frames as the correlation between any two target detection frames; and concatenating multiple feature sub-graphs according to the correlation to obtain a target feature graph.
[0088] In the previous step, the feature map of the target sub-region was extracted. The main work in this step is to stitch together to obtain a complete target feature map. Considering that there is a correlation between different detection frames during the partition detection process, for example, if multiple detection frames only extract features for person A, then the correlation between these detection frames is strong. If features of other people are extracted, then the correlation with the partition features of A is low. Therefore, when stitching the feature sub-maps, it is necessary to first determine the correlation between the two target detection frames. When stitching, the features with high correlation are spliced first, and then the features with the second highest correlation are spliced. Finally, the features without correlation can be discarded to prevent feature interference. Finally, the overall target feature map is obtained through stitching.
[0089] Therefore, when performing feature extraction, this embodiment establishes multiple target detection frames, uses each target detection frame to extract multi-channel gradient features and multi-channel color features from different target areas of the video image, and generates multiple feature sub-maps; calculates the intersection-and-union ratio between any two target detection frames as the correlation between any two target detection frames; splices multiple feature sub-maps according to the correlation to obtain a target feature map. Through partitioned feature extraction, more refined image features can be extracted; by considering the correlation between different target detection frames, invalid features can be effectively filtered during feature splicing, reducing noise interference, and improving the feature quality of feature extraction.
[0090] S40, calculating a motion blur kernel of the target feature map, and obtaining the blurriness of the target feature map according to the motion blur kernel.
[0091] The motion blur kernel, also known as the motion blur parameter, refers to a characteristic of an image that is blurred due to object motion, camera shake, or object out of focus. In image processing, the motion blur kernel is considered to be the process of obtaining a blurred image after a sharp image is convolved with a blur kernel. Specifically, when the object moves during exposure, or the camera itself shakes, or the object is out of focus, these factors may cause the image to be blurred. This blur is due to the fact that during exposure, images with different displacements are recorded on the sensor, which is equivalent to a rectangular wave convolved on an image of a stationary object. This rectangular wave can be regarded as a one-dimensional convolution kernel function.
[0092] In this embodiment, after calculating the motion blur kernel, the blurriness of the target feature map can be further determined. The blurriness usually represents the error or difference between the pixel value in the image and the true value. The smaller the blurriness, the higher the clarity of the image, and vice versa. Since the existence of the motion blur kernel will change the pixel value of each pixel in the image, after obtaining the motion blur kernel, based on the pixels when no motion blur occurs and the motion blur kernel, the pixel size of different pixels in the image after motion blur can be determined, and finally the blurriness is calculated according to the pixel size.
[0093] S50: Determine whether the ambiguity reaches a preset value.
[0094] S60: If the blurriness does not reach the preset value, the motion blur kernel is compensated and optimized until the blurriness reaches the preset value, and the current motion blur kernel is output.
[0095] Before deblurring, it is usually necessary to ensure that the blur value reaches an operable standard to prevent under-processing or over-processing. After obtaining the blur, just compare it with the preset value. If it does not reach the value, the motion blur kernel compensation is adjusted, that is, the blur kernel matrix obtained by the final mapping is changed by changing parameters such as the blur radius until the blur reaches the preset value, and then the latest motion blur kernel is output.
[0096] Preferably, the compensating and tuning the motion blur kernel includes:
[0097] If the blurriness does not reach the preset value, the blur radius is multiplied by the compensation coefficient and then brought back to the affine transformation matrix to recalculate the motion blur kernel and blurriness until the blurriness reaches the preset value; wherein the compensation coefficient has a value range of (1.1, 1.5).
[0098] S70. Determine the parameters of the deconvolution filter according to the current motion blur kernel, and perform a deblurring operation on the target feature map through the deconvolution filter.
[0099] The deconvolution filter is a special filter whose purpose is to restore the original image by deconvolving the blurred image. The parameters of the deconvolution filter usually need to be determined through experiments and adjustments. They depend on many factors, such as the size and shape of the blur kernel. Therefore, when the latest motion blur kernel is obtained, the parameters of the deconvolution filter can be matched to perform a deblurring operation to obtain a feature map with higher definition.
[0100] Based on the premise of accurately and effectively extracting image features, this embodiment further calculates the motion blur kernel of the feature map to evaluate the blurriness of the feature map. When it is determined that the blurriness does not reach the preset value, the motion blur kernel is supplemented and optimized until the blurriness meets the requirements, and then the deconvolution filtering deblurring operation is performed, thereby greatly improving the image quality.
[0101] S80, using a correlation filter to perform a circular convolution calculation on the deblurred target feature map to determine the position coordinates of the target in the current frame image; based on all position coordinates of the target in the continuous frame video image, the motion trajectory of the target is obtained to complete the target tracking and positioning.
[0102] By using the minimization formula of the correlation filter to determine the corresponding objective function, solving the correlation filter, and applying the correlation filter to the target feature map to obtain a response map, the position coordinates of the target in the current frame image can be obtained according to the response map. Finally, by iteratively solving the position coordinates of the target in each frame image, the motion trajectory of the dynamic target is obtained in the order of consecutive frame images, and the target tracking and positioning can be achieved.
[0103] For the dynamic positioning of the target in continuous frame images, this embodiment uses a correlation filter to perform circular convolution calculations on the deblurred target feature map to determine the position coordinates of the target in each frame of the image. Finally, the motion trajectory of the target in the continuous frames can be determined according to the arrangement order of the continuous frames, and the target tracking and positioning is finally achieved accurately. At the same time, compared with general neural networks, the algorithm provided by this embodiment has a greatly reduced amount of calculation, which speeds up the calculation and reduces the cost of target positioning and tracking.
[0104] See also Figure 2 In one embodiment, the step of establishing multiple target detection frames includes:
[0105] S201, use the fully convolutional neural network FCN to perform instance segmentation on the target image to obtain an initial rectangular detection frame and a corresponding polygonal outline.
[0106] When performing instance segmentation of the target image, FCN will first preprocess the image, and then use the convolution layer and pooling layer to extract the high-level features of the image. Next, FCN will use the deconvolution layer to upsample the featuremap of the last convolution layer to restore it to the same size as the input image, so that a prediction can be generated for each pixel while retaining the spatial information in the original input image.
[0107] Furthermore, FCN will find the largest rectangular area in the image that meets the predefined threshold according to the preset detection scale, which is the initial detection box. When obtaining the polygon outline, FCN will generate a series of segmentation masks inside the boundary. Each segmentation mask represents an instance. By merging and fusing the segmentation masks, the final polygon outline can be obtained.
[0108] S202, calculating a first IOU value between the initial detection box and the polygonal outline, and when the first IOU value reaches a first preset threshold, calculating a second IOU value between the polygonal outline and the actual outline of the target, and when the second IOU value reaches a second preset threshold, filtering out the corresponding initial detection box as the target detection box.
[0109] The first preset threshold IOU1 and the second preset threshold IOU2 can be set according to different scenarios; and, in order to improve the detection accuracy of the rectangular detection frame, the second preset threshold IOU2 is usually greater than the first preset threshold IOU1. The value ranges of the first preset threshold IOU1 and the second preset threshold IOU2 are both between 0.5 and 0.7.
[0110] Therefore, this embodiment first performs the first match between the initial detection frame and the predicted target, and screens the first match result, that is, the IOU value of the initial detection frame is greater than IOU1. Then the second match between the polygon outline and the predicted target is performed, and the second match result is screened, that is, the IOU value of the polygon outline is greater than IOU2. Finally, the initial detection frame after completing the two screenings is used as the final target detection frame.
[0111] In summary, this embodiment uses the FCN algorithm to perform instance segmentation, obtains two branch results, namely the initial detection box and the polygonal outline, and then establishes a new judgment relationship between the two parallel and non-intersecting branch results; by using the initial detection box for preliminary IOU screening and using the polygonal outline for secondary IOU screening, a target detection box with higher detection accuracy is obtained.
[0112] In one embodiment, the calculating the motion blur kernel of the target feature map includes:
[0113] 1) Initialize the blur radius R, and use the blur radius R to construct a motion vector map, where the motion vector map is a straight line with a length of R, an angle of 0, and a width of 1 pixel.
[0114] It should be noted that the blur radius refers to the radius of the blur operation used to smooth the image in image processing. The size of the blur radius determines the degree of influence of the blur operation on the image, and is usually used to reduce noise and details in the image, making the image smoother and softer.
[0115] Motion vector graph is used to describe the displacement relationship between video frames. Usually, a motion vector graph is an image, and each point on it represents the position change of a frame relative to another frame. The motion vector graph is constructed by blurring the radius R to obtain a straight line with a length of R, an angle of 0, and a width of 1 pixel.
[0116] Based on the blur radius R, establish the affine transformation matrix K:
[0117]
[0118]
[0119]
[0120] Where, θ is the moving angle of the video surveillance device;
[0121] The motion vector map is mapped using the affine transformation matrix K to obtain a motion blur kernel.
[0122] Preferably, the motion blur kernel is obtained by mapping the motion vector image of 80*80 pixels.
[0123] Further, calculating the moving angle of the video surveillance device includes:
[0124] Based on n consecutive video frames, m feature points are randomly selected from the first video frame, and matching points of the m feature points are searched from consecutive frames in turn:
[0125] X 11 ,X 12 ,...,X 1m
[0126] X 21 ,X 22 ,...,X 2m ......
[0128] X n1 ,X n2 ,...,X nm
[0129] Where, X 1m is the mth feature point in the first frame of the video image, X 2m For X1m The matching point in the second frame video image, X nm For X (n-1)m Matching points in the nth frame of the video image;
[0130] Calculate the movement angle of the video surveillance device:
[0131]
[0132]
[0133]
[0134] In the formula, (x ij ,y ij ) is the jth feature point X in the i-th frame video image ij The coordinate value of the video surveillance device; θ is the moving angle of the video surveillance device.
[0135] In this embodiment, multiple feature points are selected on a frame image, and the offset distance of each feature point in the continuous frame image is calculated, including the offset in the x-coordinate direction and the y-coordinate direction. Finally, the offsets of all points are averaged and the final device movement angle is calculated, thereby improving the accuracy of the calculation results.
[0136] In one embodiment, obtaining the blurriness of the target feature map according to the motion blur kernel includes:
[0137] Determine the pixel value of each point in the video image using the motion blur kernel;
[0138] Calculate the blur of the video image according to the pixel value:
[0139]
[0140] Where L is the width of the image, H is the height of the image, and P lh is the pixel value of the image at pixel (l,h).
[0141] In one embodiment, the deblurred target feature map is subjected to circular convolution calculation using a correlation filter to determine the position coordinates of the target in the current frame image;
[0142] Apply the correlation filter F to the target feature map D to obtain the response map C:
[0143] C=D*F
[0144] E(F)=||D*FY|| 2 +||F|| 2
[0145] Where * is circular convolution; E(F) is the objective function of the correlation filter F, Y represents the Gaussian distribution with the center point of the space as the highest value; || || represents the norm;
[0146] The correlation filter F is solved by using fast Fourier transform, and the coordinates of the position where the maximum value of the response map C is located are calculated, as well as the position coordinates of the target in the current frame image.
[0147] When the correlation filter is used for target tracking, the idea of sample cyclic shift is used to greatly solve the problem of lack of training samples, but it also has certain boundary effects, which affect the target positioning and tracking effect. The boundary effect means that the training samples generated by cyclic shift are synthetic samples. During the sample generation process, the target boundary will follow the cyclic shift, resulting in a large number of non-real training samples, thereby reducing the discrimination ability of the correlation filter.
[0148] In order to solve the problem of boundary effect, it is possible to consider adding a spatial regularization term to the correlation filter target tracking for constraint. For the objective function in the above embodiment, the spatial weight map W can be introduced as a constraint term in the process of updating the correlation filter F in a certain frame to obtain a new optimization objective function, which specifically includes the following steps:
[0149] The spatial regularization term is used to constrain the objective function of the correlation filter F and optimize the objective function:
[0150]
[0151] In the formula, represents the regularization term, represents the matrix element multiplication operation, and W represents the spatial weight map that obeys the quadratic function distribution; where:
[0152]
[0153] Where β and λ represent setting parameters, both greater than 0; (a, b) represent the coordinates of discrete points around the target center, and a=1,2,...,A, b=1,2,...,B; G1 and G2 represent the width and height of the target.
[0154] Since the target center is at the center of the sampled image, the introduction of the regularization weight W can suppress the values of the non-target area in the filter F and alleviate the boundary effect problem.
[0155] Preferably, in another embodiment, another boundary-constrained correlation filtering method can be used to optimize the model, that is, an adaptive spatial regularization algorithm is used for correlation filtering target tracking. The spatial regularization weight map used can be adaptively and dynamically adjusted according to the characteristics of the target during the tracking process, so that the optimized correlation filter has a stronger generalization ability.
[0156] See also Figure 3 In one embodiment of the present invention, a target positioning system based on video surveillance is provided, the system comprising:
[0157] The video stream acquisition unit 100 is used to acquire video stream data, wherein the video stream data includes a plurality of continuous frame video images;
[0158] The detection frame construction unit 200 is used to establish multiple target detection frames, and use each target detection frame to perform feature extraction of multi-channel gradient features and multi-channel color features on different target areas of the video image to generate multiple feature sub-maps;
[0159] The feature map concatenation unit 300 is used to calculate the intersection-over-union ratio between any two target detection frames as the correlation between any two target detection frames; and to concatenate multiple feature sub-maps according to the correlation to obtain a target feature map;
[0160] A blur calculation unit 400 is used to calculate a motion blur kernel of a target feature map, and obtain blur of the target feature map according to the motion blur kernel;
[0161] A deblurring unit 500 is used to determine whether the blur degree reaches a preset value. If the blur degree does not reach the preset value, the motion blur kernel is compensated and tuned until the blur degree reaches the preset value, the current motion blur kernel is output, and the parameters of the deconvolution filter are determined according to the current motion blur kernel, and the target feature map is deblurred by the deconvolution filter;
[0162] The tracking and positioning unit 600 is used to perform circular convolution calculation on the deblurred target feature map using a correlation filter to determine the position coordinates of the target in the current frame image; based on all the position coordinates of the target in the continuous frame video image, the motion trajectory of the target is obtained to complete the target tracking and positioning.
[0163] In a preferred embodiment, the detection frame construction unit 200 is further used to perform instance segmentation on the target image using a fully convolutional neural network FCN to obtain a rectangular initial detection frame and a corresponding polygonal contour;
[0164] Calculate the first IOU value between the initial detection box and the polygon outline. When the first IOU value reaches the first preset threshold, calculate the second IOU value between the polygon outline and the actual target outline. When the second IOU value reaches the second preset threshold, select the corresponding initial detection box as the target detection box.
[0165] In a preferred embodiment, the blur calculation unit 400 is used to calculate the motion blur kernel of the target feature map, including:
[0166] Initialize the blur radius R, and use the blur radius R to construct a motion vector diagram, where the motion vector diagram is a straight line with a length of R, an angle of 0, and a width of 1 pixel;
[0167] Based on the blur radius R, establish the affine transformation matrix K:
[0168]
[0169]
[0170]
[0171] Where, θ is the moving angle of the video surveillance device;
[0172] The motion vector map is mapped using the affine transformation matrix K to obtain a motion blur kernel.
[0173] In a preferred embodiment, the fuzziness calculation unit 400 is further used to calculate the moving angle of the video surveillance device, including:
[0174] Based on n consecutive video frames, m feature points are randomly selected from the first video frame, and matching points of the m feature points are searched from consecutive frames in turn:
[0175] X 11 ,X 12 ,...,X 1m
[0176] X 21 ,X 22 ,...,X 2m ......
[0178] X n1 ,X n2 ,...,X nm
[0179] Where, X 1m is the mth feature point in the first frame of the video image, X 2m For X 1m The matching point in the second frame video image, X nm For X (n-1)m Matching points in the nth frame of the video image;
[0180] Calculate the movement angle of the video surveillance device:
[0181]
[0182]
[0183]
[0184] In the formula, (x ij ,y ij ) is the jth feature point X in the i-th frame video image ij The coordinate value of the video surveillance device; θ is the moving angle of the video surveillance device.
[0185] In a preferred embodiment, the fuzziness calculation unit 400, used for obtaining the fuzziness of the target feature map according to the motion blur kernel, includes:
[0186] Determine the pixel value of each point in the video image using the motion blur kernel;
[0187] Calculate the blur of the video image according to the pixel value:
[0188]
[0189] Where L is the width of the image, H is the height of the image, and P lh is the pixel value of the image at pixel (l,h).
[0190] In a preferred embodiment, the deblurring unit 500 is used to compensate and tune the motion blur kernel, including:
[0191] If the blurriness does not reach the preset value, the blur radius is multiplied by the compensation coefficient and then brought back to the affine transformation matrix to recalculate the motion blur kernel and blurriness until the blurriness reaches the preset value; wherein the compensation coefficient has a value range of (1.1, 1.5).
[0192] In a preferred embodiment, the tracking and positioning unit 600 is used to perform a circular convolution calculation on the deblurred target feature map using a correlation filter to determine the position coordinates of the target in the current frame image, including:
[0193] Apply the correlation filter F to the target feature map D to obtain the response map C:
[0194] C=D*F
[0195] E(F)=||D*FY|| 2 +||F|| 2
[0196] Where * is circular convolution; E(F) is the objective function of the correlation filter F, Y represents the Gaussian distribution with the center point of the space as the highest value; |||| represents the norm;
[0197] The correlation filter F is solved by using fast Fourier transform, and the coordinates of the position where the maximum value of the response map C is located are calculated, as well as the position coordinates of the target in the current frame image.
[0198] In some embodiments, the functions or modules included in the target positioning system based on video surveillance provided in this embodiment can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be further described here.
[0199] A certain embodiment of the present invention further provides an electronic device, comprising: a processor, a sending device, an input device, an output device and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes a method as described in any possible implementation manner.
[0200] A certain embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes a method as described in any possible implementation manner.
[0201] See also Figure 4 , Figure 4 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention.
[0202] The electronic device 2 includes a processor 21, a memory 24, an input device 22, and an output device 23. The processor 21, the memory 24, the input device 22, and the output device 23 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.
[0203] The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present invention.
[0204] The memory 24 can be used to store computer program instructions and various computer program codes including program codes for executing the scheme of the present invention. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.
[0205] The input device 22 is used to input data and / or signals, and the output device 23 is used to output data and / or signals. The output device 23 and the input device 22 may be independent devices or an integrated device.
[0206] It is understandable that in the embodiment of the present invention, the memory 24 can be used not only to store relevant instructions, and the embodiment of the present invention does not limit the specific data stored in the memory.
[0207] Understandably, Figure 4 Only a simplified design of an electronic device is shown. In practical applications, the electronic device may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all video analysis devices that can implement the embodiments of the present invention are within the protection scope of the present invention.
[0208] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0209] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present invention have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.
[0210] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0211] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0212] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0213] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0214] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
Claims
1. A target positioning method based on video surveillance, characterized in that: The method comprises: Acquire video stream data, wherein the video stream data includes a plurality of continuous frame video images; Establishing multiple target detection frames, using each target detection frame to extract multi-channel gradient features and multi-channel color features from different target areas of the video image, and generating multiple feature sub-maps; Calculate the intersection-and-union ratio between any two target detection frames as the correlation between the any two target detection frames; splice multiple feature sub-maps according to the correlation to obtain a target feature map; Calculate the motion blur kernel of the target feature map, and obtain the blur degree of the target feature map according to the motion blur kernel; Determine whether the blur reaches a preset value, if the blur does not reach the preset value, compensate and tune the motion blur kernel until the blur reaches the preset value, output the current motion blur kernel, and determine the parameters of the deconvolution filter according to the current motion blur kernel, and perform a deblurring operation on the target feature map through the deconvolution filter; The deblurred target feature map is subjected to circular convolution calculation using a correlation filter to determine the position coordinates of the target in the current frame image; based on all the position coordinates of the target in the continuous frame video images, the motion trajectory of the target is obtained to complete the target tracking and positioning.
2. The target positioning method based on video surveillance according to claim 1 is characterized in that: The establishing of multiple target detection frames includes: Use the fully convolutional neural network FCN to perform instance segmentation on the target image and obtain the initial rectangular detection frame and the corresponding polygon outline; Calculate the first IOU value between the initial detection box and the polygon outline. When the first IOU value reaches the first preset threshold, calculate the second IOU value between the polygon outline and the actual target outline. When the second IOU value reaches the second preset threshold, select the corresponding initial detection box as the target detection box.
3. The target positioning method based on video surveillance according to claim 1 is characterized in that: The calculating the motion blur kernel of the target feature map includes: Initialize the blur radius R, and use the blur radius R to construct a motion vector diagram, where the motion vector diagram is a straight line with a length of R, an angle of 0, and a width of 1 pixel; Based on the blur radius R, establish the affine transformation matrix K: Where, θ is the moving angle of the video surveillance device; The motion vector map is mapped using the affine transformation matrix K to obtain a motion blur kernel.
4. The target positioning method based on video surveillance according to claim 3 is characterized in that: The method further includes calculating the moving angle of the video surveillance device, including: Based on n consecutive video frames, m feature points are randomly selected from the first video frame, and matching points of the m feature points are searched from consecutive frames in turn: X 11 ,X 12 ,...,X 1m X 21 ,X 22 ,...,X 2m ...... X n1 ,X n2 ,...,X nm Where, X 1m is the mth feature point in the first frame of the video image, X 2m For X 1m The matching point in the second frame video image, X nm For X (n-1)m Matching points in the nth frame of the video image; Calculate the movement angle of the video surveillance device: In the formula, (x ij ,y ij ) is the jth feature point X in the i-th frame video image ij The coordinate value of the video surveillance device; θ is the moving angle of the video surveillance device.
5. The target positioning method based on video surveillance according to claim 3 is characterized in that: The step of obtaining the blurriness of the target feature map according to the motion blur kernel includes: Determine the pixel value of each point in the video image using the motion blur kernel; Calculate the blur of the video image according to the pixel value: Where L is the width of the image, H is the height of the image, and P lh is the pixel value of the image at pixel (l,h).
6. The target positioning method based on video surveillance according to claim 3 is characterized in that: The compensation tuning of the motion blur kernel includes: If the blurriness does not reach the preset value, the blur radius is multiplied by the compensation coefficient and then brought back to the affine transformation matrix to recalculate the motion blur kernel and blurriness until the blurriness reaches the preset value; wherein the compensation coefficient has a value range of (1.1, 1.5).
7. The target positioning method based on video surveillance according to claim 1, characterized in that: The step of performing a circular convolution calculation on the deblurred target feature map using a correlation filter to determine the position coordinates of the target in the current frame image includes: Apply the correlation filter F to the target feature map D to obtain the response map C: C=D*F E(F)=||D*F-Y|| 2 +||F|| 2 Where * is circular convolution; E(F) is the objective function of the correlation filter F, Y represents the Gaussian distribution with the center point of the space as the highest value; |||| represents the norm; The correlation filter F is solved by fast Fourier transform, and the coordinates of the maximum value of the response map C and the position coordinates of the target in the current frame image are calculated.
8. A target positioning system based on video surveillance, characterized in that: The system comprises: A video stream acquisition unit, used to acquire video stream data, wherein the video stream data includes a plurality of continuous frame video images; A detection frame construction unit is used to establish multiple target detection frames, and use each target detection frame to perform feature extraction of multi-channel gradient features and multi-channel color features on different target areas of the video image to generate multiple feature sub-maps; A feature map concatenation unit is used to calculate the intersection-over-union ratio between any two target detection frames as the correlation between any two target detection frames; and concatenate multiple feature sub-maps according to the correlation to obtain a target feature map; A fuzziness calculation unit is used to calculate a motion blur kernel of a target feature map, and obtain the fuzziness of the target feature map according to the motion blur kernel; A deblurring unit, used to determine whether the blur degree reaches a preset value, and if the blur degree does not reach the preset value, to compensate and tune the motion blur kernel until the blur degree reaches the preset value, to output the current motion blur kernel, and to determine the parameters of the deconvolution filter according to the current motion blur kernel, and to perform a deblurring operation on the target feature map through the deconvolution filter; The tracking and positioning unit is used to perform circular convolution calculation on the deblurred target feature map using a correlation filter to determine the position coordinates of the target in the current frame image; based on all the position coordinates of the target in the continuous frame video image, the motion trajectory of the target is obtained to complete the target tracking and positioning.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code includes computer instructions, and when the processor executes the computer instructions, the electronic device executes the target positioning method based on video surveillance as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the target positioning method based on video surveillance as described in any one of claims 1 to 7.
