Target trajectory generation method, electronic device and computer readable storage medium
By dividing the camera subset and obtaining the target set and its trajectory information, the target trajectory accuracy problem in the multi-camera acquisition area is solved, the accuracy and accuracy of the trajectory is improved, and more efficient target matching is achieved.
Patent Information
- Application Number
- CN202411143538.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-20
AI Technical Summary
The prior art is difficult to accurately generate the trajectory of the target within the multi-camera acquisition area, especially when the target moves across the camera, and a single algorithm is difficult to ensure the accuracy of the trajectory.
By dividing a subset based on the path distance and connection relationship between cameras, the target set and trajectory information in each subset are obtained, and the target matching is performed, the target trajectory within the entire acquisition area is fused to ensure space-time continuity and redundancy. Decreased.
It improves the accuracy and accuracy of the target trajectory, reduces the redundancy of the targets in the camera subset, and enhances the efficiency and accuracy of target matching.
Smart Images

Figure CN118657809B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a target trajectory generation method, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the popularity of cameras, how to use the data collected by cameras to generate the trajectory of the target has become an important research direction. In the existing technology, the target recognition algorithm can obtain the dynamic information of the target in the shooting area of a single camera, but when there are multiple cameras in the collection area, it is necessary to generate the trajectory of the target across cameras. It is difficult to accurately generate the trajectory of the target in the entire collection area by relying on a single algorithm. In view of this, how to improve the accuracy of the target trajectory has become an urgent problem to be solved. Summary of the invention
[0003] The main technical problem solved by the present application is to provide a target trajectory generation method, an electronic device and a computer-readable storage medium, which can improve the accuracy of the target trajectory.
[0004] To solve the above technical problems, the first aspect of the present application provides a target trajectory generation method, which includes: obtaining camera subsets corresponding to each of multiple sub-areas in a collection area; wherein the camera subsets are divided based on the path distance and connectivity relationship between cameras, the path distance is related to the number of cameras spaced between the camera points, and the connectivity relationship is related to the shooting area of the camera; obtaining a target set of cameras in each of the camera subsets within a specified time period, and trajectory information corresponding to the targets in the target set; wherein the duration of the specified time period is related to the path distance; performing target matching on the targets in the target set corresponding to all cameras in the camera subsets, and obtaining the target trajectory of the target in the collection area based on the trajectory information corresponding to the matched targets.
[0005] To solve the above technical problem, the second aspect of the present application provides an electronic device, which includes: a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method described in the first aspect.
[0006] In order to solve the above technical problem, the third aspect of the present application provides a computer-readable storage medium on which program data is stored. When the program data is executed by a processor, the method described in the first aspect is implemented.
[0007] In the above scheme, multiple cameras are arranged in the collection area, and the collection area corresponds to multiple sub-areas, and the camera subsets corresponding to each sub-area in the collection area are obtained. Among them, the camera subset includes cameras matching the sub-areas, and the camera subset is divided based on the path distance and connectivity relationship between the cameras. The path distance is related to the number of cameras between the camera points, which is used to more accurately feedback the distance to be moved when the target moves across the cameras. The connectivity relationship is related to the shooting area of the camera, which is used to more accurately feedback the correlation between the cameras, so as to obtain an accurate and reasonable camera subset after division. The target set composed of all targets collected by the cameras in each camera subset within the specified time period and the trajectory information corresponding to the targets in the target set are obtained, wherein the duration of the specified time period is related to the path distance, so as to fully consider the spatiotemporal continuity of the target during the movement process, and obtain a more accurate target set. The targets contained in the target set corresponding to the cameras in all camera subsets are matched to obtain the matched targets, and the target trajectory of the target in the collection area is obtained by fusion based on the trajectory information corresponding to the matched targets. Therefore, by dividing the camera subsets reasonably, the redundancy of the targets in the camera subsets is reduced, and the target sets corresponding to the cameras are first determined in the camera subsets. When obtaining the target set, the spatiotemporal continuity of the targets is fully considered, so that higher-precision target trajectories can be obtained in all camera subsets, thereby improving the accuracy of the target trajectories. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0009] Figure 1 It is a flowchart of an implementation method of the target trajectory generation method of the present application;
[0010] Figure 2 It is a flowchart of another implementation method of the target trajectory generation method of the present application;
[0011] Figure 3 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0012] Figure 4 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments, and different implementation methods can be adaptively combined. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0014] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0015] The target trajectory generation method provided in the present application is used to determine the trajectory of the target within the acquisition area, and its corresponding execution subject is a terminal capable of performing image processing.
[0016] See also Figure 1 , Figure 1 : is a flow chart of an implementation method of a target trajectory generation method of the present application, the method comprising:
[0017] S101: Obtain camera subsets corresponding to multiple sub-areas in the acquisition area; wherein the camera subsets are divided based on the path distance and connectivity relationship between cameras, the path distance is related to the number of cameras spaced between the camera locations, and the connectivity relationship is related to the shooting area of the camera.
[0018] Specifically, a plurality of cameras are arranged in the acquisition area, the acquisition area corresponds to a plurality of sub-areas, and a camera subset corresponding to each sub-area in the acquisition area is obtained.
[0019] It should be noted that the camera subset includes cameras that match the sub-area. The camera subset is divided based on the path distance and connectivity relationship between cameras. The path distance is related to the number of cameras between the camera locations, and is used to more accurately feedback the distance the target needs to move when moving across cameras. The connectivity relationship is related to the shooting area of the camera, and is used to more accurately feedback the correlation between cameras, thereby obtaining an accurate and reasonable camera subset after division.
[0020] It can be understood that multiple cameras in the acquisition area have corresponding installation positions, and the connectivity relationship between the cameras is pre-set based on the actual scene in the acquisition area. The path distance corresponds to the actual distance that the target needs to travel from the shooting area of the current camera to the shooting area of other cameras, rather than the straight-line distance between the two cameras. The camera subset is pre-divided based on the path distance and connectivity relationship between the cameras.
[0021] In some implementation scenarios, any camera in the acquisition area is taken as the starting point, and cameras that are connected to the current camera and whose path distances satisfy the distance conditions are formed into a camera subset. The constructed camera subset is obtained, and cameras outside the constructed camera subset are taken as the starting point. The camera subset is repeatedly constructed until all cameras in the acquisition area are traversed, all camera subsets corresponding to the acquisition area are obtained, and the sub-areas covered by the cameras in each camera subset are determined.
[0022] In some implementation scenarios, the acquisition area is divided into multiple partitions, and a camera subset with a connectivity relationship and a path distance that satisfies a distance condition is determined in each partition, and at least one camera subset corresponding to each partition is obtained. The sub-area covered by the camera subset in the corresponding partition is determined, and all partitions are summarized to obtain all camera subsets corresponding to the acquisition area.
[0023] It should be noted that cameras with connectivity are not affected by obstacles and can relay target recognition. Cameras in each camera subset have connectivity with each other, and the path distance meets the distance condition, which includes but is not limited to the path distance being less than the distance threshold.
[0024] S102: Obtaining a target set of cameras in each camera subset within a specified time period, and trajectory information corresponding to the targets in the target set; wherein the duration of the specified time period is related to the path distance.
[0025] Specifically, a target set consisting of all targets captured by the cameras in each camera subset within a specified time period and trajectory information corresponding to the targets in the target set are obtained, wherein the duration of the specified time period is related to the path distance, thereby fully considering the spatiotemporal continuity of the targets during movement and obtaining a more accurate target set.
[0026] It can be understood that the duration of the specified time period is positively correlated with the path distance. When the path distance between the two cameras is longer, the duration of the specified time period is longer.
[0027] In some implementation scenarios, a time interval selected for generating a target trajectory is obtained, a specified time period between every two cameras in the camera subset is determined based on the time interval and the path distance between every two cameras in the camera subset, a target set consisting of all targets captured by every two cameras in the specified time period is obtained, and trajectory information corresponding to the targets in the target set within the shooting area of a single camera is determined.
[0028] In some implementation scenarios, a reference camera selected for generating a target trajectory is obtained, and the reference camera is used as a starting point. Based on the path distance between every two adjacent cameras in the camera subset, a specified time period between every two adjacent cameras in the camera subset is determined, a target set consisting of all targets captured by every two adjacent cameras in the specified time period is obtained, and the trajectory information corresponding to the targets in the target set within the shooting area of a single camera is determined.
[0029] Optionally, the trajectory information corresponding to the target in the shooting area of a single camera is determined by a target recognition algorithm, all the targets in the single camera are matched with target identifiers, and different recognition areas on the targets are bound to the target identifiers.
[0030] S103: performing target matching on targets in the target set corresponding to the cameras in all camera subsets, and obtaining target trajectories of the targets in the acquisition area based on trajectory information corresponding to the matched targets.
[0031] Specifically, target matching is performed on targets contained in the target set corresponding to the cameras in all camera subsets to obtain matched targets, and based on the trajectory information corresponding to the matched targets, the target trajectory of the target in the acquisition area is fused.
[0032] In some implementation scenarios, target matching is performed on the target set corresponding to all cameras in each camera subset to obtain a fused trajectory corresponding to the matched targets in each camera subset, and target matching is performed on the matched targets in all camera subsets to obtain matched targets in the acquisition area. The target trajectory of the target in the acquisition area is generated using the fused trajectory corresponding to the matched targets in the camera subset.
[0033] In some implementation scenarios, target matching is performed on the target set corresponding to all cameras in each camera subset to obtain a fused trajectory corresponding to the matched targets in each camera subset, and target matching is performed on the matched targets in every two camera subsets until all camera subsets are traversed to obtain matched targets in the acquisition area, and the target trajectory of the target in the acquisition area is generated using the fused trajectory corresponding to the matched targets in the camera subset.
[0034] In some implementation scenarios, target matching is performed on a target set corresponding to cameras in all camera subsets to obtain matched targets in the acquisition area, and target trajectories of the targets in the acquisition area are generated using trajectory information corresponding to the matched targets.
[0035] It can be understood that target matching can be performed in parallel within each camera subset, reducing the redundancy of targets within the camera subset and improving the efficiency of target matching. All camera subsets perform target matching together, which can comprehensively match all targets and improve the accuracy of target matching.
[0036] In the above scheme, multiple cameras are arranged in the collection area, and the collection area corresponds to multiple sub-areas, and the camera subsets corresponding to each sub-area in the collection area are obtained. Among them, the camera subset includes cameras matching the sub-areas, and the camera subset is divided based on the path distance and connectivity relationship between the cameras. The path distance is related to the number of cameras between the camera points, which is used to more accurately feedback the distance to be moved when the target moves across the cameras. The connectivity relationship is related to the shooting area of the camera, which is used to more accurately feedback the correlation between the cameras, so as to obtain an accurate and reasonable camera subset after division. The target set composed of all targets collected by the cameras in each camera subset within the specified time period and the trajectory information corresponding to the targets in the target set are obtained, wherein the duration of the specified time period is related to the path distance, so as to fully consider the spatiotemporal continuity of the target during the movement process, and obtain a more accurate target set. The targets contained in the target set corresponding to the cameras in all camera subsets are matched to obtain the matched targets, and the target trajectory of the target in the collection area is obtained by fusion based on the trajectory information corresponding to the matched targets. Therefore, by dividing the camera subsets reasonably, the redundancy of the targets in the camera subsets is reduced, and the target sets corresponding to the cameras are first determined in the camera subsets. When obtaining the target set, the spatiotemporal continuity of the targets is fully considered, so that higher-precision target trajectories can be obtained in all camera subsets, thereby improving the accuracy of the target trajectories.
[0037] See also Figure 2 , Figure 2 : is a flow chart of another embodiment of the target trajectory generation method of the present application, the method comprising:
[0038] S201: Obtain camera subsets corresponding to multiple sub-areas in the acquisition area; wherein the camera subsets are divided based on the path distance and connectivity relationship between cameras, the path distance is related to the number of cameras spaced between the camera locations, and the connectivity relationship is related to the shooting area of the camera.
[0039] Specifically, a plurality of sub-areas together constitute a collection area, a plurality of cameras are arranged in the collection area, and the plurality of cameras are respectively divided into camera subsets matching the sub-areas, and the camera subsets are pre-divided based on the path distance and connectivity relationship between the cameras.
[0040] For ease of explanation, taking three cameras A, B, and C arranged in sequence as an example, when there are no obstacles between every two adjacent cameras and the shooting areas are adjacent or there is a partial overlapping area, it is determined that the three cameras are connected to each other, that is, A and B, B and C, and A and C are all connected, where the path distance between two adjacent cameras corresponds to the distance between the cameras, and the path distance from A to C corresponds to the distance of the target from A to B and then from B to C.
[0041] In some implementation scenarios, the cameras in the collection area are pre-set, and the process of dividing the camera subsets includes: obtaining the installation positions of all cameras in the collection area and the shooting areas corresponding to all cameras; determining the connectivity relationship between every two cameras based on the installation positions and the shooting areas, and determining the path distance between every two cameras based on the installation positions; based on the path distance and connectivity relationship between every two cameras, dividing each camera in the collection area into corresponding camera subsets; wherein the cameras in each camera subset have a connectivity relationship with each other, and the path distance is less than a distance threshold.
[0042] Specifically, the installation positions of all cameras in the acquisition area and the shooting areas corresponding to all cameras are obtained. Based on the installation positions and shooting areas of all cameras, the connectivity relationship between every two cameras is determined to ensure that the target can pass through the shooting areas of different cameras and accurately calibrate from the shooting area of one camera to the shooting area of another camera. Based on the installation positions of all cameras, the path distance between every two cameras is determined to improve the accuracy of the distance that the target needs to move when moving across cameras.
[0043] Furthermore, based on the path distance and connectivity relationship between every two cameras, the camera subset to which each camera in the acquisition area belongs is divided, and the camera subset to which each camera belongs is determined, so that there is a corresponding connectivity relationship between any two cameras in each camera subset, and the path distance is less than the distance threshold. Therefore, each camera subset can cover a sub-area in the acquisition area, and the cameras in each camera subset are associated with each other, reducing the difficulty of matching targets within the camera subset.
[0044] Optionally, based on the path distance and connectivity relationship between every two cameras, each camera in the acquisition area is divided into a corresponding camera subset, including: generating a distance measurement matrix based on the path distance and connectivity relationship between every two cameras; wherein, when there is a corresponding connectivity relationship between the two cameras, the element at the corresponding position in the distance measurement matrix is the path distance between the two cameras, and when there is no corresponding connectivity relationship between the two cameras, the element at the corresponding position in the distance measurement matrix is a preset distance value; and clustering the cameras in the acquisition area using the distance measurement matrix to obtain camera subsets corresponding to each of the multiple sub-areas in the acquisition area.
[0045] Specifically, the connectivity relationship between each two cameras is obtained. When there is a connectivity relationship between the two cameras, the path distance between the two cameras is obtained, and the element at the corresponding position in the distance measurement matrix is set to the path distance between the two cameras. When there is no connectivity relationship between the two cameras, the element at the corresponding position in the distance measurement matrix is set to a preset distance value to obtain a distance measurement matrix, wherein the preset distance value is different from any path distance. The above process is expressed by the following formula:
[0046] (1)
[0047] The distance measurement matrix is D, and each element represents the distance value set between the corresponding camera. If the cameras are connected, the elements in the matrix D represent the path distance. If they are not connected, the elements in the matrix D are preset distance values, which can be infinite or negative.
[0048] Furthermore, the distance metric matrix is used to cluster the cameras in the acquisition area, so that each camera subset has a cluster center, the cameras in each camera subset have a corresponding connectivity relationship, and the path distance is less than the distance threshold, so as to obtain a more reasonable division of camera subsets, so that the cameras in the camera subset have higher efficiency in target recognition and target matching.
[0049] S202: Obtain a target set of cameras in each camera subset within a specified time period, and trajectory information corresponding to the targets in the target set; wherein the duration of the specified time period is related to the path distance.
[0050] Specifically, a target set consisting of all targets captured by cameras in each camera subset within a specified time period and trajectory information corresponding to the targets in the target set are obtained.
[0051] In some implementation scenarios, obtaining a target set of cameras in each camera subset within a specified time period, and trajectory information corresponding to the targets in the target set, includes: obtaining a target set of cameras in each camera subset within a specified time period; wherein the specified time period is obtained based on the path distance, the reference speed of the target, and the time compensation constant; determining a representative image set corresponding to the targets in the target set, and trajectory information corresponding to the targets in the target set; wherein the representative image set corresponds to a first representative image corresponding to a first recognition area on the target, and a second representative image corresponding to a second recognition area on the target.
[0052] Specifically, a target set of cameras in each camera subset within a corresponding specified time period is obtained, wherein the specified time period is obtained based on the path distance between cameras, a reference speed, and a time compensation constant, thereby improving the rationality of the specified time period, fully considering the spatiotemporal continuity of target movement, and improving the probability of obtaining a complete trajectory of the target in the acquisition area.
[0053] For ease of understanding, in a specific implementation scenario, assume that the current time is t 0 , the specified time period is the part of the time period before and after the current time, that is, t 0 ± t, where t is based on the path distance, reference speed and time compensation constant. The time t required to move within the path distance corresponding to the camera is determined according to the reference speed of the target. d , t = t d + t c , where t c is the time compensation constant, which is used to compensate for the error caused by the difference in the actual moving speed of the target and improve the accuracy of the specified time period. In other implementation scenarios, the specified time period can also be based on t d and t c It is obtained by weighted summation, or based on other conversion relationships, and this application does not impose any specific restrictions on this.
[0054] Furthermore, a representative image set corresponding to the target in the target set within a specified time period and trajectory information corresponding to the target in the target set within a specified time period are determined. The representative image set includes a first representative image corresponding to a first recognition area on the target and a second representative image corresponding to a second recognition area on the target. Therefore, by obtaining a first representative image corresponding to the first recognition area on the target and a second representative image corresponding to the second recognition area, the description capability of the target is enhanced and the possibility of mismatching the target is reduced.
[0055] It should be noted that after obtaining the camera subsets corresponding to the multiple sub-areas in the acquisition area, it also includes: performing target recognition on the target captured by each camera to obtain the first recognition area and the second recognition area on the target, and trajectory information corresponding to the target; obtaining the first quality score of the first recognition area and the second quality score of the second recognition area, determining the first representative image corresponding to the first recognition area based on the first quality score, and determining the second representative image corresponding to the second recognition area based on the second quality score.
[0056] Specifically, target recognition is performed on the target captured by each camera, and a first recognition area and a second recognition area on the target are determined, so that the recognition of the target is subdivided into recognition of multiple recognition areas, and the same target is continuously recognized to obtain the corresponding trajectory information of the target in the shooting area of a single camera.
[0057] Furthermore, a first quality score corresponding to the image blocks in the first recognition area and a second quality score corresponding to the image blocks in the second recognition area are obtained. Based on the first quality score, the image blocks in the first recognition area are screened to obtain a first representative image corresponding to the first recognition area. Based on the second quality score, the image blocks in the second recognition area are screened to obtain a second representative image corresponding to the second recognition area, thereby obtaining a first representative image with better quality in the first recognition area and a second representative image with better quality in the second recognition area, thereby reducing the difficulty of target matching.
[0058] Optionally, the quality score is determined based at least on the clarity of the image and the angle of the target, and the selection of the representative image corresponds to a trigger condition, which includes but is not limited to triggering every fixed period of time, triggering once within the target life cycle, or triggering based on alarm information related to the target.
[0059] It can be understood that the first recognition area and the second recognition area correspond to respective representative images, and the first representative image and the second representative image corresponding to the same target may originate from the same original image or from different original images.
[0060] S203: performing target matching on targets in the target set corresponding to the cameras in all camera subsets, and obtaining target trajectories of the targets in the acquisition area based on trajectory information corresponding to the matched targets.
[0061] Specifically, target matching is performed on targets contained in the target set corresponding to the cameras in all camera subsets to obtain matched targets, and based on the trajectory information corresponding to the matched targets, the target trajectory of the target in the acquisition area is fused.
[0062] In some implementation scenarios, target matching is performed on targets in a target set corresponding to cameras in all camera subsets, and based on trajectory information corresponding to the matched targets, target trajectories of the targets in a collection area are obtained, including: for each camera subset, based on a first representative image and a second representative image corresponding to the targets in the target set, matching is performed on the targets in the camera subset to obtain matched targets in the camera subset, and target features and fusion trajectories corresponding to the matched targets are determined; in all camera subsets, based on the target features of each target, targets that meet feature conditions are determined, and the target trajectory of the targets in the collection area is generated using the fusion trajectory of the targets that meet the feature conditions.
[0063] Specifically, within each camera subset, based on the first representative image and the second representative image corresponding to the targets in each target set, the targets in the camera subset are matched to determine the matched targets in the camera subset, wherein the matched targets can be classified as the same target, target features corresponding to the matched targets are determined, and trajectory information corresponding to the matched targets is fused to obtain a fused trajectory, thereby completing target matching within the camera subset with less target matching processing within the camera subset.
[0064] It can be understood that the first feature corresponding to the first recognition area can be extracted based on the first representative image, and the second feature corresponding to the second recognition area can be extracted based on the second representative image. When matching targets in the camera subset, target matching is performed based on the first feature and the second feature, and the target feature corresponding to the matched targets in the target subset is obtained by fusing the first feature and the second feature.
[0065] Furthermore, among all camera subsets, based on the target features of each target, the matched targets in the camera subsets are further matched to determine targets that meet the feature conditions, wherein the feature conditions are related to the similarity between the target features, for example, the similarity is greater than a similarity threshold.
[0066] It is understandable that after determining the target that meets the characteristic conditions, the target that meets the characteristic conditions can be regarded as the same target recognized across cameras in the acquisition area, and the fusion tracks of the targets that meet the characteristic conditions can be summarized into one track to generate the target track of the target in the acquisition area. Therefore, in each camera subset, the targets in a single camera subset can be efficiently matched, the redundancy of the targets in the camera subset can be reduced, and the targets can be matched twice between camera subsets to generate the target track in the entire acquisition area, so that the target track is complete and accurate.
[0067] Optionally, based on the first representative image and the second representative image corresponding to the targets in the target set, the targets in the camera subset are matched to obtain matched targets in the camera subset, and target features and fusion trajectories corresponding to the matched targets are determined, including: acquiring a first feature corresponding to the first representative image and a second feature corresponding to the second representative image; performing feature matching or target clustering on the targets in the target set based on the first feature and the second feature corresponding to each target to obtain matched targets in the camera subset; determining the target features corresponding to the matched targets based on the first feature and the second feature corresponding to the matched targets, and determining the fusion trajectory corresponding to the matched targets based on the trajectory information corresponding to the matched targets.
[0068] Specifically, feature extraction is performed on the first representative image to obtain a first feature corresponding to the first representative image, and feature extraction is performed on the second representative image to obtain a second feature corresponding to the second representative image.
[0069] Furthermore, based on the first feature and the second feature corresponding to each target, the targets in the target set are feature matched, or the targets in the target set are clustered to obtain the matched targets in the camera subset, wherein the matched targets can be classified as the same target, and the target features corresponding to the matched targets are determined using the first feature and the second feature corresponding to the matched targets, wherein the target features can characterize the overall features of the targets. Therefore, through the features in the two recognition areas, the targets can be matched more accurately in the camera subset, and the fusion trajectory corresponding to the matched targets in the camera subset can be determined. In the case where the targets have been matched in the camera subset, the target features that can characterize the overall features are obtained, thereby more efficiently matching targets between target sets.
[0070] It can be understood that by fusing the trajectory information corresponding to the matched target, a fused trajectory corresponding to the matched target can be obtained.
[0071] In a specific implementation scenario, the current target in the target set is matched with the targets under other cameras by the first feature and the second feature, wherein the first feature and the second feature have respective weights when matched, and when the feature matching condition is met, the matched targets are classified into the same collection and their trajectory information is fused, and so on to obtain all the matched targets in the camera subset, and the first feature and the second feature corresponding to the matched targets are fused to obtain the target feature, and all the trajectory information of the matched targets is fused to obtain the fused trajectory.
[0072] In a specific implementation scenario, the first feature and the second feature corresponding to the target in the target set are clustered to obtain a cluster set, the target indicated by the cluster center of the cluster set is used as the matched target, the first feature and the second feature corresponding to the cluster center in the cluster set are fused to obtain the target feature of the target, and all trajectory information of the matched target is fused to obtain a fused trajectory.
[0073] S204: Based on the conversion relationship between the camera coordinate system corresponding to the camera that collected the target trajectory and the map coordinate system, the target trajectory is converted into the map coordinate system, and the motion trajectory of the target in the map coordinate system is obtained and displayed.
[0074] Specifically, the acquisition area corresponds to a map coordinate system, and the camera coordinate system corresponding to each camera is pre-set with a conversion relationship with the map coordinate system.
[0075] It can be understood that based on the spatial transformation relationship between the camera plane coordinates and the scene map coordinates, the transformation relationship between the camera coordinate system and the map coordinate system can be determined. The target trajectory can be transformed into the map coordinate system corresponding to the acquisition area using this transformation relationship, thereby mapping the target trajectory to the actual scene, and obtaining the motion trajectory of the target in the map coordinate system. The trajectory information of the target in the actual scene can be visualized to make the target trajectory more intuitive.
[0076] Optionally, the state of the target (such as staying, moving speed, etc.) is indicated by color, arrows, etc. In this way, by mapping the trajectory on the camera plane to the scene map and combining the time information to display the moving speed and state of the target, the trajectory and state of the target under different cameras can be clearly displayed.
[0077] In this embodiment, by acquiring the first representative image corresponding to the first recognition area on the target and the second representative image corresponding to the second recognition area, the description capability of the target is enhanced and the possibility of mismatching the target is reduced. Through the features in the two recognition areas, the target can be matched more accurately in the camera subset, and the fusion trajectory corresponding to the matched target in the camera subset is determined. When the target has been matched in the camera subset, the target features that can characterize the overall features are obtained. Among all camera subsets, based on the target features of each target, the matched targets in the camera subset are further matched to determine the targets that meet the feature conditions, and the fusion trajectories of the targets that meet the feature conditions are summarized into one trajectory to generate the target trajectory of the target in the acquisition area. The target trajectory is mapped to the actual scene to obtain the motion trajectory of the target in the map coordinate system, and the trajectory information of the target in the actual scene is visualized to make the target trajectory more intuitive.
[0078] See also Figure 3 , Figure 3It is a structural diagram of an embodiment of an electronic device of the present application, wherein the electronic device 30 includes a memory 301 and a processor 302 coupled to each other, wherein the memory 301 stores program data (not shown), and the processor 302 calls the program data to implement the method in any of the above embodiments. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0079] See also Figure 4 , Figure 4 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 40 stores program data 400. When the program data 400 is executed by a processor, the method in any of the above embodiments is implemented. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0080] It should be noted that the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0083] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A target trajectory generation method, characterized in that: The method comprises: Obtaining camera subsets corresponding to each of the multiple sub-areas in the acquisition area; wherein the camera subsets are divided based on the path distance and connectivity relationship between the cameras, the path distance is related to the number of cameras spaced between the camera points, and the connectivity relationship is related to the shooting area of the camera; Obtaining a target set of cameras in each of the camera subsets within a specified time period, and trajectory information corresponding to the targets in the target set; wherein the duration of the specified time period is related to the path distance; specifically comprising: obtaining a target set of cameras in each of the camera subsets within a specified time period; wherein the specified time period is obtained based on the path distance, the reference speed of the target, and a time compensation constant; determining a representative image set corresponding to the targets in the target set, and trajectory information corresponding to the targets in the target set; wherein the representative image set corresponds to a first representative image corresponding to a first recognition area on the target, and a second representative image corresponding to a second recognition area on the target; The targets in the target set corresponding to all cameras in the camera subsets are matched, and the target trajectory of the target in the acquisition area is obtained based on the trajectory information corresponding to the matched target. Specifically, the method comprises: for each camera subset, based on the first representative image and the second representative image corresponding to the target in the target set, matching the targets in the camera subset to obtain the matched targets in the camera subset, and determining the target features and fusion trajectories corresponding to the matched targets; in all the camera subsets, based on the target features of each target, determining the targets that meet the feature conditions, and generating the target trajectory of the targets in the acquisition area by using the fusion trajectories of the targets that meet the feature conditions.
2. The method according to claim 1, characterized in that The cameras in the acquisition area are pre-set, and the process of dividing the camera subsets includes: Get the installation positions of all cameras in the acquisition area and the shooting areas corresponding to all cameras; Based on the installation position and the shooting area, determining a connectivity relationship between every two cameras, and based on the installation position, determining a path distance between every two cameras; Based on the path distance and the connectivity relationship between every two cameras, each camera in the acquisition area is divided into a corresponding camera subset; wherein the cameras in each camera subset have the connectivity relationship with each other, and the path distance is less than a distance threshold.
3. The method according to claim 2, characterized in that The dividing each camera in the acquisition area into a corresponding camera subset based on the path distance and the connectivity relationship between every two cameras comprises: Based on the path distance and the connectivity relationship between each two cameras, a distance measurement matrix is generated; wherein, when there is a connectivity relationship between the two cameras, the element at the corresponding position in the distance measurement matrix is the path distance between the two cameras, and when there is no connectivity relationship between the two cameras, the element at the corresponding position in the distance measurement matrix is a preset distance value; The cameras in the acquisition area are clustered using the distance metric matrix to obtain the camera subsets corresponding to the multiple sub-areas in the acquisition area.
4. The method according to claim 1, characterized in that: After acquiring the camera subsets corresponding to the multiple sub-areas in the acquisition area, the method further includes: Performing target recognition on the target captured by each camera to obtain the first recognition area and the second recognition area on the target, and trajectory information corresponding to the target; Obtain a first quality score of the first recognition area and a second quality score of the second recognition area, determine a first representative image corresponding to the first recognition area based on the first quality score, and determine a second representative image corresponding to the second recognition area based on the second quality score.
5. The method according to claim 1, characterized in that The matching of the targets in the camera subset based on the first representative image and the second representative image corresponding to the targets in the target set to obtain matched targets in the camera subset and determining target features and fusion trajectories corresponding to the matched targets includes: Acquire a first feature corresponding to the first representative image and a second feature corresponding to the second representative image; Based on the first feature and the second feature corresponding to each target, perform feature matching or target clustering on the targets in the target set to obtain matched targets in the camera subset; Based on the first feature and the second feature corresponding to the matched target, a target feature corresponding to the matched target is determined, and based on the trajectory information corresponding to the matched target, a fusion trajectory corresponding to the matched target is determined.
6. The method according to claim 1, characterized in that The acquisition area corresponds to a map coordinate system, and the camera coordinate system corresponding to each camera is pre-set with a conversion relationship with the map coordinate system; After performing target matching on the targets in the target set corresponding to all cameras in the camera subset, and obtaining the target trajectory of the target in the acquisition area based on the trajectory information corresponding to the matched targets, the method further includes: Based on the conversion relationship between the camera coordinate system corresponding to the camera that collects the target trajectory and the map coordinate system, the target trajectory is converted to the map coordinate system, and the motion trajectory of the target in the map coordinate system is obtained and displayed.
7. An electronic device, characterized in that: include: A memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
