A Dynamic Target Density Detection Method Based on Video Streams

By adaptively cutting and data enhancement of video stream data, combined with target tracking algorithms and density calculations, accurate detection and quantitative analysis of target density and rate of change such as people flow are achieved, and the problems of inefficiency and lack of quantitative analysis in the existing technology are solved.

CN115331161BActive Publication Date: 2025-06-24DA FANG ELECTRONIC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210776357.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-30
Publication Date
2025-06-24
Estimated Expiration
2042-06-30

AI Technical Summary

Technical Problem

Existing target detection algorithms such as abortion cannot accurately detect small targets, calculate the density of targets, and are inefficient, lack quantitative analysis, and cannot quantify the density of targets such as abortion.

Method used

The dynamic target density detection method based on video stream is adopted, and the target density and dynamic change rate are calculated by adaptively cutting and data augmenting the image or video stream data, combined with the target tracking algorithm and density calculation.

Benefits of technology

It significantly improves the effect and accuracy of target detection, and can calculate the dynamic target change rate within a certain period of time, solving the problem of quantitative analysis of target density and change rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115331161B_ABST
    Figure CN115331161B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for detecting the density of dynamic targets based on video streams, belonging to the field of computer vision. The method includes the following steps: S1. Selecting video stream sample data at multiple time points; S2. Image adaptive cutting; S3. Detecting dynamic targets in spatial regions; S4. Detecting the actual distance of targets in spatial regions; S5. Exponentiating the transformation rate of dynamic targets. The present invention is based on image or video stream data, and performs detection, recognition and tracking calculations on the dynamic targets therein, including target density and dynamic change rate. By performing certain preprocessing methods such as cutting and enhancement on the image or video stream data, the calculation and recognition effect and accuracy are significantly improved, and at the same time, the change rate of dynamic targets and the like can be calculated within a certain time period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and particularly to a dynamic target density detection method based on a video stream. Background Art

[0002] Currently, in existing target detection algorithms for people flow and the like, the problem of accurately detecting small targets cannot be solved, and thus the density of the detected targets cannot be calculated. Moreover, the detection is based on a single image, resulting in poor detection effect and low efficiency. The density size is mainly qualitatively judged by a heat map manually or simply determined by the recognition of the number of people, lacking exponential index analysis. At the same time, the density degree of targets such as people flow cannot be quantified and can only be qualitatively judged. Therefore, it has certain limitations in practical applications. In addition, there is currently a lack of calculation of the change rate of targets in a video stream. Summary of the Invention

[0003] The purpose of the present invention is to provide a dynamic target density detection method based on a video stream, which detects, identifies, and tracks and calculates dynamic targets in image or video stream data, including target density and dynamic change rate. By performing certain preprocessing methods such as cutting and enhancement on the image or video stream data, the calculation recognition effect and accuracy are significantly improved, and at the same time, the change rate of dynamic targets and the like can be calculated within a certain time period. Thus, the problems raised in the above background art are solved.

[0004] The technical solution adopted by the present invention is as follows:

[0005] A dynamic target density detection method based on a video stream includes the following steps:

[0006] S1. Select video stream sample data at multiple time points s , and s divide it into sub-data streams with fixed time periods , and each video stream is divided into frames of images, and each frame of image is ;

[0007] S2. Image adaptive cutting

[0008] Cut a larger-resolution image. When there is a detected target at the cutting position, use the cross-cutting method to avoid cutting the target at the cutting position in half. Then, perform sample data enhancement on each cut block through a data enhancement algorithm, and then perform sample data detection and recognition. Finally, merge all the sample detection data blocks in the original splitting order; select a cutting threshold according to the actual situation, and the specific cutting algorithm is as follows:

[0009] When the cutting threshold is:

[0010] The size is :

[0011] If :

[0012] then cut the frame image into four pieces;

[0013] If :

[0014] then continue to cut until it reaches;

[0015] Otherwise, perform data augmentation on each cut image block respectively, perform object detection in sequence, and then perform merging;

[0016] Return the detection result ;

[0017] Otherwise, directly detect the frame image and return the detection result ;

[0018] Return the detection result of the frame ;

[0019] S3. Spatial Region Dynamic Object Detection

[0020] According to the object tracking algorithm and the object detection algorithm, calculate the density of the objects within a certain time period, which is the number of different objects passing through in the video stream during this time period; where the video stream data the detection result is:

[0021]

[0022] Calculate the number of objects at each moment as follows:

[0023]

[0024] Among them, is the number of objects in the time period, is the number of objects in the frame image of the video stream;

[0025] S4. Spatial Region Object Actual Distance Detection

[0026] By obtaining the mutual relationship between the camera coordinates, pixel coordinates, and world coordinates, design an algorithm structure for converting parameters, so as to recalculate the actual spatial distance between the detected objects in the video stream or image by obtaining the established parameters of the camera;

[0027] S5. Indexing of Dynamic Target Transformation Rate

[0028] When given video stream sample data or picture data with time series, within a selected definite time period or the existing time, count the targets detected and recognized at two time points. Each time point will not count the repeatedly appearing targets to avoid duplicate recognition of targets. Calculate the number of target recognitions at the two moments, and compare the changes in the detected targets in the two time periods by calculating the base period growth rate, so as to calculate the dynamic target density change rate within a specific time period in the regional space and index the density of targets in the video stream or image. The specific algorithm is as follows:

[0029] Estimate the target growth rate of the video stream based on the changes in the target data before and after the two moments , and then calculate the growth rate per unit time :

[0030]

[0031]

[0032] Among them, represents the target growth rate per unit time, that is, the target change rate, represents the number of non-repeated targets at the moment, and represent two different moments.

[0033] The number of image cuts in step S2 is determined whether to cut and how many pieces to cut according to the size of the original image.

[0034] To sum up, due to the adoption of the above technical solutions, the beneficial effects of the present invention are:

[0035] 1. The present invention adopts an adaptive cutting method for images or video streams with higher resolution, appropriately cuts the original image, reasonably divides the image data, avoids the problem that repeated images cannot be recognized after being cut, then performs sample data enhancement on each cut block through a data enhancement algorithm, and then performs sample data detection and recognition. Finally, all sample detection data blocks are merged according to the original cutting order, thereby improving the detection effect and recognition accuracy and avoiding data loss during sample data cutting.

[0036] 2. The present invention detects the actual distance in the target space, converts the image pixel distance into a space distance, and thus detects the distance between target groups.

[0037] 3. The present invention counts the target flow in a certain time period in the video stream through spatial target density detection.

[0038] 4. The present invention detects the change rate of an object in a certain time period in a video stream through the indexation of dynamic objects, and solves the calculation of the growth rate of spatial objects.

[0039] In summary, the present invention detects, identifies and tracks and calculates dynamic objects in image or video stream data, including object density and dynamic change rate. Through certain preprocessing methods such as cutting and enhancing the image or video stream data, the calculation and recognition effect and accuracy are significantly improved, and at the same time, the change rate of dynamic objects can be calculated within a certain time period. Brief Description of the Drawings

[0040] Figure 1 is the schematic diagram of the present invention; Detailed Embodiments

[0041] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.

[0042] Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0043] Embodiment 1

[0044] As Figure 1 , this embodiment provides a method for detecting the density of dynamic objects based on a video stream, including the following steps:

[0045] S1. Select video stream sample data at multiple time points s , and divide s into sub-data streams with fixed time periods , and each video stream is divided into frame images, and each frame image is ;

[0046] S2. Image adaptive cutting

[0047] Properly cut the larger - resolution image. When there is a detection target at the cutting position, directly cutting may cause the target at the cutting position to be undetected. Therefore, the cross - cutting method is adopted to avoid the situation where the target at the cutting position is cut in half and cannot be detected, thereby improving the overall target recognition rate. Then, sample data augmentation is performed on each cut block through the data augmentation algorithm, followed by sample data detection and recognition. Finally, all the sample detection data blocks are merged according to the original segmentation order; thus, the detection effect and recognition accuracy are improved. The determination of the specific number of cuts is based on the size of the original image to judge whether to cut and how many blocks to cut. The cutting threshold is selected according to the actual situation. The specific cutting algorithm is as follows:

[0048] When the cutting threshold is:

[0049] with the size of :

[0050] If :

[0051] then cut the frame image into , , , four pieces;

[0052] If :

[0053] then continue to cut until ;

[0054] Otherwise, perform data augmentation on each cut - block image respectively, conduct target detection in sequence, and then perform merging;

[0055] Return the detection result ;

[0056] Otherwise, directly detect the frame image and return the detection result ;

[0057] Return the detection result of the frame ;

[0058] S3. Dynamic target detection in the spatial region

[0059] According to the target tracking algorithm and the target detection algorithm, calculate the density of targets within a certain period of time, which is the number of different targets passing through in the video stream during this period; since the video stream is dynamically changing and the detected targets are changing all the time, simply calculating the target density of a single frame of the video stream doesn't make much sense and is inefficient. Therefore, it is necessary to detect the density problem within a certain period of time in the video stream and provide a basis for other related calculations.

[0060] Among them, the video stream data The detection result is:

[0061]

[0062] Calculate the number of targets at each moment as follows:

[0063]

[0064] Among them, is the number of targets in the time period, is the video stream in the number of targets in the

[0065] S4. Detection of the actual distance of targets in the spatial region

[0066] In practical applications, it is necessary to calculate the actual distance between targets. Since the pixel distance of the video stream or image cannot accurately describe the actual relative distance between the detected targets. Therefore, by obtaining the mutual relationship between the camera coordinates, pixel coordinates, and world coordinates, design the algorithm structure for parameter conversion, so as to recalculate the actual spatial distance between the detected targets in the video stream or image by obtaining the established parameters of the camera;

[0067] S5. Exponentiation of the dynamic target transformation rate

[0068] According to the actual situation, a calculation method for the dynamic target density in the video stream within a given period of time. When given video stream sample data or picture data with a time series, within a selected definite time period or the existing time, count the targets detected and recognized at two time points. Each time point will not count the targets that appear repeatedly to avoid repeated recognition of targets. Calculate the number of target recognitions at the two time points, and calculate the change in the detected targets between the two time periods by calculating the base period growth rate, so as to calculate the change rate of the dynamic target density in a specific time period within the regional space and exponentiate the density of the targets in the video stream or image; The specific algorithm is as follows,

[0069] Estimate the target growth rate of the video stream based on the changes in the target data before and after two time points , and then calculate the growth rate per unit time :

[0070]

[0071]

[0072] Wherein, represents the target growth rate per unit time, that is, the target change rate, represents the number of non-repeating targets at the moment, and represent two different moments.

[0073] The working principle of the present invention is to solve the problem of small target recognition in image or video stream target detection.

[0074] Since the resolution of the detected image or video stream is relatively high, and when the targets therein are small, combined with the problem that traditional target detection methods cannot detect small targets, the present invention mainly adopts an adaptive cutting method for images or video streams with relatively high resolution, appropriately cuts the original image, reasonably divides the image data, avoids the problem that repeated images cannot be recognized after being cut, then performs sample data enhancement on each cut block by using a data enhancement algorithm, then performs sample data detection and recognition, and finally merges all sample detection data blocks in the order of the original division, thereby improving the detection effect and recognition accuracy, and avoiding data loss during sample data segmentation.

[0075] Exponentiation of the dynamic target change rate. Aiming at the problem that traditional algorithms only calculate the density of single-frame images in video data and cannot quantitatively present the dynamic changes within a specific spatial region over a period of time, the present invention proposes a calculation method for the dynamic target change rate in a video stream at multiple time points according to the actual situation. When given video stream sample data or picture data with a time series, different time points are selected, the targets detected at two time points are counted, and each time point does not count the repeatedly appearing targets, so as to avoid repeated recognition of targets. Calculate the number of target recognitions at two moments, calculate the change rate of the detected targets in two time periods by calculating the base period growth rate, so as to calculate the change rate of the dynamic targets per unit time in the regional space, and exponentiate the target change rate in the video stream or image.

[0076] The present invention is not limited to the detection of people, and as long as it is video stream data, target detection can be performed, such as vehicles.

Claims

1. A dynamic target density detection method based on video stream, characterized in that It includes the following steps: S1. Select video stream sample data at multiple time points s , and s divide it into sub-data streams of fixed time periods . Each video stream is divided into frames of images, and each frame of image is ; S2. Image adaptive cutting Cut the larger-resolution image. When there is a detection target at the cutting position, use the cross-cutting method to avoid cutting the target at the cutting position in half. Then, perform sample data augmentation on each cut block through the data augmentation algorithm, and then perform sample data detection and recognition. Finally, merge all the sample detection data blocks in the original splitting order; select the cutting threshold according to the actual situation. The specific cutting algorithm is as follows: When the cutting threshold is: The size of : If :[[]]END]] Then, the frame image is cut into four pieces; If : Then continue cutting until it stops; Otherwise, perform data augmentation on each cut-block image separately, perform object detection in sequence, and then perform merging; Return the detection result ; Otherwise, directly detect the frame image and return the detection result ; Return Detection result of the frame ; S3. Spatial region dynamic object detection According to the target tracking algorithm and the target detection algorithm, calculate the density of the target within a certain time period, which is the number of different targets passing through in the video stream during this time period; among them, the video stream data The detection result is: Calculate the number of objects at each moment as follows: Among them, is the target number of the time period, and is the target number of the th frame image in the video stream; S4. Spatial region object actual distance detection By obtaining the mutual relationship between the camera coordinates, pixel coordinates, and world coordinates, design the algorithm structure for converting parameters, so as to recalculate the actual spatial distance between the detected objects in the video stream by obtaining the established parameters of the camera; S5. Exponentiation of the dynamic object transformation rate When given the sample data of the video stream, within a selected definite time period or the existing time, count the objects detected and recognized at two time points. Each time point will not count the repeatedly appearing objects to avoid repeated recognition of the objects. Calculate the number of object recognitions at the two time points, and calculate the change of the detected objects in the two time periods by calculating the base period growth rate, so as to calculate the dynamic object density change rate in the specific time period in the regional space and exponentiate the density of the objects in the video stream or image; the specific algorithm is as follows, Estimate the target growth rate of the video stream based on the changes in the target data before and after two moments , and then calculate the growth rate per unit time : Among them, represents the target growth rate per unit time, that is, the target change rate, represents the number of non-repeating targets at the moment, and represent two different moments.

2. The dynamic target density detection method based on video stream according to claim 1, wherein: The number of image cuts in step S2 is determined according to the size of the original image to judge whether to cut and how many blocks to cut.

Citation Information

Patent Citations

  • Method for realizing target positioning and tracking based on coordinate mapping

    CN114078084A

  • Method for detecting crowd density, and method and apparatus for detecting interest degree of crowd in target position

    US20160133025A1