Method, device, computer equipment and storage medium for counting photographed objects

By acquiring and mapping detection frames in images, and deleting and merging duplicate detection frames, the problem of inaccurate crowd counting in monitoring scenarios is solved, the accuracy of counting results is improved, and the reliability of crowd management is enhanced.

CN113744221BActive Publication Date: 2024-09-17ANHUI IFLYTEK INTELLIGENT SYST
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202110987321.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-26
Publication Date
2024-09-17
Estimated Expiration
2041-08-26

AI Technical Summary

Technical Problem

Existing technologies in surveillance scenarios lead to inaccurate crowd counting due to complex distribution and overlapping phenomena of surveillance cameras, and are unable to effectively manage and control the flow of people, which may lead to mass incidents.

Method used

By obtaining the images of the same shooting scene from each shooting device, the detection frame is determined and mapped to the base map of the shooting scene. The detection frames that are repeatedly detected in the base map are deleted, different types of detection frames are merged, and the detection frames in the base map are calculated. The total number of frames determines the total number of subjects in the shooting scene.

Benefits of technology

It improves the accuracy of object counting, avoids the problem of the same object being captured and counted multiple times by multiple cameras at the same time, and enhances the reliability of crowd management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113744221B
    Figure CN113744221B
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for counting photographed objects. The method comprises: obtaining images captured by each photographing device at the same time for the same photographing scene, and determining a detection frame in each image; mapping the detection frame in each image to a base map corresponding to the photographing scene, and deleting the detection frame detected repeatedly in the base map; and determining the total number of photographed objects in the photographing scene according to the total number of detection frames in the base map. The method provided by an embodiment of the present invention maps the detection frame in each image to a base map corresponding to the photographing scene, and deletes the detection frame detected repeatedly in the base map; and determines the total number of photographed objects in the photographing scene according to the total number of detection frames in the base map. Since after mapping the detection frame in the image to the base map, the detection frame detected repeatedly in the base map can be deleted, it is possible to avoid counting multiple times the photographed objects captured by multiple cameras at the same time, thereby improving the accuracy of the counting results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device, computer equipment and storage medium for counting photographed objects. Background Art

[0002] At present, the crowd gathering behavior in the entire monitoring scene still lacks effective management and control. The slow flow of people caused by crowd congestion may cause serious group incidents, so it is necessary to monitor the number of people. In the relevant technology, the main process of the method for counting people is as follows: obtain the base map and monitoring image of the observation scene, calculate the homography matrix corresponding to the base map and the monitoring image, map the monitoring image to the base map, and build a scene model; pre-process the monitoring image, and obtain the information of the head point bounding box in the monitoring image through the crowd counting neural network, and map the head point bounding box to the base map; according to the non-maximum suppression algorithm, the head point bounding box in the base map is screened, the repeated head point bounding boxes are deleted, and the total number of head point bounding boxes is calculated as the total number of people in the observation scene.

[0003] Since the above process only imports the monitoring images taken by a single surveillance camera, and determines the number of people captured by each camera, and then simply adds the number of people determined by each camera, the distribution of surveillance cameras in real scenarios is complex and there is overlap in the monitoring areas, that is, the number of people determined by each camera may be repeated, making it impossible to accurately determine the total number of people in the monitoring scene. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for counting photographed objects that can improve the accuracy of counting photographed objects in response to the above technical problems.

[0005] A method for counting photographed objects, the method comprising:

[0006] Obtain images captured by each shooting device for the same shooting scene at the same time, and determine a detection frame in each image;

[0007] Map the detection frame in each image to the base map corresponding to the shooting scene, and delete the detection frames that are repeatedly detected in the base map;

[0008] According to the total number of detection frames in the base image, the total number of objects in the shooting scene is determined.

[0009] In one embodiment, before mapping the detection frame in each image to the base map corresponding to the shooting scene, the method further includes:

[0010] Delete the same type of detection boxes that are detected repeatedly in each image.

[0011] In one embodiment, there are at least two types of detection frames; accordingly, after deleting the detection frames detected repeatedly in each type of detection frame subset corresponding to each image, the method further includes:

[0012] Merge different types of detection boxes in each image.

[0013] In one embodiment, different types of detection frames in each image are merged, including:

[0014] For any image, a detection frame set corresponding to any image is composed of detection frames in any image. Based on a selection condition, a detection frame is selected from the detection frame set corresponding to any image as a detection frame to be matched, a repetition index between the detection frame to be matched and each other detection frame in the detection frame set is calculated, and other detection frames corresponding to repetition indexes greater than a first preset threshold are deleted from the detection frame set. The above selection, calculation and deletion processes are repeated until the remaining detection frames in the detection frame set are all selected, and the remaining detection frames in the detection frame set are used as detection frames in any image; wherein the selection condition is that the remaining detection frames in the detection frame set have the largest area and have not been selected, and the repetition index is used to characterize the possibility that two detection frames correspond to the same photographed object.

[0015] In one embodiment, calculating the repetition index between the detection frame to be matched and each other detection frame in the detection frame set includes:

[0016] For any other detection frame, determine the overlapping area between any other detection frame and the detection frame to be matched in any image;

[0017] The product of the area of ​​any other detection frame and the area of ​​the detection frame to be matched is calculated, and the ratio between the square value of the overlapping area and the product is used as the repetition index between the detection frame to be matched and any other detection frame.

[0018] In one embodiment, mapping the detection frame in each image to a base map corresponding to the shooting scene includes:

[0019] Determine the anchor point of each detection box in each image, and determine the coordinates of the anchor point of each detection box in the base map;

[0020] According to the coordinates of the anchor point of each detection frame in the base map, determine the area where each detection frame is located in the base map;

[0021] Each detection box is added to the base map according to the area where each detection box is located in the base map.

[0022] In one of the embodiments, deleting the detection boxes of repeated detections in the base map includes:

[0023] For all detection frame groups consisting of every two detection frames in the base image, if there is a detection frame group whose matching features meet the preset conditions, the detection frames in the detection frame group that meet the preset conditions are deleted; wherein the matching features include the intersection-and-union ratio between the two detection frames, and the preset conditions include the intersection-and-union ratio being greater than a second preset threshold.

[0024] In one of the embodiments, the matching feature also includes the similarity between the two detection frames; the preset condition also includes that the similarity is greater than a third preset threshold.

[0025] In one embodiment, the similarity calculation process includes:

[0026] For any two detection frames, feature points in the images selected by each detection frame are extracted to form their corresponding feature point sets; the images selected by each detection frame refer to the parts of the images selected by the detection frame in the image before mapping;

[0027] According to the feature point sets corresponding to any two detection frames, the corresponding feature vectors are determined;

[0028] According to the feature vectors corresponding to any two detection frames, the similarity between any two detection frames is determined.

[0029] In one embodiment, determining the total number of objects in the shooting scene according to the total number of detection frames in the base image includes:

[0030] According to the shooting coverage of each shooting device, determine the total shooting area covered by all shooting devices in the base map;

[0031] Determine the distribution density of the objects in the shooting scene according to the total number of detection frames and the area of ​​the shooting area in the base map;

[0032] The total number of objects in the shooting scene is determined based on the distribution density and the total area of ​​the base map.

[0033] A device for counting photographed objects, the device comprising:

[0034] An acquisition module is used to acquire images captured by each shooting device at the same time for the same shooting scene;

[0035] A first determination module, used to determine a detection frame in each image;

[0036] A mapping module, used to map the detection frame in each image to a base map corresponding to the shooting scene;

[0037] The first deletion module is used to delete the detection frames of repeated detections in the base map;

[0038] The second determination module is used to determine the total number of objects in the shooting scene according to the total number of detection frames in the base image.

[0039] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0040] Obtain images captured by each shooting device for the same shooting scene at the same time, and determine a detection frame in each image;

[0041] Map the detection frame in each image to the base map corresponding to the shooting scene, and delete the detection frames that are repeatedly detected in the base map;

[0042] According to the total number of detection frames in the base image, the total number of objects in the shooting scene is determined.

[0043] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0044] Obtain images captured by each shooting device for the same shooting scene at the same time, and determine a detection frame in each image;

[0045] Map the detection frame in each image to the base map corresponding to the shooting scene, and delete the detection frames that are repeatedly detected in the base map;

[0046] According to the total number of detection frames in the base image, the total number of objects in the shooting scene is determined.

[0047] The above-mentioned object counting method, device, computer equipment and storage medium obtain images captured by each shooting device at the same time of the same shooting scene, and determine the detection frame in each image. The detection frame in each image is mapped to the base map corresponding to the shooting scene, and the detection frames that are repeatedly detected in the base map are deleted. According to the total number of detection frames in the base map, the total number of objects in the shooting scene is determined. Since after the detection frames in the image are mapped to the base map, the detection frames that are repeatedly detected in the base map can be deleted, it is possible to avoid the objects that are simultaneously captured by multiple cameras from being counted multiple times, thereby improving the accuracy of the counting results. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a schematic diagram of a shooting scene in one embodiment;

[0049] Figure 2 A schematic diagram of a counting process in an embodiment;

[0050] Figure 3 is a schematic flow chart of a method for counting photographed objects in one embodiment;

[0051] Figure 4 is a schematic diagram of a detection frame in an embodiment;

[0052] Figure 5 is a schematic diagram of a head and shoulders frame and a body frame in one embodiment;

[0053] Figure 6 A schematic diagram of a detection frame of the same type that is repeatedly detected in one embodiment;

[0054] Figure 7 A schematic diagram of a method flow chart for deleting duplicate detection frames of the same type in one embodiment;

[0055] Figure 8 A schematic diagram of different types of detection frames for repeated detection in one embodiment;

[0056] Fig. 9 A schematic diagram of a method flow for merging different types of detection frames for repeated detection in one embodiment;

[0057] Fig.10 A schematic diagram of a method flow for mapping a detection frame to a base map in one embodiment;

[0058] Fig.11 1 is a flow chart of a method for calculating similarity between detection frames in one embodiment;

[0059] Fig.12 is a schematic diagram of characteristic points in one embodiment;

[0060] Fig.13 A schematic diagram of a method flow chart for determining the total number of photographed objects in one embodiment;

[0061] Fig.14 is a structural block diagram of a voiceprint identification device in an embodiment;

[0062] Fig.15 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] It is understood that the terms "first", "second", etc. used in this application can be used in this article to describe various professional terms, but unless otherwise specified, these professional terms are not limited by these terms. These terms are only used to distinguish one professional term from another professional term. For example, without departing from the scope of this application, the third preset threshold and the fourth preset threshold can be the same or different.

[0065] At present, the crowd gathering behavior in the entire monitoring scene still lacks effective management and control. The slow flow of people caused by crowd congestion may cause serious group incidents, so it is necessary to monitor the number of people. In the relevant technology, the main process of the method for counting people is as follows: obtain the base map and monitoring image of the observation scene, calculate the homography matrix corresponding to the base map and the monitoring image, map the monitoring image to the base map, and build a scene model; pre-process the monitoring image, and obtain the information of the head point bounding box in the monitoring image through the crowd counting neural network, and map the head point bounding box to the base map; according to the non-maximum suppression algorithm, the head point bounding box in the base map is screened, the repeated head point bounding boxes are deleted, and the total number of head point bounding boxes is calculated as the total number of people in the observation scene.

[0066] Since the above process only imports the monitoring images taken by a single surveillance camera, and determines the number of people captured by each camera, and then simply adds the number of people determined by each camera, the distribution of surveillance cameras in real scenarios is complex and there is overlap in the monitoring areas, that is, the number of people determined by each camera may be repeated, making it impossible to accurately determine the total number of people in the monitoring scene.

[0067] like Figure 1 As shown, Figure 1 The frame in represents the common shooting scene of all shooting devices, and the area framed by the arc dashed line centered on each shooting device represents the shooting coverage of each shooting device. Figure 1 It can be seen that there is an obvious overlapping area between the shooting coverage of different shooting devices. If there is a shooting object located in the overlapping area, the head point bounding box of the shooting object will be counted twice in the relevant technology, which will make it impossible to accurately determine the total number of people in the monitoring scene.

[0068] In view of the problems existing in the above-mentioned related technologies, an embodiment of the present invention provides a method for counting photographed objects. The method can be applied to different scenarios according to different needs, such as counting of crowds in personnel gathering places, monitoring of crowd gathering or evacuation, and counting of transportation vehicles, etc., and the embodiment of the present invention does not specifically limit this. In view of the fact that there is still a lack of effective management and control of crowd gathering, the method provided by the embodiment of the present invention is now explained by taking the monitoring scenario of crowd gathering as an example. At this time, the photographed object in the embodiment of the present invention is actually a person. Of course, in the actual implementation process, the specific type of the photographed object may be different according to the different scenarios to which the method provided by the embodiment of the present invention is applied. For example, if the method provided by the embodiment of the present invention is applied to the statistical scenario of transportation vehicles, then the photographed object in the method provided by the embodiment of the present invention is a transportation vehicle.

[0069] In addition, the method provided by the embodiment of the present invention is applied to the server, that is, Figure 1 The camera in the image captures the image, and Figure 1 After the shooting device captures the image, the image can be transmitted to the server through the network, and then the server executes the method provided by the embodiment of the present invention. Figure 2 As shown, Figure 2 Only one shooting device 201 is schematically shown. In actual implementation, there may be multiple shooting devices 201 for the same shooting scene. After each shooting device 201 captures an image, the image may be sent to the server 202. The server 202 counts the shooting objects in the shooting scene by executing the method provided in the embodiment of the present invention.

[0070] Of course, in the actual implementation process, the execution subject of the method provided in the embodiment of the present invention can be applied to other devices besides the server, such as computers, tablet computers and portable wearable devices with specific data processing functions, etc., and the embodiment of the present invention does not specifically limit this. It should be noted that the number of "multiple" and the like mentioned in each embodiment of the present application refers to the number of "at least two", for example, "multiple" refers to "at least two".

[0071] In combination with the above description, in one embodiment, see Figure 3 , provides a method for counting photographed objects. Taking the method applied to a server and the execution subject being the server as an example, the method includes the following steps:

[0072] 301. Obtain images captured by each shooting device for the same shooting scene at the same time, and determine a detection frame in each image;

[0073] 302. Mapping the detection frame in each image to a base map corresponding to the shooting scene, and deleting the detection frames that are repeatedly detected in the base map;

[0074] 303. Determine the total number of objects in the shooting scene according to the total number of detection frames in the base image.

[0075] In the above step 301, the detection frame refers to the boundary frame surrounding the photographed object. Figure 4 As shown, when the photographed object is a person, the dotted boundary box surrounding the person is the detection box. The detection box in the image can be determined by an algorithm based on a deep neural network or an algorithm based on a regional convolutional neural network, which is not specifically limited in the embodiment of the present invention.

[0076] In the above step 302, the base image refers to the background image of the shooting scene. Figure 1 As shown, Figure 1The box represents the shooting scene, and the background image with the same coverage as the shooting scene is the base map. In the actual implementation process, the shooting scene without the shooting object can be photographed at different angles by a handheld shooting device, so as to obtain images with different perspectives. By splicing these images with different shooting perspectives, a base map can be obtained. Among them, these images with different perspectives can cover the entire shooting scene. In the actual implementation process, the SURF algorithm, the FAST algorithm or the random sample consistency algorithm can be used to splice images with different perspectives, and the embodiment of the present invention does not specifically limit this.

[0077] When mapping the detection frame to the base map, a pixel mapping method can be used. Specifically, for a certain detection frame, the detection frame actually selects the image content corresponding to the photographed object in the original image. And mapping the detection frame to the base map actually requires mapping the image content corresponding to the photographed object to the base map. Therefore, mapping each pixel in the image content corresponding to the photographed object to the base map is equivalent to mapping the detection frame to the base map. In the actual implementation process, the pixel transformation matrix between the original image and the base map can be determined first, and then the pixel in the base map can be determined based on the pixel transformation matrix and the position coordinates of the pixel in the original image. Through the above process, each detection frame in each image should be mapped to the base map, and the detection frame contains the image content composed of the mapped pixels.

[0078] From the above embodiments, it can be seen that although the base image can actually be composed of multiple images without the subject, the base image as a whole image can actually be abstracted as a picture taken by a certain shooting device at a certain shooting angle. Therefore, the position of the shooting device that took the base image and the shooting angle used can be known. The original image selected by the detection frame is actually also taken by a certain shooting device at a certain shooting angle, so the position of the shooting device that took the original image and the shooting angle used can be known.

[0079] Under the premise that both of the above can be known, for a certain camera device that shoots the original image, the rotation extrinsic parameter matrix of the two cameras, that is, the pixel transformation matrix, can be determined based on the location of the camera device and the shooting angle used, and the location of the camera device that shoots the base map and the shooting angle used. For a certain detection frame and the image content selected by the detection frame in the original image frame, if it is necessary to map the pixels of the image content to the base map, that is, to determine the position coordinates of the pixel in the base map, the position coordinates of the pixel in the base map can be calculated based on the pixel transformation matrix between the camera device corresponding to the detection frame and the camera device that shoots the base map, as well as the position coordinates of the pixel in the original image.

[0080] like Figure 1As shown, in the monitoring scene, different shooting devices have overlapping monitoring areas. As a result, there may be a situation where the same shooting object is photographed by multiple shooting devices at the same time. This will result in that after each detection frame in each image should be mapped to the base map, for the same shooting object, there may be more than two detection frames of the shooting object in the base map. Since the total number of shooting objects in the shooting scene needs to be determined based on the total number of detection frames in the base map in the subsequent process, the above situation may cause the same shooting object to be counted repeatedly. Therefore, in the above step 302, it is also necessary to delete the detection frames that are repeatedly detected in the base map. Among them, the "repeated detection" here mainly refers to the same shooting object being photographed by different shooting devices, thereby deriving multiple detection frames for the same shooting object, and these detection frames only correspond to different shooting angles.

[0081] Before deleting the detection frames of repeated detection in the base map, the detection frames of repeated detection in the base map can be determined first. The embodiment of the present invention does not specifically limit the method of determining the detection frames of repeated detection in the base map, including but not limited to: calculating the similarity between every two detection frames in the base map, and for two detection frames whose similarity is greater than a fourth preset threshold, deleting one of the detection frames in the two detection frames. Among them, two detection frames whose similarity is greater than the fourth preset threshold can indicate that there is a detection frame of repeated detection in the two detection frames. In addition, the image similarity between the image contents respectively contained in the two detection frames in the base map can be calculated as the similarity between the two detection frames. Further, the mean square error, structural similarity or peak signal-to-noise ratio can be calculated as the image similarity, which is not specifically limited in the embodiment of the present invention.

[0082] After the detection frames that are repeatedly detected in the base image are deleted in step 302, in step 303, the total number of detection frames in the base image can be directly used as the total number of objects in the shooting scene.

[0083] The method provided by the embodiment of the present invention obtains the images captured by each shooting device at the same time of the same shooting scene, and determines the detection frame in each image. The detection frame in each image is mapped to the base map corresponding to the shooting scene, and the detection frames detected repeatedly in the base map are deleted. According to the total number of detection frames in the base map, the total number of shooting objects in the shooting scene is determined. Since after mapping the detection frames in the image to the base map, the detection frames detected repeatedly in the base map can be deleted, it is possible to avoid the shooting objects captured by multiple cameras at the same time from being counted multiple times, thereby improving the accuracy of the counting results.

[0084] The content of the above embodiment is mainly aimed at: the overlapping area where multiple shooting devices exist, and the shooting object located in the overlapping area will be photographed multiple times to form multiple detection frames, which will be counted multiple times and cause inaccurate counting. In the actual implementation process, in addition to the above situation, it may also appear that the same shooting object is marked multiple times in the image captured by a certain shooting device, that is, multiple detection frames are detected for the same shooting object in the image. In response to this problem, combined with the content of the above embodiment, in one embodiment, before mapping the detection frame in each image to the base map corresponding to the shooting scene, it also includes: deleting the same type of detection frames that are repeatedly detected in each image.

[0085] The detection frame may be of different types. The embodiment of the present invention does not specifically limit the types of the detection frame, including but not limited to the head-shoulder frame and the body frame. The shapes and distributions of the head-shoulder frame and the body frame can be specifically referred to in Figure 5 , the head and shoulders frame refers to a detection frame that selects the head and shoulders of a human body, and the body frame refers to a detection frame that selects the entire body of a human body. It should be noted that the reason why the detection frame in the embodiment of the present invention includes the head and shoulders frame and the body frame is that the use of a single type of detection frame is likely to miss the photographed object, resulting in a smaller number of subsequent counts and insufficient accuracy, and the use of two detection frames can improve the error tolerance rate. Of course, in the actual implementation process, there can be only one type of detection frame, such as only a body frame.

[0086] For the same photographed object, there may be repeated detection frames of the same type. For example, taking the body frame as an example, Figure 6 As shown in the figure, for the same photographed object, three body frames are marked. Similarly, for the same photographed object, multiple head and shoulder frames may appear. Therefore, it is necessary to delete the same type of detection frames that are repeatedly detected in each image.

[0087] Specifically, if the detection frame includes two types, the head and shoulder frame and the body frame, then the head and shoulder frame detected repeatedly in each image can be deleted, and the body frame detected repeatedly can be deleted. For ease of description, each type of detection frame in each image can be grouped into a detection frame subset of each type. Taking the example that the detection frame includes two types, the head and shoulder frame and the body frame, for a certain image, the head and shoulder frames in the image can form a head and shoulder frame subset, and the body frames in the image can form a body frame subset. For any type of detection frame subset corresponding to any image, the embodiment of the present invention does not specifically limit the method of deleting the detection frames detected repeatedly in the detection frame subset, see Figure 7 , including but not limited to:

[0088] 701. Determine a detection frame with the highest confidence in the detection frame subset, add the detection frame with the highest confidence to the output set, and delete the detection frame with the highest confidence from the detection frame subset;

[0089] 702. Calculate an intersection-over-union ratio between each remaining detection frame in the detection frame subset and the detection frame with the highest confidence, and delete detection frames whose intersection-over-union ratios are greater than a fifth preset threshold from the detection frame subset;

[0090] 703. Repeat the steps 701 and 702 until the detection box subset is empty.

[0091] Among them, the detection frame in the output set is the detection frame remaining after deleting the detection frames of the same type that are detected repeatedly in the detection frame subset. In addition, the confidence of the detection frame can be obtained together when the detection frame in the image is detected. The intersection-union ratio mainly refers to the ratio between the area of ​​the intersection area between two detection frames and the area of ​​the union area. It should be noted that in addition to the above-mentioned method, other methods can be used to delete the detection frames of the same type that are detected repeatedly in the actual implementation process. For example, the image similarity between the partial images selected by each two detection frames of the detection frame subset in the original image can be calculated. If the image similarity between two detection frames is greater than the sixth preset threshold, one of the two detection frames can be deleted.

[0092] The method provided by the embodiment of the present invention can delete the same type of detection frames that are repeatedly detected in each image before mapping the detection frames in the image to the base map, thereby avoiding the subsequent counting of multiple times of the photographed objects that are marked multiple times in each image, thereby improving the accuracy of the counting results.

[0093] The process of the above embodiment is mainly to delete the same type of detection frames in each image. In the case of only one type of detection frame, the above step 302 can be directly executed, that is, the detection frame of each image is mapped to the base map corresponding to the shooting scene. In the case of multiple types of detection frames, if the different types of detection frames are not merged, the same shooting object will correspond to multiple types of detection frames, which will cause the shooting object to be counted repeatedly when the total number of shooting objects is determined based on the total number of detection frames. Figure 8 As shown, under the premise that the subject is a person, the head and shoulder frame of the person behind is relatively close to the body frame, and will be counted twice later, that is, the person behind will be counted twice. To address this problem, combined with the content of the above embodiment, in one embodiment, the method provided by the embodiment of the present invention further includes: merging different types of detection frames in each image after deleting the same type of detection frames that are repeatedly detected in each image.

[0094] Taking the detection frame including the head and shoulder frame and the body frame as an example, for a certain image, the head and shoulder frame and the body frame in the image can be merged. Among them, the merging process mainly includes two points, one is how to determine the merged object, and the other is how to merge. In view of the above two points, taking the detection frame including the head and shoulder frame and the body frame as an example, the embodiment of the present invention does not specifically limit the way to merge different types of detection frames in each image, including but not limited to: for any image, each head and shoulder frame and each body frame in the image form a detection frame pair, and calculate the intersection and union ratio between the two detection frames in each detection frame pair; if there is a detection frame pair whose intersection and union ratio is greater than the seventh preset threshold, then delete the detection frame with a smaller area in the detection frame pair whose intersection and union ratio is greater than the seventh preset threshold.

[0095] Among them, "the detection frame pair with an IoU greater than the seventh preset threshold" is the determined merging object, and "deleting the detection frame with a smaller area in the detection frame pair with an IoU greater than the seventh preset threshold" is the merging method. For example, if the detection frame pair is composed of a head-shoulder frame A and a body frame B, and the IoU between A and B is greater than the seventh preset threshold, the detection frame with a smaller area in A and B can be deleted. For example, if the area of ​​A is smaller than B, the head-shoulder frame A is deleted. If the area of ​​B is smaller than A, the body frame B is deleted. It should be noted that the reason why the above process selects the detection frame pair with an IoU greater than the seventh preset threshold as the merging object is mainly because the IoU is greater than the seventh preset threshold, which can indicate that the two detection frames in the detection frame pair have a large overlap in the framed area in the same image, and thus are likely to target the same photographed object. Therefore, one of the detection frames can be deleted. It should also be noted that the reason why the detection frame with a large area is retained is that the detection frame with a large area will frame more image content, so that the detection frame can be further screened based on the image content framed by the detection frame in the future.

[0096] In addition, the process of “merging different types of detection frames in each image” proposed in the embodiment of the present invention can be performed according to the currently given execution sequence, that is, after “deleting the same type of detection frames that are repeatedly detected in each image”, or before the above-mentioned deletion process, and the embodiment of the present invention does not specifically limit this. In the embodiment of the present invention, the reason why it is performed after the deletion process is that the merging process needs to combine the detection frames in pairs and perform calculations based on the detection frame pairs obtained by the combination. If the same type of detection frames that are repeatedly detected in each image are not deleted first, the number of detection frame pairs that appear in the subsequent merging process will increase, thereby increasing the amount of calculation in the merging process. By performing the deletion process first and then the merging process, the amount of calculation in the merging process can be effectively reduced.

[0097] The method provided by the embodiment of the present invention can merge different types of detection frames in each image before mapping the detection frames in the image to the base map, thereby avoiding the subsequent counting of multiple times of objects marked with multiple types of detection frames in each image, thereby improving the accuracy of the counting results.

[0098] In combination with the contents of the above embodiments, in one embodiment, the embodiment of the present invention does not specifically limit the manner of merging different types of detection frames in each image, including but not limited to: for any image, the detection frames in the image form a detection frame set corresponding to the image, based on a selection condition, a detection frame is selected from the detection frame set corresponding to the image as the detection frame to be matched, the repetition index between the detection frame to be matched and each other detection frame in the detection frame set is calculated, and other detection frames corresponding to the repetition index less than a first preset threshold are deleted from the detection frame set, and the above selection, calculation and deletion process are repeated until the remaining detection frames in the detection frame set are all selected, and the remaining detection frames in the detection frame set are used as the detection frames in the image; wherein the selection condition is that the detection frame remaining in the detection frame set has the largest area and has not been selected, and the repetition index is used to characterize the possibility that two detection frames correspond to the same photographed object.

[0099] Among them, the repetition index can be an intersection-and-union ratio, and the embodiment of the present invention does not specifically limit this. For example, if after the above-mentioned deletion process, there are n detection frames left in a certain image, then the detection frame set corresponding to the image includes n detection frames. Select a detection frame with the largest area (such as a) from the detection frame set as the detection frame to be matched, and calculate the repetition index between the detection frame to be matched and each other detection frame in the detection frame set. If there are three other detection frames whose corresponding repetition indexes are greater than the first preset threshold, it indicates that the three other detection frames may all be aimed at the same photographed object as the detection frame to be matched, so that the three other detection frames can be deleted from the detection frame set. Among them, other detection frames refer to the detection frames other than detection frame a in the detection frame set.

[0100] After deleting the above three other detection frames from the detection frame set, the total number of detection frames in the detection frame set that can be selected for the next round of execution is (n-3-1). Among them, "-3" means that the above three other detection frames are deleted, and "-1" means that detection frame a has been selected. According to the selection conditions, detection frame a cannot be selected as the detection frame with the largest area in the next round of execution. Repeat the above execution process. When the last unselected detection frame in the remaining detection frames in the detection frame set is selected, perform the above calculation and deletion process to complete the above iterative process. At this time, the remaining detection frames in the detection frame set are the final merged results.

[0101] The method provided by the embodiment of the present invention can merge different types of detection frames in each image before mapping the detection frames in the image to the base map, thereby avoiding the subsequent counting of multiple times of objects marked with multiple types of detection frames in each image, thereby improving the accuracy of the counting results.

[0102] In combination with the contents of the above embodiments, in one embodiment, see Fig. 9 The embodiment of the present invention does not specifically limit the method of calculating the repetition index between the detection box to be matched and each other detection box in the detection box set, including but not limited to:

[0103] 901. For any other detection frame, determine an overlapping area between the other detection frame and the detection frame to be matched in the image;

[0104] 902. Calculate the product of the area of ​​the other detection frame and the area of ​​the detection frame to be matched, and use the ratio of the square value of the overlapping area to the product as the repetition index between the detection frame to be matched and the other detection frame.

[0105] It should be noted that, for two detection frames, the above calculation process is equivalent to first calculating the ratio between the overlapping area of ​​the two detection frames and the area of ​​one of the detection frames, then calculating the ratio between the overlapping area of ​​the two detection frames and the area of ​​the other detection frame, and then taking the product of the two ratios as the repetition index between the two detection frames. Among them, the two ratios can each reflect the area ratio of the overlapping area to the area occupied by itself. When the overlapping area of ​​the two detection frames is larger, the two ratios will also be larger. The larger the overlapping area, the more likely it is that the two detection frames correspond to the same photographed object. Therefore, the product between the two ratios can reflect the possibility that the two detection frames correspond to the same photographed object.

[0106] The method provided by the embodiment of the present invention, for any other detection frame, determines the overlapping area between the other detection frame and the detection frame to be matched in the image. The product between the area of ​​the other detection frame and the area of ​​the detection frame to be matched is calculated, and the ratio between the square value of the overlapping area and the product is used as the repetition index between the detection frame to be matched and the other detection frame. Since the larger the overlapping area of ​​two detection frames, the more likely it is that the two detection frames correspond to the same photographed object, and the larger the repetition index can reflect the larger overlapping area of ​​the two detection frames, the detection frames belonging to the same photographed object in different types of detection frames can be accurately merged according to the repetition index.

[0107] In combination with the contents of the above embodiments, in one embodiment, see Fig.10 , the embodiment of the present invention does not specifically limit the method of mapping the detection frame in each image to the base map corresponding to the shooting scene, including but not limited to:

[0108] 1001. Determine an anchor point of each detection frame in each image, and determine the coordinates of the anchor point of each detection frame in the base image;

[0109] 1002. Determine the area where each detection frame is located in the base map according to the coordinates of the anchor point of each detection frame in the base map;

[0110] 1003. Add each detection frame to the base map according to the area where each detection frame is located in the base map.

[0111] In the above step 1001, the anchor point refers to a point that can be used to uniquely determine the position of the detection frame in the base map. Since the detection frame is usually a rectangle, the position and shape of the detection frame in the base map can be determined by determining the positions of the two diagonal vertices in the base map. Therefore, the two diagonal vertices of the detection frame can be used as anchor points. In addition, the center point of the detection frame can also be used as an anchor point. After determining the length and width of the detection frame, and then determining the position of the center point of the detection frame in the base map, the position and shape of the detection frame in the base map can be determined. In addition, the coordinates of the anchor point of each detection frame in the base map can be determined by the above-mentioned pixel transformation matrix and the position coordinates of the anchor point in the original image. The specific process can refer to the content of the above-mentioned embodiment, which will not be repeated here.

[0112] In the above step 1002, taking the anchor point as the center point as an example, the position coordinates of the anchor point in the base map can be determined by the above method. The length and width of the detection frame can be known, so based on the position coordinates of the center point of the detection frame in the base map and the length and width of the detection frame, the area where the detection frame is located in the base map can be determined, that is, the position coordinates of the detection frame in the base map can be determined.

[0113] In the above step 1003, each detection frame in each image can be added to the base map according to the area where each detection frame in each image is located in the base map. In the embodiment of the present invention, adding the detection frame to the base map does not only add the "rectangular frame" to the base map, but also adds the part of the image selected by the detection frame in the original image.

[0114] It should be noted that the detection box is restored 1:1 when it is mapped to the base map, and when the part of the image selected by the detection box in the original image is added to the base map, it is also restored 1:1, that is, the part of the image selected by the detection box in the original image is moved to the base map without change.

[0115] It should also be noted that, for the partial image selected by the detection frame in the original image, in the related art, each pixel in the partial image is mapped to the base map, which will cause the photographed object to be deformed in the base map and cannot be detected. In addition, if different shooting devices have different shooting angles and the shooting ranges actually overlap, the images captured by different shooting devices actually have overlapping areas. If there is a photographed object in the overlapping area, after the detection frames of the photographed object in different images are mapped to the base map, the partial images selected in these detection frames will have pixel overlap confusion, thereby affecting the detection process of the photographed object, and further may not be able to accurately determine the total number of photographed objects. In the embodiment of the present invention, the detection frame and the partial image selected by the detection frame in the original image are directly added to the base map without change, so that the partial image selected by the detection frame in the original image will not be deformed in the base map. In addition, for the photographed object in the overlapping area, after the detection frames of the photographed object in different images are mapped to the base map, pixel overlap confusion will not be generated.

[0116] The method provided by the embodiment of the present invention determines the anchor point of each detection frame in each image, and determines the coordinates of the anchor point of each detection frame in the base map. According to the coordinates of the anchor point of each detection frame in the base map, the area where each detection frame is located in the base map is determined. According to the area where each detection frame is located in the base map, each detection frame is added to the base map. Since the part of the image selected by the detection frame in the original image will not be deformed in the base map, subsequent detection or comparison with each other is convenient. In addition, for the photographed object in the overlapping area, since the detection frames of the photographed object in different images are mapped to the base map, there will be no pixel overlap and confusion, which can also facilitate subsequent detection or comparison with each other.

[0117] The process mentioned in the above embodiment is mainly to delete the same type of detection frames that are repeatedly detected in each image. At the same time, different types of detection frames in each image are also merged. It can be seen that the above screening process for the detection frame is mainly for the same image. Since different shooting devices may have overlapping areas, the images captured by different shooting devices may include the same shooting object. Therefore, the images captured by different shooting devices may contain detection frames for the same shooting object. Therefore, after mapping the detection frame of each image to the base map, the detection frames from different images but for the same shooting object can also be screened to avoid subsequent repeated counting of the same shooting object. In combination with the content of the above embodiment, in one embodiment, the embodiment of the present invention does not specifically limit the method of deleting the detection frame that is repeatedly detected in the base map, including but not limited to: for all detection frame groups composed of every two detection frames in the base map, if there is a detection frame group whose matching feature meets the preset condition, the detection frame in the detection frame group that meets the preset condition is deleted; wherein the matching feature includes the intersection-over-union ratio between the two detection frames, and the preset condition includes that the intersection-over-union ratio is greater than the second preset threshold.

[0118] Among them, the matching features can also be used to characterize the possibility that two detection frames correspond to the same photographed object. Thus, the matching features may include the intersection-and-union ratio between the two detection frames. For example, if there are m detection frames in the base image, a total of [m*(m-1) / 2] detection frame groups can be combined. If there are detection frame groups that meet the preset conditions among these detection frame groups, the detection frames in the detection frame groups that meet the preset conditions can be deleted. Among them, the deletion method can be to randomly delete a detection frame from each detection frame group that meets the preset conditions, and the embodiments of the present invention do not specifically limit this.

[0119] The method provided by the embodiment of the present invention deletes the detection frames in the detection frame group that meets the preset conditions for all detection frame groups formed by every two detection frames in the base image when there is a detection frame group whose matching features meet the preset conditions. Since the detection frames from different images but for the same photographed object can be screened, the repeated counting of the same photographed object can be avoided in the future.

[0120] The above-mentioned process of deleting the detection frame in the base image is mainly based on the position and shape, that is, the intersection and union ratio included in the matching feature, as a basis for determining whether the two detection frames are for the same photographed object. In the actual implementation process, in addition to the position and shape, other bases can also be used. In combination with the content of the above embodiment, in one embodiment, the matching feature also includes the similarity between the two detection frames; the preset condition also includes that the similarity is greater than a third preset threshold.

[0121] It can be seen from the contents of the above embodiments that when the detection frame is mapped to the base map, it is not only mapped to the base map as a "rectangular frame" in a 1:1 ratio. At the same time, the partial image selected by the detection frame in the original image is also mapped to the base map without change. Based on this, in an embodiment of the present invention, the similarity between two detection frames can be the image similarity between the partial images selected by the two detection frames. Among them, the process of calculating the image similarity can refer to the contents of the above embodiments and will not be repeated here. It should be noted that the reason why the preset condition is set to also include a similarity greater than the third preset threshold is because the greater the similarity, the more similar the partial images selected by the two detection frames are, and thus the two detection frames are more likely to be targeting the same photographed object.

[0122] The method provided by the embodiment of the present invention deletes the detection frames in the detection frame group that meets the preset conditions for all detection frame groups formed by every two detection frames in the base image when there is a detection frame group whose matching features meet the preset conditions. Since the detection frames from different images but for the same photographed object can be screened, the repeated counting of the same photographed object can be avoided in the future.

[0123] In combination with the contents of the above embodiments, in one embodiment, see Fig.11 , the embodiment of the present invention does not specifically limit the calculation process of the similarity between two detection frames, including but not limited to:

[0124] 1101. For any two detection frames, feature points in the images selected by the respective detection frames are extracted to form respective corresponding feature point sets; wherein the images selected by the respective detection frames refer to the partial images selected by the detection frames in the images before mapping;

[0125] 1102. Determine the feature vectors corresponding to any two detection frames according to the feature point sets corresponding to the two detection frames;

[0126] 1103. Determine the similarity between any two detection frames according to the feature vectors corresponding to any two detection frames.

[0127] In the above step 1101, the feature point refers to a point that can represent the outline of the photographed object. Taking the photographed object as a human body as an example, the feature point can refer to Fig.12 The point shown. Fig.12 In the figure, the feature points clearly outline the human body. In addition, the size of the feature points can be set according to the requirements, and the embodiment of the present invention does not specifically limit this. In addition, when the photographed object is a human body, the feature point extraction process is actually the human body key point detection process, which can be implemented using a human body key point detection algorithm.

[0128] In the above step 1102, Fig.12It can be seen that the feature point will cover pixels within a certain range, and the pixels covered by the feature point is a small part of the image, so the image feature vector corresponding to the small part of the image can be used to represent the feature vector of the feature point. Based on this, the feature vector corresponding to each detection frame can be composed of the feature vectors of the feature points in each detection frame. The size of each feature point can be the same, so the dimension of the feature vector of each feature point can also be the same. It should be noted that in the actual implementation process, the feature point sets corresponding to different detection frames may contain the same number of feature points or different numbers of feature points.

[0129] Through the above steps, the feature vector corresponding to each detection frame can be obtained. In this way, the similarity between the feature vectors of the two detection frames can be calculated and used as the similarity between the two detection frames. It should be noted that in the actual implementation process, in the above step 1103, the feature point sets corresponding to different detection frames may contain different numbers of feature points. At this time, the feature vectors used by the two detection frames may have different dimensions. In order to enable the feature vectors of two different dimensions to calculate the similarity, the feature vectors that are missing some content can be padded with 0 to make the two feature vectors have the same dimension.

[0130] The method provided by the embodiment of the present invention, for any two detection frames, respectively extracts feature points in the images selected by the respective frames to form corresponding feature point sets. According to the feature point sets corresponding to the respective two detection frames, the corresponding feature vectors are determined. According to the feature vectors corresponding to the respective two detection frames, the similarity between the two detection frames in the any two detection frames is determined. Since feature points can be extracted to form feature vectors to represent the image contents selected in the detection frames, when calculating the similarity, it is only necessary to calculate the similarity between partial contents, and it is not necessary to calculate the similarity between all image contents, thereby reducing the amount of calculation and improving the operation efficiency.

[0131] Combined with the content of the above embodiment, in one embodiment, the preset condition also includes that the two detection frames come from different images before mapping. It can be seen from the content of the above embodiment that the process of deleting the detection frame is mainly divided into two parts. The first part of the deletion process is "deleting the same type of detection frames that are repeatedly detected in each image" and "merging different types of detection frames in each image", which is mainly to filter the detection frames that come from the same image and may be for the same shooting object. After mapping the detection frame in each image to the base map, it is the second part of the deletion process of the detection frame. This process is mainly to filter the detection frames when different shooting devices shoot the same shooting object. Since each shooting device shoots the same shooting scene at the same time to obtain an image, the above "detection frames of the same shooting object shot by different shooting devices" are actually from different images. Therefore, the second part of the deletion process is mainly to filter the detection frames from different images before mapping. Therefore, the above preset conditions can also include the restriction condition that "the two detection frames come from different images before mapping".

[0132] It should be noted that the reason for adding such a restriction here is that the first part of the deletion process has fully screened the detection frames that come from the same image and may be for the same photographed object. Therefore, in the second part of the deletion process, there is no need to let the detection frames from the same image participate in the similarity calculation. Instead, attention is focused on screening the detection frames from different images, which can reduce the amount of calculation.

[0133] The method provided by the embodiment of the present invention can further limit the preset conditions to also include that the two detection frames come from different images before mapping, thereby avoiding allowing the detection frames from the same image to participate in the similarity calculation, thereby reducing the amount of calculation.

[0134] like Figure 1 As shown, in the actual implementation process, there will be shooting blind spots in the shooting scene that cannot be covered by each camera. Based on the counting method in the related art, it is impossible to count the shooting objects in these shooting blind spots. To solve this problem, combined with the content of the above embodiment, in one embodiment, see Fig.13 The embodiment of the present invention does not specifically limit the method of determining the total number of objects in the shooting scene according to the total number of detection boxes in the base map, including but not limited to:

[0135] 1301. Determine the total shooting area covered by all shooting devices in the base map according to the shooting coverage of each shooting device;

[0136] 1302. Determine the distribution density of the shooting objects in the shooting scene according to the total number of detection frames and the shooting area in the base map;

[0137] 1303. Determine the total number of objects in the shooting scene according to the distribution density and the total area of ​​the base map.

[0138] In the above step 1301, for a certain shooting scene corresponding to the base map, combined with the shooting coverage of each shooting device, the overlapping area of ​​each shooting device and the base map can be determined. Then, the overlapping area of ​​each shooting device is superimposed to obtain the total shooting area covered by all shooting devices in the base map.

[0139] The total number of detection frames in the base map can be obtained from the above embodiment. In the above step 1302, the ratio between the total number and the total shooting area is calculated, which is the distribution density of the shooting objects in the shooting scene. In the above step 1303, the distribution density is multiplied by the total area of ​​the base map to obtain the total number of shooting objects in the shooting scene.

[0140] The method provided by the embodiment of the present invention determines the total shooting area covered by all shooting devices in the base map according to the shooting coverage of each shooting device. The distribution density of the shooting objects in the shooting scene is determined according to the total number of detection frames and the shooting area in the base map. The total number of shooting objects in the shooting scene is determined according to the distribution density and the total area of ​​the base map. Since the number of shooting objects in the shooting blind area can be estimated, it can also be applied in the scene where there is a shooting blind area, and the accuracy rate of counting the shooting objects can be improved.

[0141] It should be understood that although Figure 3 , Figure 7 , Fig. 9 , Fig.10 , Fig.11 and Fig.13 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3 , Figure 7 , Fig. 9 , Fig.10 , Fig.11 and Fig.13 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0142] It should be noted that the technical solutions described above can be implemented as independent embodiments in the actual implementation process, or they can be combined with each other and implemented as a combined embodiment. In addition, when describing the contents of the above embodiments of the present invention, different embodiments are described in a corresponding order based on the idea of ​​convenient description, such as the order of data flow, instead of limiting the execution order between different embodiments. Accordingly, in the actual implementation process, if it is necessary to implement multiple embodiments provided by the present invention, it is not necessary to follow the execution order provided when the embodiments are described by the present invention, but the execution order between different embodiments can be arranged according to the needs.

[0143] In combination with the contents of the above embodiments, in one embodiment, Fig.14 As shown, a device for counting photographed objects is provided, comprising: an acquisition module 1401, a first determination module 1402, a mapping module 1403, a first deletion module 1404 and a second determination module 1405, wherein:

[0144] An acquisition module 1401 is used to acquire images captured by each shooting device at the same time for the same shooting scene;

[0145] A first determination module 1402, configured to determine a detection frame in each image;

[0146] A mapping module 1403, used to map the detection frame in each image to a base map corresponding to the shooting scene;

[0147] A first deleting module 1404 is used to delete the detection boxes of repeated detections in the base map;

[0148] The second determining module 1405 is used to determine the total number of objects in the shooting scene according to the total number of detection frames in the base image.

[0149] In one embodiment, the apparatus further comprises:

[0150] The second deleting module is used to delete the same type of detection frames that are repeatedly detected in each image.

[0151] In one embodiment, the apparatus further comprises:

[0152] The merging module is used to merge different types of detection frames in each image.

[0153] In one embodiment, a merging module is used to, for any image, form a detection frame set corresponding to the image from the detection frames in the image, select a detection frame from the detection frame set corresponding to the image as the detection frame to be matched based on a selection condition, calculate a repetition index between the detection frame to be matched and each other detection frame in the detection frame set, delete other detection frames corresponding to the repetition index greater than a first preset threshold from the detection frame set, repeat the above selection, calculation and deletion process until the remaining detection frames in the detection frame set have been selected, and use the remaining detection frames in the detection frame set as the detection frames in the image; wherein the selection condition is that the detection frame remaining in the detection frame set has the largest area and has not been selected, and the repetition index is used to characterize the possibility that two detection frames correspond to the same photographed object.

[0154] In one embodiment, a merging module is used to determine, for any other detection frame, an overlapping area between the other detection frame and the detection frame to be matched in the image; calculate the product between the area of ​​the other detection frame and the area of ​​the detection frame to be matched, and use the ratio between the square value of the overlapping area and the product as the repetition index between the detection frame to be matched and the other detection frame.

[0155] In one embodiment, the mapping module 1403 is used to determine the anchor point of each detection box in each image, and determine the coordinates of the anchor point of each detection box in the base map; determine the area where each detection box is located in the base map according to the coordinates of the anchor point of each detection box in the base map; and add each detection box to the base map according to the area where each detection box is located in the base map.

[0156] In one embodiment, the first deletion module 1404 is used to delete the detection frames in the detection frame groups that meet the preset conditions for all detection frame groups consisting of every two detection frames in the base image, if there is a detection frame group whose matching features meet the preset conditions; wherein the matching features include the intersection-and-union ratio between the two detection frames, and the preset conditions include the intersection-and-union ratio being greater than a second preset threshold.

[0157] In one embodiment, the matching feature further includes the similarity between the two detection frames; the preset condition further includes the similarity being greater than a third preset threshold.

[0158] In one embodiment, the apparatus further comprises:

[0159] The calculation module is used to extract the feature points in the images selected by each of the two detection frames to form their corresponding feature point sets; wherein the images selected by each of the detection frames refer to the partial images selected by the detection frames in the images before mapping; according to the feature point sets corresponding to each of the two detection frames, the corresponding feature vectors are determined; according to the feature vectors corresponding to each of the two detection frames, the similarity between the two detection frames in any two detection frames is determined.

[0160] In one embodiment, the second determination module 1405 is used to determine the total shooting area covered by all shooting devices in the base map according to the shooting coverage of each shooting device; determine the distribution density of the shooting objects in the shooting scene according to the total number of detection frames and the shooting area area in the base map; determine the total number of shooting objects in the shooting scene according to the distribution density and the total area of ​​the base map.

[0161] The device provided by the embodiment of the present invention obtains images captured by each shooting device at the same time for the same shooting scene, and determines the detection frame in each image. The detection frame in each image is mapped to the base map corresponding to the shooting scene, and the detection frames detected repeatedly in the base map are deleted. According to the total number of detection frames in the base map, the total number of shooting objects in the shooting scene is determined. Since after mapping the detection frames in the image to the base map, the detection frames detected repeatedly in the base map can be deleted, it is possible to avoid the shooting objects simultaneously captured by multiple cameras from being counted multiple times, thereby improving the accuracy of the counting results.

[0162] For the specific definition of the photographed object counting device, please refer to the definition of the photographed object counting method above, which will not be repeated here. Each module in the above-mentioned photographed object counting device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0163] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.15 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset thresholds. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for counting photographed objects is implemented.

[0164] Those skilled in the art will understand that Fig.15The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0165] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0166] Obtain images captured by each shooting device for the same shooting scene at the same time, and determine a detection frame in each image;

[0167] Map the detection frame in each image to the base map corresponding to the shooting scene, and delete the detection frames that are repeatedly detected in the base map;

[0168] According to the total number of detection frames in the base image, the total number of objects in the shooting scene is determined.

[0169] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0170] Delete the same type of detection boxes that are detected repeatedly in each image.

[0171] In one embodiment, there are at least two types of detection frames; accordingly, when the processor executes the computer program, the following steps are also implemented:

[0172] Merge different types of detection boxes in each image.

[0173] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0174] For any image, a detection frame set corresponding to the image is composed of the detection frames in the image. Based on the selection condition, a detection frame is selected from the detection frame set corresponding to the image as the detection frame to be matched, and the repetition index between the detection frame to be matched and each other detection frame in the detection frame set is calculated. Other detection frames corresponding to the repetition index greater than a first preset threshold are deleted from the detection frame set, and the above selection, calculation and deletion processes are repeated until the remaining detection frames in the detection frame set are all selected, and the remaining detection frames in the detection frame set are used as the detection frames in the image; wherein the selection condition is that the detection frame remaining in the detection frame set has the largest area and has not been selected, and the repetition index is used to characterize the possibility that two detection frames correspond to the same photographed object.

[0175] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0176] For any other detection frame, determining the overlapping area between the other detection frame and the detection frame to be matched in the image;

[0177] The product of the area of ​​the other detection frame and the area of ​​the detection frame to be matched is calculated, and the ratio between the square value of the overlapping area and the product is used as the repetition index between the detection frame to be matched and the other detection frame.

[0178] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0179] Determine the anchor point of each detection box in each image, and determine the coordinates of the anchor point of each detection box in the base map;

[0180] According to the coordinates of the anchor point of each detection frame in the base map, determine the area where each detection frame is located in the base map;

[0181] Each detection box is added to the base map according to the area where each detection box is located in the base map.

[0182] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0183] For all detection frame groups consisting of every two detection frames in the base image, if there is a detection frame group whose matching features meet the preset conditions, the detection frames in the detection frame group that meet the preset conditions are deleted; wherein the matching features include the intersection-and-union ratio between the two detection frames, and the preset conditions include the intersection-and-union ratio being greater than a second preset threshold.

[0184] In one embodiment, when the processor executes the computer program, the matching feature further includes the similarity between the two detection frames; and the preset condition further includes the similarity being greater than a third preset threshold.

[0185] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0186] For any two detection frames, feature points in the images selected by each detection frame are extracted to form their corresponding feature point sets; the images selected by each detection frame refer to the parts of the images selected by the detection frame in the image before mapping;

[0187] According to the feature point sets corresponding to any two detection frames, the corresponding feature vectors are determined;

[0188] According to the feature vectors corresponding to any two detection frames, the similarity between any two detection frames is determined.

[0189] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0190] According to the shooting coverage of each shooting device, determine the total shooting area covered by all shooting devices in the base map;

[0191] Determine the distribution density of the objects in the shooting scene according to the total number of detection frames and the area of ​​the shooting area in the base map;

[0192] The total number of objects in the shooting scene is determined based on the distribution density and the total area of ​​the base map.

[0193] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0194] Obtain images captured by each shooting device for the same shooting scene at the same time, and determine a detection frame in each image;

[0195] Map the detection frame in each image to the base map corresponding to the shooting scene, and delete the detection frames that are repeatedly detected in the base map;

[0196] According to the total number of detection frames in the base image, the total number of objects in the shooting scene is determined.

[0197] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0198] Delete the same type of detection boxes that are detected repeatedly in each image.

[0199] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0200] Merge different types of detection boxes in each image.

[0201] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0202] For any image, a detection frame set corresponding to the image is composed of the detection frames in the image. Based on the selection condition, a detection frame is selected from the detection frame set corresponding to the image as the detection frame to be matched, and the repetition index between the detection frame to be matched and each other detection frame in the detection frame set is calculated. Other detection frames corresponding to the repetition index greater than a first preset threshold are deleted from the detection frame set, and the above selection, calculation and deletion processes are repeated until the remaining detection frames in the detection frame set are all selected, and the remaining detection frames in the detection frame set are used as the detection frames in the image; wherein the selection condition is that the detection frame remaining in the detection frame set has the largest area and has not been selected, and the repetition index is used to characterize the possibility that two detection frames correspond to the same photographed object.

[0203] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0204] For any other detection frame, determining the overlapping area between the other detection frame and the detection frame to be matched in the image;

[0205] The product of the area of ​​the other detection frame and the area of ​​the detection frame to be matched is calculated, and the ratio between the square value of the overlapping area and the product is used as the repetition index between the detection frame to be matched and the other detection frame.

[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0207] Determine the anchor point of each detection box in each image, and determine the coordinates of the anchor point of each detection box in the base map;

[0208] According to the coordinates of the anchor point of each detection frame in the base map, determine the area where each detection frame is located in the base map;

[0209] Each detection box is added to the base map according to the area where each detection box is located in the base map.

[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0211] For all detection frame groups consisting of every two detection frames in the base image, if there is a detection frame group whose matching features meet the preset conditions, the detection frames in the detection frame group that meet the preset conditions are deleted; wherein the matching features include the intersection-and-union ratio between the two detection frames, and the preset conditions include the intersection-and-union ratio being greater than a second preset threshold.

[0212] In one embodiment, when the computer program is executed by a processor, the matching feature further includes the similarity between the two detection frames; and the preset condition further includes the similarity being greater than a third preset threshold.

[0213] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0214] For any two detection frames, feature points in the images selected by each detection frame are extracted to form their corresponding feature point sets; the images selected by each detection frame refer to the parts of the images selected by the detection frame in the image before mapping;

[0215] According to the feature point sets corresponding to any two detection frames, the corresponding feature vectors are determined;

[0216] According to the feature vectors corresponding to any two detection frames, the similarity between any two detection frames is determined.

[0217] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0218] According to the shooting coverage of each shooting device, determine the total shooting area covered by all shooting devices in the base map;

[0219] Determine the distribution density of the objects in the shooting scene according to the total number of detection frames and the area of ​​the shooting area in the base map;

[0220] The total number of objects in the shooting scene is determined based on the distribution density and the total area of ​​the base map.

[0221] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0222] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0223] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for counting photographed objects, It is characterized in that The method comprises: Obtain images captured by each shooting device at the same time for the same shooting scene, determine the detection frame in each image, delete the same type of detection frames that are repeatedly detected in each image, and merge different types of detection frames for the same shooting object in each image; Mapping the detection frame in each image to the base map corresponding to the shooting scene, for all detection frame groups consisting of every two detection frames in the base map, if there is a detection frame group whose matching features meet the preset conditions, deleting the detection frames in the detection frame group that meet the preset conditions; The total number of objects in the shooting scene is determined according to the total number of detection frames in the base image.

2. The method according to claim 1, It is characterized in that The merging of different types of detection frames in each image includes: For any image, a detection frame set corresponding to the any image is composed of the detection frames in the any image, and based on a selection condition, a detection frame is selected from the detection frame set corresponding to the any image as a detection frame to be matched, and a repetition index between the detection frame to be matched and each other detection frame in the detection frame set is calculated, and other detection frames corresponding to repetition indexes greater than a first preset threshold are deleted from the detection frame set, and the above selection, calculation and deletion processes are repeated until the remaining detection frames in the detection frame set are all selected, and the remaining detection frames in the detection frame set are used as the detection frames in the any image; wherein the selection condition is that the remaining detection frames in the detection frame set have the largest area and have not been selected, and the repetition index is used to characterize the possibility that two detection frames correspond to the same photographed object.

3. The method according to claim 2, It is characterized in that The calculating the repetition index between the to-be-matched detection frame and each other detection frame in the detection frame set includes: For any other detection frame, determining an overlapping area between the any other detection frame and the detection frame to be matched in the any image; The product of the area of ​​any other detection frame and the area of ​​the detection frame to be matched is calculated, and the ratio between the square value of the overlapping area and the product is used as the repetition index between the detection frame to be matched and any other detection frame.

4. The method according to any one of claims 1 to 3, It is characterized in that Mapping the detection frame in each image to a base map corresponding to the shooting scene includes: Determine the anchor point of each detection box in each image, and determine the coordinates of the anchor point of each detection box in the base map; Determine the region where each detection frame is located in the base map according to the coordinates of the anchor point of each detection frame in the base map; Each detection box is added to the base map according to the area where each detection box is located in the base map.

5. The method according to claim 1, It is characterized in that The matching feature also includes the similarity between the two detection frames; the preset condition also includes the similarity being greater than a third preset threshold.

6. The method according to claim 5, It is characterized in that The similarity calculation process includes: For any two detection frames, feature points in the images selected by each detection frame are extracted to form their corresponding feature point sets; the images selected by each detection frame refer to the parts of the images selected by the detection frame in the image before mapping; Determine the feature vectors corresponding to the two detection frames according to the feature point sets corresponding to the two detection frames; Determine the similarity between two detection frames in the arbitrary two detection frames according to the feature vectors corresponding to the arbitrary two detection frames.

7. The method according to any one of claims 1 to 3, It is characterized in that Determining the total number of objects in the shooting scene according to the total number of detection frames in the base map includes: Determine the total shooting area covered by all shooting devices in the base map according to the shooting coverage of each shooting device; Determine the distribution density of the shooting object in the shooting scene according to the total number of detection frames in the base map and the area of ​​the shooting region; The total number of photographing objects in the photographing scene is determined according to the distribution density and the total area of ​​the base map.

8. A device for counting photographed objects, It is characterized in that The device comprises: An acquisition module is used to acquire images captured by each shooting device at the same time for the same shooting scene; A first determination module, used to determine a detection frame in each image; The second deletion module is used to delete the same type of detection frames that are repeatedly detected in each image; A merging module, used for merging different types of detection frames for the same photographed object in each image; A mapping module, used to map the detection frame in each image to a base map corresponding to the shooting scene; A first deleting module is used to delete the detection frames in the detection frame group that meets the preset condition if there is a detection frame group whose matching features meet the preset condition for all detection frame groups formed by every two detection frames in the base image; The second determination module is used to determine the total number of shooting objects in the shooting scene according to the total number of detection frames in the base map.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Pedestrian flow monitoring method based on pedestrian detection and tracking

    CN103425967A

  • Three-dimensional human face image generation method and system

    CN104809687A

  • Image generation method, neural network training method and device and electronic equipment

    CN109727264A

  • Pedestrian mask and three-dimensional scene fusion display method, terminal and storage medium

    CN111563516A

  • Human body multi-part detection box association method and device, electronic device and storage medium

    CN112507786A