Real-time cross-lens multi-target tracking method for multiple fixed lenses, storage medium and electronic equipment
By using the binary graph matching algorithm and projection transformation matrix for multi-object tracking in a multi-fixed lens environment, the problems of feature generalization and ID confusion of Re-ID models are solved, and real-time and low resource requirements of multi-objectives are tracked.
Patent Information
- Application Number
- CN202411659152.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, when multi-object tracking is used with the Re-ID model, feature extraction is not generalized enough, cannot adapt to real application scenarios, and it is difficult to extract discriminative features when multiple targets with the same appearance, resulting in ID confusion.
The real-time cross-mirror multi-objective tracking method for multiple fixed lenses is adopted. By obtaining the center point coordinates of each target in the first frame of the video captured by multiple cameras, a two-way target matching algorithm is used to match pairwise targets, and the pre-calculated projection transformation matrix is used to project the coordinates of the target center point into the same position coordinate system to achieve multi-objective tracking.
There is no need to calculate the target characteristics, reduce the computing resource requirements, and can achieve real-time tracking of multiple targets, and be suitable for any scenario, avoiding the problem of ID confusion.
Smart Images

Figure CN119600311A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of target tracking technology, and in particular to a real-time cross-lens multi-target tracking method, storage medium and electronic device for multiple fixed lenses. Background Art
[0002] At present, tracking multiple targets in scenarios where multiple cameras have overlapping areas is mainly achieved through the Re-ID model. However, the target tracking and identification method using the Re-ID model has the following defects:
[0003] 1. The features extracted by the Re-ID model are not general enough and usually only work for a specific category, and cannot be universally adapted to real-world application scenarios;
[0004] 2. When encountering multiple targets with the same appearance, it is difficult to extract discriminative features, resulting in ID confusion. Summary of the invention
[0005] The embodiments of the present application provide a real-time cross-lens multi-target tracking method, storage medium and electronic device for multiple fixed lenses to solve the technical problems existing in the prior art.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to a first aspect of an embodiment of the present application, a real-time cross-lens multi-target tracking method for multiple fixed lenses is provided, which is characterized by comprising:
[0008] Get the center point coordinates of each target in the first frame of the video captured by multiple cameras;
[0009] Based on the center point coordinates of the target, a bipartite graph matching algorithm is used to match two targets. The two successfully matched targets are assigned the same ID, and the unmatched targets are assigned new unique IDs until all targets in the first frame of the video captured by all cameras are assigned.
[0010] Based on the matching result of the first frame of the video, a corresponding multi-target tracker is initialized for each camera;
[0011] Target detection is performed on the subsequent video frames of each camera based on the multi-target tracker. If a new target without an ID is present in the subsequent video frames, target matching is performed again on the new target without an ID until all cameras are matched.
[0012] In some embodiments of the present application, based on the above solution, obtaining the center point coordinates of each target in the first frame of the video captured by multiple cameras includes:
[0013] Perform target detection on the first frames of videos shot by multiple cameras respectively to obtain target detection results;
[0014] Determine the center point coordinates of each target based on the target detection results.
[0015] In some embodiments of the present application, based on the above solution, before performing pairwise target matching using a bipartite graph matching algorithm based on the center point coordinates of the target, the method further includes:
[0016] Calculate the projection transformation matrix between two cameras based on the images taken by each camera at the same time;
[0017] The projection transformation matrix is used to project the center point coordinates of multiple targets between two cameras into the same position coordinate system.
[0018] In some embodiments of the present application, based on the above solution, the step of calculating the projection transformation matrix between two cameras according to the images simultaneously captured by each camera includes:
[0019] Get a frame of image taken by each camera at the same time, and extract the key points and key point features of all images;
[0020] The projection transformation matrix between each camera is calculated based on the key points and key point features.
[0021] In some embodiments of the present application, based on the above solution, the pairwise target matching using a bipartite graph matching algorithm based on the center point coordinates of the target includes:
[0022] Based on the projected coordinates, calculate the Euclidean distance between the coordinates of all target center points of one camera and the coordinates of all target center points of another camera;
[0023] The Euclidean distance is used as a cost matrix and sent to a bipartite graph matching algorithm to perform pairwise target matching.
[0024] In some embodiments of the present application, based on the above solution, the process of performing pairwise target matching further includes:
[0025] The matching results whose cost matrix is less than the set threshold are restricted to be valid matches.
[0026] According to a second aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer executes the method according to the first aspect.
[0027] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a memory and a processor;
[0028] The memory is used to store computer instructions;
[0029] The processor is used to call the computer instructions stored in the memory so that the electronic device executes the method as described in the first aspect.
[0030] The technical solution of the present application does not require the calculation of target features and has low requirements on computing resources. It can track multiple targets by only utilizing the projection transformation relationship between cameras and can be migrated to any scene.
[0031] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0033] Figure 1 A schematic flow chart of a real-time cross-lens multi-target tracking method for multiple fixed lenses according to an embodiment of the present application is shown;
[0034] Figure 2 A block diagram of an electronic device according to an embodiment of the present application is shown;
[0035] Figure 3 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0037] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0038] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0039] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0040] It should be noted that the “plurality” mentioned in this article refers to two or more.
[0041] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] Some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0043] In view of the defects in the prior art of using the Re-ID model for multi-target tracking, the embodiment of the present application proposes a real-time cross-lens multi-target tracking method for multiple fixed lenses. Taking into account that the existing defects are all caused by the use of the Re-ID model, the method directly eliminates the Re-ID model and instead uses the pre-calculated homography matrix (Homography matrix, also known as the projection transformation matrix) between two cameras to project the center positions of multiple targets between cameras into the same position coordinate system, and then uses the bipartite graph matching algorithm to perform minimum cost multi-target pairwise matching, assigns the same ID to the two matched targets, and reassigns a unique ID to the unmatched targets, thereby achieving tracking of multiple targets.
[0044] For details, see Figure 1 , shows D according to an embodiment of the present application.
[0045] like Figure 1 As shown, a real-time cross-lens multi-target tracking method for multiple fixed lenses is demonstrated, which specifically includes steps S100 to S400.
[0046] refer to Figure 1 , step S100, obtaining the center point coordinates of each target in the first frame of the video captured by multiple cameras.
[0047] It should be noted that this method is applicable to scenes where multiple cameras have overlapping areas, so before target tracking, multiple cameras need to be fixed and ensure that each camera has an overlapping shooting area with at least one other camera.
[0048] In some feasible embodiments, based on the above solution, obtaining the center point coordinates of each target in the first frame of the video captured by multiple cameras includes:
[0049] Perform target detection on the first frames of videos shot by multiple cameras respectively to obtain target detection results;
[0050] Determine the center point coordinates of each target based on the target detection results.
[0051] It is understandable that performing target detection on the first frame of a video can detect how many targets there are in the video image, and then confirm the coordinates of the center point of each target based on the target position in the image.
[0052] Continue to refer Figure 1 , step S200, based on the center point coordinates of the target, use the bipartite graph matching algorithm to perform pairwise target matching, assign the same ID to the two successfully matched targets, and assign a new unique ID to the unmatched targets until all targets in the first frame of the video captured by all cameras are assigned.
[0053] It can be understood that in step S200, the cameras are processed in pairs in sequence until all the targets in the first frames of the videos shot by all the cameras are allocated.
[0054] In some feasible embodiments, based on the above solution, before performing pairwise target matching using a bipartite graph matching algorithm based on the center point coordinates of the targets, the method further includes:
[0055] Calculate the projection transformation matrix between two cameras based on the images taken by each camera at the same time;
[0056] The projection transformation matrix is used to project the center point coordinates of multiple targets between two cameras into the same position coordinate system.
[0057] It can be understood that projecting the center point coordinates of multiple targets between two cameras into the same position coordinate system can refer to projecting all target center point coordinates of one camera between two cameras into the position coordinate system of another camera using the calculated projection transformation matrix between two cameras.
[0058] In some feasible embodiments, based on the above solution, the step of calculating the projection transformation matrix between two cameras according to the images simultaneously captured by each camera includes:
[0059] Get a frame of image taken by each camera at the same time, and extract the key points and key point features of all images;
[0060] The projection transformation matrix between each camera is calculated based on the key points and key point features.
[0061] In some feasible embodiments, based on the above solution, the pairwise target matching using a bipartite graph matching algorithm based on the center point coordinates of the target includes:
[0062] Based on the projected coordinates, calculate the Euclidean distance between the coordinates of all target center points of one camera and the coordinates of all target center points of another camera;
[0063] The Euclidean distance is used as a cost matrix and sent to a bipartite graph matching algorithm to perform pairwise target matching.
[0064] In some feasible embodiments, based on the above solution, the process of pairwise target matching further includes:
[0065] The matching results whose cost matrix is less than the set threshold are restricted to be valid matches.
[0066] It is understandable that a successful match means a valid match.
[0067] Continue to refer Figure 1, step S300, based on the matching result of the first frame of the video, a corresponding multi-target tracker is initialized for each camera.
[0068] It is understandable that the generated multi-target tracker can identify already matched targets appearing in subsequent frames of the video to avoid repeated identification, which leads to reduced work efficiency.
[0069] Continue to refer Figure 1 , step S400, target detection is performed on subsequent video frames of each camera based on the multi-target tracker. If a new target without an ID is present in the subsequent video frame, target matching is performed again on the new target without an ID until all cameras are matched.
[0070] It can be understood that re-target matching for a new target without an assigned ID means obtaining the center point coordinates of the new target without an assigned ID, then using the projection transformation matrix to transform the coordinates, and then calculating the cost matrix based on the transformed coordinates, and sending the cost matrix to the bipartite graph matching algorithm for pairwise matching. If the match is successful, the same ID is assigned, otherwise a new unique ID is assigned.
[0071] Illustratively, a specific implementation of the method is provided below.
[0072] Step 1: Fix multiple cameras and make sure that each camera has an overlapping shooting area with at least one other camera;
[0073] Step 2: Take a frame of image taken by each camera at the same time, extract the key points and key point features of all images, calculate the projection transformation matrix between each camera according to the key points and key point features, and save all the projection transformation matrices;
[0074] Step 3: After the cameras are deployed online, target detection is performed on the first frames of the videos captured by multiple cameras to obtain detection results, and the center point coordinates of each target are obtained based on the detection results;
[0075] Step 4: Process the cameras in pairs in turn, and use the calculated projection transformation matrix between the cameras to project the coordinates of all target center points of one camera into the coordinate system of the other camera;
[0076] Step 5: Calculate the Euclidean distance between the coordinates of all target center points of one camera and the coordinates of all target center points of another camera as the cost matrix, and send it to the bipartite graph matching algorithm to obtain the result of pairwise target matching. At the same time, limit the matching results with a cost matrix less than a certain threshold as valid matches to prevent two targets that are far apart from each other from matching. Assign the same ID to the two validly matched targets, and assign a new unique ID to the unmatched targets. Add the unmatched targets in one camera to the target set of the other camera.
[0077] Step 6: Repeat steps 4-5 until all cameras are processed.
[0078] Step 7: Use the matching results of the first frame of video taken by each camera to initialize a single-lens multi-target tracker for each camera.
[0079] Step 8: Send the subsequent video frames of each camera to its corresponding multi-target tracker. The multi-target tracker will classify the targets into two categories: matched targets and unmatched targets. The matched targets do not need to be processed. The coordinates of all the unmatched target center points in the two cameras are executed in steps 4 and 5 until all cameras are processed.
[0080] Step 7: Repeat step 8 until finished.
[0081] To sum up, in the existing target tracking and identification methods using the Re-ID model, the features extracted by the Re-ID model are not general enough and usually can only work for a specific category and cannot be universally adapted to real-world application scenarios. The method provided in the embodiment of the present application does not require training and can be migrated to any scenario.
[0082] The existing target tracking and identification methods using the Re-ID model are difficult to extract discriminative features when encountering multiple targets with the same appearance, resulting in ID confusion. The method provided in the embodiment of the present application can avoid this situation well; at the same time, since the use of the Re-ID model is avoided, the GPU computing power requirement is not required, and the effect of real-time tracking can be achieved.
[0083] like Figure 2 As shown, an embodiment of the present application also provides an electronic device 200, including a memory 210, a processor 220, and a computer program 211 stored in the memory 210 and executable on the processor. When the processor 220 executes the computer program 211, the steps of the above-mentioned real-time cross-lens multi-target tracking method for multiple fixed lenses are implemented.
[0084] Since the electronic device introduced in this embodiment is a device used to implement a real-time cross-lens multi-target tracking method for multiple fixed lenses in the embodiment of the present application, based on the method introduced in the embodiment of the present application, technical personnel in this field can understand the specific implementation mode of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present application is not introduced in detail here. As long as the equipment used by technical personnel in this field to implement the method in the embodiment of the present application is within the scope of protection of this application.
[0085] During the specific implementation process, when the computer program 211 is executed by a processor, any implementation method in the embodiments corresponding to the first aspect can be implemented.
[0086] Figure 3 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0087] It should be noted that Figure 3 The computer system 300 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0088] like Figure 3 As shown, the computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0089] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
[0090] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 309, and / or installed from a removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, various functions defined in the system of the present application are executed.
[0091] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0092] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0093] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0094] As another aspect, the present application further provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes a real-time cross-lens multi-target tracking method for multiple fixed lenses as described in the above embodiment.
[0095] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements a real-time cross-lens multi-target tracking method for multiple fixed lenses described in the above embodiment.
[0096] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0097] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0098] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. It should be understood that the present application is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A real-time cross-lens multi-target tracking method for multiple fixed lenses, characterized by: include: Get the center point coordinates of each target in the first frame of the video captured by multiple cameras; Based on the center point coordinates of the target, a bipartite graph matching algorithm is used to match two targets. The two successfully matched targets are assigned the same ID, and the unmatched targets are assigned new unique IDs until all targets in the first frame of the video captured by all cameras are assigned. Based on the matching results of the first frame of the video, a corresponding multi-target tracker is initialized for each camera; Target detection is performed on the subsequent video frames of each camera based on the multi-target tracker. If a new target with an unassigned ID appears in the subsequent video frame, target matching is performed again on the new target with an unassigned ID until all cameras are matched.
2. The method according to claim 1, characterized in that The step of obtaining the center point coordinates of each target in the first frame of a video captured by multiple cameras includes: Perform target detection on the first frames of videos shot by multiple cameras to obtain target detection results; Determine the center point coordinates of each target based on the target detection results.
3. The method according to claim 2, characterized in that Before performing pairwise target matching using a bipartite graph matching algorithm based on the target's center point coordinates, the following steps are also included: Calculate the projection transformation matrix between two cameras based on the images taken by each camera at the same time; The projection transformation matrix is used to project the center point coordinates of multiple targets between two cameras into the same position coordinate system.
4. The method according to claim 3, characterized in that The method of calculating the projection transformation matrix between two cameras based on the images simultaneously captured by each camera includes: Get a frame of image taken by each camera at the same time, and extract the key points and key point features of all images; The projection transformation matrix between each camera is calculated based on the key points and key point features.
5. The method according to claim 3, characterized in that The pairwise target matching using a bipartite graph matching algorithm based on the target center point coordinates includes: Calculate the Euclidean distances between the coordinates of all target center points of one camera and the coordinates of all target center points of another camera based on the projected coordinates; The Euclidean distance is used as a cost matrix and fed into a bipartite graph matching algorithm to perform pairwise target matching.
6. The method according to claim 5, characterized in that The process of pairwise target matching also includes: The matching results whose cost matrix is less than the set threshold are considered valid matches.
7. A computer-readable storage medium, characterized in that The storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 6.
8. An electronic device, characterized in that: including memory and processor; The memory is used to store computer instructions; The processor is configured to call the computer instructions stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 6.