Data Processing Method, Apparatus, Electronic Device, and Machine-readable Storage Medium
By determining the co-occurrence point of the personnel and the accompanying distance of the calculation trajectory data within the preset statistical period, the efficiency and accuracy of distance calculation in personnel accompaniment relationship analysis are solved, and efficient accompanying analysis is achieved.
Patent Information
- Application Number
- CN202011280365.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-16
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2040-11-16
AI Technical Summary
How to effectively determine the accompanying distance between people so as to conduct accompanying analysis and discover relationships.
By determining the co-occurrence point of the first object and the second object within the preset statistical period, computing the accompanying distance based on their trajectory data. The specific steps include determining the starting point and end point of the co-occurrence point and the trajectory data, and then calculating the accompanying distance.
This method reduces the amount of data that requires concomitant analysis, improves analysis efficiency, and improves the accuracy of concomitant distance statistics.
Smart Images

Figure CN114511815B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular, to a data processing method, apparatus, electronic device, and machine-readable storage medium. Background Art
[0002] Based on the identity information corresponding to the image acquisition data, the image acquisition data can be analyzed concomitantly, so that the relationship between people can be discovered to a certain extent. If the accompanying distance between two people is relatively long, then there is probably a certain relationship between these two people. Through concomitant analysis, some people who are not easily discovered and are related to the target person can be found.
[0003] How to determine the accompanying distance between people has become a technical problem to be solved urgently. Summary of the Invention
[0004] In view of this, the present application provides a data processing method, apparatus, electronic device, and machine-readable storage medium.
[0005] According to the first aspect of the embodiments of the present application, a data processing method is provided, including:
[0006] Determine the co-occurrence points of the first object and the second object within a preset statistical period; wherein, a co-occurrence point is a monitoring point where images of the first object and the second object are collected within a preset time interval;
[0007] Based on the first trajectory data and the second trajectory data, determine the accompanying distance between the first object and the second object within a preset statistical period; wherein, the first trajectory data includes the image acquisition data on the first trajectory of the first object starting from the first co-occurrence point and ending at the second co-occurrence point, the second trajectory data includes the image acquisition data on the second trajectory of the second object starting from the first co-occurrence point and ending at the second co-occurrence point, and the first co-occurrence point and the second co-occurrence point are respectively the first co-occurrence point and the last co-occurrence point of the first object and the second object within a preset statistical period.
[0008] According to the second aspect of the embodiments of the present application, a data processing apparatus is provided, including:
[0009] A first determination unit configured to determine the co-occurrence points of the first object and the second object within a preset statistical period; wherein, a co-occurrence point is a monitoring point where images of the first object and the second object are collected within a preset time interval;
[0010] A second determination unit, configured to determine an accompanying distance between a first object and a second object within a preset statistical period based on first trajectory data and second trajectory data, where the first trajectory data includes image acquisition data on a first trajectory of the first object starting from a first co-occurrence point and ending at a second co-occurrence point, the second trajectory data includes image acquisition data on a second trajectory of the second object starting from the first co-occurrence point and ending at the second co-occurrence point, and the first co-occurrence point and the second co-occurrence point are respectively the first co-occurrence point and the last co-occurrence point of the first object and the second object within the preset statistical period.
[0011] According to a third aspect of the embodiments of the present application, there is provided an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0012] The memory is used to store a computer program;
[0013] The processor is configured to implement the data processing method of the first aspect when executing the program stored on the memory.
[0014] According to a fourth aspect of the embodiments of the present application, there is provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the data processing method of the first aspect is implemented.
[0015] According to a fifth aspect of the embodiments of the present application, there is provided a computer program, which is stored in a machine-readable storage medium, and when the processor executes the computer program, the processor is prompted to execute the data processing method of the first aspect.
[0016] The data processing method of the embodiments of the present application determines the co-occurrence points of the first object and the second object within a preset statistical period, and determines the accompanying distance between the first object and the second object within the preset statistical period based on the first trajectory data and the second trajectory data. By calculating the accompanying distance between the objects with co-occurrence points within the preset statistical period, the amount of data required for accompanying analysis is reduced, and the efficiency of accompanying analysis is improved; in addition, by determining the trajectory data of the two objects within the first co-occurrence point and the last co-occurrence point within the preset statistical period, and statistically calculating the accompanying distance between the two objects within the preset statistical period, the accuracy of accompanying distance statistics is improved. Description of the Drawings
[0017] Figure 1 is a schematic flowchart of a data processing method shown in an exemplary embodiment of the present application;
[0018] Figure 2It is a schematic flow chart showing the co - accompanying distance between a first object and a second object within a preset statistical period in an exemplary embodiment of the present application;
[0019] Figure 3 It is a schematic diagram showing the monitoring points of traj1 and traj2 in an exemplary embodiment of the present application;
[0020] Figure 4 It is a schematic structural diagram of a data processing device shown in an exemplary embodiment of the present application;
[0021] Figure 5 It is a schematic hardware structure diagram of an electronic device shown in an exemplary embodiment of the present application. Detailed implementation manners
[0022] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0023] The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The singular forms "a", "the", and "said" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0024] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present application, some technical terms related to the embodiments of the present application will be briefly described below.
[0025] Co - occurrence point: The co - occurrence point of the first object and the second object refers to a monitoring point where the images of both the first object and the second object are collected, and the difference between the collection time of the image of the first object and the collection time of the image of the second object (taking the larger value minus the smaller value, the same below) does not exceed a preset time interval (which can be set according to the actual scenario, such as 5 seconds).
[0026] For example, assume that the preset time interval is λ, the monitoring point A collects the image of the first object at time T1 and the image of the second object at time T2 (T2 > T1), and T2 - T1 ≤ λ, then the monitoring point A is the co - occurrence point of the first object and the second object.
[0027] Mutually exclusive points: The mutually exclusive points of the first object and the second object refer to two monitoring points that the first object and the second object cannot respectively pass through in an accompanying state when they move along the determined trajectories.
[0028] For example, when the first monitoring point captures an image of the first object, the second monitoring point captures an image of the second object, and the distance between the first monitoring point and the second monitoring point is greater than the product of the acquisition time difference (the difference between the acquisition time when the first monitoring point captures the image of the first object and the acquisition time when the second monitoring point captures the image of the second object) and the preset maximum speed (which can be set according to the actual scenario, such as 2 m / s), the first monitoring point and the second monitoring point are the mutually exclusive points of the first object and the second object; or, the acquisition time difference is less than the ratio of the distance between the first monitoring point and the second monitoring point to the preset maximum speed; or, the ratio of the distance between the first monitoring point and the second monitoring point to the acquisition time difference is greater than the preset maximum speed.
[0029] For example, assume that the preset maximum speed is Vmax, the monitoring point C captures an image of the first object at time T3, the monitoring point D captures an image of the second object (T4 > T3) at time T4, and the distance between the monitoring point C and the monitoring point D is S. Then, when S > (T2 - T1) * Vmax, the monitoring point C and the monitoring point D are the mutually exclusive points of the first object and the second object.
[0030] To make the above objects, features, and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0031] Please refer to Figure 1 , which is a schematic flowchart of a data processing method provided by an embodiment of the present application. As Figure 1 shown, the data processing method may include the following steps:
[0032] Step S100: Determine the co-occurrence points of the first object and the second object within a preset statistical period; where a co-occurrence point is a monitoring point that captures images of the first object and the second object within a preset time interval.
[0033] In the embodiments of the present application, the first object and the second object do not specifically refer to two fixed objects, but can refer to any two objects whose images are captured in the data processing system applying the technical solution provided by the embodiments of the present application. This will not be repeated in the following embodiments of the present application.
[0034] Exemplarily, the object may include, but is not limited to, a person or a vehicle, etc.
[0035] In addition, in the embodiments of the present application, unless otherwise specified, the image acquisition data mentioned refers to pictures that can identify the identity information of the object to be acquired. For example, for a vehicle, the identity information can be the license plate number; for a person, the identity information can be the person information obtained through face analysis, etc. In the embodiments of the present application, considering that two objects with an accompanying relationship usually appear at the same monitoring point within a preset time interval (that is, images of the two objects are respectively acquired by the monitoring point within the preset time interval, and the monitoring point is the co-occurrence point of the two objects), therefore, when performing an accompanying analysis on the two objects, it is necessary to first determine the co-occurrence point of the two objects.
[0036] Exemplarily, based on the image acquisition data of the first object and the second object within a preset statistical period, the co-occurrence points of the first object and the second object within the preset statistical period can be determined.
[0037] It should be noted that in the embodiments of the present application, when there is no co-occurrence point of the first object and the second object within the preset statistical period, it can be determined that there is no accompanying relationship between the first object and the second object within the preset statistical period.
[0038] In addition, when the number of co-occurrence points of the first object and the second object within the preset statistical period is one, it is usually impossible to determine whether there is an accompanying relationship between the first object and the second object before or after the co-occurrence point. Therefore, when the number of co-occurrence points of the first object and the second object within the preset statistical period is one, it can be determined that the accompanying distance between the first object and the second object within the preset statistical period is 0.
[0039] Exemplarily, the preset statistical period can be a day (i.e., a natural day), a week, a month, or other time ranges.
[0040] Step S110: Determine the accompanying distance between the first object and the second object within the preset statistical period based on the first trajectory data and the second trajectory data; wherein, the first trajectory data includes the image acquisition data on the first trajectory of the first object starting from the first co-occurrence point and ending at the second co-occurrence point, the second trajectory data includes the image acquisition data on the second trajectory of the second object starting from the first co-occurrence point and ending at the second co-occurrence point, and the first co-occurrence point and the second co-occurrence point are respectively the first co-occurrence point and the last co-occurrence point of the first object and the second object within the preset statistical period.
[0041] In the embodiments of the present application, considering that it is usually impossible to determine whether there is an accompanying relationship between the first object and the second object before the co-occurrence point of the first object and the second object appears.
[0042] In addition, considering that when there is no co-occurrence point of the first object and the second object after a certain co-occurrence point between the first object and the second object, it is usually impossible to determine whether there is an accompanying relationship between the first object and the second object after this co-occurrence point.
[0043] Therefore, based on the image acquisition data between the first co-occurrence point (referred to as the first co-occurrence point in this article) and the last co-occurrence point (referred to as the second co-occurrence point in this article) of the first object and the second object within a preset statistical period, the accompanying analysis of the first object and the second object can be performed.
[0044] Exemplarily, the first co-occurrence point and the second co-occurrence point of the first object and the second object within a preset statistical period can be determined first, and the image acquisition data (referred to as the first trajectory data in this article) on the trajectory (referred to as the first trajectory in this article) starting from the first co-occurrence point and ending at the second co-occurrence point of the first object can be obtained, and the image acquisition data (referred to as the second trajectory data in this article) on the trajectory (referred to as the second trajectory in this article) starting from the first co-occurrence point and ending at the second co-occurrence point of the second object can be obtained, and based on the first trajectory data and the second trajectory data, the accompanying distance between the first object and the second object within a preset statistical period can be determined.
[0045] In one example, based on the first trajectory data and the second trajectory data, the dynamic programming algorithm can be used to determine the accompanying distance between the first object and the second object within a preset statistical period.
[0046] It can be seen that in Figure 1 the method embodiment shown, the co-occurrence points of the first object and the second object within a preset statistical period are determined, and based on the first trajectory data and the second trajectory data, the accompanying distance between the first object and the second object within this preset statistical period is determined. By excluding the objects without co-occurrence points during the accompanying distance statistics within the preset statistical period, the amount of data required for the accompanying analysis is reduced, and the efficiency of the accompanying analysis is improved; in addition, by determining the trajectory data of the two objects within the first co-occurrence point and the last co-occurrence point within the preset statistical period, and based on this trajectory data, the accompanying distance between the two objects within this preset statistical period is statistically calculated, the accuracy of the accompanying distance statistics is improved.
[0047] As a possible embodiment, as Figure 2 shown, in step S110, based on the first trajectory data and the second trajectory data, determining the accompanying distance between the first object and the second object within this preset statistical period may include:
[0048] Step S111, traverse the first trajectory data and the second trajectory data to determine the co-occurrence points of the first object and the second object existing in the first trajectory and the second trajectory.
[0049] Step S112: Determine adjacent co-occurrence points, and determine the accompanying distance between the first object and the second object between each pair of adjacent co-occurrence points.
[0050] Step S113: Based on the accompanying distances between the first object and the second object between each pair of adjacent co-occurrence points, determine the accompanying distance between the first object and the second object within the preset statistical period.
[0051] Exemplarily, by traversing the first trajectory data and the second trajectory data, the co-occurrence points of the first object and the second object existing in the first trajectory and the second trajectory can be determined (including at least the above-mentioned first co-occurrence point and the second co-occurrence point).
[0052] When the co-occurrence points of the first object and the second object existing in the first trajectory and the second trajectory are determined, the accompanying distances between the first object and the second object between each pair of adjacent co-occurrence points can be determined respectively.
[0053] In one example, determining the accompanying distance between the first object and the second object between each pair of adjacent co-occurrence points may include:
[0054] For the same pair of adjacent co-occurrence points, if it is determined that there are mutually exclusive points of the first object and the second object between the first trajectory and the second trajectory at the adjacent co-occurrence points, then determine that the accompanying distance between the adjacent co-occurrence points is 0.
[0055] Exemplarily, for a pair of adjacent co-occurrence points, it can be determined whether there are mutually exclusive points of the first object and the second object between the first trajectory and the second trajectory at the adjacent co-occurrence points.
[0056] Among them, the mutually exclusive points of the first object and the second object are two monitoring points that cannot be respectively passed by the first object and the second object in an accompanying state based on the image acquisition data, where the first object moves along the first trajectory and the second object moves along the second trajectory.
[0057] For example, assume that monitoring point E and monitoring point F are adjacent co-occurrence points. The first trajectory also includes monitoring point G and monitoring point H between monitoring point E and monitoring point F, and the second trajectory also includes monitoring point I between monitoring point E and monitoring point F. Then, the image acquisition data of monitoring point G for the first object and the image acquisition data of monitoring point I for the second object can be compared to determine whether monitoring point G and monitoring point I are mutually exclusive points of the first object and the second object, and, the image acquisition data of monitoring point H for the first object and the image acquisition data of monitoring point I for the second object can be compared to determine whether monitoring point H and monitoring point I are mutually exclusive points of the first object and the second object.
[0058] For example, taking monitoring point G and monitoring point I as examples, the acquisition time of the image of the first object collected by monitoring point G and the acquisition time of the image of the second object collected by monitoring point I can be determined, and it can be judged whether the product of the difference between the two and the preset maximum speed is less than the distance between monitoring point G and monitoring point I; if so, it is determined that monitoring point G and monitoring point I are mutually exclusive points for the first object and the second object, that is, it is determined that the first object and the second object cannot pass through monitoring point G and monitoring point I respectively in the accompanied state; otherwise, it is determined that monitoring point G and monitoring point I are not mutually exclusive points for the first object and the second object.
[0059] Considering that when the first object and the second object are in the accompanied state, the monitoring points passed by the first object and the second object usually do not have mutually exclusive points. Therefore, when there are mutually exclusive points of the first object and the second object between the first trajectory and the second trajectory at adjacent co-occurrence points, it can be determined that the first object and the second object are not accompanied between the adjacent co-occurrence points, that is, the accompanied distance between the first object and the second object between the adjacent co-occurrence points is 0.
[0060] In another example, determining the accompanied distance between the first object and the second object at each adjacent co-occurrence point may include:
[0061] For the same pair of adjacent co-occurrence points, if it is determined that there are no mutually exclusive points of the first object and the second object between the first trajectory and the second trajectory at the adjacent co-occurrence points, then based on the monitoring points between the first trajectory and the second trajectory at the adjacent co-occurrence points, the accompanied distance between the first object and the second object at the adjacent co-occurrence points is determined.
[0062] Exemplarily, for the same pair of adjacent co-occurrence points, when there are no mutually exclusive points of the first object and the second object between the first trajectory and the second trajectory at the adjacent co-occurrence points, the accompanied distance between the first object and the second object at the adjacent co-occurrence points can be determined based on the monitoring points between the first trajectory and the second trajectory at the adjacent co-occurrence points.
[0063] When the accompanied distances between the first object and the second object at each adjacent co-occurrence point are determined respectively in the above manner, the accompanied distance between the first object and the second object within a preset statistical period can be determined based on the accompanied distances between the first object and the second object at each adjacent co-occurrence point.
[0064] Exemplarily, the sum of the accompanied distances between the first object and the second object at each adjacent co-occurrence point can be determined as the accompanied distance between the first object and the second object within a preset statistical period.
[0065] For example, assume that the adjacent co-occurrence points include (co-occurrence point E, co-occurrence point F), (co-occurrence point F, co-occurrence point J), and (co-occurrence point J, co-occurrence point K). According to the above method, the accompanying distance between the first object and the second object between co-occurrence point E and co-occurrence point F is determined to be S1 (S1 > 0, that is, there is no mutually exclusive point of the first object and the second object between co-occurrence point E and co-occurrence point F on the first trajectory and the second trajectory), the accompanying distance between the first object and the second object between co-occurrence point F and co-occurrence point J is 0 (that is, there is a mutually exclusive point of the first object and the second object between co-occurrence point F and co-occurrence point J on the first trajectory and the second trajectory), and the accompanying distance between the first object and the second object between co-occurrence point J and co-occurrence point K is S2. Then, the accompanying distance between the first object and the second object within the preset statistical period can be S1 + S2.
[0066] In one example, determining the accompanying distance between the first object and the second object between the adjacent co-occurrence points based on the monitoring points between the first trajectory and the second trajectory at the adjacent co-occurrence points may include:
[0067] Sort the adjacent co-occurrence points and the different monitoring points between the first trajectory and the second trajectory at the adjacent co-occurrence points in the order of acquisition time;
[0068] Respectively determine the distances between adjacent monitoring points after sorting, and determine the sum of the distances between adjacent monitoring points as the accompanying distance between the first object and the second object between the adjacent co-occurrence points.
[0069] Exemplarily, for adjacent co-occurrence points, when it is determined that there is no mutually exclusive point of the first object and the second object between the adjacent co-occurrence points on the first trajectory and the second trajectory, the adjacent co-occurrence points and the different monitoring points between the first trajectory and the second trajectory at the adjacent co-occurrence points can be sorted in the order of acquisition time, and the distances between adjacent monitoring points after sorting can be determined respectively. Furthermore, the sum of the distances between adjacent monitoring points is determined as the accompanying distance between the first object and the second object between the adjacent co-occurrence points.
[0070] For example, assume that the adjacent co-occurrence points include co-occurrence point E and co-occurrence point F. Between co-occurrence point E and co-occurrence point F in the first trajectory, there are monitoring points G and H, and between co-occurrence point E and co-occurrence point F in the second trajectory, there is monitoring point I. The acquisition time of co-occurrence point E for the first object and the second object is T11 (taking the acquisition time of the co-occurrence point for the first object and the second object to be the same as an example), the acquisition time of co-occurrence point F for the first object and the second object is T12, the acquisition time of monitoring point G for the first object is T13, the acquisition time of monitoring point H for the first object is T14, the acquisition time of monitoring point I for the second object is T22, and T11 < T13 < T22 < T14 < T12. Since there are no monitoring points for the first object and the second object between co-occurrence point E and co-occurrence point F in the first trajectory and the second trajectory, it can be determined that the first object and the second object are in an accompanying state between co-occurrence point E and co-occurrence point F. Monitoring points G and H missed the second object, and monitoring point I missed the first object. The first object and the second object passed through co-occurrence point E, monitoring point G, monitoring point I, monitoring point H, and co-occurrence point F in an accompanying state in sequence. Therefore, the distances between adjacent monitoring points can be determined respectively, that is, the distance between co-occurrence point E and monitoring point G (assumed to be S11), the distance between monitoring point G and monitoring point I (assumed to be S12), the distance between monitoring point I and monitoring point H (assumed to be S13), and the distance between monitoring point H and co-occurrence point F (assumed to be S14), and S11 + S12 + S13 + S14 is determined as the accompanying distance between the first object and the second object between co-occurrence point E and co-occurrence point F.
[0071] As a possible embodiment, in step S100, determining the co-occurrence points of the first object and the second object within a preset statistical period may include:
[0072] Obtain the image acquisition data of the first object within the preset statistical period as the first image acquisition data set; and obtain the image acquisition data of the second object within the preset statistical period as the second image acquisition data set;
[0073] For any piece of image acquisition data in the first image acquisition data set and the second image acquisition data set, based on the acquisition time of this piece of image acquisition data and the preset time interval, determine the time period to which this piece of image acquisition data belongs;
[0074] Based on the first image acquisition data and the second image acquisition data within the same time period, determine the co-occurrence points of the first object and the second object; where the first image acquisition data is the image acquisition data in the first image acquisition data set, and the second image acquisition data is the image acquisition data in the second image acquisition data set.
[0075] Exemplarily, when determining whether there is a co-occurrence point between two objects by comparing any piece of image acquisition data in the first image acquisition dataset and any piece of image acquisition data in the second image acquisition dataset respectively, since the time difference between the acquisition times of most of the image acquisition data is greater than the preset time interval, the implementation performance of determining the co-occurrence point is too poor.
[0076] Therefore, the image acquisition data can be mapped to different time periods based on the acquisition time of the image acquisition data at preset time intervals, and it is determined whether the monitoring point is the co-occurrence point of the two objects based on whether the acquisition times of the image acquisition data of the two objects at the same monitoring point are mapped to the same time period.
[0077] For example, assuming that the preset time interval is 5 seconds, the image acquisition data can be mapped to different time periods with 5 seconds as a time period.
[0078] For example, the image acquisition data with an acquisition time of 1 - 5 seconds can be mapped to time period 0; the image acquisition data with an acquisition time of 6 - 10 seconds can be mapped to time period 1, and so on.
[0079] It should be noted that the acquisition time of the image acquisition of the object by the monitoring point can be converted into seconds based on the first statistical period.
[0080] For example, taking the preset statistical period as a day, the acquisition time can be obtained by subtracting the reference time of the day from the system time at the time of image acquisition and then converting it into seconds.
[0081] Assuming within the first statistical period of March 9, 2020, the acquisition time can be obtained by subtracting 2020 - 03 - 09 00:00:00 from the system time and then converting it into seconds.
[0082] For example, for the image acquisition data collected at 2020 - 03 - 09 00:01:00, the acquisition time can be converted into 60 seconds, that is, the image acquisition data was collected at the 60th second of the day.
[0083] When the time periods to which the image acquisition data in the first image acquisition dataset and the second image acquisition dataset belong are determined, the co-occurrence points of the first object and the second object can be determined based on the first image acquisition data and the second image acquisition data within the same time period.
[0084] For example, when the monitoring points of the first image acquisition data and the second image acquisition data within a certain time period are the same and the acquisition time difference is less than the preset time interval, it is considered that the monitoring point of the first image acquisition data and the second image acquisition data is the co-occurrence point of the first object and the second object.
[0085] Considering that in the actual scenario, the acquisition time mapping of the image acquisition data of two objects at the same monitoring point is mapped to different time periods, but the difference in the acquisition time is within the preset time interval.
[0086] For example, assuming that the preset time interval is 5 seconds, the acquisition time of the monitoring point A for object 1 is 4 seconds, and the acquisition time for object 2 is 8 seconds. Then, when performing time period mapping in the above manner, the acquisition time of the image acquisition data of the monitoring point A for object 1 is mapped to time period 0, and the acquisition time of the image acquisition data for object 2 is mapped to time period 1, that is, mapped to different time periods, and it is concluded that the monitoring point A is not the co-occurrence point of object 1 and object 2. However, since the difference in the actual acquisition time of the monitoring point A for object 1 and object 2 is less than 5 seconds, that is, the monitoring point A is the co-occurrence point of object 1 and object 2. It can be seen that performing time period mapping in the above manner may cause some co-occurrence points not to be counted, that is, data loss occurs.
[0087] Based on the above considerations, in order to avoid data loss while improving the processing performance, when performing time period mapping on the image acquisition data, any image acquisition data in the first image acquisition dataset can be mapped to two adjacent time periods, and / or, any image acquisition data in the second image acquisition dataset can be mapped to two adjacent time periods.
[0088] That is, the time period to which any image acquisition data in the first image acquisition dataset belongs includes two adjacent time periods, or,
[0089] the time period to which any image acquisition data in the second image acquisition dataset belongs includes two adjacent time periods, or,
[0090] the time period to which any image acquisition data in the first image acquisition dataset belongs includes two adjacent time periods, and, the time period to which any image acquisition data in the second image acquisition dataset belongs includes two adjacent time periods.
[0091] In one example, for any image acquisition data in the first image acquisition dataset and the second image acquisition dataset, based on the acquisition time in this image acquisition data and the preset time interval, determining the time period to which this image acquisition data belongs includes:
[0092] For any image acquisition data in the first image acquisition dataset and the second image acquisition dataset, based on the ratio of the acquisition time of this image acquisition data to the preset value, determining the first time period to which this image acquisition data belongs;
[0093] For any piece of image acquisition data in the first image acquisition dataset, determine the second time period to which the piece of image acquisition data belongs based on the remainder obtained by taking the remainder of the acquisition time of the piece of image acquisition data with respect to a preset value, and the first time period; or / and, for any piece of image acquisition data in the second image acquisition dataset, determine the second time period to which the piece of image acquisition data belongs based on the remainder obtained by taking the remainder of the acquisition time of the piece of image acquisition data with respect to a preset value, and the first time period.
[0094] Exemplarily, on the one hand, for any piece of image acquisition data in the first image acquisition dataset and the second image acquisition dataset, the time period (referred to as the first time period in this article) to which the piece of image acquisition data belongs can be determined based on the ratio of the acquisition time of the piece of image acquisition data to a preset value.
[0095] For example, assuming that the preset value is twice the preset time interval, the first time period to which the image acquisition data belongs can be determined according to the following formula:
[0096]
[0097] where timeSegment1 is the first time period to which the image acquisition data belongs, timestamp is the acquisition time of the image acquisition data, λ is the preset time interval, is the floor function symbol.
[0098] On the other hand, for any piece of image acquisition data in the first image acquisition dataset, determine the second time period to which the piece of image acquisition data belongs based on the remainder obtained by taking the remainder of the acquisition time of the piece of image acquisition data with respect to a preset value, and the first time period; or / and, for any piece of image acquisition data in the second image acquisition dataset, determine the second time period to which the piece of image acquisition data belongs based on the remainder obtained by taking the remainder of the acquisition time of the piece of image acquisition data with respect to a preset value, and the first time period.
[0099] For example, still taking the preset value as twice the preset time interval as an example, for any piece of image acquisition data in the first image acquisition dataset, or / and, for any piece of image acquisition data in the second image acquisition dataset, the second time period to which the image acquisition data belongs can be determined according to the following formula:
[0100]
[0101] where timeSegment2 is the second time period to which the image acquisition data belongs, and "%" is the remainder operation.
[0102] It should be noted that considering that mapping any piece of image acquisition data in the first image acquisition dataset to two adjacent time periods, or mapping any piece of image acquisition data in the second image acquisition dataset to two adjacent time periods can avoid the above data loss situation. Therefore, any piece of image acquisition data in the first image acquisition dataset can be mapped to two adjacent time periods, or any piece of image acquisition data in the second image acquisition dataset can be mapped to two adjacent time periods, that is, any piece of image acquisition data in one of the first image acquisition dataset and the second image acquisition dataset is mapped to two adjacent time periods, and any piece of image acquisition data in the other dataset is mapped to one time period (such as implemented according to the above formula (1)) to reduce the amount of data to be processed.
[0103] In addition, to further reduce the amount of data to be processed, any piece of image acquisition data in the dataset with less data volume in the first image acquisition dataset and the second image acquisition dataset can be mapped to two adjacent time periods, and any piece of image acquisition data in the other dataset can be mapped to one time period.
[0104] Exemplarily, in the embodiment of the present application, after determining the accompanying distance between the first object and the second object within a preset statistical period (which can be called a preset first statistical period) in the above manner, the accompanying distance between the first object and the second object within each preset first statistical period determined within the preset second statistical period can also be used to determine the accompanying distance between the first object and the second object within the preset second statistical period, and the association relationship between the first object and the second object can be judged based on this accompanying distance.
[0105] For example, based on the comparison result between this accompanying distance and a preset distance threshold, the association relationship between the first object and the second object is judged.
[0106] Exemplarily, the preset second statistical period includes multiple preset first statistical periods.
[0107] For example, the preset first statistical period is a day, and the preset second statistical period is a week, a month, or a quarter, etc.
[0108] Another example is that the preset first statistical period is a month, and the preset second statistical period is a quarter or a half year, etc.
[0109] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present application, the technical solutions provided in the embodiments of the present application are described below with specific examples.
[0110] In this embodiment, taking the object as a person as an example, that is, performing accompanying analysis on face image acquisition data.
[0111] Exemplarily, the data used in the face image acquisition data accompanying analysis method is the face image acquisition data after being labeled with identity information (taking humanID as an example in this embodiment).
[0112] In this embodiment, the implementation process of the face image acquisition data accompanying method is as follows:
[0113] 1. Obtain the face image acquisition data set to be analyzed.
[0114] Exemplarily, when performing accompanying analysis on any two persons (assuming person 1 and person 2), the image acquisition data of person 1 within a preset statistical period can be used as the first image acquisition data set; the image acquisition data of person 2 within a preset statistical period can be used as the second image acquisition data set.
[0115] When performing accompanying analysis on a specified person (which can be called the target person), the image acquisition data can be divided into the image acquisition data set A of the target person within a preset statistical period, and the image acquisition data set B of all persons within a preset statistical period.
[0116] For example, assuming that it is necessary to analyze the accompanying persons of certain key persons, then the data set A is the image acquisition data of the corresponding key persons, and the data set B is the image acquisition data of all persons within the corresponding time period.
[0117] Exemplarily, taking the preset statistical period as a day as an example.
[0118] 2. Perform time period mapping processing on the image acquisition data set A of the target person. Each piece of data (deviceId, humanId, timestamp) is mapped to two adjacent time periods. One of them is (deviceId, humanId, timeSegment, timestamp), where timeSegment is the first time period in the above embodiment and can be determined using the above formula (1).
[0119] Among them, deviceId is the monitoring point number of the image acquisition data, humanId is the identity number of the person whose image is collected, timestamp is the acquisition time of the image acquisition data, λ is the configured time interval parameter, and when the time interval between two persons collected by the same monitoring point is less than λ, it is determined that these two persons appear at this monitoring point simultaneously.
[0120] The other piece of data is:
[0121]
[0122] That is, when this image acquisition data is in the first half of the current time period on the time axis, a copy of this image acquisition data is copied to the previous time period; otherwise, a copy of this image acquisition data is copied to the next time period. Here, timeSegment - 1 or timeSegment + 1 in the above formula is the second time period mentioned above.
[0123] 3. Using formula (1), perform time period mapping on the image acquisition data set B of all personnel within the preset statistical period. Each piece of data (deviceId, humanId, timestamp) will be processed into (deviceId, humanId, timeSegment, timestamp).
[0124] It can be seen that in this embodiment, since the amount of data in data set A is much smaller than that in data set B, therefore, by processing each piece of image acquisition data in data set A into two pieces of data and each piece of image acquisition data in data set B into one piece of data, while avoiding data loss, the amount of data to be processed is reduced, and the processing performance is improved.
[0125] 4. Perform a join (combination) on data sets A and B after the time period mapping process using deviceId + timeSegment as the key (primary key). The data format after the join is as follows:
[0126] (deviceId + timeSegment, [(humanId1, timestamp1), (humanId2, timestamp2)])
[0127] Filter the data after the join to remove data where humanId1 is equal to humanId2 (i.e., filter out data where the same person is accompanied by each other) or the time interval between timestamp1 and timestamp2 is greater than λ.
[0128] 5. Convert the data in step 4 into (humanId1 + human|d2, (deviceId, timestamp1, timestamp2));
[0129] Here, humanId1 < humanId2, that is, the smaller humanId is in the front. Group and aggregate using humanId1 + humanId2 as the key, that is, aggregate data with the same humanId1 + humanId2. After aggregation, filter out the result where there is only one piece of data with humanId1 + humanId2 as the key (i.e., filter out data where the number of co - occurrence points is 1).
[0130] 6. For each piece of grouped and aggregated data with the key of humanId1 + humanId2 in 5, find the first co-occurrence point and the last co-occurrence point of humanId1 and humanId2 on the same day, and determine the image acquisition data traj1 (i.e., the above-mentioned first trajectory data) of humanId1 on the trajectory starting from the first co-occurrence point and ending at the last co-occurrence point on the same day; and the image acquisition data traj2 (i.e., the above-mentioned second trajectory data) of humanId2 on the trajectory starting from the first co-occurrence point and ending at the last co-occurrence point on the same day.
[0131] Exemplarily, the formats of traj1 and traj2 are List[(deviceId, timestamp)], that is, a list composed of multiple (deviceId, timestamp), and each (deviceId, timestamp) is sorted in ascending order based on timestamp.
[0132] In this embodiment, based on traj1 and traj2 obtained in 6, the dynamic programming algorithm can be used to determine the accompanying distance between humanId1 and humanId2, and its specific implementation process is as follows:
[0133] Assume that the length of traj1 is m, that is, traj1 contains m pieces of image acquisition data, the length of traj2 is n, that is, traj2 contains n pieces of image acquisition data, and the starting points and ending points of traj1 and traj2 are the same.
[0134] Construct a two-dimensional array of m * n to store the intermediate result g of the accompanying distance calculation, where:
[0135] g(i, j) = (peerDist i,j , tempPeerDist i,j , lastDeviceId i,j )
[0136] Among them, g(i, j) represents the intermediate result calculated by the sub-trajectory composed of the first i + 1 pieces of image acquisition data of traj1 and the sub-trajectory composed of the first j + 1 pieces of image acquisition data of traj2; peerDist is the accompanying distance, tempPeerDist is the possible accompanying distance between traj1 and traj2 starting from the last co-occurrence, and 1astDeviceId is the deviceId corresponding to the image acquisition data with the largest timestamp.
[0137] The specific calculation process is as follows:
[0138] First, calculate the intermediate results in the boundary cases, that is, the results of the first row and the first column of the two-dimensional array of intermediate results. The accompanying distances are all 0, and the temporary accompanying distance tempPeerDist is the cumulative distance traveled.
[0139] tempPeerDist i,0 = tempPeerDist i-1,0 + dist(deviceId1 i , deviceId1 i-1 ), i > 0;
[0140] tempPeerDist 0,j = tempPeerDist 0,j-1 + dist(deviceId2 j , deviceId2 j-1 ), j > 0.
[0141] Among them, deviceId1 i is the i-th monitoring point passed by humanId1 under the first trajectory, and deviceId2 j is the j-th monitoring point passed by humanId2 under the second trajectory. dist(device1 i , device1 i-1 ) is the distance between device1 i and device1 i-1 , and dist(device2 i , device2 i-1 ) is the distance between device2 i and device2 i-1 .
[0142] g(0, 0) = (0, 0, deviceId10)
[0143] g(i, 0) = (0, tempPeerDist i-1,0 + dist(deviceId1 i , deviceId1 i-1 ), deviceId1 i )
[0144] g(0, j) = (0, tempPeerDist 0,j-1 + dist(deviceId2j, deviceId2 j-1 ), deviceId2 j )
[0145] When i > 0 and j > 0, the calculation result of lastDeviceId is as follows:
[0146]
[0147] The calculation results of peerDist and tempPeerDist are as follows (for any (i, j), in the order of Case 1 to Case 5, it is judged in turn whether the conditions of the corresponding case are met):
[0148] Case 1: If traj1 and traj2 just co - occur at (i, j), that is, the (i + 1)-th monitoring point in traj1 and the (j + 1)-th monitoring point in traj2 are the same monitoring point, that is, deviceId1 i is equal to deviceId2 j , and the time difference between the acquisition times of the images of humanId1 and humanId2 is less than λ, then g(i, j)
[0149]
[0150] Case 2: If the sub - trajectory formed by the first i + 1 image acquisition data of traj1 and the sub - trajectory formed by the first j + 1 image acquisition data of traj2 co - occur at i or j, that is, there is a monitoring point among the first j monitoring points of traj2 that is the same as the (i + 1)-th monitoring point of traj1, and the time difference between the acquisition times of the images of humanId1 and humanId2 is less than λ, or there is a monitoring point among the first i monitoring points of traj1 that is the same as the (j + 1)-th monitoring point of traj2, and the time difference between the acquisition times of the images of humanId1 and humanId2 is less than λ, then it is calculated in the manner described in Case 5, that is, for the middle result of the two - dimensional array, the rows and columns where the co - occurrence point is located after the co - occurrence point are calculated in the calculation manner described in Case 5.
[0151] Case 3: If tempPeerDist i-1 , j < 0 or tempPeerDist i,j-1 < 0, then
[0152] g(i, j) = (max(peerDist i,j-1 , peerDist i-1,j ), - 1, lastDeviceId i,j )
[0153] Among them, when there are mutually exclusive points in traj1 and traj2, set tempPeerDist to -1, and when the first co-occurring point appears after the mutually exclusive point, set tempPeerDist to 0.
[0154] Case 4: If dist(deviceId1 i , deviceId2 j ) > |time1 i - time2 j | * maxV, then
[0155] g(i, j) = (max(peerDist i,j-1 , peerDist i-1,j ), -1, lastDeviceId i,j )
[0156] Among them, maxV is the preset maximum speed, time1 i is the acquisition time of the (i + 1)-th monitoring point of traj1 for humanId1, time2 j is the acquisition time of the (j + 1)-th monitoring point of traj2 for humanId2, dist(deviceId1 i , deviceId2 j ) is the distance between the (i + 1)-th monitoring point of traj1 and the (j + 1)-th monitoring point of traj2. When dist(deviceId1 i , deviceId2 j ) > |time1 i - time2 j | * maxV, it indicates that the (i + 1)-th monitoring point of traj1 and the (j + 1)-th monitoring point of traj2 are mutually exclusive points.
[0157] Case 5: When the conditions of Case 2 are met, or when the conditions of Cases 1 - 4 are not met, first compare the magnitudes of peerDist i,j-1 and peerDist i-1,j , set peerDist i,j to the maximum value of the two, and calculate tempPeerDist i,j based on the lastDeviceId of the intermediate result corresponding to the maximum value of the two. The calculation process is as follows:
[0158]
[0159] If peerDist i,j-1 > peerDist i-1,j, then
[0160] tempPeerDist i,j = tempPeerDist i,j-1 + dist(lastDeviceId i,j , lastDeviceId i,j-1 )
[0161] If peerDist i,j-1 < peerDist i-1,j , then
[0162] tempPeerDist i,j = tempPeerDist i-1,j + dist(lastDeviceId i,j , lastDeviceId i-1,j )
[0163] When peerDist i,j-1 and peerDist i-1,j are equal, select the maximum value between tempPeerDist i-1,j + dist(lastDeviceId i,j , lastDeviceId i-1,j ) and tempPeerDist i,j-1 + dist(lastDeviceId i,j , lastDeviceId i,j-1 )) as the value of tempPeerDist i,j . The calculation process is as follows:
[0164] If peerDist i,j-1 = peerDist i-1,j , then:
[0165] tempPeerDist i,j = max(
[0166] tempPeerDist i-1,j + dist(lastDeviceId i,j , lastDeviceId i-1,j ),
[0167] tempPeerDist i,j-1 + dist(lastDeviceId i,j , lastDeviceId i,j-1 ))
[0168] The final accompanying distance is peerDist m-1,n-1 。
[0169] For example, please refer to Figure 3 ,assuming that the monitoring points of traj1 and traj2 are respectively as shown by the solid line and the dotted line in Figure 3 ,wherein Figure 3 the horizontal and vertical coordinates of the coordinate system in
[0170] are the longitude and latitude of the abstract space model. Based on the coordinates of the monitoring points in this coordinate system, the positions of the monitoring points can be determined.
[0171] [(deviceId1, 0s), (deviceId2, 100s), (deviceId4, 200s), (deviceId6, 400s), (deviceId7, 500s)]
[0172] traj2 is:
[0173] [(deviceId1, 1s), (deviceId3, 101s), (deviceId4, 201s), (deviceId5, 301s), (deviceId7, 501s)]
[0174] Among them, the coordinate of deviceId1 is (0, 0) in the figure, the coordinate of deviceId2 is (0, 1), the coordinate of deviceId3 is (1, 0), the coordinate of deviceId4 is (1, 1), the coordinate of deviceId5 is (2, 1), the coordinate of deviceId6 is (2, 2), and the coordinate of deviceId7 is (3, 2).
[0175] Assume Figure 3 that one scale in represents an actual distance of 100 meters, that is, the actual distance between deviceId1 and deviceId2 is 100 meters, and the actual distance between deviceId2 and deviceId3 is
[0176] Assume that the preset maximum speed maxV is 2 m / s. Then, there is a mutual exclusion between the two image acquisition data of (deviceId2, 100 s) and (deviceId3, 101 s), that is, the distance between deviceId2 and deviceId3 (142 meters) is greater than the product of the acquisition time difference (101 - 100 = 1 second) and the preset maximum speed (1 * 2 = 2 meters). Then, it is determined that the accompanying distance between traj1 and traj2 from deviceId1 to deviceId4 is 0, that is, there is no accompaniment. There is no mutually exclusive point between the co-occurrence point positions deviceId4 and deviceId7. Therefore, it can be determined that traj1 and traj2 are in an accompanying state from deviceId4 to deviceId7.
[0177] Considering the actual scenario, limited by the angle of the monitoring point positions and the accuracy of the annotation algorithm, there may be a situation where the images of two people are not collected simultaneously at some monitoring point positions between traj1 and traj2 from deviceId4 to deviceId7. Therefore, when it is determined that traj1 and traj2 are in an accompanying state from deviceId4 to deviceId7, all the monitoring point positions included between traj1 and traj2 from deviceId4 to deviceId7 can be used as the monitoring point positions accompanied by passage, that is, deviceId4, deviceId5, deviceId6, and deviceId7 are all the monitoring point positions accompanied by passage, and the accompanying distance is the sum of the distance from deviceId4 to deviceId5, the distance from deviceId5 to deviceId6, and the distance from deviceId6 to deviceId7, that is, 100 meters + 100 meters + 100 meters = 300 meters.
[0178] The process of calculating the accompanying distance of the two trajectories traj1 and traj2 according to the above dynamic programming algorithm is as follows:
[0179] First, calculate the boundary results to obtain the intermediate result g as follows, where the horizontal axis i represents the serial number of the image acquisition data of traj1, and the vertical axis j represents the serial number of the image acquisition data of traj2:
[0180]
[0181]
[0182] When i = 1 and j = 1, since deviceId2 and devicedI3 are mutually exclusive point positions, tempPeerDist = -1, and the following intermediate calculation results are obtained:
[0183]
[0184] When i = 2 and j = 2, since deviceId4 is a co - occurrence point, that is, after the mutually exclusive points appear, the co - occurrence point appears again. Therefore, tempPeerDist will be reset to 0, and the intermediate calculation result is as follows:
[0185]
[0186] The subsequent intermediate calculation results are as follows:
[0187]
[0188] Finally, the companion distance between traj1 and traj2 is 300 meters.
[0189] Among them, the calculation method of each intermediate result corresponds to the following table:
[0190]
[0191] In the embodiments of the present application, the co - occurrence points of the first object and the second object within a preset statistical period are determined, and based on the first trajectory data and the second trajectory data, the companion distance between the first object and the second object within the preset statistical period is determined. By calculating the companion distance between the objects with co - occurrence points within the preset statistical period, the amount of data required for companion analysis is reduced, and the efficiency of companion analysis is improved; in addition, by determining the trajectory data of the two objects within the first co - occurrence point and the last co - occurrence point within the preset statistical period, and based on this trajectory data, the companion distance between the two objects within the preset statistical period is statistically calculated, the accuracy of companion distance statistics is improved.
[0192] The method provided by the present application has been described above. Next, the device provided by the present application will be described:
[0193] Please refer to Figure 4 , which is a schematic structural diagram of a data processing device provided by an embodiment of the present application. As Figure 4 shown, the data processing device may include:
[0194] A first determination unit 410, configured to determine the co - occurrence points of the first object and the second object within a preset statistical period; where a co - occurrence point is a monitoring point where images of the first object and the second object are collected within a preset time interval;
[0195] A second determination unit 420, configured to determine an accompanying distance between a first object and a second object within a preset statistical period based on first trajectory data and second trajectory data; wherein, the first trajectory data includes image acquisition data on a first trajectory of the first object starting from a first co-occurrence point position and ending at a second co-occurrence point position, the second trajectory data includes image acquisition data on a second trajectory of the second object starting from the first co-occurrence point position and ending at the second co-occurrence point position, and the first co-occurrence point position and the second co-occurrence point position are respectively the first co-occurrence point position and the last co-occurrence point position of the first object and the second object within the preset statistical period.
[0196] In a possible embodiment, the second determination unit 420 is specifically configured to traverse the first trajectory data and the second trajectory data to determine co-occurrence point positions of the first object and the second object existing in the first trajectory and the second trajectory;
[0197] Determine adjacent co-occurrence point positions, and determine the accompanying distance between the first object and the second object between each pair of adjacent co-occurrence point positions;
[0198] Based on the accompanying distances between the first object and the second object between each pair of adjacent co-occurrence point positions, determine the accompanying distance between the first object and the second object within the preset statistical period.
[0199] In a possible embodiment, the second determination unit 420 is specifically configured to, for the same pair of adjacent co-occurrence point positions, if it is determined that there are mutually exclusive point positions of the first object and the second object between the first trajectory and the second trajectory at the adjacent co-occurrence point positions, determine that the accompanying distance between the adjacent co-occurrence point positions is 0; wherein, the mutually exclusive point positions are determined based on the image acquisition data, and are two monitoring point positions that cannot be respectively passed by the first object moving along the first trajectory and the second object moving along the second trajectory in an accompanying state.
[0200] In a possible embodiment, the second determination unit 420 is specifically configured to, for the same pair of adjacent co-occurrence point positions, if it is determined that there are no mutually exclusive point positions of the first object and the second object between the first trajectory and the second trajectory at the adjacent co-occurrence point positions, determine the accompanying distance between the first object and the second object between the adjacent co-occurrence point positions based on the monitoring point positions between the first trajectory and the second trajectory at the adjacent co-occurrence point positions; wherein, the mutually exclusive point positions are determined based on the image acquisition data, and are two monitoring point positions that cannot be respectively passed by the first object moving along the first trajectory and the second object moving along the second trajectory in an accompanying state.
[0201] In a possible embodiment, the second determination unit 420 is specifically configured to sort the adjacent co-occurrence point positions and different monitoring point positions between the first trajectory and the second trajectory at the adjacent co-occurrence point positions in the order of acquisition time;
[0202] Determine the distances between adjacent monitored points after sorting respectively, and determine the sum of the distances between adjacent monitored points as the accompanying distance between the first object and the second object at the adjacent co-occurrence points.
[0203] In a possible embodiment, the first determination unit 410 is specifically configured to obtain the image acquisition data of the first object within a preset statistical period as the first image acquisition data set; and obtain the image acquisition data of the second object within a preset statistical period as the second image acquisition data set;
[0204] For any piece of image acquisition data in the first image acquisition data set and the second image acquisition data set, determine the time period to which the piece of image acquisition data belongs based on the acquisition time of the piece of image acquisition data and a preset time interval;
[0205] Based on the first image acquisition data and the second image acquisition data within the same time period, determine the co-occurrence points of the first object and the second object; wherein, the first image acquisition data is the image acquisition data in the first image acquisition data set, and the second image acquisition data is the image acquisition data in the second image acquisition data set.
[0206] In a possible embodiment, the time period to which any piece of image acquisition data in the first image acquisition data set belongs includes two adjacent time periods, or,
[0207] the time period to which any piece of image acquisition data in the second image acquisition data set belongs includes two adjacent time periods, or,
[0208] the time period to which any piece of image acquisition data in the first image acquisition data set belongs includes two adjacent time periods, and the time period to which any piece of image acquisition data in the second image acquisition data set belongs includes two adjacent time periods.
[0209] In a possible embodiment, the first determination unit 410 is specifically configured to, for any piece of image acquisition data in the first image acquisition data set and the second image acquisition data set, determine the first time period to which the piece of image acquisition data belongs based on the ratio of the acquisition time of the piece of image acquisition data to a preset value;
[0210] For any piece of image acquisition data in the first image acquisition data set, determine the second time period to which the piece of image acquisition data belongs based on the remainder of the acquisition time of the piece of image acquisition data divided by the preset value and the first time period; or / and, for any piece of image acquisition data in the second image acquisition data set, determine the second time period to which the piece of image acquisition data belongs based on the remainder of the acquisition time of the piece of image acquisition data divided by the preset value and the first time period.
[0211] Please refer to Figure 5 , which is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. The electronic device may include a processor 501, a communication interface 502, a memory 503, and a communication bus 504. The processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504. Among them, a computer program is stored on the memory 503; the processor 501 may execute the data processing method described above by executing the program stored on the memory 503.
[0212] The memory 503 mentioned in this article may be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the memory 502 may be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
[0213] An embodiment of the present application also provides a machine-readable storage medium storing a computer program, such as Figure 5 the memory 503 in Figure 5 The computer program can be executed by the processor 501 in the electronic device shown to implement the data processing method described above.
[0214] An embodiment of the present application also provides a computer program stored in a machine-readable storage medium, such as Figure 5 the memory 503 in
[0215] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the presence of additional identical elements in the process, method, article, or device including the element.
[0216] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the scope of protection of the present application.
Claims
1. A data processing method, characterized in that, Including: Determine the co-occurrence points of the first object and the second object within a preset statistical period; wherein, one co-occurrence point is a monitoring point where images of the first object and the second object are collected within a preset time interval. Based on the first trajectory data and the second trajectory data, determine the accompanying distance between the first object and the second object within the preset statistical period; wherein, the first trajectory data includes image acquisition data on the first trajectory of the first object starting from the first co-occurrence point and ending at the second co-occurrence point, the second trajectory data includes image acquisition data on the second trajectory of the second object starting from the first co-occurrence point and ending at the second co-occurrence point, and the first co-occurrence point and the second co-occurrence point are respectively the first co-occurrence point and the last co-occurrence point of the first object and the second object within the preset statistical period. Wherein, the determining the accompanying distance between the first object and the second object within the preset statistical period based on the first trajectory data and the second trajectory data includes: Determine the adjacent co-occurrence points in the first trajectory data and the second trajectory data, and determine the accompanying distance between the first object and the second object between each pair of adjacent co-occurrence points. Based on the accompanying distances between the first object and the second object between each pair of adjacent co-occurrence points, determine the accompanying distance between the first object and the second object within the preset statistical period.
2. The method according to claim 1, characterized in that The determining the accompanying distance between the first object and the second object between each pair of adjacent co-occurrence points includes: For the same pair of adjacent co-occurrence points, if it is determined that there are mutually exclusive points of the first object and the second object between the first trajectory and the second trajectory at the adjacent co-occurrence points, then determine the accompanying distance between the adjacent co-occurrence points to be 0; wherein, the mutually exclusive points are determined based on the image acquisition data, and when the first object moves along the first trajectory and the second object moves along the second trajectory, the two monitoring points that cannot be respectively passed in the accompanying state.
3. The method according to claim 1, wherein The determining the accompanying distance between the first object and the second object between each pair of adjacent co-occurrence points includes: For the same pair of adjacent co-occurrence points, if it is determined that there are no mutually exclusive points of the first object and the second object between the first trajectory and the second trajectory at the adjacent co-occurrence points, then based on the monitoring points between the first trajectory and the second trajectory at the adjacent co-occurrence points, determine the accompanying distance between the first object and the second object between the adjacent co-occurrence points; wherein, the mutually exclusive points are determined based on the image acquisition data, and when the first object moves along the first trajectory and the second object moves along the second trajectory, the two monitoring points that cannot be respectively passed in the accompanying state.
4. The method according to claim 3, characterized in that, The determining the accompanying distance between the first object and the second object between the adjacent co-occurrence points based on the monitoring points between the first trajectory and the second trajectory at the adjacent co-occurrence points includes: Sort the adjacent co-occurrence points and the different monitoring points between the first trajectory and the second trajectory at the adjacent co-occurrence points in the order of acquisition time; Respectively determine the distances between adjacent monitoring points after sorting, and determine the sum of the distances between adjacent monitoring points as the accompanying distance between the first object and the second object at the adjacent co-occurrence points.
5. The method according to any one of claims 1 to 4, characterized in that, The determining of the co-occurrence points of the first object and the second object within a preset statistical period includes: Obtain the image acquisition data of the first object within a preset statistical period as the first image acquisition data set; and obtain the image acquisition data of the second object within the preset statistical period as the second image acquisition data set; For any piece of image acquisition data in the first image acquisition data set and the second image acquisition data set, determine the time period to which the piece of image acquisition data belongs based on the acquisition time of the piece of image acquisition data and the preset time interval; Based on the first image acquisition data and the second image acquisition data within the same time period, determine the co-occurrence points of the first object and the second object; wherein, the first image acquisition data is the image acquisition data in the first image acquisition data set, and the second image acquisition data is the image acquisition data in the second image acquisition data set.
6. The method according to claim 5, wherein The time period to which any piece of image acquisition data in the first image acquisition data set belongs includes two adjacent time periods, or The time period to which any piece of image acquisition data in the second image acquisition data set belongs includes two adjacent time periods, or The time period to which any piece of image acquisition data in the first image acquisition data set belongs includes two adjacent time periods, and the time period to which any piece of image acquisition data in the second image acquisition data set belongs includes two adjacent time periods.
7. The method according to claim 6, wherein The determining, for any piece of image acquisition data in the first image acquisition data set and the second image acquisition data set, of the time period to which the piece of image acquisition data belongs based on the acquisition time in the piece of image acquisition data and the preset time interval includes: For any piece of image acquisition data in the first image acquisition data set and the second image acquisition data set, determine the first time period to which the piece of image acquisition data belongs based on the ratio of the acquisition time of the piece of image acquisition data to a preset value; For any piece of image acquisition data in the first image acquisition data set, determine the second time period to which the piece of image acquisition data belongs based on the remainder of the acquisition time of the piece of image acquisition data divided by the preset value and the first time period; or / and, for any piece of image acquisition data in the second image acquisition data set, determine the second time period to which the piece of image acquisition data belongs based on the remainder of the acquisition time of the piece of image acquisition data divided by the preset value and the first time period.
8. A data processing device, characterized in that, including: The first determination unit is configured to determine the co-occurrence points of the first object and the second object within a preset statistical period; wherein, one co-occurrence point is a monitoring point at which images of the first object and the second object are collected within a preset time interval. The second determination unit is configured to determine the accompanying distance between the first object and the second object within the preset statistical period based on the first trajectory data and the second trajectory data; wherein, the first trajectory data includes image acquisition data on the first trajectory of the first object starting from the first co-occurrence point and ending at the second co-occurrence point, the second trajectory data includes image acquisition data on the second trajectory of the second object starting from the first co-occurrence point and ending at the second co-occurrence point, and the first co-occurrence point and the second co-occurrence point are respectively the first co-occurrence point and the last co-occurrence point of the first object and the second object within the preset statistical period. Wherein, the second determination unit is specifically configured to determine the adjacent co-occurrence points in the first trajectory data and the second trajectory data, and determine the accompanying distance between the first object and the second object between each pair of adjacent co-occurrence points. Based on the accompanying distances between the first object and the second object between each pair of adjacent co-occurrence points, determine the accompanying distance between the first object and the second object within the preset statistical period.
9. The apparatus according to claim 8, wherein the second determination unit is specifically configured to, for the same pair of adjacent co-occurrence points, if it is determined that there are mutually exclusive points of the first object and the second object between the adjacent co-occurrence points in the first trajectory and the second trajectory, determine that the accompanying distance between the adjacent co-occurrence points is 0; wherein, the mutually exclusive points are determined based on the image acquisition data, and are two monitoring points that cannot be respectively passed by the first object moving along the first trajectory and the second object moving along the second trajectory in an accompanying state.
10. The apparatus according to claim 8, wherein the second determination unit is specifically configured to, for the same pair of adjacent co-occurrence points, if it is determined that there are no mutually exclusive points of the first object and the second object between the adjacent co-occurrence points in the first trajectory and the second trajectory, determine the accompanying distance between the first object and the second object between the adjacent co-occurrence points based on the monitoring points between the adjacent co-occurrence points in the first trajectory and the second trajectory; wherein, the mutually exclusive points are determined based on the image acquisition data, and are two monitoring points that cannot be respectively passed by the first object moving along the first trajectory and the second object moving along the second trajectory in an accompanying state.
11. The apparatus according to claim 10, wherein the second determination unit is specifically configured to sort the adjacent co-occurrence points, as well as different monitoring points between the adjacent co-occurrence points in the first trajectory and the second trajectory, in the order of acquisition time. Determine the distances between each pair of adjacent monitored points after sorting respectively, and determine the sum of the distances between each pair of adjacent monitored points as the accompanying distance between the first object and the second object at the adjacent co-occurrence points.
12. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory is used for storing computer programs; The processor is used to implement the method according to any one of claims 1-7 when executing the programs stored on the memory.
13. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1-7 is implemented.
Citation Information
Patent Citations
Method and device for determining accompanying relationship of identity features
CN110909263A
Motion trail accompanying determination method and device and server
CN110944296A