Object number determination method and device, equipment and storage medium
By shooting video data from the first perspective and identifying the activity trajectory and buffer area of the target object, the problems of low accuracy of people statistics and frequent jumps in the prior art are solved, and more accurate and reliable people statistics are achieved.
Patent Information
- Application Number
- CN202311048598.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-02-21
AI Technical Summary
The existing number of people statistics schemes deal with the situation where the human body blocks each other and the body frequently moves around the mixing line, resulting in a decrease in the accuracy of the number of people statistics, and the number of people statistics results are prone to frequent jumps.
By obtaining the video data captured from the first perspective, the activity trajectory of the target object is identified, and the buffer area is identified as the critical area between the object statistical area and the non-object statistical area in the video screen, and the position relationship between the activity trajectory and the buffer area is determined in the video screen. , accurately determine the number of objects in the object statistics area.
It improves the accuracy of determining the number of objects, avoids the reduction in the accuracy of the number of people statistics and frequent jumps in the results, and enhances the reliability of the number of people statistics.
Smart Images

Figure CN119495047A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a method, device, equipment and storage medium for determining the number of objects. Background Art
[0002] Crowd statistics are indispensable data in many scenarios. For example, in offline events, it is necessary to control the number of people in the venue to prevent the number of people in the venue from exceeding the upper limit. For another example, in places such as stations, from a security perspective, it is also necessary to count the number of people entering the station.
[0003] At present, when counting people, a line is usually set in the offline scene, and then the positional relationship between the human body and the line is determined to count the number of people in the scene. However, the existing people counting scheme, on the one hand, will cause inaccurate human body detection due to mutual occlusion between human bodies, thus affecting the accuracy of the number of people counted; on the other hand, when the human body frequently moves near the line, it is likely to cause inaccurate recognition of the positional relationship between the human body and the line, which will also affect the accuracy of the number of people counted.
[0004] In view of this, a more accurate people counting solution is currently needed. Summary of the invention
[0005] In view of this, one or more embodiments of the present disclosure provide a method, apparatus, device, and storage medium for determining the number of objects, which can improve the accuracy of determining the number of objects.
[0006] On one hand, the present disclosure provides a method for determining the number of objects, the method comprising: acquiring video data shot at a first perspective, and identifying a target object to be tracked from a video screen represented by the video data; determining an activity trajectory of the target object in the video screen; identifying a buffer area from the video screen, the buffer area being used to represent a critical area between an object statistical area and a non-object statistical area; and determining the number of objects in the object statistical area according to a positional relationship between the activity trajectory and the buffer area.
[0007] On the other hand, the present disclosure further provides a device for determining the number of objects, the device comprising: an object recognition unit, used to obtain video data shot from a first perspective, and identify a target object to be tracked from a video screen represented by the video data; a trajectory determination unit, used to determine an activity trajectory of the target object in the video screen; a buffer area recognition unit, used to identify a buffer area from the video screen, the buffer area being used to represent a critical area between an object statistical area and a non-object statistical area; and an object quantity determination unit, used to determine the number of objects in the object statistical area according to a positional relationship between the activity trajectory and the buffer area.
[0008] On the other hand, the present disclosure further provides an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the above-mentioned method for determining the number of objects is implemented.
[0009] On the other hand, the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the above-mentioned method for determining the number of objects is implemented.
[0010] The technical solution provided by one or more embodiments of the present disclosure can identify the target object in the video screen by analyzing the video data shot at a first viewing angle. In the present application, the video screen is shot at a first viewing angle so that the human bodies in the video screen will not block each other. Therefore, the corresponding target object can be accurately identified by analyzing the video data shot at the first viewing angle. In order to accurately count the number of objects in the object statistical area, a buffer area in the video screen can be identified. Different from conventional line crossings, the buffer area has a larger determination interval. By identifying the positional relationship between the target object's activity trajectory and the buffer area, it can be accurately determined whether the target object has entered the object statistical area, thereby improving the accuracy of determining the number of objects in the object statistical area. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The features and advantages of the embodiments of the present disclosure may be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:
[0012] Figure 1 A schematic diagram of counting the number of people by mixing wires in the related art is shown;
[0013] Figure 2 A schematic diagram of the steps of a method for determining the number of objects in one embodiment of the present disclosure is shown;
[0014] Figure 3(a) shows a schematic diagram of shooting angle of view in the related art;
[0015] Figure 3 (b) is a schematic diagram showing a shooting viewing angle in one embodiment of the present disclosure;
[0016] Figure 4 A schematic diagram showing the identification of a buffer area in a computer room in one embodiment of the present disclosure is shown;
[0017] Figure 5 A schematic diagram showing an irregular buffer area in one embodiment of the present disclosure is shown;
[0018] Figure 6 A simplified schematic diagram of dividing the boundaries of the buffer area of a computer room in one embodiment of the present disclosure is shown;
[0019] Figure 7 A schematic diagram showing a target object entering a computer room in one embodiment of the present disclosure is shown;
[0020] Figure 8 A schematic diagram showing a target object leaving a computer room in one embodiment of the present disclosure is shown;
[0021] Fig. 9 A schematic diagram of functional modules of a device for determining the number of objects in one embodiment of the present disclosure is shown;
[0022] Fig.10 A schematic structural diagram of an electronic device in one embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0024] In related technologies, cameras are usually deployed in scenes where people need to be counted, and real-time video of the scene is collected through the cameras. The human body in the video can be identified through object recognition algorithms. In addition, a trip wire is set in the scene, and by judging the positional relationship between the human body and the trip wire, it can be determined whether the human body has crossed the trip wire. For example, Figure 1 In the example, if a person crosses the mixing line from left to right and enters the object counting area on the right, the number of people in the object counting area can be increased. Similarly, if a person crosses the mixing line from right to left and leaves the object counting area on the right, the number of people in the object counting area can be reduced.
[0025] However, in actual applications, there may be occlusions between human bodies in the captured video, which will affect the tracking of human activity trajectories, and the accuracy of human body detection will directly affect the subsequent judgment of the positional relationship between the human body and the line, which will lead to errors in the counting of people. In addition, human activities are accompanied by a large degree of randomness. Some human bodies may move back and forth near the line. According to the relevant counting scheme, the number of people counted in this case will jump frequently, and the probability of errors in the counting of people will increase.
[0026] In view of this, an embodiment of the present disclosure provides a method for determining the number of objects, see Figure 2 , the method includes the following steps.
[0027] S1: Obtain video data shot at a first viewing angle, and identify a target object to be tracked from a video screen represented by the video data.
[0028] In this embodiment, in order to solve the problem of human bodies blocking each other, the shooting angle of the video data can be adjusted. The adjusted shooting angle can be used as the first perspective. In the video image shot at the first perspective, there is usually no situation where human bodies block each other.
[0029] In practical applications, the first viewing angle can be defined by the angle between the shooting viewing angle and the reference plane. The reference plane can be the plane where the target object moves, for example, the reference plane can be the floor of an indoor room, or the ground plane of an outdoor room. In order to prevent different human bodies in the video from blocking each other, the angle between the shooting viewing angle and the reference plane can be close to 90°, so that the shooting viewing angle and the reference plane of the human body are approximately perpendicular to each other. For example Figure 3 (a) shows the angle between the conventional shooting angle and the ground, which is usually between 0° and 60°. Figure 3 (b) shows the angle between the shooting angle of view and the ground in this embodiment, which is usually between 60° and 90°. Of course, depending on the specific application scenario and the camera deployment height, the angle between the shooting angle of view and the reference plane can be flexibly set, as long as different human bodies do not block each other in the video image captured at the first viewing angle.
[0030] In this embodiment, after acquiring the video data shot at the first perspective, an object recognition algorithm can be used to identify the target object to be tracked from the video screen represented by the video data. The target object to be tracked can be any human body in the video screen. Of course, in some scenarios, the target object is not limited to the human body. For example, in some scenarios, it is necessary to count the number of pets in a certain area, so the target object to be tracked can be the pet in the video screen.
[0031] Considering that the existing object recognition algorithms are usually unable to accurately recognize the video images in the first perspective, in this embodiment, it is necessary to improve the object recognition algorithm in the first perspective. Specifically, the object recognition model in the first perspective can be trained by machine learning.
[0032] In one embodiment, an image training sample taken at a first viewing angle may be obtained, and the position of the target object to be identified may be marked in the image training sample. The target object in the image training sample may be marked by a detection frame, which may be a circumscribed rectangular frame that can accommodate the target object. The position of the target object may be represented by the vertex coordinates of the detection frame.
[0033] In this embodiment, after obtaining the image training samples with marked positions, the image training samples can be input into the object recognition model to be trained, and the predicted position of the target object can be output by the object recognition model. The predicted position can also be expressed as the vertex coordinates of the predicted detection frame. In this way, by calculating the error between the predicted position and the marked accurate position, the error can be used to correct the above-mentioned object recognition model. Through the training of a large number of image training samples, an object recognition model suitable for the first perspective can be finally obtained.
[0034] In the actual model training process, the above-mentioned object recognition model can flexibly adopt different model structures according to the needs. For example, in order to better identify and detect human features in different postures, the model structure of YOLOv8 can be used to implement the object recognition model. In addition, in the feature extraction layer of the YOLOv8 model structure, the FPN (Feature Pyramid Networks) structure can be added to downsample the image training samples in different dimensions, and generate fused features corresponding to the downsampled multi-dimensional features, so that the fused features can include both deep and shallow features, thereby being able to more accurately identify the target object in the first perspective.
[0035] In addition, when constructing image training samples, in order to expand the diversity of samples, Mosaic or Mixup can be used to perform data enhancement operations on existing image training samples to generate new image samples. For example, taking the Mosaic method as an example, 4 existing image training samples can be selected, and a part of the regional image can be cut out from each of the selected image training samples, and the cut regional images can be synthesized into new image training samples.
[0036] In the training process of the object recognition model, in order to avoid overfitting, label smoothing can be introduced in the process of generating error information, thereby enhancing the generalization ability of the object recognition model.
[0037] S3: Determine the activity track of the target object in the video picture.
[0038] In this embodiment, after the video screen in the first viewing angle is recognized, the target object recognized in the video screen can be represented by a detection frame. In the same video screen, different detection frames can have different detection frame identifiers, and in different video screens, for the same target object, the detection frame of the target object can have the same detection frame identifier. In this way, by recognizing the detection frame identifiers in different video screens, the activity track of a certain target object in different video screens can be obtained.
[0039] Specifically, for any frame of video, the target area where the detection frame of the target object is located in the video can be identified, and the target area can be represented by the vertex coordinates of the detection frame. Subsequently, in order to reduce the amount of data to be processed, the equivalent position of the target object in the video can be generated based on the target area. Generally speaking, the equivalent position can be represented by only one coordinate, so that the position information of the target object in the video can be simplified from multiple vertex coordinates of the detection frame to one coordinate of the equivalent position.
[0040] In practical applications, the equivalent position of the target object in the video picture may be the center position of the detection frame of the target object. Of course, the equivalent position of the target object may also be determined in other ways. For example, the equivalent position of the target object may also be the centroid position of the detection frame. The present disclosure does not limit the method for determining the equivalent position, as long as the equivalent position can characterize the position of the target object in the video picture.
[0041] For each frame of video, the equivalent position of the target object can be obtained. Subsequently, the activity track of the target object in the video can be generated according to the equivalent position of the target object in each frame of video. Specifically, the equivalent positions of the target object can be arranged according to the shooting order of the video, and the activity track of the target object in time sequence can be obtained.
[0042] S5: Identify a buffer area from the video frame, where the buffer area is used to represent a critical area between an object statistical area and a non-object statistical area.
[0043] In this embodiment, in order to accurately determine whether the target object has entered the object statistical area, a buffer area can be identified between the object statistical area and the non-object statistical area, and the buffer area can be used as a critical area between the object statistical area and the non-object statistical area. In different application scenarios, the object statistical area and the non-object statistical area can be flexibly set. For example, in order to detect the flow of people entering the station, the object statistical area can be the internal area of the station after security check, and the non-object statistical area can be the external area of the station before security check. For another example, in order to count the number of people in the machine room in real time, the object statistical area can be the area inside the machine room door, and the non-object statistical area can be the area outside the machine room door.
[0044] In this embodiment, the buffer area between the object statistical area and the non-object statistical area may be determined in different ways according to different actual application scenarios. Figure 4 In the equipment room scenario shown, the buffer area can be determined based on the door frame for entering the equipment room. Figure 4 In the embodiment, the buffer area can be a trapezoidal area adapted to the door frame.
[0045] It should be noted that the buffer area in the video screen can be pre-marked or obtained after identification based on the reference object in the video screen. Among them, if the buffer area is pre-marked, the coordinate information of the buffer area can be received, and then the outline of the buffer area can be generated in the video screen based on the coordinate information. If the buffer area needs to be automatically generated based on the recognition result of the reference object, then the reference object located between the object statistical area and the non-object statistical area can be identified, and based on the outline of the reference object, the buffer area between the object statistical area and the non-object statistical area can be generated. Among them, the type of reference object can be pre-configured according to the actual application scenario. For example, in the scenario of the machine room, the reference object can be the door of the machine room; for example, in the scenario of the station, the reference object can be a security gate; for example, in the scenario of the ticket gate, the reference object can be a ticket gate, etc. After the reference object is identified, the outline of the reference object can be obtained. Finally, the area defined by the outline of the reference object in the video screen can be directly used as the buffer area, or a certain degree of cropping or expansion can be performed on the basis of the area defined by the outline of the reference object to obtain the buffer area. For example, in Figure 4 In the embodiment, the area defined by the outline of the door frame is not directly used as the buffer area, but a part of the area is used as the buffer area.
[0046] Compared with conventional wire crossings, the buffer area can more accurately divide the object statistical area and the non-object statistical area. At the same time, the proportion of the buffer area in the video screen is usually larger than the proportion of the wire crossing in the video screen. When identifying the positional relationship between the target object and the buffer area, a more accurate positional relationship can be obtained. At the same time, it can also avoid frequent changes in the statistical results of the number of objects in a short period of time. The specific reasons will be stated in the subsequent steps.
[0047] S7: Determine the number of objects in the object counting area according to the positional relationship between the activity trajectory and the buffer area.
[0048] In this embodiment, the buffer area is not composed of a single mixing line, so there are multiple boundaries distributed in space in the video picture. Figure 4 In the example, the left and right sides and the top edge of the trapezoidal area can be used as the second boundary, and the bottom edge of the trapezoidal area can be used as the first boundary. For another example, assuming that the buffer area is Figure 5 The irregular closed curve shown in the figure can be cut by the pre-set auxiliary cutting line ( Figure 5The irregular closed curve can be divided into a first boundary in the upper part and a second boundary in the lower part, by using the dotted line in the figure. Of course, the number of boundaries corresponding to the buffer area may be different depending on the complexity of the contour of the buffer area. However, generally speaking, when the target object enters the object statistical area from the non-object statistical area, it will at least pass through the first boundary and the second boundary in the buffer area. For example, Figure 4 In the embodiment, when a human body enters the upper internal area of the computer room from the lower external area of the computer room, it will first pass through the first boundary below the buffer area, and then pass through the second boundary above the buffer area.
[0049] In this way, by analyzing the activity trajectory of the target object, the positional relationship between the activity trajectory and the buffer area can be determined. In one embodiment, if the activity trajectory of the target object indicates that the target object moves from the second boundary toward the non-object statistical area to the second boundary toward the object statistical area, then it indicates that the target object has crossed the second boundary, and the number of objects can be increased based on the original number of objects in the object statistical area.
[0050] by Figure 4 Taking the computer room scene shown in the figure as an example, the second boundary is the boundary formed by the two waists and the top edge of the trapezoid. The side of the second boundary facing the object statistical area refers to the upper side of the second boundary, and the side of the second boundary facing the non-object statistical area refers to the lower side of the second boundary. Figure 4 The scene is simplified and we get Figure 6 The scene shown. Figure 6 In the example, the trapezoidal area represents the buffer area, the second boundary is represented by a thicker line, and the first boundary is represented by a thinner line. Then the upward arrow indicates that the second boundary is facing the object statistical area, and the downward arrow indicates that the second boundary is facing the non-object statistical area. Figure 7 In the figure, the black circle can represent the equivalent position of the target object. Figure 7 In the figure, the target object's activity trajectory shows that it moves from the second boundary toward the non-object statistical area to the second boundary toward the object statistical area. This indicates that the target object enters the computer room from outside the computer room, and the number of people in the computer room should increase.
[0051] At the data processing level, when determining whether the activity trajectory of the target object moves from one side of the second boundary to the other side, the adjacent first activity position and the second activity position in the activity trajectory may be detected. Specifically, the first activity position may be earlier than the second activity position in timing, indicating that the target object moves from the first activity position to the second activity position. If the first activity position is located on the side of the second boundary facing the non-object statistical area, and the second activity position is located on the side of the second boundary facing the object statistical area, it can be determined that the target object moves from the side of the second boundary facing the non-object statistical area to the side of the second boundary facing the object statistical area.
[0052] Generally speaking, the boundary of the buffer area close to the object statistical area can be used as the second boundary, and the boundary close to the non-object statistical area can be used as the first boundary. When judging whether the target object enters the object statistical area from the non-object statistical area, the positional relationship between the target object's activity trajectory and the second boundary can be judged in the above manner. However, if it is to be judged whether the target object leaves the object statistical area and enters the non-object statistical area, it is often necessary to combine the positional relationship between the target object's activity trajectory and the first boundary.
[0053] Specifically, see Figure 8 , if the target object's activity trajectory indicates that the target object enters the buffer area from the object statistical area through the second boundary, and enters the non-object statistical area from the buffer area through the first boundary, it indicates that the target object enters the non-object statistical area from the object statistical area, and the number of objects in the object statistical area will be reduced based on the original number of objects in the object statistical area. The reason why it is necessary to combine the positional relationship between the activity trajectory and the first boundary to determine whether the target object has left the object statistical area is to avoid the situation where the number of objects changes frequently in a short time. For example, when the target object enters the buffer area from the object statistical area through the second boundary, and then returns to the object statistical area from the buffer area through the second boundary, based on the above description, since the target object does not enter the non-object statistical area from the buffer area through the first boundary, in this case, the number of objects in the object statistical area will not change. That is to say, when the target object leaves the object statistical area, but wanders at the entrance of the object statistical area and returns to the object statistical area, this case will not cause a change in the number of objects in the object statistical area, thereby avoiding the statistical anomaly of the number of objects caused by the frequent changes in the number of objects in a short time.
[0054] In this embodiment, after detecting that the target object leaves the object statistical area, enters the buffer area, and leaves the buffer area and enters the non-object statistical area, it can be confirmed that the target object has left the entrance area of the object statistical area. At this time, the number of objects in the object statistical area is updated, which avoids frequent changes in the number of objects and ensures the accuracy of the number of objects.
[0055] It can be seen from the above description that if the activity trajectory of the target object represents that the target object enters the buffer area from the object statistical area through the second boundary, and returns from the buffer area to the object statistical area through the second boundary, it indicates that the target object does not leave the entrance of the object statistical area too far, and the original number of objects in the object statistical area can be kept unchanged.
[0056] Similarly, if the activity trajectory of the target object indicates that the target object enters the buffer area from the object statistical area through the second boundary and stays in the buffer area, it means that the target object is still lingering at the entrance of the object statistical area. At this time, the original number of objects in the object statistical area can be kept unchanged.
[0057] It can be seen from the above description that in the related art, the number of objects in the object statistical area may be frequently changed in a short period of time through the relationship between the target object and the mixing line. For example, when the target object moves back and forth near the mixing line, the number of objects counted in the related art will change frequently. In the technical solution provided in the above-mentioned partial implementation methods of the present disclosure, by combining the relationship between the activity trajectory of the target object and the first boundary, it is possible to avoid frequent changes in the number of objects obtained by counting, thereby avoiding possible quantitative statistical anomalies.
[0058] In one embodiment, considering that the proportion of the non-object statistical area in the video screen may be small, when the target object leaves the object statistical area and enters the non-object statistical area, the information of the target object may not be captured in the video screen, so that the complete activity trajectory of the target object cannot be obtained. In this case, if the activity trajectory of the target object indicates that the target object enters the buffer area from the object statistical area through the second boundary, and the target object cannot be identified in the video screen of a specified number of frames after the target object enters the buffer area, it means that the target object has actually left the object statistical area, but due to the problem of shooting angle, the video screen of the target object entering the non-object statistical area is not obtained in time, and the number of objects should be reduced based on the original number of objects in the object statistical area.
[0059] The technical solution provided by one or more embodiments of the present disclosure can identify the target object in the video screen by analyzing the video data shot from the first perspective. Generally speaking, in the video screen shot from the first perspective, there is often no situation where human bodies occlude each other. Therefore, based on the analysis of the video data shot from the first perspective, the corresponding target object can be accurately identified. In order to accurately count the number of objects in the object statistical area, a buffer area in the video screen can be identified. Different from conventional line crossings, the buffer area has a larger determination interval. By identifying the positional relationship between the target object's activity trajectory and the buffer area, it can be accurately determined whether the target object has entered the object statistical area, thereby improving the accuracy of determining the number of objects in the object statistical area.
[0060] See also Fig. 9 In one embodiment of the present disclosure, there is also provided a device for determining the number of objects, the device comprising:
[0061] The object recognition unit 100 is used to obtain video data captured at a first viewing angle, and recognize a target object to be tracked from a video screen represented by the video data;
[0062] A trajectory determination unit 200, configured to determine an activity trajectory of the target object in the video frame;
[0063] A buffer region identifying unit 300 is used to identify a buffer region from the video picture, wherein the buffer region is used to represent a critical region between an object statistical region and a non-object statistical region;
[0064] The object quantity determination unit 400 is used to determine the number of objects in the object counting area according to the position relationship between the activity trajectory and the buffer area.
[0065] Among them, the specific processing logic of each functional module can be found in the description of the aforementioned method implementation method, which will not be repeated here.
[0066] Each unit described in the above embodiments may be implemented by a computer chip or a product having a certain function. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0067] For the convenience of description, the above devices are described in terms of functions and are described separately in various units. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0068] See also Fig.10 An embodiment of the present disclosure further provides an electronic device, which includes a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the above-mentioned method for determining the number of objects is implemented.
[0069] The present disclosure also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the above-mentioned method for determining the number of objects is implemented.
[0070] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0071] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.
[0072] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0073] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0074] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, equipment, and storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0075] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
[0076] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for determining the number of objects, characterized in that: The method comprises: Acquire video data captured at a first perspective, and identify a target object to be tracked from a video screen represented by the video data; Determining the activity trajectory of the target object in the video picture; identifying a buffer area from the video picture, the buffer area being used to characterize a critical area between an object statistical area and a non-object statistical area; The number of objects in the object counting area is determined according to the positional relationship between the activity trajectory and the buffer area.
2. The method according to claim 1, characterized in that In the video image, the identified target object is represented by a detection frame, and the detection frames of the same target object have the same detection frame identifier; Determining the activity trajectory of the target object in the video frame includes: For any frame of video, identify a target area where a detection frame of the target object is located in the video, and generate an equivalent position of the target object in the video based on the target area; According to the equivalent position of the target object in each frame of the video, an activity track of the target object in the video picture is generated.
3. The method according to claim 1, characterized in that Identifying a buffer area from the video picture includes: A reference object located between an object statistical region and a non-object statistical region is identified, and a buffer region between the object statistical region and the non-object statistical region is generated based on a contour of the reference object.
4. The method according to claim 1 or 3, characterized in that: The buffer area at least includes a first boundary and a second boundary, wherein the target object passes through the first boundary and the second boundary successively when entering the object statistical area from the non-object statistical area; Determining the number of objects in the object counting area includes: If the target object's activity trajectory indicates that the target object moves from the second boundary toward the non-object statistical area, to the second boundary toward the object statistical area, the number of objects is increased based on the original number of objects in the object statistical area.
5. The method according to claim 4, characterized in that For a first activity position and a second activity position adjacent to each other in the activity trajectory of the target object, if the first activity position is located on a side of the second boundary facing the non-object statistical area, and the second activity position is located on a side of the second boundary facing the object statistical area, it is determined that the target object moves from a side of the second boundary facing the non-object statistical area to a side of the second boundary facing the object statistical area; wherein the first activity position is earlier than the second activity position in terms of timing.
6. The method according to claim 4, characterized in that The step of determining the number of objects in the object counting area further includes: If the activity trajectory of the target object indicates that the target object enters the buffer area from the object statistical area through the second boundary and enters the non-object statistical area from the buffer area through the first boundary, the number of objects is reduced based on the original number of objects in the object statistical area.
7. The method according to claim 4, characterized in that The step of determining the number of objects in the object counting area further includes: If the activity trajectory of the target object indicates that the target object enters the buffer area from the object statistical area through the second boundary and returns from the buffer area to the object statistical area through the second boundary, the original number of objects in the object statistical area is kept unchanged.
8. The method according to claim 4, characterized in that The step of determining the number of objects in the object counting area further includes: If the activity trajectory of the target object indicates that the target object passes through the second boundary from the object statistical area into the buffer area and stays in the buffer area, the original number of objects in the object statistical area is kept unchanged.
9. The method according to claim 4, characterized in that The step of determining the number of objects in the object counting area further includes: If the activity trajectory of the target object indicates that the target object enters the buffer area from the object statistical area through the second boundary, and the target object cannot be identified in the video images of a specified number of frames after the target object enters the buffer area, the number of objects is reduced based on the original number of objects in the object statistical area.
10. A device for determining the number of objects, characterized in that: The device comprises: An object recognition unit is used to obtain video data captured at a first viewing angle, and recognize a target object to be tracked from a video screen represented by the video data; A trajectory determination unit, used to determine the activity trajectory of the target object in the video picture; A buffer region identification unit, used to identify a buffer region from the video picture, wherein the buffer region is used to characterize a critical region between an object statistical region and a non-object statistical region; The object quantity determination unit is used to determine the number of objects in the object counting area according to the position relationship between the activity trajectory and the buffer area.
11. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.