Target traffic statistics system, method, apparatus and device
By acquiring multiple images from a camera with any viewing angle, the relative positions of the upper and lower ends of the target with the direction sub-region are determined. The entry and exit type of the target is predicted using an entry and exit statistics model. This solves the problem of inaccurate traffic statistics caused by the target's legs obstructing the view from a top-down angle, achieving higher accuracy and privacy protection.
Patent Information
- Application Number
- CN202211743962.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-12-30
AI Technical Summary
From a bird's-eye view, the target's legs are easily blocked, making it impossible to accurately determine the target's movement path, thus affecting the accuracy of target traffic statistics.
Multiple images are captured using a camera with an arbitrary viewing angle. By determining the relative position information of the upper and/or lower ends of the target with the corresponding directional sub-region, a relative position matrix is generated. Then, an entrance and exit statistical model is used for prediction to improve the accuracy of target traffic statistics.
It can capture target images without relying on cameras at specific angles, accurately determine the entry and exit types of targets, avoid missed detections, improve the accuracy of target traffic statistics, and protect the privacy of targets.
Smart Images

Figure CN116052079B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent image analysis, and in particular to a target traffic statistics system, method, device and equipment. Background Art
[0002] Cameras are usually installed at the entrances and exits of public areas such as stations, shopping malls, and cafes to conduct target traffic statistics, and then regulate the targets based on the target traffic to avoid large-scale congestion.
[0003] Currently, after taking an image from a bird's-eye view through a camera, the target flow is counted based on the movement path of the two feet in the image.
[0004] However, from a bird's-eye view, the target's legs are easily blocked, making it impossible to accurately determine the target's movement path, making it impossible to perform target flow statistics, and thus affecting the accuracy of target flow statistics. Summary of the Invention
[0005] In view of this, embodiments of the present application provide a target traffic statistics system, method, apparatus, and device, aiming to improve the accuracy of target traffic statistics.
[0006] To achieve the above objectives, the present application provides a target traffic statistics system, the system comprising:
[0007] A camera, configured to capture a plurality of first images of a scene to be measured based on any viewing angle and transmit the first images to a computing device;
[0008] A computing device, the computing device is used to receive a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images; determine the relative position information of a target end of a target in the first image and a corresponding direction sub-area; the target end includes an upper end and / or a lower end, and the sub-area is obtained by dividing a section in a channel through which the target passes along a preset direction; summarize the relative position information of the target within a first preset time length to obtain the duration for which the target is continuously in the same relative position, and based on the duration and the relative position information, obtain a relative position matrix, and input the relative position matrix into an entry and exit statistical model, perform prediction processing on the relative position matrix based on the entry and exit statistical model to obtain the entry and exit type of the target, wherein the entry and exit statistical model is obtained by iteratively training a preset model to be trained based on the training data with entry and exit labels, and summarize the entry and exit types of multiple targets within a second preset time length to obtain the target flow within the preset time length.
[0009] The present invention provides a method for collecting statistics on target traffic, which is applied to a computing device in a target traffic statistics system. The method includes:
[0010] Receiving a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images;
[0011] Determining relative position information between a target end of the target in the first image and a corresponding directional subregion; the target end includes an upper end and / or a lower end, and the subregion is obtained by dividing a cross section of a passage through which the target passes along a preset direction;
[0012] Summarizing the relative position information of the target within a first preset time period to obtain a duration in which the target is continuously at the same relative position, and obtaining a relative position matrix based on the duration and the relative position information, and inputting the relative position matrix into an entry and exit statistical model, performing prediction processing on the relative position matrix based on the entry and exit statistical model to obtain the entry and exit type of the target, wherein the entry and exit statistical model is obtained by iteratively training a preset model to be trained based on the training data to be trained with entry and exit labels;
[0013] The entry and exit types of multiple targets within the second preset time period are summarized to obtain the target flow within the preset time period.
[0014] In a possible implementation of the present application, when dividing a cross section of the passage through which the target passes into regions along the vertical direction and / or the horizontal direction, the step of determining relative position information between a target end portion of the target in the first image and a corresponding directional subregion includes:
[0015] Determining first relative position information between an upper end portion of the target and a vertical sub-region in the first image;
[0016] and / or determining second relative position information between a lower end portion of the target and a horizontal sub-region in the first image; the horizontal sub-region is located within a moving plane of the lower end portion, and the moving plane is a plane located within a preset range of the cross section;
[0017] The first relative position information and / or the second relative position information are combined to obtain relative position information of the target end portion of the target in the first image and the corresponding direction sub-region.
[0018] In a possible implementation manner of the present application, the step of determining first relative position information between the upper end of the target and the vertical sub-region in the first image includes:
[0019] Selecting vertical sub-regions of different heights from the vertical region, the vertical sub-regions comprising at least a first vertical sub-region within a first height range and a second vertical sub-region within a second height range, the first height range corresponding to a preset height of a first type of targets among the targets, the second height range corresponding to a preset height of a second type of targets among the targets, and the preset height of the first type of targets being greater than the preset height of the second type of targets;
[0020] Determine first relative position information between the upper end of the target in the first image and each vertical sub-region.
[0021] In a possible implementation manner of the present application, the step of determining first relative position information between the upper end of the target and each vertical sub-region in the first image includes:
[0022] Taking the vertical sub-region as the center, a cross section in the target passage is divided into at least two upper and lower regions to obtain divided regions;
[0023] and / or dividing a cross section of the target passage into at least four regions, namely, upper, lower, left, and right, with the vertical sub-region as the center, to obtain the divided regions;
[0024] First relative position information between a first object divided region where an upper end of the object in the first image is located and each vertical sub-region is determined.
[0025] In a possible implementation of the present application, when a cross section in the passage through which the target passes is a transparent cross section, the step of determining second relative position information between a lower end portion of the target and a horizontal subregion in the first image includes:
[0026] Selecting horizontal sub-regions with different distances from the transparent cross-section from the horizontal region, the horizontal sub-regions at least including a first horizontal sub-region at a first distance and a second horizontal sub-region at a second distance, the second distance being greater than the first distance, the first distance corresponding to a transparent door in the physical door, and the second distance corresponding to a non-transparent door in the physical door;
[0027] Second relative position information between the lower end of the target in the first image and each horizontal sub-region is determined.
[0028] In a possible implementation manner of the present application, the step of determining second relative position information between the lower end of the target in the first image and each horizontal sub-region includes:
[0029] Taking the horizontal sub-region as the center, the moving plane of the lower end is divided into at least two upper and lower regions to obtain each divided region, wherein a cross section in the passage perpendicular to the target passage and pointing to the horizontal sub-region is considered to be downward;
[0030] Second relative position information between a second object division region where a lower end portion of the object in the first image is located and each horizontal sub-region is determined.
[0031] In a possible implementation manner of the present application, before the step of acquiring a first image of the scene to be measured, wherein the first image is a plurality of images, the method further includes:
[0032] Determining training data with preset input and output labels, wherein the training data includes a relative position matrix obtained by summarizing relative position information of an object end portion of an object and a corresponding directional sub-region in a second image, wherein the second image corresponds to a plurality of scenes to be tested, and each scene to be tested corresponds to a plurality of second images;
[0033] Inputting the data to be trained into a preset model to be trained to obtain the predicted input and output types of the target;
[0034] Calculate the difference between the predicted input and output type and the input and output type label of the training data to obtain an error result;
[0035] Based on the error result, determining whether the error result meets an error standard indicated by a preset error threshold range;
[0036] If the error result does not meet the error standard indicated by the preset error threshold range, return to the step of inputting the data to be trained into the preset model to be trained to obtain the predicted entry and exit type of the target, and stop training until the training error result meets the error standard indicated by the preset error threshold range to obtain the entry and exit statistical model.
[0037] The present application also provides a target traffic statistics device, the device comprising:
[0038] A receiving module, configured to receive a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images;
[0039] a first determining module, configured to determine relative position information between a target end portion of a target in the first image and a corresponding directional subregion; the target end portion includes an upper end portion and / or a lower end portion, and the subregion is obtained by dividing a cross section of a passage through which the target passes along a preset direction;
[0040] A first input module is configured to summarize the relative position information of the target within a first preset time period to obtain a duration during which the target is continuously in the same relative position, obtain a relative position matrix based on the duration and the relative position information, input the relative position matrix into an entry / exit statistical model, perform prediction processing on the relative position matrix based on the entry / exit statistical model, and obtain the entry / exit type of the target, wherein the entry / exit statistical model is obtained by iteratively training a preset model to be trained based on the training data to be trained with entry / exit labels;
[0041] The summarizing module is used to summarize the entry and exit types of multiple targets within a second preset time period to obtain the target flow within the preset time period.
[0042] In a possible implementation manner of the present application, the first determining module includes:
[0043] The first determination unit is used to determine the first relative position information between the upper end of the target in the first image and the vertical sub-area; the second determination unit is used to determine the second relative position information between the lower end of the target in the first image and the horizontal sub-area; the horizontal sub-area is located in the moving plane of the lower end, and the moving plane is a plane located within the preset range of the section; the third determination unit is used to combine the first relative position information and / or the second relative position information to obtain the relative position information between the target end of the target in the first image and the corresponding direction sub-area.
[0044] And / or the first determination unit includes: a first selection sub-unit, used to select vertical sub-regions with different heights from the vertical direction area, the vertical sub-regions at least including a first vertical sub-region of a first height range, and a second vertical sub-region of a second height range, the first height range corresponds to the preset height of the first type of targets in the target, the second height range corresponds to the preset height of the second type of targets in the target, and the preset height of the first type of targets is greater than the preset height of the second type of targets; the first determination sub-unit, used to determine the first relative position information of the upper end of the target in the first image and each vertical sub-region.
[0045] And / or the first determination subunit is used to divide a cross-section in the channel through which the target passes into at least two upper and lower regions with the vertical sub-region as the center to obtain each divided region; and / or divide a cross-section in the channel through which the target passes into at least four upper, lower, left and right regions with the vertical sub-region as the center to obtain each divided region; determine the first relative position information between the first target divided region where the upper end of the target in the first image is located and each vertical sub-region.
[0046] And / or the second determination unit includes: a second selection sub-unit, used to select a horizontal sub-region with a different distance from the transparent section from the horizontal direction area, the horizontal sub-region at least including a first horizontal sub-region with a first distance, and a second horizontal sub-region with a second distance, the second distance is greater than the first distance, the first distance corresponds to the transparent door in the physical door, and the second distance corresponds to the non-transparent door in the physical door; the second determination sub-unit is used to determine the second relative position information of the lower end of the target in the first image and each horizontal sub-region.
[0047] and / or the second determining subunit is configured to divide the moving plane of the lower end into at least two upper and lower regions with the horizontal subregion as the center, to obtain the divided regions, wherein a direction perpendicular to a cross section in the passage through which the target passes and pointing to the horizontal subregion is considered downward;
[0048] Second relative position information between a second object division region where a lower end portion of the object in the first image is located and each horizontal sub-region is determined.
[0049] And / or the device also includes: a second determination module, used to determine the data to be trained with preset entry and exit labels, wherein the data to be trained includes a relative position matrix obtained by summarizing the relative position information of the target end of the target and the corresponding direction sub-area in the second image, wherein the second image corresponds to multiple scenes to be tested, and each scene to be tested corresponds to multiple second images; a second input module, used to input the data to be trained into a preset model to be trained to obtain the predicted entry and exit type of the target; a calculation module, used to perform difference calculation between the predicted entry and exit type and the entry and exit type label of the data to be trained to obtain an error result; a judgment module, used to judge whether the error result meets the error standard indicated by the preset error threshold range based on the error result; a return module, used to return to the step of inputting the data to be trained into the preset model to be trained to obtain the predicted entry and exit type of the target if the error result does not meet the error standard indicated by the preset error threshold range, and stop training until the training error result meets the error standard indicated by the preset error threshold range to obtain an entry and exit statistical model.
[0050] The present application also provides a target traffic calculation device, which is a physical node device. The target traffic calculation device includes: a memory, a processor, and a program of the target traffic statistics method stored in the memory and runnable on the processor. When the program of the target traffic statistics method is executed by the processor, the steps of the target traffic statistics method described above can be implemented.
[0051] To achieve the above-mentioned purpose, a storage medium is further provided, on which a target traffic statistics program is stored. When the target traffic statistics program is executed by a processor, the steps of any of the above-mentioned target traffic statistics methods are implemented.
[0052] The present application provides a target flow statistics system, method, device and equipment. Compared with the prior art, in which the moving path can only be determined based on the target's feet in the image at a top-down angle, and the target's feet are easily blocked, making the moving path inaccurate, resulting in low accuracy of target flow statistics, in the present application, a first image of the scene to be measured sent by a camera of any viewing angle is received, wherein the first image is multiple; the relative position information of the target end and the corresponding direction sub-area in the first image is determined; the target end includes an upper end and / or a lower end, and the sub-area is obtained by dividing a cross-section in the channel through which the target passes along a preset direction. The method comprises the following steps: obtaining the target's relative position information within a first preset time period, obtaining the duration of time that the target is continuously at the same relative position, and obtaining a relative position matrix based on the duration and the relative position information, and inputting the relative position matrix into an in-and-out door statistical model. The relative position matrix is then predicted based on the in-and-out door statistical model to obtain the target's entry and exit type, wherein the in-and-out door statistical model is obtained by iteratively training a preset model to be trained based on training data with entry and exit labels; and summarizing the entry and exit types of multiple targets within a second preset time period to obtain the target flow within the preset time period. In the present application, a first image of a target can be captured without relying on a camera at a specific angle. After the first image is captured, the target's entry and exit type is accurately determined based on the relative position matrix of the target end and the corresponding direction sub-region in the target in the first image and the trained in-and-out door statistical model. Since the camera can capture at least one of the upper and lower ends of the target at any angle, when one end of the target is blocked, the target's entry and exit type can be accurately predicted based on the other end. Thus, missed detection is avoided and the accuracy of target flow statistics is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 This is a flow chart of the first embodiment of the target traffic statistics method of the present application;
[0054] Figure 2 This is a schematic diagram of the first scenario involved in the target traffic statistics method of this application;
[0055] Figure 3 This is a schematic diagram of the second scenario involved in the target traffic statistics method of this application;
[0056] Figure 4 This is a schematic diagram of the third scenario involved in the target traffic statistics method of this application;
[0057] Figure 5 This is a schematic diagram of the fourth scenario involved in the target traffic statistics method of this application;
[0058] Figure 6 This is a schematic diagram of the fifth scenario involved in the target traffic statistics method of this application;
[0059] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application. DETAILED DESCRIPTION
[0060] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0061] The present invention provides a method for collecting statistics on target traffic. In one embodiment of the method for collecting statistics on target traffic, the method includes:
[0062] Step S10, receiving a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images;
[0063] Step S20: determining relative position information between a target end of the target in the first image and a corresponding directional subregion; the target end includes an upper end and / or a lower end, and the subregion is obtained by dividing a cross section of a passage through which the target passes along a preset direction;
[0064] Step S30: Summarize the relative position information of the target within a first preset time period to obtain the duration of time that the target is continuously in the same relative position, and obtain a relative position matrix based on the duration and the relative position information. The relative position matrix is input into an entry and exit statistical model, and the relative position matrix is predicted based on the entry and exit statistical model to obtain the entry and exit type of the target. The entry and exit statistical model is obtained by iteratively training a preset model to be trained based on the training data with entry and exit labels.
[0065] Step S40: Summarize the entry and exit types of multiple targets within the second preset time period to obtain the target flow within the preset time period.
[0066] In this embodiment, the specific application scenarios are:
[0067] Scenario 1: Many public places, such as train stations, bus stations, airports, subway stations, hospitals, banks, schools, shopping malls, and stores, are equipped with cameras to capture target traffic. Passenger transport centers like train stations use target traffic to conduct macro-control and avoid large-scale congestion. Shopping malls use target traffic to adjust their business strategies and enhance the customer experience. Existing methods for counting target traffic include counting target traffic based on the movement paths of the center points of the feet in an image. However, this method only captures the movement paths of the target's feet in an image from a bird's-eye view, and the target's feet are easily obscured, resulting in inaccurate movement paths and low target traffic accuracy.
[0068] Scenario 2: Existing methods for counting target traffic also include: using facial recognition technology to count target traffic. However, this method requires obtaining the target's facial features, which is not conducive to protecting the target's privacy information.
[0069] This embodiment aims to improve the accuracy of target traffic statistics by changing the target traffic statistics strategy.
[0070] Specifically, in the present application, the target's entry and exit type can be determined by the upper end and the lower end. That is, when the lower end is blocked, the target's entry and exit type can be determined by the upper end. Compared with the inability to generate the foot center point due to partial or complete occlusion of the foot, and thus the inability to count the target's entry and exit type, determining the target's entry and exit type by the upper end or the upper end combined with the lower end can improve the accuracy of target flow statistics, and the camera can capture images of any angle of the scene to be measured. By analyzing the images of multiple angles in the scene to be measured, the target's entry and exit types at multiple angles can be predicted, and each entry and exit type can be mutually verified, further improving the accuracy of target flow statistics. Moreover, the present application predicts the target's entry and exit type by the upper end, without collecting the target's facial feature information, thus protecting the target's privacy.
[0071] Specifically, in this application, after the corresponding entry and exit types are generated for the upper and lower ends of a target, a comparison and verification of the entry and exit types can be performed to determine the accuracy of the target's entry and exit types. For example, based on the relative position matrix of the upper end, the target's entry and exit type can be determined as leaving the house, while based on the relative position matrix of the lower end, the target's entry and exit type can be determined as being indoors, not leaving the house. At this point, the target can be marked to further determine the target's entry and exit type. Compared to a single foot center point, the entry and exit types corresponding to multiple ends can be mutually verified, improving the accuracy of target flow statistics.
[0072] Specifically, in the present application, a cross section in the channel through which the target passes is divided into a vertical area and a horizontal area, and vertical sub-areas with different height ranges are selected from the vertical area. With them as the center, the relative position information of the upper end of the target is determined, and then a relative position matrix containing the target entry and exit types is generated. There is a height difference between the vertical sub-areas, and the entry and exit types of targets of different height ranges can be counted, and the target capture rate is high. And by jointly determining the entry and exit type of the upper end of the same target through multiple vertical sub-areas, the accuracy of the upper end entry and exit type judgment can be improved, thereby improving the accuracy of the target flow statistics.
[0073] Specifically, in this application, horizontal sub-regions at varying distances from the transparent cross-section are selected from the horizontal door region. These sub-regions are used as the center to determine the relative position of the target's lower end, thereby generating a relative position matrix containing target entry and exit types. This division into multiple horizontal sub-regions allows this application to eliminate the influence of the target's lower end's shadow in the transparent cross-section, thereby improving the accuracy of target flow statistics.
[0074] Specifically, in this application, the corresponding direction sub-areas are further divided to determine the relative position information of the target. For example, with the first vertical direction sub-area as the center, the vertical direction area is divided into 5 areas, the first vertical direction sub-area is the inner area, and the rest are the upper area, lower area, left area, and right area, and are marked as 1, 2, 3, 4, and 5 respectively for model training and prediction of entry and exit information. Compared with the traditional prediction of entry and exit information through the target path, this application greatly reduces the data information during training and improves the training rate.
[0075] Specifically, in this application, by acquiring multiple scenes to be tested and a large number of images captured by multiple camera angles, sufficient relative position matrix training samples are obtained to train the preset model to be trained, thereby ensuring the accuracy of the entry and exit statistical model obtained by training, improving the accuracy of the target end entry and exit type judgment, and thereby improving the accuracy of the target traffic statistics.
[0076] The specific steps are as follows:
[0077] Step S10, receiving a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images;
[0078] As an example, the target traffic statistics method may be applied to a target traffic calculation device, which belongs to a target traffic statistics system.
[0079] As an example, the scene to be tested may be a railway station, bus station, airport, subway station, hospital, bank, school, shopping mall or store, etc.
[0080] As an example, an image is extracted from a real-time video stream or a historical video stream of the scene to be measured captured by a camera to obtain a first image of the scene to be measured. The first image may be a real-time captured image or a historical captured image.
[0081] As an example, the number of collected images is set as needed and is not specifically limited in this embodiment.
[0082] As an example, an image of the scene to be measured is captured by a camera and transmitted to the computing device. The angle at which the camera captures the image of the scene to be measured is set as needed and is not specifically limited in this embodiment.
[0083] In this embodiment, the computing device receives real-time images or historical images of the scene to be measured captured by a camera, and sorts the images according to a time sequence of capture to obtain an image set of the scene to be measured.
[0084] Step S20: determining relative position information between a target end of the target in the first image and a corresponding directional subregion; the target end includes an upper end and / or a lower end, and the subregion is obtained by dividing a cross section of a passage through which the target passes along a preset direction;
[0085] As an example, the target end of the target includes an upper end of the target and / or a lower end of the target.
[0086] As an example, the corresponding direction sub-area includes a vertical direction sub-area and a horizontal direction sub-area, wherein the vertical direction area includes multiple vertical direction sub-areas, and the horizontal direction area includes multiple horizontal direction sub-areas. The preset direction includes the vertical direction and the horizontal direction.
[0087] As an example, a cross section in a passage where the target passes is marked in each first image, and a plurality of vertical sub-regions and a plurality of horizontal sub-regions of the cross section in the passage where the target passes are generated.
[0088] As an example, in each test scenario, the number of times and direction of the target passing through the cross section are usually used as the basis for monitoring the target flow.
[0089] As an example, the relative position information of the upper end is determined based on the vertical sub-region, and the relative position information of the lower end is determined based on the horizontal sub-region.
[0090] As an example, the relative position information is information about the relative position of the target end and the corresponding direction sub-area, including information about the relative position of the upper end and the vertical direction area and / or information about the relative position of the lower end and the horizontal direction area.
[0091] As an example, Figure 2As shown, 201 is a section in the channel where the target passes and the lower boundary of the vertical direction area, 202 is a section in the channel where the target passes and the left boundary of the vertical direction area, 203 is a section in the channel where the target passes and the right boundary of the vertical direction area, 204 is the upper boundary of a section in the channel where the target passes, and 205 is the upper boundary of the vertical direction area. The upper boundary, left boundary, lower boundary and right boundary of the vertical direction area are connected to obtain the vertical direction area.
[0092] As an example, a method for marking the horizontal region may be to generate regions of the same size in the horizontal direction with the lower boundary of the vertical region as the axis of symmetry.
[0093] Specifically, when dividing a cross section of the passage through which the target passes into regions along the vertical direction and / or the horizontal direction, the step of determining relative position information between the target end portion of the target in the first image and the corresponding directional subregion includes:
[0094] Step S21, determining first relative position information between the upper end of the target and the vertical sub-region in the first image;
[0095] Specifically, the step of determining first relative position information between the upper end of the target and the vertical sub-region in the first image includes:
[0096] Step S211: selecting vertical sub-regions of different heights from the vertical region, the vertical sub-regions including at least a first vertical sub-region within a first height range and a second vertical sub-region within a second height range, the first height range corresponding to a preset height of a first type of targets among the targets, the second height range corresponding to a preset height of a second type of targets among the targets, and the preset height of the first type of targets being greater than the preset height of the second type of targets;
[0097] As an example, the selection of the vertical sub-regions is set as needed and is not specifically limited in this embodiment. For example, vertical sub-regions spaced apart from each other are selected from the top and the bottom.
[0098] As an example, the number of selected vertical sub-regions is set as needed and is not specifically limited in this embodiment. The vertical sub-regions include at least a first vertical sub-region within a first height range and a second vertical sub-region within a second height range, wherein the first height corresponds to a preset height of a first type of target among the targets, and the second height corresponds to a preset height of a second type of target among the targets, and the preset height of the first type of target is greater than the preset height of the second type of target.
[0099] As an example, the preset heights of the first height range and the second height range are set as needed, for example: the first height range is 120-150 cm, and the second height range is 60-90 cm.
[0100] As an example, the preset height of the first type of target and the preset height of the second type of target are set as needed, for example, the preset height of the first type of target is 155 cm, and the preset height of the second type of target is 110 cm.
[0101] As an example, Figure 3 As shown in FIG, the vertical direction area is divided into 4 vertical direction areas along the vertical direction. Figure 3 As shown, from the four vertical regions, a first vertical region 301 is selected from the top to the bottom as the first vertical sub-region, and a third vertical region 302 is selected as the second vertical sub-region. The upper boundary height of the first vertical sub-region is less than the preset height of the first type of target, and the upper boundary height is greater than the preset height of the second type of target; the upper boundary height of the second vertical sub-region is less than the preset height of the second type of target.
[0102] Step S212: Determine first relative position information between the upper end of the target in the first image and each vertical sub-region.
[0103] As an example, if there are two vertical sub-areas, the first vertical sub-area and the second vertical sub-area, the relative position information of the upper end of the target is generated based on the first vertical sub-area and the second vertical sub-area to jointly determine the entry and exit type of the target.
[0104] Specifically, the step of determining first relative position information between the upper end of the target in the first image and each vertical sub-region includes:
[0105] Step S2121, dividing a cross section in the target passage into at least two upper and lower regions with the vertical sub-region as the center, to obtain divided regions;
[0106] As an example, the vertical sub-area includes at least a first vertical sub-area and a second vertical sub-area. For example, with the first vertical sub-area as the center, a cross-section of the passageway through which the target passes is divided into at least two upper and lower regions, obtaining an upper region and a lower region. For example, with the upper and lower edges of the first vertical sub-area as the dividing lines, the area above the upper edge of the first vertical sub-area is defined as the upper region corresponding to the first vertical sub-area, and the area below the lower edge of the first vertical sub-area is defined as the lower region corresponding to the first vertical sub-area, and are labeled 1 and 2, respectively. With the upper and lower edges of the second vertical sub-area as the dividing lines, the area above the upper edge of the second vertical sub-area is defined as the upper region corresponding to the second vertical sub-area, and the area below the lower edge of the second vertical sub-area is defined as the lower region corresponding to the second vertical sub-area, and are labeled 1 and 2, respectively. When the camera is viewing from a bird's-eye view, if the relative position of the upper end of the target with respect to the first vertical sub-area changes from 1 to 2, the target is determined to have entered the state.
[0107] Step S2122, and / or dividing a cross section of the target passage into at least four regions, namely, upper, lower, left, and right, with the vertical sub-region as the center, to obtain the divided regions;
[0108] As an example, a cross section of the target passageway is divided into at least four regions: top, bottom, left, and right, with the vertical sub-region as the center. For example, with the first vertical sub-region as the center and the upper edge as the dividing line, the area upward is the upper region, the area downward from the lower edge is the lower region, and in the remaining area, the area to the left of the left edge is the left region, and the area to the right of the right edge is the right region. The relative positions of these four regions with respect to the first vertical sub-region are top, bottom, left, and right, and are labeled 1, 1, 2, 3, and 4, respectively.
[0109] As an example, the first vertical sub-region and the second vertical sub-region may be divided in the same or different ways.
[0110] Step S2123 : determining first relative position information between the first object divided region where the upper end of the object in the first image is located and each vertical sub-region.
[0111] As an example, the first target segmentation region is the region where the upper end of the target in the first image is located. For example, if a cross section in a passage through which the target passes is divided into four regions, and the upper end of the target is located in the upper left region, then its first relative position information is the upper left region.
[0112] In this application, vertical sub-areas of different heights in the vertical area are selected and used as the center to determine the entry and exit type of the upper end of the target. There is a height difference between the vertical sub-areas, and the entry and exit information of targets of different height ranges can be counted at the same time, thereby improving the capture rate of the camera. For example, if the relative position of the second type of target relative to the first vertical sub-area that is higher than the first type of target is continuously below, the entry and exit type of the second type of target cannot be predicted. After adding the second vertical sub-area, the entry and exit type of the second type of target can be predicted based on the relative position information of the second type of target and the second vertical sub-area. In addition, the entry and exit type of the upper end of the same target can be determined by multiple vertical sub-areas, thereby improving the accuracy of the upper end entry and exit type judgment, thereby improving the accuracy of the target flow statistics. And its accuracy is proportional to the number of vertical sub-areas, that is, the more vertical sub-areas there are, the higher the accuracy; the fewer vertical sub-areas there are, the lower the accuracy.
[0113] In this application, the vertical sub-areas are further divided to clarify the relative positional relationship between a section in the channel where the target passes and the vertical sub-area, and mark them. Compared with the traditional prediction of entry and exit information through the target path, the data containing position information is greatly reduced, and the rate of model training is improved. When a section in the channel where the target passes is divided into two upper and lower areas, the basic judgment conditions for determining its entry and exit information when the target passes through the section vertically can be met. When a section in the channel where the target passes is divided into four areas, the basic judgment conditions for determining its entry and exit information when the target passes through the section obliquely can be met. And the more areas are divided, the more accurate the judgment of its entry and exit information.
[0114] Step S22, and / or determining second relative position information between the lower end portion of the target and the horizontal sub-region in the first image; the horizontal sub-region is located in a moving plane of the lower end portion, and the moving plane is a plane located within a preset range of the cross section;
[0115] Specifically, when a cross section in the passage through which the target passes is a transparent cross section, the step of determining second relative position information between the lower end of the target and the horizontal sub-region in the first image includes:
[0116] Step S221: selecting horizontal sub-regions at different distances from the transparent cross-section from the horizontal region, the horizontal sub-regions at least including a first horizontal sub-region at a first distance and a second horizontal sub-region at a second distance, the second distance being greater than the first distance, the first distance corresponding to a transparent door in the physical door, and the second distance corresponding to a non-transparent door in the physical door;
[0117] As an example, the method for selecting the horizontal sub-regions is set as needed and is not specifically limited in this embodiment. For example, adjacent horizontal sub-regions are selected.
[0118] As an example, the number of horizontal sub-regions is set as needed and is not specifically limited in this embodiment. The horizontal sub-regions at least include a first horizontal sub-region with a first distance from the transparent cross-section and a second horizontal sub-region with a second distance, the second distance being greater than the first distance, wherein the first distance is the distance between the edge of the first horizontal sub-region close to the transparent cross-section and the transparent cross-section, and the second distance is the distance between the edge of the second horizontal sub-region close to the transparent cross-section and the transparent cross-section. For example, Figure 3 As shown, the horizontal region is divided into four horizontal regions along the horizontal direction. With the direction close to the transparent cross section as the top, a first horizontal region 303 is selected from the top and bottom of the four horizontal regions as the first horizontal sub-region, and a second horizontal region 304 is selected as the second horizontal sub-region.
[0119] Step S222: Determine second relative position information between the lower end of the target in the first image and each horizontal sub-region.
[0120] As an example, if there are two horizontal sub-areas, the first horizontal sub-area and the second horizontal sub-area, the relative position information of the lower end of the target is generated based on the first horizontal sub-area and the second horizontal sub-area respectively, and the entry and exit type of the target is jointly determined.
[0121] Specifically, the step of determining the second relative position information between the lower end of the target in the first image and each horizontal sub-region includes:
[0122] Step S2221: Divide the moving plane at the lower end into at least two upper and lower regions with the horizontal sub-region as the center, to obtain each divided region, wherein a cross section in the passage perpendicular to the target passage and pointing toward the horizontal sub-region is considered downward;
[0123] As an example, the moving plane of the lower end includes at least two areas, the inner area of the horizontal sub-area and the outer area of the horizontal sub-area, wherein the outer area of the horizontal sub-area can be further divided to determine the relative position between the end and the sub-area, and the horizontal sub-area can be further divided to improve the accuracy of determining the end position.
[0124] As an example, the horizontal sub-region includes at least a first horizontal sub-region and a second horizontal sub-region. With each horizontal sub-region as the center, the moving plane of the lower end is divided into at least two upper and lower regions. For example, with the first horizontal sub-region as the center, the area above the upper edge is the upper region corresponding to the first horizontal sub-region, and the area below the lower edge is the lower region corresponding to the first horizontal sub-region. Their relative positions relative to the first horizontal sub-region are region upper and region lower, respectively, and are labeled 1 and 2. Alternatively, with the first horizontal sub-region as the center, the area above the upper edge is the upper region corresponding to the first horizontal sub-region, and the area below the upper edge is the lower region corresponding to the first horizontal sub-region, respectively, and are labeled 1 and 2. Here, a cross-section in the passageway perpendicular to the target and pointing toward the horizontal sub-region is considered lower. If the relative position of the target's upper end to the first horizontal sub-region changes from 1 to 2, the target is determined to be in the entry state.
[0125] As an example, the moving plane at the lower end can be divided into 9 areas with the sub-area as the center. Figure 4 As shown, with the sub-region as the center and the four edges of the sub-region as dividing lines, the relative positions of the sub-region can be divided into within the region, upper left of the region, upper side of the region, upper right of the region, right side of the region, lower right side of the region, lower side of the region, lower left side of the region, and left side of the region. Each relative position is numbered 1, 2, 3, 4, 5, 6, 7, 8, and 9 in sequence.
[0126] As an example, the moving plane at the lower end can be divided into five areas with the sub-area as the center. Figure 5 As shown, with the sub-region as the center, the relative positions of the sub-regions are divided into within the region, above the region, right side of the region, below the region, and left side of the region. Each relative position is numbered 1, 2, 3, 4, and 5 in sequence for model training and prediction of input and output information.
[0127] As an example, further region division within the subregion may include: selecting a first dividing line parallel to the upper edge of the subregion, and dividing the subregion into at least two upper and lower regions along the first dividing line. And / or selecting a second dividing line perpendicular to the upper edge of the subregion, and dividing the subregion into at least four upper, lower, left, and right regions along the first dividing line and the second dividing line. Each divided region may be labeled with a number.
[0128] As an example, the first horizontal sub-region and the second horizontal sub-region may be divided in the same or different ways, and the vertical sub-region and the horizontal sub-region may be divided in the same or different ways.
[0129] Step S2222: Determine second relative position information between the second object division region where the lower end of the object in the first image is located and each horizontal sub-region.
[0130] As an example, the second target divided area is the area where the lower end of the target in the first image is located. For example, if the moving plane of the lower end is divided into four areas, and the lower end of the target is located in the upper left area, then its second relative position information is the upper left area.
[0131] Step S23 : combining the first relative position information and / or the second relative position information to obtain relative position information between the target end portion of the target in the first image and the corresponding direction sub-region.
[0132] As an example, after obtaining the first relative position information and the second relative position information, the first relative position information is used as the relative position information or the first relative position information and the second relative position information are combined to obtain the relative position information of the target.
[0133] Step S25 : determining the target divided region where the target end of the target in the first image is located, and determining relative position information between the target divided region and the corresponding direction sub-region.
[0134] As an example, the target divided region is the region where the target end of the target in the first image is currently located, and relative position information between the target divided region and the corresponding direction sub-region is determined.
[0135] As an example, the relative position information includes the left side, right side, bottom side, etc. of the corresponding direction sub-region.
[0136] As an example, the steps before determining the relative position information between the target end portion of the target in the first image and the corresponding direction sub-region include:
[0137] Step a: generating a rectangular frame of the target based on the contour information of the target in each first image;
[0138] Step b: determining the upper end of the target and / or determining the lower end of the target based on the rectangular frame.
[0139] As an example, the rectangular frame is a rectangular frame that contains the most contour information of the target in the first image and has the smallest area.
[0140] As an example, the method for generating the upper end and the lower end includes: taking the midpoint of the upper edge of the rectangular frame as the target upper end, and taking the midpoint of the lower edge of the circumscribed rectangular frame as the target lower end.
[0141] Step S30: Summarize the relative position information of the target within a first preset time period to obtain the duration of time that the target is continuously in the same relative position, and obtain a relative position matrix based on the duration and the relative position information. The relative position matrix is input into an entry and exit statistical model, and the relative position matrix is predicted based on the entry and exit statistical model to obtain the entry and exit type of the target. The entry and exit statistical model is obtained by iteratively training a preset model to be trained based on the training data with entry and exit labels.
[0142] As an example, the first preset duration is set as needed, and this embodiment does not make any specific limitation. For example, the preset duration is 5 minutes.
[0143] As an example, Figure 6 As shown, the relative position matrix contains the relative position information of the target and the duration of being continuously at the relative position and the training label.
[0144] As an example, the entry and exit statistical model is obtained by iteratively training a preset model to be trained based on the training data with entry and exit labels.
[0145] As an example, the entry and exit types include: entering, leaving, indoors, and outdoors.
[0146] As an example, the relative position matrix of the target is input into the door entry and exit statistical model, and the relative position matrix is predicted by the door entry and exit statistical model to obtain the entry and exit type of the target.
[0147] Step S40: Summarize the entry and exit types of multiple targets within the second preset time period to obtain the target flow within the preset time period.
[0148] As an example, the target flow includes inbound target flow and outbound target flow.
[0149] As an example, the preset duration is set as needed, and this embodiment does not make any specific limitation. For example, the preset duration is 1 hour.
[0150] As an example, the entry and exit types of multiple targets in the first image within the second preset time period are summarized to obtain the target flow within the preset time period.
[0151] This application provides a target traffic statistics system, method, device and equipment, which are different from the existing technology.
[0152] Only when looking down can the moving path be determined based on the target's feet in the image, and the target's feet are easily blocked, which makes the moving path inaccurate, resulting in low accuracy of target flow statistics. In this application,
[0153] Receive a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images; determine relative position information between a target end of a target in the first image and a sub-region of a corresponding direction; the target end includes an upper end and / or a lower end, and the sub-region is a channel through which the target passes.
[0154] The relative position information of the target within the first preset time period is summarized to obtain the duration of the target being in the same relative position continuously, and the relative position information of the target is obtained based on the duration.
[0155] The relative position matrix is obtained by combining the time and the relative position information, and the relative position matrix is input into the door entry and exit statistical model. The relative position matrix is predicted based on the door entry and exit statistical model to obtain the entry and exit type of the target. The door entry and exit statistical model is based on the entry and exit mark.
[0156] The training data to be signed is obtained by iteratively training the preset training model; the entry and exit types of multiple targets within the second preset time length 0 are summarized to obtain the target flow within the preset time length. In this application, the first image of the target can be captured without relying on a camera at a specific angle. After the first image is captured, the entry and exit type of the target is accurately determined based on the relative position matrix of the target end and the corresponding direction sub-area in the target in the first image, and the trained entry and exit statistical model. Since the camera is at any angle,
[0157] At least one of the upper and lower ends of the target can be captured. When one end of the target is blocked, the target's entry and exit type can be accurately predicted based on the other end, thus avoiding missed detection and improving
[0158] The accuracy of target traffic statistics.
[0159] Further, based on the first embodiment of the present application, another embodiment of the present application is provided.
[0160] In this embodiment, before the step of acquiring a first image of the scene to be measured, wherein the first image is a plurality of images, the method further includes:
[0161] Step S50: determining training data with preset input and output labels, wherein the training data includes a relative position matrix obtained by summarizing relative position information of an end portion of an object and a corresponding directional subregion in a second image, wherein the second image corresponds to a plurality of scenes to be tested, and each scene to be tested corresponds to a plurality of second images;
[0162] As an example, the door entry and exit statistical model is a deep neural network model.
[0163] As an example, the door entry and exit statistical model can perform prediction processing on the relative position matrix of the target to obtain the entry and exit type of the target.
[0164] As an example, the multiple scenes to be tested are part or all of the scenes in a railway station, bus station, airport, subway station, hospital, bank, school, shopping mall or store, etc.
[0165] As an example, the multiple scenes to be tested may be scenes at different time periods at the same location on the same day, for example, a shopping mall from 10:00 to 12:00, a shopping mall from 12:00 to 14:00, and a shopping mall from 20:00 to 22:00.
[0166] As an example, the multiple scenes to be tested can be scenes at the same location and the same time period but on different days, for example, a shopping mall from 20:00 to 22:00 on Monday, a shopping mall from 20:00 to 22:00 on Friday, and a shopping mall from 20:00 to 22:00 on Saturday.
[0167] As an example, the multiple angles include 75° diagonally downward from the horizontal direction, 45° diagonally upward from the horizontal direction, 60° diagonally upward from the horizontal direction, and the like.
[0168] As an example, the preset entry and exit tags include: entering, leaving, indoors, and outdoors.
[0169] As an example, the second images are images of multiple angles of multiple scenes to be measured, and the second images are multiple. A relative position matrix of the target in each second image is determined as the training data with preset input and output labels.
[0170] Step S60, inputting the to-be-trained data into a preset to-be-trained model to obtain a predicted input and output type of the target;
[0171] As an example, the data to be trained with preset entry and exit labels is input into the preset model to be trained, wherein the preset model to be trained is an initial entry and exit statistical model. The preset model to be trained judges and processes the training data to obtain the predicted entry and exit type of the target.
[0172] Step S70, calculating the difference between the predicted input / output type and the input / output type label of the training data to obtain an error result;
[0173] As an example, the computing device calculates the difference between the predicted entry / exit type and the entry / exit type label of the training data to obtain an error result. For example, if the entry / exit type label of the training data is "entry" and the predicted entry / exit type is "indoors", an error will occur.
[0174] Step S80, based on the error result, determining whether the error result meets the error standard indicated by a preset error threshold range;
[0175] As an example, the computing device determines whether the error result meets the error standard indicated by the preset error threshold range based on the error result. If there is an error, it is determined that the error standard indicated by the preset error threshold range is not met; if there is no error, it is determined that the error standard indicated by the preset error threshold range is met.
[0176] Step S90: If the error result does not meet the error standard indicated by the preset error threshold range, return to the step of inputting the data to be trained into the preset model to be trained to obtain the predicted entry and exit type of the target, and stop training until the training error result meets the error standard indicated by the preset error threshold range to obtain the entry and exit statistical model.
[0177] As an example, through iterative training of the training data, a statistical model of entry and exit doors that meets the accuracy conditions is obtained.
[0178] In this application, by acquiring multiple scenes to be tested and a large number of images captured by multiple camera angles, sufficient training samples can be obtained to train the preset entry and exit statistical model, ensuring the accuracy of the trained entry and exit statistical model, improving the accuracy of the entry and exit type judgment of each target end, and thereby improving the accuracy of the target traffic statistics.
[0179] Reference Figure 7 , Figure 7 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0180] like Figure 7 As shown, the target flow calculation device may include: a processor 1001 , a memory 1005 , and a communication bus 1002 . The communication bus 1002 is used to implement connection and communication between the processor 1001 and the memory 1005 .
[0181] Optionally, the target flow calculation device may further include a user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, a WiFi module, and the like. The user interface may include a display screen and an input submodule such as a keyboard. The optional user interface may also include a standard wired interface and a wireless interface. The network interface may include a standard wired interface and a wireless interface (such as a WiFi interface).
[0182] The technical objectives in this field can be understood. Figure 7 The target flow calculation device structure shown in the figure does not constitute a limitation to the target flow calculation device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0183] like Figure 7As shown, memory 1005, a storage medium, may include an operating system, a network communication module, and a target traffic statistics program. The operating system is a program that manages and controls the hardware and software resources of the target traffic calculation device and supports the operation of the target traffic statistics program and other software and / or programs. The network communication module is used to enable communication between the various components within memory 1005, as well as communication with other hardware and software in the target traffic statistics system.
[0184] exist Figure 7 In the target flow calculation device shown, the processor 1001 is used to execute the target flow statistics program stored in the memory 1005 to implement the steps of any of the above-mentioned target flow statistics methods.
[0185] The specific implementation of the target flow calculation device of the present application is basically the same as the embodiments of the above-mentioned target flow statistics method, and will not be repeated here.
[0186] The present application also provides a target traffic statistics device, the device comprising:
[0187] A receiving module, configured to receive a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images;
[0188] a first determining module, configured to determine relative position information between a target end portion of a target in the first image and a corresponding directional subregion; the target end portion includes an upper end portion and / or a lower end portion, and the subregion is obtained by dividing a cross section of a passage through which the target passes along a preset direction;
[0189] A first input module is configured to summarize the relative position information of the target within a first preset time period to obtain a duration during which the target is continuously in the same relative position, obtain a relative position matrix based on the duration and the relative position information, input the relative position matrix into an entry / exit statistical model, perform prediction processing on the relative position matrix based on the entry / exit statistical model, and obtain the entry / exit type of the target, wherein the entry / exit statistical model is obtained by iteratively training a preset model to be trained based on the training data to be trained with entry / exit labels;
[0190] The summarizing module is used to summarize the entry and exit types of multiple targets within a second preset time period to obtain the target flow within the preset time period.
[0191] In a possible implementation manner of the present application, the first determining module includes:
[0192] The first determination unit is used to determine the first relative position information between the upper end of the target in the first image and the vertical sub-area; the second determination unit is used to determine the second relative position information between the lower end of the target in the first image and the horizontal sub-area; the horizontal sub-area is located in the moving plane of the lower end, and the moving plane is a plane located within the preset range of the section; the third determination unit is used to combine the first relative position information and / or the second relative position information to obtain the relative position information between the target end of the target in the first image and the corresponding direction sub-area.
[0193] and / or the first determining unit includes: selecting vertical sub-areas of different heights from the vertical area, the vertical sub-areas including at least a first vertical sub-area of a first height range and a second vertical sub-area of a second height range, the first height range corresponding to a preset height of a first type of target among the targets, the second height range corresponding to a preset height of a second type of target among the targets, the preset height of the first type of target being greater than the preset height of the second type of target; the first determining sub-unit is used to
[0194] Determine first relative position information between the upper end of the target in the first image and each vertical sub-region.
[0195] And / or the first determination subunit is used to divide a cross-section in the channel through which the target passes into at least two upper and lower regions with the vertical sub-region as the center to obtain each divided region; and / or divide a cross-section in the channel through which the target passes into at least four upper, lower, left and right regions with the vertical sub-region as the center to obtain each divided region; determine the first relative position information between the first target divided region where the upper end of the target in the first image is located and each vertical sub-region.
[0196] And / or the second determination unit includes: a second selection sub-unit, used to select a horizontal sub-region with a different distance from the transparent section from the horizontal direction area, the horizontal sub-region at least including a first horizontal sub-region with a first distance, and a second horizontal sub-region with a second distance, the second distance is greater than the first distance, the first distance corresponds to the transparent door in the physical door, and the second distance corresponds to the non-transparent door in the physical door; the second determination sub-unit is used to determine the second relative position information of the lower end of the target in the first image and each horizontal sub-region.
[0197] and / or the second determining subunit is configured to divide the moving plane of the lower end into at least two upper and lower regions with the horizontal subregion as the center, to obtain the divided regions, wherein a direction perpendicular to a cross section in the passage through which the target passes and pointing to the horizontal subregion is considered downward;
[0198] Second relative position information between a second object division region where a lower end portion of the object in the first image is located and each horizontal sub-region is determined.
[0199] And / or the device also includes: a second determination module, used to determine the data to be trained with preset entry and exit labels, wherein the data to be trained includes a relative position matrix obtained by summarizing the relative position information of the target end of the target and the corresponding direction sub-area in the second image, wherein the second image corresponds to multiple scenes to be tested, and each scene to be tested corresponds to multiple second images; a second input module, used to input the data to be trained into a preset model to be trained to obtain the predicted entry and exit type of the target; a calculation module, used to perform difference calculation between the predicted entry and exit type and the entry and exit type label of the data to be trained to obtain an error result; a judgment module, used to judge whether the error result meets the error standard indicated by the preset error threshold range based on the error result; a return module, used to return to the step of inputting the data to be trained into the preset model to be trained to obtain the predicted entry and exit type of the target if the error result does not meet the error standard indicated by the preset error threshold range, and stop training until the training error result meets the error standard indicated by the preset error threshold range to obtain an entry and exit statistical model.
[0200] The specific implementation of the target flow statistics device of the present application is basically the same as the embodiments of the above-mentioned target flow statistics method, and will not be repeated here.
[0201] The present application also provides a target flow statistics system, the system comprising: a camera and a computing device; the camera being configured to capture multiple first images of a scene to be measured based on an arbitrary perspective and transmit the first images to a computing device; the computing device being configured to receive multiple first images of the scene to be measured sent by the camera from an arbitrary perspective; determining relative position information of a target end of a target and a corresponding directional subregion in the first image; the target end comprising an upper end and / or a lower end, the subregion being obtained by dividing a cross section of a passage through which the target passes along a preset direction; summarizing the relative position information of the target within a first preset time period to obtain a duration during which the target is continuously at the same relative position; and obtaining a relative position matrix based on the duration and the relative position information. The relative position matrix is input into an entry / exit door statistical model, and the relative position matrix is predicted based on the entry / exit door statistical model to obtain an entry / exit type of the target, wherein the entry / exit door statistical model is obtained by iteratively training a preset model to be trained based on data to be trained with entry / exit labels. The entry / exit types of multiple targets within a second preset time period are summarized to obtain the target flow within the preset time period.
[0202] An embodiment of the present application provides a storage medium, and the storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned target traffic statistics methods.
[0203] The specific implementation of the storage medium of the present application is basically the same as the embodiments of the above-mentioned target traffic statistics method, and will not be repeated here.
[0204] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned target traffic statistics method when executed by a processor.
[0205] The specific implementation of the computer program product of the present application is basically the same as the embodiments of the above-mentioned target traffic statistics method, and will not be repeated here.
[0206] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0207] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0208] Through the description of the above embodiments, the technical objectives of this field can be clearly understood that the above-mentioned embodiment methods can be implemented by means of software plus hardware platform, or by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM) and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0209] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A target traffic statistics system, characterized in that: The system comprises: A camera, configured to capture a plurality of first images of a scene to be measured based on any viewing angle and transmit the first images to a computing device; A computing device, the computing device is used to receive a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images; determine the relative position information of a target end of a target in the first image and a corresponding direction sub-area; the target end includes an upper end and / or a lower end, and the sub-area is obtained by dividing a section in a channel through which the target passes along a preset direction; summarize the relative position information of the target within a first preset time length to obtain the duration for which the target is continuously in the same relative position, and based on the duration and the relative position information, obtain a relative position matrix, and input the relative position matrix into an entry and exit statistical model, perform prediction processing on the relative position matrix based on the entry and exit statistical model to obtain the entry and exit type of the target, wherein the entry and exit statistical model is obtained by iteratively training a preset model to be trained based on the training data with entry and exit labels, and summarize the entry and exit types of multiple targets within a second preset time length to obtain the target flow within the preset time length.
2. A target traffic statistics method, characterized in that: The method comprises: Receiving a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images; Determining relative position information between a target end of the target in the first image and a corresponding directional subregion; the target end includes an upper end and / or a lower end, and the subregion is obtained by dividing a cross section of a passage through which the target passes along a preset direction; Summarizing the relative position information of the target within a first preset time period to obtain a duration in which the target is continuously at the same relative position, and obtaining a relative position matrix based on the duration and the relative position information, and inputting the relative position matrix into an entry and exit statistical model, performing prediction processing on the relative position matrix based on the entry and exit statistical model to obtain the entry and exit type of the target, wherein the entry and exit statistical model is obtained by iteratively training a preset model to be trained based on the training data to be trained with entry and exit labels; The entry and exit types of multiple targets within the second preset time period are summarized to obtain the target flow within the preset time period.
3. The target traffic statistics method according to claim 2, wherein: When a cross section in the passage through which the target passes is divided into regions along the vertical direction and / or the horizontal direction, the step of determining relative position information between the target end portion of the target in the first image and the corresponding directional subregion includes: Determining first relative position information between an upper end portion of the target and a vertical subregion in the first image; and / or determining second relative position information between a lower end portion of the target and a horizontal sub-region in the first image; the horizontal sub-region is located within a moving plane of the lower end portion, and the moving plane is a plane located within a preset range of the cross section; The first relative position information and / or the second relative position information are combined to obtain relative position information of the target end of the target in the first image and the corresponding direction sub-region.
4. The target traffic statistics method according to claim 3, wherein: The step of determining first relative position information between the upper end of the target and the vertical sub-region in the first image includes: Selecting vertical sub-regions of different heights from the vertical region, the vertical sub-regions including at least a first vertical sub-region of a first height range and a second vertical sub-region of a second height range, the first height range corresponding to a preset height of a first type of targets among the targets, the second height range corresponding to a preset height of a second type of targets among the targets, and the preset height of the first type of targets being greater than the preset height of the second type of targets; Determine first relative position information between the upper end of the target in the first image and each vertical sub-region.
5. The target traffic statistics method according to claim 4, characterized in that: The step of determining first relative position information between the upper end of the target and each vertical sub-region in the first image includes: Taking the vertical sub-region as the center, a cross section in the target passage is divided into at least two upper and lower regions to obtain divided regions; and / or dividing a cross section of the target passage into at least four regions, namely, upper, lower, left, and right, with the vertical sub-region as the center, to obtain the divided regions; First relative position information between a first object divided region where an upper end of the object in the first image is located and each vertical sub-region is determined.
6. The target traffic statistics method according to claim 3, wherein: When a cross section in the passage through which the target passes is a transparent cross section, the step of determining second relative position information between the lower end of the target and the horizontal sub-region in the first image includes: Selecting horizontal sub-regions with different distances from the transparent cross section from the horizontal region, the horizontal sub-regions at least including a first horizontal sub-region at a first distance and a second horizontal sub-region at a second distance, wherein the second distance is greater than the first distance; Second relative position information between the lower end of the target in the first image and each horizontal sub-region is determined.
7. The target traffic statistics method according to claim 6, characterized in that: The step of determining second relative position information between the lower end of the target in the first image and each horizontal sub-region includes: Taking the horizontal sub-region as the center, the moving plane of the lower end is divided into at least two upper and lower regions to obtain each divided region, wherein a cross section in the passage perpendicular to the target passage and pointing to the horizontal sub-region is considered to be downward; Second relative position information between a second object division region where a lower end portion of the object in the first image is located and each horizontal sub-region is determined.
8. The target traffic statistics method according to claim 2, wherein: Before the step of acquiring a first image of the scene to be measured, wherein the first image is a plurality of images, the method further includes: Determining training data with preset input and output labels, wherein the training data includes a relative position matrix obtained by summarizing relative position information of an object end portion of an object and a corresponding directional sub-region in a second image, wherein the second image corresponds to a plurality of scenes to be tested, and each scene to be tested corresponds to a plurality of second images; Inputting the data to be trained into a preset model to be trained to obtain the predicted input and output types of the target; Calculate the difference between the predicted input and output type and the input and output type label of the training data to obtain an error result; Based on the error result, determining whether the error result meets an error standard indicated by a preset error threshold range; If the error result does not meet the error standard indicated by the preset error threshold range, return to the step of inputting the data to be trained into the preset model to be trained to obtain the predicted entry and exit type of the target, and stop training until the training error result meets the error standard indicated by the preset error threshold range to obtain the entry and exit statistical model.
9. A target traffic statistics device, characterized in that: The device comprises: A receiving module, configured to receive a first image of a scene to be measured sent by a camera of any viewing angle, wherein the first image is a plurality of images; a first determining module, configured to determine relative position information between a target end portion of a target in the first image and a corresponding directional subregion; the target end portion includes an upper end portion and / or a lower end portion, and the subregion is obtained by dividing a cross section of a passage through which the target passes along a preset direction; A first input module is configured to summarize the relative position information of the target within a first preset time period to obtain a duration during which the target is continuously in the same relative position, obtain a relative position matrix based on the duration and the relative position information, input the relative position matrix into an entry / exit statistical model, perform prediction processing on the relative position matrix based on the entry / exit statistical model, and obtain the entry / exit type of the target, wherein the entry / exit statistical model is obtained by iteratively training a preset model to be trained based on the training data to be trained with entry / exit labels; The summarizing module is used to summarize the entry and exit types of multiple targets within a second preset time period to obtain the target flow within the preset time period.
10. A target flow calculation device, characterized in that: The method comprises a memory, a processor and a target flow statistics program stored in the memory and executable on the processor, wherein the processor implements the steps of the target flow statistics method according to any one of claims 2 to 8 when executing the target flow statistics program.
Citation Information
Patent Citations
Pedestrian?flow?counting method based on section?flow counting and system
CN103824114A
Mobile device-based spraying control method and terminal, and mobile device
CN109271862A