Peer object detection method, device, equipment and medium
By using trajectory information screening and numbering processing technology in peer detection, the problems of traditional peer detection calculations are solved, and more efficient and accurate peer detection is achieved.
Patent Information
- Application Number
- CN202311169305.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2025-03-11
AI Technical Summary
Traditional peer detection technology has the problems of long calculation time and poor detection accuracy, especially in complex scenarios where there are a large number of repeated trajectory points.
By obtaining the trajectory information of the target object and the object to be tested based on the image data collected by each camera during the specified period, selecting the trajectory information of the object to be tested, and adding a sorted continuous number to it, eliminating the same repeated trajectory points identified by the camera, and finally determining whether the object to be tested is in line with the target object based on the number of remaining trajectory information.
It reduces the calculation time-consuming of peer detection, improves detection accuracy, and effectively eliminates the repeated track points captured by the same camera in continuous time.
Smart Images

Figure CN119600493A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a peer object detection method, apparatus, device and medium. Background Art
[0002] Target peer detection is an important task in the field of traffic safety. Target peer detection refers to identifying peer objects that have a peer relationship with the target object (such as pedestrians, vehicles, etc.) from the image data captured by road network cameras.
[0003] The technical implementation of traditional peer detection mainly involves pre-selecting the object to be processed in a given video stream that is suspected to have a peer relationship with the target object, performing data analysis on the video stream through a pre-trained network model, obtaining the similarity comparison result of the travel trajectory of the object to be processed and the target object in the video stream, and determining whether the object to be processed and the target object are in the same peer relationship based on the comparison result.
[0004] The process of using network models for peer detection is relatively complex. It not only requires labeling multiple target samples in consecutive video frames during the model training phase, but also integrates algorithmic logic for trajectory recognition and similarity comparison. Furthermore, currently known network models for peer detection can only perform peer detection on one target at a time, resulting in lengthy computational overhead. Furthermore, network models typically exhibit poor detection accuracy in complex scenarios with numerous repeated trajectory points. Summary of the Invention
[0005] The embodiments of the present application provide a peer object detection method, apparatus, device, and medium for reducing the computational time of the peer detection process and improving detection accuracy.
[0006] To achieve the above objectives, the technical solution of the embodiment of the present application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a peer object detection method, the method comprising:
[0008] Based on the image data collected by each camera during a specified time period, first trajectory information of the target object and second trajectory information of the object to be measured are obtained; wherein each piece of trajectory information includes a camera identifier and a time point, and the trajectory information represents image data of the object corresponding to the trajectory information collected by the camera with the camera identifier at the time point; the trajectory information is the first trajectory information or the second trajectory information;
[0009] Selecting the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information;
[0010] For each object to be measured, a first number is added to the measured trajectory information according to the time point of the object to be measured corresponding to the measured trajectory information; if the camera identifiers of any two adjacent measured trajectory information with the same first number are the same, one of the two measured trajectory information is eliminated based on a preset rule; wherein the first numbers of the measured trajectory information with the same time point are different;
[0011] Determine whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory to be detected of the object to be detected.
[0012] In some possible embodiments, selecting the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information includes:
[0013] For each piece of first trajectory information, determining a time interval of the first trajectory information according to a time point of the first trajectory information; and using second trajectory information whose time point falls within the time interval as second trajectory information associated with the first trajectory information;
[0014] Eliminate the second track information that has no correlation with each first track information;
[0015] For the remaining second trajectory information after the elimination, the second trajectory information corresponding to the same object as the object to be measured is used as the trajectory information to be measured corresponding to the object to be measured.
[0016] In some possible embodiments, adding a first serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured includes:
[0017] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, sort the multiple pieces of track information to be measured in order of priority;
[0018] The first numbers with consecutive numbers are sequentially added to the sorted track information to be measured in the order of time points from earliest to latest.
[0019] In some possible embodiments, before determining whether the object to be detected is traveling with the target object based on the number of pieces of information about the remaining trajectory of the object to be detected, the method further includes:
[0020] According to the time point of the object to be measured corresponding to the trajectory information to be measured, a second number is added to the trajectory information to be measured, wherein the second number of each trajectory information to be measured having the same time point is the same;
[0021] In some possible embodiments, adding a second serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured includes:
[0022] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, put the multiple pieces of track information to be measured in the same sequence;
[0023] Second numbers with consecutive numbers are added to the sorted track information to be measured in order from the earliest to the last time point.
[0024] In some possible embodiments, before determining whether the object to be detected is traveling with the target object based on the number of pieces of information about the remaining trajectory of the object to be detected, the method further includes:
[0025] If the camera identifiers of any two pieces of track information to be measured that are adjacent to each other in the second number are the same, one piece of track information to be measured is eliminated based on a preset rule.
[0026] In some possible embodiments, determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected includes:
[0027] Determining the number of target cameras that have captured the object to be measured according to the camera identifiers in the remaining track information to be measured;
[0028] Performing a priori probability calculation on the number of pieces of information and the number of cameras to obtain a probability that the object to be measured and the target object are traveling together;
[0029] If the traveling together probability is greater than a preset probability threshold, it is determined that the object to be tested and the target object are traveling together.
[0030] In some possible embodiments, in the first trajectory information and the second trajectory, any two pieces of first trajectory information have different camera identifiers and / or time points, and any two pieces of second trajectory information have different camera identifiers and / or time points.
[0031] In a second aspect, an embodiment of the present application provides a peer object detection device, the device comprising:
[0032] An information unit is configured to obtain first trajectory information of the target object and second trajectory information of the object to be measured based on image data collected by each camera during a specified time period; wherein each piece of trajectory information includes a camera identifier and a time point, and the trajectory information represents image data of the object corresponding to the trajectory information collected by the camera with the camera identifier at the time point; the trajectory information is the first trajectory information or the second trajectory information;
[0033] An allocating unit is configured to select the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information;
[0034] The processing unit is configured to, for each object to be measured, add a first number to the measured trajectory information in a sequential order according to a time point of the measured trajectory information corresponding to the object to be measured; if any two pieces of measured trajectory information with adjacent first numbers have the same camera identifier, then eliminate one of the two pieces of measured trajectory information based on a preset rule; wherein the first numbers of the pieces of measured trajectory information with the same time point are different;
[0035] The detection unit is configured to determine whether the object to be detected is traveling together with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected.
[0036] In some possible embodiments, the selecting, based on the time point of the first trajectory information, the trajectory information to be measured corresponding to each object to be measured from the second trajectory information is performed, and the allocating unit is configured to:
[0037] For each piece of first trajectory information, determining a time interval of the first trajectory information according to a time point of the first trajectory information; and using second trajectory information whose time point falls within the time interval as second trajectory information associated with the first trajectory information;
[0038] Eliminate the second track information that has no correlation with each first track information;
[0039] For the remaining second trajectory information after the elimination, the second trajectory information corresponding to the same object as the object to be measured is used as the trajectory information to be measured corresponding to the object to be measured.
[0040] In some possible embodiments, the step of adding a first serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured is performed by the processing unit being configured as follows:
[0041] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, sort the multiple pieces of track information to be measured in order of priority;
[0042] The first numbers with consecutive numbers are sequentially added to the sorted track information to be measured in the order of time points from earliest to latest.
[0043] In some possible embodiments, before performing the step of determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processing unit is further configured to:
[0044] According to the time point of the object to be measured corresponding to the trajectory information to be measured, a second number is added to the trajectory information to be measured, wherein the second number of each trajectory information to be measured having the same time point is the same;
[0045] In some possible embodiments, the step of adding a second serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured is performed by the processing unit being configured as follows:
[0046] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, put the multiple pieces of track information to be measured in the same sequence;
[0047] Second numbers with consecutive numbers are added to the sorted track information to be measured in order from the earliest to the last time point.
[0048] In some possible embodiments, before performing the step of determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processing unit is further configured to:
[0049] If the camera identifiers of any two pieces of track information to be measured that are adjacent to each other in the second number are the same, one piece of track information to be measured is eliminated based on a preset rule.
[0050] In some possible embodiments, the determining of whether the object to be detected is traveling together with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected is performed, and the detecting unit is configured to:
[0051] Determining the number of target cameras that have captured the object to be measured according to the camera identifiers in the remaining track information to be measured;
[0052] Performing a priori probability calculation on the number of pieces of information and the number of cameras to obtain a probability that the object to be measured and the target object are traveling together;
[0053] If the traveling together probability is greater than a preset probability threshold, it is determined that the object to be tested and the target object are traveling together.
[0054] In some possible embodiments, in the first trajectory information and the second trajectory, any two pieces of first trajectory information have different camera identifiers and / or time points, and any two pieces of second trajectory information have different camera identifiers and / or time points.
[0055] In a third aspect, an embodiment of the present application further provides an electronic device, including a data transmission unit and a processor:
[0056] The data transmission unit is configured to: obtain image data collected by each camera during a specified period of time;
[0057] The processor is configured to: obtain first trajectory information of the target object and second trajectory information of the object to be measured based on the image data; wherein the processor is configured with a camera identifier and a time point for each piece of trajectory information, and the trajectory information represents that the camera with the camera identifier captures image data of the object corresponding to the trajectory information at the time point; the trajectory information is the first trajectory information or the second trajectory information;
[0058] Selecting the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information;
[0059] For each object to be measured, a first number is added to the measured trajectory information according to the time point of the object to be measured corresponding to the measured trajectory information; if the camera identifiers of any two adjacent measured trajectory information with the same first number are the same, one of the two measured trajectory information is eliminated based on a preset rule; wherein the first numbers of the measured trajectory information with the same time point are different;
[0060] Determine whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory to be detected of the object to be detected.
[0061] In some possible embodiments, the processor is configured to select the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information:
[0062] For each piece of first trajectory information, determining a time interval of the first trajectory information according to a time point of the first trajectory information; and using second trajectory information whose time point falls within the time interval as second trajectory information associated with the first trajectory information;
[0063] Eliminate the second track information that has no correlation with each first track information;
[0064] For the remaining second trajectory information after the elimination, the second trajectory information corresponding to the same object as the object to be measured is used as the trajectory information to be measured corresponding to the object to be measured.
[0065] In some possible embodiments, the step of adding a first serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured is performed by the processor being configured to:
[0066] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, sort the multiple pieces of track information to be measured in order of priority;
[0067] The first numbers with consecutive numbers are sequentially added to the sorted track information to be measured in the order of time points from earliest to latest.
[0068] In some possible embodiments, before executing the step of determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processor is further configured to:
[0069] According to the time point of the object to be measured corresponding to the trajectory information to be measured, a second number is added to the trajectory information to be measured, wherein the second number of each trajectory information to be measured having the same time point is the same;
[0070] In some possible embodiments, the processor is configured to add a second serial number to the track information to be measured according to the time point at which the track information to be measured corresponds to the track information to be measured, and the processor is configured to:
[0071] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, put the multiple pieces of track information to be measured in the same sequence;
[0072] Second numbers with consecutive numbers are added to the sorted track information to be measured in order from the earliest to the last time point.
[0073] In some possible embodiments, before executing the step of determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processor is further configured to:
[0074] If the camera identifiers of any two pieces of track information to be measured that are adjacent to each other in the second number are the same, one piece of track information to be measured is eliminated based on a preset rule.
[0075] In some possible embodiments, the processor is configured to:
[0076] Determining the number of target cameras that have captured the object to be measured according to the camera identifiers in the remaining track information to be measured;
[0077] Performing a priori probability calculation on the number of pieces of information and the number of cameras to obtain a probability that the object to be measured and the target object are traveling together;
[0078] If the traveling together probability is greater than a preset probability threshold, it is determined that the object to be tested and the target object are traveling together.
[0079] In some possible embodiments, in the first trajectory information and the second trajectory, any two pieces of first trajectory information have different camera identifiers and / or time points, and any two pieces of second trajectory information have different camera identifiers and / or time points.
[0080] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any one of the methods of the first aspect described above.
[0081] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; when a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device executes any one of the methods of the first aspect above.
[0082] In an embodiment of the present application, the first trajectory information of the target object and the second trajectory information of the object to be measured are obtained based on the image data collected by each camera within a specified time period. Then, based on the time point of the first trajectory information, the trajectory information to be measured of each object to be measured is selected from the second trajectory information, and a first number that is sorted continuously is added to each trajectory information to be measured based on the time point of the trajectory information to be measured, so that each trajectory information to be measured corresponding to the object to be processed has a unique and continuous number. Next, one of any two trajectory information to be measured that have adjacent numbers and the same camera identifier is deleted. Finally, based on the number of pieces of information of the remaining trajectory information to be measured, it is determined whether the object to be measured is traveling together with the target object. The above process can not only reduce the computational time of detection in the same line, but also effectively eliminate repeated trajectory points captured by the same camera in a continuous time, thereby improving the detection accuracy.
[0083] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present disclosure. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 A schematic diagram of the traditional peer detection process provided in an embodiment of the present application;
[0085] Figure 2 An overall flow chart of a peer object detection method provided in an embodiment of the present application;
[0086] Figure 3 A schematic diagram of a data acquisition scenario provided in an embodiment of the present application;
[0087] Figure 4A schematic diagram of trajectory information provided in an embodiment of the present application;
[0088] Figure 5 A schematic diagram of the causes of redundant data provided in an embodiment of the present application;
[0089] Figure 6 A schematic diagram of a process for determining the trajectory information to be measured provided in an embodiment of the present application;
[0090] Figure 7 A schematic diagram of associating first trajectory information with second trajectory information provided in an embodiment of the present application;
[0091] Figure 8 A schematic diagram of adding numbers using the windowing function Row_number provided in an embodiment of the present application;
[0092] Figure 9 A schematic diagram of the logic for eliminating Row_number provided in an embodiment of the present application;
[0093] Figure 10 A schematic diagram of a specific shooting scene provided in an embodiment of the present application;
[0094] Figure 11 A schematic diagram of trajectory data to be measured generated in a specific shooting scenario is provided for an embodiment of the present application;
[0095] Figure 12 A schematic diagram of adding numbers using the windowing function Dense_rank provided in an embodiment of the present application;
[0096] Figure 13 A schematic diagram of the elimination logic of Dense_rank provided in an embodiment of the present application;
[0097] Figure 14 A schematic diagram of the trajectory data remaining to be measured after elimination provided in an embodiment of the present application;
[0098] Figure 15 A structural diagram of a peer object detection device provided in an embodiment of the present application;
[0099] Figure 16 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0100] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. Unless there is a conflict, the embodiments in the present application and the features in the embodiments can be combined with each other in any way. In addition, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that here.
[0101] The terms "first" and "second" in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of its variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in this application can mean at least two, for example, two, three or more, and the embodiments of this application are not limited thereto.
[0102] Before introducing a peer object detection method provided by an embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail.
[0103] As mentioned earlier, traditional peer detection technology primarily involves preselecting a target object in a given video stream that is suspected of being in the same industry as the target object. Using a pretrained network model, the video stream is analyzed to determine the similarity between the target object's and the target object's trajectories in the video stream. Based on this similarity, the team then determines whether the target object and the target object are in the same industry. Unlike simple target recognition, peer detection using a network model requires a more complex computational process, requiring not only multi-target sample labeling in consecutive video frames during the model training phase but also the integration of trajectory recognition and similarity comparison algorithms.
[0104] In addition, the currently known network models for peer detection can only perform peer detection on one object at a time, for example Figure 1As shown in the figure, the model needs to be given a target object and an object to be processed that is suspected to be traveling in the same direction as the target object. The network model then analyzes the video frame images to determine the similarity of the travel trajectories between the target object and the object to be processed. In practice, there are often multiple objects to be processed that are suspected to be traveling in the same direction. The model in the above process can only process one object at a time, resulting in a long computational time. Furthermore, due to algorithmic limitations, the network model's detection accuracy is often difficult to guarantee in complex scenes with a large number of repeated trajectory points.
[0105] In order to solve the above problems, the invention of the present application is as follows: the first trajectory information of the target object and the second trajectory information of the object to be measured are obtained based on the image data collected by each camera within a specified time period. Then, based on the time point of the first trajectory information, the trajectory information to be measured of each object to be measured is selected from the second trajectory information, and a first number that is sorted continuously is added to each trajectory information to be measured based on the time point of the trajectory information to be measured, so that each trajectory information to be measured corresponding to the object to be processed has a unique and continuous number. Next, by deleting one of the two adjacent numbers and the same camera identifiers of the trajectory information to be measured, the repeated trajectory points captured by the same camera in a continuous time are eliminated. Finally, based on the number of remaining pieces of information of the trajectory information to be measured, it is determined whether the object to be measured is traveling with the target object.
[0106] The above process can not only eliminate repeated trajectory points captured by the same camera in a continuous time, thereby improving the detection accuracy, but also reduce the computational time of peer detection.
[0107] Next, Figure 2 As shown, Figure 2 The overall process of a peer detection method provided by an embodiment of the present application is shown, which specifically includes:
[0108] Step 201: Obtaining first trajectory information of a target object and second trajectory information of an object to be measured based on image data collected by each camera during a specified time period; wherein each piece of trajectory information includes a camera identifier and a time point, and the trajectory information represents image data of the object corresponding to the trajectory information collected by the camera with the camera identifier at the time point; the trajectory information is either the first trajectory information or the second trajectory information;
[0109] As mentioned above, the target peer detection task mainly detects whether the object to be processed and the target object are traveling together. According to the target object, it can be divided into two categories: pedestrian peer detection and vehicle peer detection. To facilitate the description of the technical solution of this application, the following is an example of the vehicle peer detection scenario;
[0110] When executing step 201, the image data collected by each camera within a specified period of time is acquired in advance. In the scenario of vehicle peer detection, the above-mentioned cameras can be, for example, Figure 3 , which shows all road network cameras within the area where a target vehicle has appeared. The designated time period in step 201 can be set based on actual needs. For example, the designated time period can be adaptively set based on the size of each camera's coverage area, or based on the time range when the target vehicle enters and leaves each camera's coverage area. This application does not limit this.
[0111] After acquiring the image data of each camera within a specified time period, target recognition can be performed on the image using a trained recognition model or other recognition algorithm to obtain first trajectory information of the target object and second trajectory information of the object to be measured.
[0112] Next, we will explain the objects and trajectory information in the above process respectively:
[0113] In the vehicle peer detection scenario, the target object is the target vehicle, and the specific object to be tested is set according to the actual detection needs. For example, when checking peer vehicles in a blind field of view, the object to be tested can be other vehicles that appear in the image that are different from the target vehicle. For another example, when checking peer vehicles with a certain field of view, the object to be tested can be a vehicle with certain characteristics (such as a black car, a yellow SUV). To facilitate understanding of the technical solutions of the embodiments of the present application, the objects to be tested can be regarded as multiple other vehicles different from the target vehicle.
[0114] Each piece of track information in the embodiment of the present application corresponds to an object, and each piece of track information consists of a camera identifier (DeviceId) and a time point (SnapTime). Any piece of track information represents that the camera with the camera identifier has collected image data of the object corresponding to the track information at that time point. Specifically, a piece of track information is a track point of the object corresponding to the track information, for example Figure 4 The two trajectory information of the target object are shown as [DeviceId: 1, SnapTime: T1] and [DeviceId: 2, SnapTime: T3], which means that the target vehicle was captured by the road network camera (DeviceId: 1) at time T1 and was captured by the road network camera (DeviceId: 2) at time T3.
[0115] Considering that in actual applications, road network cameras may capture images continuously, which will result in a large amount of repeated trajectory information. Figure 5The road network camera (DeviceId: 1) shown captures 5 identical images in succession at time T1. Five identical track information will be generated for the target object in the image and each object to be measured. For such repeated data, only one copy needs to be retained to avoid a large number of repeated track points affecting subsequent calculations. Based on this, in an embodiment of the present application, the camera identifiers and / or time points of any two first track information are different, and the camera identifiers and / or time points of any two second track information are different.
[0116] Step 202: selecting the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information;
[0117] When executing step 202, the specific steps are as follows: Figure 6 As shown, the following steps are included:
[0118] Step 601: For each piece of first trajectory information, determine the time interval of the first trajectory information according to the time point of the first trajectory information; and use the second trajectory information whose time point falls within the time interval as the second trajectory information associated with the first trajectory information;
[0119] Specific as Figure 7 As shown in the figure, assuming the first trajectory information of the target object is [DeviceId: 1, SnapTime: 12:05], the time interval of 3 seconds before and after the time point in the first trajectory information is used as the time interval of the first trajectory information. That is, the time range 12:02 to 12:08 is obtained. Then, among all the second trajectory information, the second trajectory information 4 to 7 whose time points fall within this time interval are regarded as the second trajectory information associated with the first trajectory information;
[0120] Step 602: Eliminate the second trajectory information that has no correlation with any first trajectory information;
[0121] After traversing each first track information through the process of step 601 , all second track information is screened, and second track information that has no correlation with any first track information is removed.
[0122] The second trajectory information eliminated here can be understood as that no target object appears near the time point when the second trajectory point is captured by the road network camera. That is, from the time dimension, the second trajectory point cannot be used as a trajectory point traveling with the target object.
[0123] Step 603: For the remaining second trajectory information after elimination, the second trajectory information corresponding to the same object as the object to be measured is used as the trajectory information to be measured corresponding to the object to be measured.
[0124] That is, the remaining second trajectory information is classified according to the object to be measured, and each second trajectory information belonging to the same object to be measured is used as the trajectory information to be measured corresponding to the object to be measured, thereby obtaining the trajectory information to be measured corresponding to each object to be measured.
[0125] Step 203: For each object to be measured, adding a first number to the measured trajectory information in a sequential order according to the time point of the measured object corresponding to the measured trajectory information; if any two pieces of measured trajectory information with adjacent first numbers have the same camera identifier, one of the two pieces of measured trajectory information is eliminated based on a preset rule; wherein the first numbers of the pieces of measured trajectory information with the same time point are different;
[0126] When adding a first number to the track information to be measured corresponding to each object to be measured, the track information to be measured can be sorted in order from the earliest to the latest time point; if there are multiple track information to be measured with the same time point, these multiple track information to be measured are arranged in order based on a preset sorting strategy; for example, the track information to be measured with the same time point can be randomly arranged, and it is only necessary to ensure that these track information to be measured with the same time point have a certain order.
[0127] Then, the sorted track information is sequentially assigned a first number, with consecutive numbers, in descending order of time. Specifically, a windowing function, Row_number, can be used to assign a first number to each track information item. Row_number can be used to assign an ascending numerical sequence number to each record, even if the values are identical, to prevent duplication. Figure 8 That is, an example of adding a first number (Row_number) to each piece of track information to be measured corresponding to the object to be measured (PeerID: 1).
[0128] Next, the track information to be measured after the addition of the first number is checked. If there are two track information to be measured with adjacent first numbers and the same camera identifier, one of the two track information to be measured is eliminated based on the preset rule. In specific implementation, the one with the larger number of the two track information to be measured can be eliminated, or the one with the smaller number of the two track information to be measured can be eliminated. This application does not limit this. It only needs to ensure that every two track information to be measured with adjacent first numbers are eliminated according to the same elimination rule.
[0129] With the aforementioned Figure 8 An example is given to illustrate the specific Figure 9As shown, since the target object (PeerID: 1) corresponds to four track information to be measured, namely Row_number 1 to 4, the camera IDs in Row_number 1 and Row_number 2, Row_number 2 and Row_number 3, and Row_number 3 and Row_number 4 are compared to see if they are the same. It should be noted that the above comparison process can be performed simultaneously, for example, by comparing numbers 1 and 2, 2 and 3, 3 and 4, etc., and then counting the numbers of each group of track information to be eliminated, and finally performing the elimination operation uniformly.
[0130] pass Figure 9 It can be seen intuitively that the camera identifiers of Row_number1 and Row_number2, as well as Row_number2 and Row_number3 are the same, both of which are DeviceId: 1. However, the camera identifiers of Row_number3 and Row_number4 are different. Assuming that the elimination rule is to eliminate the one with the smaller number, the comparison between Row_number1 and Row_number2 can determine that the first number of the track information to be eliminated is Row_number1, and the comparison between Row_number2 and Row_number3 can determine that the first number of the track information to be eliminated is Row_number2. Then the track information to be eliminated corresponding to the first number to be eliminated is uniformly eliminated, and the remaining track information to be tested is Row_number3 and Row_number4.
[0131] In addition, each track information currently being calculated is the second track information associated with at least one first track information calculated in steps 601 to 603. That is, each track information to be measured is equivalent to a journey between the object to be measured and the target object.
[0132] Without this elimination process, if the target object and the target object are captured N times by the same camera within a continuous period of time, it would be equivalent to the target object and the target object traveling together N times. Specifically, if the target vehicle and the target vehicle are captured 10 times by a road network camera while waiting at the same intersection, it would be equivalent to judging that the target object and the target object traveled together 10 times, which is obviously unreasonable. Therefore, the above process is required to eliminate the repeated track points captured by the same camera within a continuous period of time, retaining only the information of the track to be measured.
[0133] Also consider Figure 10When the two road network cameras shown are close to each other, the object to be measured may be photographed by both road network cameras at the same time and by one of the road network cameras at the next time, and the following will appear: Figure 11 That is, at time T1, the object to be measured (PeerID: 1) is photographed by both the road network camera (DeviceId: 1) and the road network camera (DeviceId: 2), and at time T2, it is photographed by the road network camera (DeviceId: 2). If only the window function Row_number is used to add the first number, then according to the aforementioned elimination logic, Figure 11 The Row_number3 shown in the above cannot be eliminated. Figure 10 In the illustrated scenario, Row_number3 and Row_number1 are obtained, which are actually repeated trajectory points captured by the same camera in continuous time.
[0134] To solve the above problem, the embodiment of the present application further adds a second number to the track information to be measured according to the time point of the track information to be measured corresponding to the time point of the track information to be measured; wherein, the second number of each track information to be measured with the same time point is the same.
[0135] During implementation, each piece of track information to be measured may be sorted in order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, these multiple pieces of track information to be measured are sorted in the same sequence.
[0136] Then, the sorted track information to be measured is sequentially added with a second number in the order of time points from the earliest to the latest. Specifically, the window function Dense_rank can be used to add a second number to the track information to be measured for each object to be measured. Dense_rank can add an increasing sequence number to each record, and if the values are the same, they share the same number. Figure 11 For example, the result of adding the second number (Dense_rank) can be as follows Figure 12 shown.
[0137] Next, the second-numbered track information is tested. If two adjacent first-numbered track information pieces have the same camera identifier, one of the two track information pieces is removed based on a preset rule. In practice, the larger or smaller track information piece can be removed. This is not a limitation in this application; it is only necessary to ensure that the same removal rule is applied to each pair of adjacent first-numbered track information pieces.
[0138] With the aforementioned Figure 12 Take the three track information of the object to be measured (PeerID: 1) as an example, as shown in FIG. Figure 13As shown, since the camera identifiers of Row_number1 and Row_number2 are different, and the camera identifiers of Row_number2 and Row_number3 are different, no track information to be measured will be eliminated according to the elimination logic of the first number. However, since the camera identifiers of the first Dense_rank1 and Dense_rank2 are the same, the first Dense_rank1 can be eliminated, thus leaving only the track information to be measured.
[0139] The embodiment of the present application can eliminate repeated trajectory points captured by the same camera in a continuous time through the aforementioned first number (Row_number) and second number (Dense_rank) elimination logic, thereby improving the statistical accuracy of the number of times the target object and the object to be measured travel together.
[0140] Step 204: Determine whether the object to be detected is traveling with the target object based on the number of pieces of information about the remaining trajectory of the object to be detected.
[0141] During implementation, the number of target cameras that captured the object under test is determined based on the camera identifiers in the remaining track information. A priori probability calculation is then performed on the number of information pieces and the number of cameras to determine the probability that the object under test and the target object are traveling together.
[0142] Specific as Figure 14 As shown, Figure 14 The figure shows the 4 remaining track data of the object to be measured (PeerID: 1) after the elimination logic of the first number (Row_number) and the second number (Dense_rank) mentioned above, that is, the number of information items is 4. The camera identifiers in these 4 track data are (DeviceId: 1) and (DeviceId: 2), that is, the number of cameras is 2.
[0143] Next, the number of cameras (2) and the number of information items (4) are substituted into the following formula (1) to obtain the probability that the object to be tested and the target object are traveling together. If the probability of traveling together is greater than the preset probability threshold, it is determined that the object to be tested and the target object are traveling together.
[0144] P(L(x,y))=1-e ﹣αx﹣βy (1)
[0145] Where x is the number of cameras, y is the number of information items, and α and β are both fixed probability parameters > 0. It should be noted that the above formula (1) is based on the prior probability formula P(L(x,y))=1-e ﹣σxThe derivation formula containing two unknowns is obtained by smoothing the number of cameras and the number of information items. σ is the probability parameter in the prior probability formula and is a fixed value greater than zero. It should be noted that the process of deriving the above formula (1) based on the prior probability formula is a traditional method for solving the prior probability of two unknowns and does not involve the improvements of this application, so it will not be repeated here.
[0146] Through the technical solution provided by this application, the trajectory information to be measured corresponding to each piece of data to be measured can be extracted from the road network traffic data, and the elimination logic of the two windowing functions of the first number (Row_number) and the second number (Dense_rank) can be used to eliminate the trajectory information of each object to be measured in parallel and perform subsequent synchronous detection calculations based on prior probability. Multiple objects to be measured can be synchronously detected at one time. It can be seen that the above process can not only eliminate repeated trajectory points captured by the same camera in a continuous time, improve detection accuracy, but also reduce the computational time of peer detection.
[0147] Based on the same inventive concept, the present application embodiment also provides a peer object detection device, specifically as follows Figure 15 Shown, including:
[0148] The information unit 151 is configured to obtain first trajectory information of the target object and second trajectory information of the object to be measured based on the image data collected by each camera during a specified time period; wherein each piece of trajectory information includes a camera identifier and a time point, and the trajectory information represents the image data of the object corresponding to the trajectory information collected by the camera with the camera identifier at the time point; the trajectory information is the first trajectory information or the second trajectory information;
[0149] The allocating unit 152 is configured to select the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information;
[0150] The processing unit 153 is configured to, for each object to be measured, add a first number to the measured trajectory information in a sequential order according to the time point of the measured trajectory information corresponding to the object to be measured; if the camera identifiers of any two adjacent measured trajectory information with the same first number are the same, then one of the two measured trajectory information is eliminated based on a preset rule; wherein the first numbers of the measured trajectory information at the same time point are different;
[0151] The detection unit 154 is configured to determine whether the object to be detected is traveling together with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected.
[0152] In some possible embodiments, the selecting, based on the time point of the first trajectory information, the trajectory information to be measured corresponding to each object to be measured from the second trajectory information is performed, and the allocating unit is configured to:
[0153] For each piece of first trajectory information, determining a time interval of the first trajectory information according to a time point of the first trajectory information; and using second trajectory information whose time point falls within the time interval as second trajectory information associated with the first trajectory information;
[0154] Eliminate the second track information that has no correlation with each first track information;
[0155] For the remaining second trajectory information after the elimination, the second trajectory information corresponding to the same object as the object to be measured is used as the trajectory information to be measured corresponding to the object to be measured.
[0156] In some possible embodiments, the step of adding a first serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured is performed by the processing unit being configured as follows:
[0157] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, sort the multiple pieces of track information to be measured in order of priority;
[0158] The first numbers with consecutive numbers are sequentially added to the sorted track information to be measured in the order of time points from earliest to latest.
[0159] In some possible embodiments, before performing the step of determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processing unit is further configured to:
[0160] According to the time point of the object to be measured corresponding to the trajectory information to be measured, a second number is added to the trajectory information to be measured, wherein the second number of each trajectory information to be measured having the same time point is the same;
[0161] In some possible embodiments, the step of adding a second serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured is performed by the processing unit being configured as follows:
[0162] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, put the multiple pieces of track information to be measured in the same sequence;
[0163] Second numbers with consecutive numbers are added to the sorted track information to be measured in order from the earliest to the last time point.
[0164] In some possible embodiments, before performing the step of determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processing unit is further configured to:
[0165] If the camera identifiers of any two pieces of track information to be measured that are adjacent to each other in the second number are the same, one piece of track information to be measured is eliminated based on a preset rule.
[0166] In some possible embodiments, the determining of whether the object to be detected is traveling together with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected is performed, and the detecting unit is configured to:
[0167] Determining the number of target cameras that have captured the object to be measured according to the camera identifiers in the remaining track information to be measured;
[0168] Performing a priori probability calculation on the number of pieces of information and the number of cameras to obtain a probability that the object to be measured and the target object are traveling together;
[0169] If the traveling together probability is greater than a preset probability threshold, it is determined that the object to be tested and the target object are traveling together.
[0170] In some possible embodiments, in the first trajectory information and the second trajectory, any two pieces of first trajectory information have different camera identifiers and / or time points, and any two pieces of second trajectory information have different camera identifiers and / or time points.
[0171] Based on the same inventive concept, the embodiment of the present application further provides an electronic device, specifically Figure 16 As shown, it includes a data transmission unit 161 and a processor 162:
[0172] The data transmission unit 161 is configured to: obtain image data collected by each camera during a specified period;
[0173] The processor 162 is configured to obtain first trajectory information of the target object and second trajectory information of the object to be measured based on the image data; wherein the processor 162 is configured with a camera identifier and a time point for each piece of trajectory information, and the trajectory information represents that the camera with the camera identifier captures image data of the object corresponding to the trajectory information at the time point; the trajectory information is the first trajectory information or the second trajectory information;
[0174] Selecting the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information;
[0175] For each object to be measured, a first number is added to the measured trajectory information according to the time point of the object to be measured corresponding to the measured trajectory information; if the camera identifiers of any two adjacent measured trajectory information with the same first number are the same, one of the two measured trajectory information is eliminated based on a preset rule; wherein the first numbers of the measured trajectory information with the same time point are different;
[0176] Determine whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory to be detected of the object to be detected.
[0177] In some possible embodiments, to select the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information, the processor 162 is configured to:
[0178] For each piece of first trajectory information, determining a time interval of the first trajectory information according to a time point of the first trajectory information; and using second trajectory information whose time point falls within the time interval as second trajectory information associated with the first trajectory information;
[0179] Eliminate the second track information that has no correlation with each first track information;
[0180] For the remaining second trajectory information after the elimination, the second trajectory information corresponding to the same object as the object to be measured is used as the trajectory information to be measured corresponding to the object to be measured.
[0181] In some possible embodiments, to perform the step of adding a first serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured, the processor 162 is configured to:
[0182] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, sort the multiple pieces of track information to be measured in order of priority;
[0183] The first numbers with consecutive numbers are sequentially added to the sorted track information to be measured in the order of time points from earliest to latest.
[0184] In some possible embodiments, before performing the step of determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processor 162 is further configured to:
[0185] According to the time point of the object to be measured corresponding to the trajectory information to be measured, a second number is added to the trajectory information to be measured, wherein the second number of each trajectory information to be measured having the same time point is the same;
[0186] In some possible embodiments, to add a second serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured, the processor 162 is configured to:
[0187] Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, put the multiple pieces of track information to be measured in the same sequence;
[0188] Second numbers with consecutive numbers are added to the sorted track information to be measured in order from the earliest to the last time point.
[0189] In some possible embodiments, before performing the step of determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processor 162 is further configured to:
[0190] If the camera identifiers of any two pieces of track information to be measured that are adjacent to each other in the second number are the same, one piece of track information to be measured is eliminated based on a preset rule.
[0191] In some possible embodiments, when determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory of the object to be detected, the processor 162 is configured to:
[0192] Determining the number of target cameras that have captured the object to be measured according to the camera identifiers in the remaining track information to be measured;
[0193] Performing a priori probability calculation on the number of pieces of information and the number of cameras to obtain a probability that the object to be measured and the target object are traveling together;
[0194] If the traveling together probability is greater than a preset probability threshold, it is determined that the object to be tested and the target object are traveling together.
[0195] In some possible embodiments, in the first trajectory information and the second trajectory, any two pieces of first trajectory information have different camera identifiers and / or time points, and any two pieces of second trajectory information have different camera identifiers and / or time points.
[0196] An embodiment of the present application further provides a computer storage medium, in which computer program instructions are stored. When the instructions are executed on a computer, the computer executes the steps of the above-mentioned traffic signal control method.
[0197] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0198] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor 202 of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor 202 of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0199] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0200] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0201] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
Claims
1. A peer object detection method, characterized in that: The method comprises: According to the image data collected by each camera in a specified time period, the first trajectory information of the target object and the second trajectory information of the object to be measured are obtained; wherein each piece of trajectory information includes a camera identifier and a time point, and the trajectory information represents that the camera with the camera identifier collects the image data of the object corresponding to the trajectory information at the time point; the trajectory information is the first trajectory information or the second trajectory information; According to the time point of the first trajectory information, selecting the trajectory information to be measured corresponding to each object to be measured from the second trajectory information; For each object to be tested, a first serial number is added to the trajectory information to be tested according to the time point of the object to be tested corresponding to the trajectory information to be tested; if the camera identifiers of any two trajectory information to be tested with adjacent first numbers are the same, one of the two trajectory information to be tested is eliminated based on a preset rule; wherein the first numbers of the trajectory information to be tested at the same time point are different; Whether the object to be detected is traveling with the target object is determined based on the number of pieces of information of the trajectory to be detected remaining in the object to be detected.
2. The method according to claim 1, characterized in that The step of selecting the track information to be measured corresponding to each object to be measured from the second track information according to the time point of the first track information includes: For each piece of first trajectory information, determine a time interval of the first trajectory information according to a time point of the first trajectory information; and use second trajectory information whose time point is within the time interval as second trajectory information associated with the first trajectory information; Eliminate the second track information that has no association with each piece of first track information; For the remaining second trajectory information after elimination, the second trajectory information corresponding to the same object as the object to be measured is used as the trajectory information to be measured corresponding to the object to be measured.
3. The method according to claim 1, characterized in that: The adding a first serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured, comprises: Sort each piece of track information to be measured in order from earliest to latest time point; if there are multiple pieces of track information to be measured with the same time point, arrange the multiple pieces of track information to be measured in order of precedence; The first serial numbers with consecutive numbers are sequentially added to the sorted track information to be measured in the order of time points from the earliest to the latest.
4. The method according to claim 1, characterized in that Before determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory information of the object to be detected, the method further includes: A second serial number is added to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured; wherein the second serial numbers of the track information to be measured having the same time point are the same.
5. The method according to claim 4, characterized in that The adding a second serial number to the track information to be measured according to the time point of the track information to be measured corresponding to the track information to be measured, comprises: Sort each piece of track information to be measured in the order of time points from earliest to latest; if there are multiple pieces of track information to be measured with the same time point, put the multiple pieces of track information to be measured in the same sequence; Second numbers with consecutive numbers are added to the sorted track information to be measured in order from the earliest to the latest time point.
6. The method according to claim 4 or 5, characterized in that: Before determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory information of the object to be detected, the method further includes: If the camera identifiers of any two pieces of track information to be measured that are adjacent to each other in the second number are the same, one piece of track information to be measured is eliminated based on a preset rule.
7. The method according to any one of claims 1 to 5, characterized in that: The determining whether the object to be detected is traveling with the target object based on the number of pieces of information of the remaining trajectory information of the object to be detected includes: Determine the number of target cameras that have captured the object to be measured according to the camera identifiers in the remaining track information to be measured; Performing a priori probability calculation on the number of pieces of information and the number of cameras to obtain the probability that the object to be tested and the target object are traveling together; If the traveling probability is greater than a preset probability threshold, it is determined that the object to be detected travels with the target object.
8. The method according to any one of claims 1 to 5, characterized in that: In the first track information and the second track information, any two pieces of the first track information have different camera identifiers and / or time points, and any two pieces of the second track information have different camera identifiers and / or time points.
9. An electronic device, characterized in that: Including data transmission unit and processor: The data transmission unit is configured to: obtain image data collected by each camera during a specified period of time; The processor is configured to: obtain first trajectory information of the target object and second trajectory information of the object to be measured according to the image data; wherein each piece of trajectory information includes a camera identifier and a time point, and the trajectory information represents that the camera with the camera identifier collects image data of the object corresponding to the trajectory information at the time point; the trajectory information is the first trajectory information or the second trajectory information; According to the time point of the first trajectory information, selecting the trajectory information to be measured corresponding to each object to be measured from the second trajectory information; For each object to be tested, a first serial number is added to the trajectory information to be tested according to the time point of the object to be tested corresponding to the trajectory information to be tested; if the camera identifiers of any two trajectory information to be tested with adjacent first numbers are the same, one of the two trajectory information to be tested is eliminated based on a preset rule; wherein the first numbers of the trajectory information to be tested at the same time point are different; Whether the object to be detected is traveling with the target object is determined based on the number of pieces of information of the trajectory to be detected remaining in the object to be detected.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 8.