Vehicle tracking method, vehicle tracking device, and vehicle

By switching to the appropriate camera when the vehicle leaves the camera's tracking range, the problem of vehicle tracking interruption is solved, achieving efficient and reliable vehicle tracking and ensuring the continuity and stability of tracking.

CN122160620APending Publication Date: 2026-06-05ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD
Filing Date
2026-02-10
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In advanced driver assistance and autonomous driving systems, how can we achieve efficient and reliable vehicle tracking to avoid losing track of the target vehicle when it is outside the camera's tracking range?

Method used

By determining the target vehicle's position and direction of movement before it leaves the camera's tracking range, the direction of its departure is determined, and the system switches to the corresponding follow-up camera for tracking. By utilizing multi-camera联动 detection, the continuity and stability of the tracking are ensured.

Benefits of technology

It enables seamless switching to the next camera after the vehicle leaves the camera's tracking range, avoiding interruptions in vehicle tracking and ensuring the continuity and stability of tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122160620A_ABST
    Figure CN122160620A_ABST
Patent Text Reader

Abstract

The application provides a vehicle tracking method, a vehicle tracking device and a vehicle. The method comprises the following steps: determining a target vehicle to be tracked and a first camera currently tracking the target vehicle; in the case that the target vehicle drives out of a first tracking range of the first camera, determining a driving-out direction of the target vehicle based on a first position of the target vehicle and a motion direction of the target vehicle, wherein the first position is a position before the target vehicle drives out of the first tracking range; and determining a second camera for subsequently tracking the target vehicle based on the driving-out direction. In the case that the target vehicle drives out of the first tracking range of the first camera, the first camera cannot continue to track the target vehicle. By determining the driving-out direction of the target vehicle before the target vehicle drives out of the first tracking range, the second camera for subsequently tracking the target vehicle can be determined according to the driving-out direction. The target vehicle is avoided from being lost, and the continuity and stability of tracking are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, specifically to a vehicle tracking method, a vehicle tracking device, and a vehicle. Background Technology

[0002] In recent years, the rapid development of internet technology has brought revolutionary opportunities to the automotive industry, driving the transformation of automobiles from traditional means of transportation to intelligent, connected mobile terminals. At the same time, intelligent automotive technologies are being widely applied, and various technologies integrated into vehicles are developing rapidly. These rapidly evolving technologies include advanced driver assistance systems (ADAS) and autonomous driving systems. These technologies not only improve driving convenience and safety but also lay the technological foundation for the intelligentization of future transportation systems.

[0003] In advanced driver assistance and autonomous driving systems, continuous and stable tracking of surrounding vehicles is a key foundation for achieving accurate environmental perception, behavior prediction, and driving decisions. Therefore, how to achieve efficient and reliable vehicle tracking has become a core technological challenge that urgently needs to be overcome. Summary of the Invention

[0004] In view of this, the embodiments of this application aim to provide a vehicle tracking method, a vehicle tracking device, and a vehicle to solve the problem of how to achieve more efficient and reliable vehicle tracking. The various aspects involved in this application are described below.

[0005] In a first aspect, this application provides a vehicle tracking method, the method comprising: determining a target vehicle to be tracked and a first camera currently tracking the target vehicle; if the target vehicle leaves a first tracking range of the first camera, determining a departure direction of the target vehicle based on a first position of the target vehicle and the direction of movement of the target vehicle, wherein the first position is the position of the target vehicle before leaving the first tracking range; and determining a second camera to subsequently track the target vehicle based on the departure direction.

[0006] In one embodiment, determining the departure direction of the target vehicle based on the first position of the target vehicle and the direction of movement of the target vehicle includes: determining the boundary direction of the first position relative to the first tracking range based on the first position of the target vehicle; and determining the departure direction of the target vehicle according to the boundary direction and the direction of movement of the target vehicle.

[0007] In one embodiment, determining the boundary direction of the first position relative to the first tracking range based on the first position of the target vehicle includes: determining the target boundary region where the first position is located based on the first position of the target vehicle; and determining the boundary direction of the first position relative to the first tracking range based on the target boundary region.

[0008] In one embodiment, the first position includes an abscissa and a ordinate, the direction of the abscissa corresponding to a first boundary region and a second boundary region, and the direction of the ordinate corresponding to a third boundary region and a fourth boundary region; determining the target boundary region where the first position is located based on the first position of the target vehicle includes: determining the target boundary region where the first position is located from the first boundary region and the second boundary region based on the abscissa of the first position of the target vehicle; and / or, determining the target boundary region where the first position is located from the third boundary region and the fourth boundary region based on the ordinate of the first position of the target vehicle.

[0009] In one embodiment, after determining the target vehicle to be tracked and the first camera tracking the target vehicle, the method further includes: determining multiple second positions of the target vehicle in multiple frames of images; determining a velocity vector of the target vehicle's motion based on the multiple second positions; and determining the direction of motion of the target vehicle based on the velocity vector.

[0010] In one embodiment, determining the second camera for subsequently tracking the target vehicle based on the departure direction includes: finding a camera corresponding to the departure direction from a preset mapping relationship based on the departure direction, and determining the corresponding camera as the second camera for subsequently tracking the target vehicle, wherein the preset mapping relationship includes the correspondence between the direction of departure from the first tracking range of the first camera and at least one adjacent camera.

[0011] In one embodiment, after determining the second camera for subsequent tracking of the target vehicle based on the departure direction, the method further includes: determining a first image during the tracking of the target vehicle by the first camera, wherein the first image includes an image of the target vehicle; determining a second image during the tracking of the target vehicle by the second camera, wherein the second image includes images of at least one candidate vehicle; inputting the first image and the second image into a feature repair module in a re-identification model to obtain the first image and the second image output by the feature repair module; inputting the first image and the second image output by the feature repair module into a feature extraction module in the re-identification model to obtain feature maps corresponding to the first image and the second image respectively; using the feature maps corresponding to the first image and the second image respectively, determining the image of the target vehicle from the images of at least one candidate vehicle, and tracking the target vehicle based on the image of the target vehicle included in the second image.

[0012] In one embodiment, the feature repair module is trained by the following method: obtaining a training sample set, wherein the training sample set includes multiple sample images, including images of sample vehicles; for a first sample image among the multiple sample images, discarding some features in the first sample image to obtain a second sample image; inputting the second sample image into the generator in the feature repair module to obtain a third sample image repaired by the generator; inputting the first sample image and the third sample image into the discriminator in the feature repair module to obtain a discrimination probability value output by the discriminator, wherein the magnitude of the discrimination probability value characterizes the degree of difference between the first sample image and the third sample image; if the discrimination probability value is greater than a discrimination threshold, returning to the step of discarding some features in the first sample image among the multiple sample images to obtain a second sample image, until the discrimination probability value is less than or equal to the discrimination threshold, then stopping the iteration.

[0013] In one embodiment, the discriminator includes a global discriminator and a local discriminator; the sample image includes a global image of the sample vehicle; the step of inputting the third sample image into the discriminator in the feature repair module to obtain the discrimination probability value output by the discriminator includes: inputting the first sample image and the third sample image into the global discriminator to obtain a global discrimination result, wherein the global discrimination result characterizes the overall difference between the first sample image and the third sample image; extracting a first local image of the sample vehicle from the first sample image, and extracting a second local image of the sample vehicle from the third sample image; inputting the first local image and the second local image into the local discriminator to obtain a local discrimination result, wherein the local discrimination result characterizes the difference between the first local image and the second local image, and the difference reflects the local difference between the first sample image and the third sample image in the image regions corresponding to the repaired partial features; and determining the discrimination probability value based on the global discrimination result and the local discrimination result.

[0014] Secondly, embodiments of this application provide a vehicle tracking device, the device comprising: a first determining module configured to determine a target vehicle to be tracked and a first camera currently tracking the target vehicle; a second determining module configured to, when the target vehicle leaves a first tracking range of the first camera, determine the departure direction of the target vehicle based on a first position of the target vehicle and the direction of movement of the target vehicle, wherein the first position is the position of the target vehicle before leaving the first tracking range; and a third determining module configured to determine a second camera subsequently tracking the target vehicle based on the departure direction.

[0015] Thirdly, this application provides a vehicle including a memory and a processor, the memory for storing a computer program, and the processor for executing the computer program, including performing the vehicle tracking method of the first aspect and any embodiment of the first aspect described above.

[0016] Fourthly, this application provides a computer-readable storage medium storing program code for computer execution, the program code including a vehicle tracking method for performing the first aspect and any one of the embodiments of the first aspect.

[0017] Fifthly, embodiments of this application provide a computer program including instructions for performing the vehicle tracking method of the first aspect and any embodiment of the first aspect.

[0018] In this application, when the target vehicle leaves the first tracking range of the first camera, the first camera can no longer track the target vehicle. Based on the target vehicle's first position before leaving the first tracking range and the target vehicle's direction of movement, the departure direction of the target vehicle before leaving the first tracking range can be determined, so that a second camera that can subsequently track the target vehicle can be determined based on the departure direction. That is, through the coordinated tracking and detection between multiple cameras, the loss of the target vehicle is avoided, ensuring the continuity and stability of tracking. Attached Figure Description

[0019] Figure 1 This is a schematic flowchart of a vehicle tracking method provided in an embodiment of this application.

[0020] Figure 2 This is a flowchart of the model processing procedure for the re-identification model in a vehicle tracking method provided in this application embodiment.

[0021] Figure 3 This is a schematic diagram of the training process of the feature repair module in the re-identification model of a vehicle tracking method provided in this application embodiment.

[0022] Figure 4 This is a schematic diagram of the structure of a vehicle tracking device provided in an embodiment of this application.

[0023] Figure 5 This is a schematic structural diagram of a vehicle provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0026] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects. For example, "first target object" and "second target object," etc., are used to distinguish different target objects, not to describe a specific order of target objects.

[0027] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0028] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0029] In recent years, the rapid development of internet technology has brought revolutionary opportunities to the automotive industry, driving the transformation of automobiles from traditional means of transportation to intelligent, connected mobile terminals. At the same time, intelligent automotive technologies are being widely applied, and various technologies integrated into vehicles are developing rapidly. These rapidly evolving technologies include advanced driver assistance systems (ADAS) and autonomous driving systems. These technologies not only improve driving convenience and safety but also lay the technological foundation for the intelligentization of future transportation systems.

[0030] In advanced driver assistance and autonomous driving systems, continuous and stable tracking of surrounding vehicles is a key foundation for achieving accurate environmental perception, behavior prediction, and driving decisions. Therefore, how to achieve efficient and reliable vehicle tracking has become a core technological challenge that urgently needs to be overcome.

[0031] To address the aforementioned technical issues, this application addresses the problem that when the target vehicle leaves the first tracking range of the first camera, the first camera cannot continue tracking the target vehicle. Based on the target vehicle's initial position before leaving the first tracking range and its direction of movement, the departure direction of the target vehicle before leaving the first tracking range can be determined. This allows a second camera to be selected to subsequently track the target vehicle based on the departure direction. In other words, through coordinated tracking and detection between multiple cameras, the loss of the target vehicle is avoided, ensuring the continuity and stability of the tracking process.

[0032] The following combination Figure 1 This application will be described in detail.

[0033] Figure 1 This is a schematic flowchart of a vehicle tracking method provided in an embodiment of this application, in order to solve the above-mentioned technical problems. Figure 1 The schematic flowchart of the vehicle tracking method shown includes steps S110 to S130.

[0034] In step S110, the target vehicle to be tracked and the first camera of the target vehicle currently being tracked are determined.

[0035] The target vehicle to be tracked may include a vehicle selected by a person in the vehicle being tracked. For example, a vehicle selected by the driver of the vehicle being tracked, or a vehicle selected by a person in the passenger seat of the vehicle being tracked.

[0036] The target vehicle to be tracked can include vehicles selected from images captured by cameras. For example, vehicles selected from images captured by the first camera currently tracking the target vehicle. The camera can be a camera installed in the vehicle being tracked. For example, the camera can be a surround-view camera, covering a 360° field of view. That is, the vehicle tracking method provided in this application involves at least two types of vehicles. The first type of vehicle is the tracking vehicle. The second type of vehicle is the target vehicle to be tracked. The tracking vehicle is equipped with at least two cameras for tracking the target vehicle. For example, the first camera currently tracking the target vehicle is a camera installed in the tracking vehicle. The camera can also be called a vehicle-mounted camera, a body camera, etc.

[0037] In some embodiments, after a camera captures an image, object detection can be performed on the image to obtain the detection boxes and coordinates of vehicles in the image. For example, the image can be input into an object detection model to obtain the detection boxes and coordinates of vehicles in the image output by the object detection model. The object detection model can be, for example, YOLO, a single-stage real-time object detection algorithm. For instance, the object detection model could be the latest version of the YOLO series, YOLOv13. Object detection models are lightweight, offer excellent accuracy and efficiency, and are suitable for edge testing. For example, object detection models can efficiently adapt to the limited computing power of in-vehicle devices. By using an object detection model to detect vehicles in the camera's image and outputting their detection boxes and coordinates, detection accuracy and efficiency are improved. Correspondingly, when selecting a target vehicle to be tracked, the image after object detection can be selected. For example, the selection operation can be inputting the detection box coordinates. Alternatively, the selection operation can be clicking on a detection box in the image.

[0038] The number of target vehicles is unlimited. For example, the number of target vehicles can be one, two, or more.

[0039] Once the target vehicle to be tracked is identified, the camera that captured the image of the target vehicle can be determined, and that camera is designated as the first camera. After capturing the image of the vehicle, the first camera assigns a vehicle identification document (ID). The vehicle identification document can be understood as the vehicle's identity information. For example, when the first camera captures the image of the target vehicle, it assigns a vehicle identification document to identify the target vehicle.

[0040] In some embodiments, when using the first camera to track the target vehicle, a multi-target tracking algorithm can be used to track the target vehicle. For example, a multi-target tracking algorithm could be Byte Track.

[0041] When tracking a target vehicle using a multi-object tracking algorithm, the bounding boxes of the vehicle in the image captured by the first camera can be tracked. For example, the bounding boxes of the vehicle in multiple frames captured by the first camera can be tracked. For instance, Byte Track can be used to track the bounding boxes of the vehicle in multiple frames captured by the first camera.

[0042] In step S120, when the target vehicle leaves the first tracking range of the first camera, the departure direction of the target vehicle is determined based on the first position of the target vehicle and the direction of movement of the target vehicle, wherein the first position is the position of the target vehicle before leaving the first tracking range.

[0043] A camera has a tracking range, also known as the shooting range. The tracking range of a camera can be fixed. For example, the tracking range can be a rectangular area defined by height H and width W.

[0044] Different cameras can have the same tracking range. For example, a vehicle can be tracked by six cameras, each with a tracking range of width W and height H. Setting cameras with the same tracking range improves camera management.

[0045] Different cameras can have different tracking ranges. For example, the tracking range of a camera can be set based on its position within the vehicle being tracked. For instance, if a vehicle has six cameras, the tracking range of the first and second cameras at the front of the vehicle has a width of W1 and a height of H1; the tracking range of the third and fourth cameras located in the rearview mirrors has a width of W2 and a height of H2; and the tracking range of the fifth and sixth cameras located at the rear of the vehicle has a width of W3 and a height of H3. By using the camera's position within the vehicle to set different tracking ranges, the efficiency of tracking the target vehicle can be increased. For example, since vehicles are typically long, cameras located on the body of the vehicle can be set with a wider tracking range compared to cameras located at the front and rear of the vehicle.

[0046] The tracking ranges of adjacent cameras can overlap to allow seamless tracking of the target vehicle as it moves relative to the tracking vehicle. Alternatively, the tracking ranges of adjacent cameras can not overlap to reduce tracking costs when using cameras to track the target vehicle as it moves relative to the tracking vehicle.

[0047] If the target vehicle leaves the first tracking range of the first camera, determine the direction in which the target vehicle leaves. That is, if the first camera cannot track the target vehicle or the target vehicle is not within the first tracking range, determine the direction in which the target vehicle leaves.

[0048] The method of determining the departure direction of the target vehicle may include determining the departure direction of the target vehicle based on the target vehicle's initial position and the target vehicle's direction of motion.

[0049] The first position of the target vehicle is its position before it leaves the first tracking range. For example, the first position can be the last identifiable position of the target vehicle before it leaves the first tracking range. For instance, the first position can be the position of the target vehicle within the first tracking range in the last image captured by the first camera that includes the target vehicle while it is tracking the target vehicle.

[0050] For example, the first position can be represented in the form of coordinates. In this case, the first position may include one or more of the following: the position corresponding to the center point of the target vehicle, the position corresponding to the rearview mirror of the target vehicle, the position corresponding to the door handle of the target vehicle, etc.

[0051] For example, a coordinate axis is defined for the first tracking range. The first position can be represented using the coordinates on the defined coordinate axis corresponding to the first tracking range. For example, if the width of the first tracking range is the x-axis and the height is the y-axis, then the first position can be represented as (x, y). The origin of the coordinate axis can be the lower left corner or the upper left corner of the first tracking range. This application embodiment does not limit this and can choose according to actual needs. For example, according to the image coordinate system, the origin of the coordinate axis can be set at the upper left corner of the first tracking range. The position of the target vehicle can also be called an image coordinate point. For example, the first position can be called a first image coordinate point.

[0052] In some embodiments, determining the first position of the target vehicle may be a process of determining the boundary direction of the first position of the target vehicle relative to the first tracking range, so as to determine the departure direction of the target vehicle based on the boundary direction and the direction of movement of the target vehicle.

[0053] When the boundary direction and the target vehicle's direction of movement are in the same direction, the target vehicle's direction of movement and / or the boundary direction can be determined as the target vehicle's departure direction. When the boundary direction and the target vehicle's direction of movement are not in the same direction, the boundary direction and the target vehicle's direction of movement can be reacquired, and the target vehicle's departure direction can be determined based on the reacquired boundary direction and target vehicle's direction of movement. In other words, the boundary direction must be in the same direction as the target vehicle's direction of movement to ensure that the target vehicle leaves the first tracking range of the first camera. If the target vehicle's direction of movement does not point to the boundary direction, then the boundary direction and / or the direction of movement is not the target vehicle's departure direction. It can be understood that determining the direction in which the target vehicle leaves the first tracking range of the first camera requires simultaneously satisfying the requirements for both position and direction of movement.

[0054] The boundary direction can include the direction in which the first position deviates from the center of the first tracking range. For example, if the first position is slightly to the left of the center of the first tracking range, then the boundary direction is to the left. Or, if the first position is slightly to the right of the center of the first tracking range, then the boundary direction is to the right.

[0055] The boundary direction can be determined by the target boundary region where the first position is located. The first tracking range may include at least one boundary region. That is, the boundary region where the first position is located can be called the target boundary region. Each boundary region corresponds to a first direction. When a certain boundary region is determined to be the target boundary region, the first direction corresponding to that boundary region is taken as the boundary direction of the first position relative to the first tracking range. For example, if the first direction corresponding to boundary region A is left, then when boundary region A is the target boundary region, the boundary direction of the first position relative to the first tracking range is determined to be left. As another example, if the first direction corresponding to boundary region B is right, then when boundary region B is the target boundary region, the boundary direction of the first position relative to the first tracking range is determined to be right.

[0056] Different boundary regions can correspond to different boundary exits. If the primary direction of boundary region A is left, then the boundary exit corresponding to boundary region A is a left exit. If the primary direction of boundary region B is right, then the boundary exit corresponding to boundary region B is a right exit.

[0057] The size of at least one boundary region included in the first tracking range can be determined by a boundary threshold. The length of the boundary region in the dimension of its corresponding first direction is equal to the boundary threshold. For example, if the first direction of boundary region A is left and the dimension of its first direction is horizontal, the length of boundary region A in the horizontal direction is equal to the boundary threshold. Similarly, if the first direction of boundary region B is right and the dimension of its first direction is horizontal, the length of boundary region B in the horizontal direction is equal to the boundary threshold. And if the first direction of boundary region C is up and the dimension of its first direction is vertical, the length of boundary region C in the vertical direction is equal to the boundary threshold.

[0058] In some embodiments, the first position may include a horizontal coordinate. The direction of the horizontal coordinate may correspond to a first boundary region and a second boundary region. That is, the first direction corresponding to the first boundary region and the second boundary region can be the positive or negative direction of the horizontal coordinate axis. The first boundary region and the second boundary region can be the boundary regions included in the first tracking range.

[0059] Determining the target boundary region where the first position is located based on the first position of the target vehicle can include: determining the target boundary region where the first position is located from a first boundary region and a second boundary region based on the x-coordinate of the first position of the target vehicle. In other words, by determining whether the x-coordinate of the first position of the target vehicle is located within the first boundary region or the second boundary region, the target boundary region where the first position is located can be determined from the first boundary region and the second boundary region.

[0060] As one implementation method, the lateral ranges corresponding to the first boundary region and the second boundary region are determined respectively. The lateral coordinates of the first position of the target vehicle are compared with the lateral ranges corresponding to the first boundary region and the second boundary region respectively. The first boundary region or the second boundary region corresponding to the lateral range in which the lateral coordinates of the first position of the target vehicle are located is determined as the target boundary region.

[0061] For example, the first position can be represented as The lateral range corresponding to the first boundary region can be 0 to... The lateral range corresponding to the second boundary region can be W- To W. If the x-coordinate of the first position is between 0 and W... Then the first boundary region is defined as the target boundary region. If the x-coordinate of the first position is within W- If we reach W, then the second boundary region will be determined as the target boundary region.

[0062] As another implementation method, the region boundary values ​​corresponding to the first boundary region and the second boundary region are determined respectively, the region boundary value satisfied by the abscissa of the first position of the target vehicle is determined, and the first boundary region or the second boundary region corresponding to the satisfied region boundary value is determined as the target boundary region.

[0063] In some embodiments, the x-coordinate satisfying the region boundary value may include one or more of the following: the x-coordinate is greater than or equal to the region boundary value, or the x-coordinate is less than or equal to the region boundary value.

[0064] For example, the first position can be represented as The boundary value corresponding to the first boundary region can be... The boundary value corresponding to the second boundary region can be W- .like If the x-coordinate of the first position of the target vehicle satisfies the boundary value of the first boundary region, then the first boundary region is determined as the target boundary region. If the x-coordinate of the first position of the target vehicle satisfies the regional boundary value of the second boundary region, then the second boundary region is determined as the target boundary region.

[0065] In some embodiments, the first position may include a vertical coordinate. The direction of the vertical coordinate may correspond to a third boundary region and a fourth boundary region. That is, the first direction corresponding to the third boundary region and the fourth boundary region can be the positive and negative directions of the axis corresponding to the vertical coordinate. The third boundary region and the fourth boundary region can be the boundary regions included in the first tracking range.

[0066] Determining the target boundary region where the first position of the target vehicle is located, based on the first position's ordinate, can include: determining the target boundary region where the first position is located from the third boundary region and the fourth boundary region based on the ordinate of the first position of the target vehicle. In other words, by determining whether the ordinate of the first position of the target vehicle is located within the third boundary region or the fourth boundary region, the target boundary region where the first position is located can be determined from the third boundary region and the fourth boundary region.

[0067] As one implementation method, the longitudinal ranges corresponding to the third and fourth boundary regions are determined respectively. The longitudinal coordinates of the first position of the target vehicle are compared with the longitudinal ranges corresponding to the third and fourth boundary regions respectively. The third or fourth boundary region corresponding to the longitudinal range in which the longitudinal coordinates of the first position of the target vehicle are located is determined as the target boundary region.

[0068] For example, the first position can be represented as The longitudinal range corresponding to the third boundary region can be from 0 to... The longitudinal range corresponding to the fourth boundary region can be H- To H. If the ordinate of the first position is between 0 and H. Then the third boundary region is defined as the target boundary region. If the ordinate of the first position is within H- If we go to H, then the fourth boundary region will be determined as the target boundary region.

[0069] As another implementation method, the regional boundary values ​​corresponding to the third boundary region and the fourth boundary region are determined respectively, the regional boundary value satisfied by the ordinate of the first position of the target vehicle is determined, and the third boundary region or the fourth boundary region corresponding to the satisfied regional boundary value is determined as the target boundary region.

[0070] In some embodiments, the ordinate satisfying the region boundary value may include one or more of the following: the ordinate is greater than or equal to the region boundary value, or the ordinate is less than or equal to the region boundary value.

[0071] For example, the first position can be represented as The boundary value corresponding to the third boundary region can be... The boundary value corresponding to the fourth boundary region can be H- .like If the ordinate of the first position of the target vehicle satisfies the boundary value of the third boundary region, then the third boundary region is determined as the target boundary region. If the ordinate of the first position of the target vehicle satisfies the regional boundary value of the fourth boundary region, then the fourth boundary region is determined as the target boundary region.

[0072] In some embodiments, the first position may include an x-coordinate and a y-coordinate. The corresponding method for determining the boundary direction can be executed simultaneously based on the x-coordinate and y-coordinate.

[0073] The direction of motion can be understood as the direction in which the target vehicle moves relative to the tracking vehicle. The direction of motion can be determined based on the target vehicle's velocity vector during tracking by the first camera. The velocity vector is related to multiple second positions of the target vehicle across multiple frames of images. In other words, the velocity vector of the target vehicle's motion can be determined based on these multiple second positions across multiple frames of images.

[0074] For example, the direction of motion can be determined based on the velocity vector of the target vehicle's average speed during the tracking process by the first camera. The average speed can include both magnitude and direction. The direction included in the average speed can also be called the velocity vector. In other words, the direction of motion of the target vehicle can be determined based on the velocity vector of the average speed. For example, the velocity vector of the average speed can be used to determine the direction of motion of the target vehicle.

[0075] The first camera can determine the trajectory of the target vehicle while tracking it. This trajectory can be determined using multiple image coordinate points. Let 'i' be the time index. These multiple image coordinate points, sorted by time, can be called a series of image coordinate points. Correspondingly, the first position can be represented as... Where t is the time point for tracking the first position. t can also be called the latest time point.

[0076] The average speed of the target vehicle can be determined based on multiple image coordinate points and the corresponding time. For example, multiple image coordinate points can be determined as multiple second positions of the target vehicle in multiple frames of images, and the movement distance of the target vehicle can be determined based on the multiple second positions. This allows the average speed of the target vehicle to be determined based on the movement distance and the tracking duration of the multiple frames of images. The formula for calculating the average speed of the target vehicle can be found in the following formula (1): (1) In formula (1), v represents the average velocity. k represents the number of frames or the number of second positions. That is, it can be understood as calculating the average velocity using the k most recent points. p represents the second position, and different subscripts correspond to different second positions. . .

[0077] In some embodiments, the first tracking range can be a rectangle. For the first tracking range, the origin of the coordinate axes can be located at the upper left corner. Based on this, the following provides an example of determining the departure direction of a target vehicle.

[0078] For example, the first position can be represented as The direction of motion can be represented as .

[0079] like and If the vehicle leaves from the left boundary, then E = left, and the departure direction is left.

[0080] like and If the vehicle leaves from the right boundary, then E = right, and the departure direction is right.

[0081] like and If the vehicle leaves from the upper boundary, then E = top, and the direction of departure is upward.

[0082] like and If the vehicle exits from the lower boundary, that is, E = bottom, and the departure direction is down.

[0083] Here, E represents the boundary exit. The sign of the boundary direction is the same as the vector sign of the movement direction. If they are different, the boundary direction and movement direction need to be re-acquired to redetermine the departure direction.

[0084] In step S130, a second camera is determined based on the departure direction to subsequently track the target vehicle.

[0085] When a target vehicle leaves the first tracking range of the first camera, its departure direction can be determined. Based on this departure direction and the positional relationship between the first camera and other cameras, the camera to which the target vehicle has entered the tracking range can be identified, and this camera can be designated as the second camera. In other words, through precise camera switching logic, seamless integration between multiple cameras is achieved.

[0086] In this embodiment, during the tracking of a target vehicle using a camera, a single camera is used for tracking at each stage. For example, a first camera is used to track the target vehicle in the current stage. Alternatively, a second camera may be used in a subsequent stage. That is, although a single camera cannot cover the entire area around the vehicle being tracked, and the target vehicle may frequently enter and exit the field of view of different cameras, the vehicle tracking method provided in this embodiment allows switching between cameras tracking the target vehicle at different stages. This avoids using multiple cameras simultaneously for tracking, thereby avoiding the consumption of significant computing power associated with using multiple cameras for detection.

[0087] The positional relationship between the first camera and other cameras can be called a preset mapping relationship. This can be understood as the correspondence between the direction of departure from the first camera's tracking range and at least one adjacent camera. In other words, based on the departure direction, the camera corresponding to that direction is found in the preset mapping relationship, and that camera is designated as the second camera for subsequent tracking of the target vehicle. The preset mapping relationship can also be called a predefined mapping relationship. It can be calibrated / tested based on the model of the vehicle being tracked.

[0088] In some embodiments, each camera may have a preset mapping relationship to specify the structural relationship between other cameras and the cameras corresponding to the preset mapping relationship. For example, if a third camera has a preset mapping relationship, the preset mapping relationship can be used to represent the camera to the left of the third camera, the camera to the right of the third camera, the camera above the third camera, and the camera below the third camera. For example, if the camera currently tracking the target vehicle is camera A, and the camera to the left of camera A is camera B, then if the target vehicle drives away from the left side of camera A, then the camera that will subsequently track the target vehicle will be camera B.

[0089] If the camera tracking the target vehicle is determined to be the second camera, the second camera can be updated to the first camera. Based on this, the target vehicle to be tracked is the vehicle inherited from the camera tracking the previous target vehicle. Accordingly, the camera within the tracking range that the target vehicle enters is designated as the first camera.

[0090] In some embodiments, image feature comparison can be used to detect whether the target vehicle included in the first image during the first camera's tracking of the target vehicle and the vehicle included in the second image during the second camera's tracking of the target vehicle are the same vehicle, or whether the target vehicle is included in the second image, so as to find the target vehicle from the second image during the second camera's tracking of the target vehicle. The image feature comparison method may include one or more of the following: training a neural network model for image feature comparison using multiple sets of first and second sample images; inputting the first and second images into the neural network model to obtain the image feature comparison result output by the neural network model; using a feature comparison algorithm to calculate the image feature similarity between the first and second images to determine the image feature comparison result; using a re-identification model to obtain feature maps of the first and second images, and determining the feature comparison result between the first and second images based on the feature maps; and determining whether to continue tracking the target vehicle based on the second image according to the feature comparison result.

[0091] The following provides a detailed explanation of the scheme for using a re-identification model to compare image features and determine the target vehicle for tracking.

[0092] By using a re-identification model, it's possible to detect whether the target vehicle included in the first image during the first camera's tracking of the target vehicle is the same vehicle as the vehicle included in the second image during the second camera's tracking of the target vehicle, or whether the target vehicle is included in the second image at all. This allows for the identification of the target vehicle from the second image during the second camera's tracking of the target vehicle. This avoids situations where a change in the camera tracking the target vehicle could prevent subsequent tracking by the second camera from failing to identify the target vehicle. In other words, it prevents situations where, when switching cameras to track the target vehicle, it's impossible to determine which vehicle the second camera is tracking as the target vehicle.

[0093] In some embodiments, the second camera may assign a new vehicle identifier to the vehicle included in the second image. If it is determined that the vehicle included in the second image is the target vehicle, the new vehicle identifier assigned by the second camera to the vehicle included in the second image may be associated with the vehicle identifier assigned by the first camera to the target vehicle.

[0094] The first image may include an image of the target vehicle. The second image may include images of at least one candidate vehicle. Inputting the first and second images into the re-identification model yields feature maps corresponding to the first and second images, respectively, output by the model. Using these feature maps, the image of the target vehicle can be determined from the images of at least one candidate vehicle, and the target vehicle can be tracked based on the image of the target vehicle included in the second image. In other words, the target vehicle is determined from at least one candidate vehicle tracked by the second camera, enabling the second camera to track the determined target vehicle. The introduction of the re-identification model further ensures seamless tracking of the target vehicle among multiple cameras.

[0095] Using the feature maps corresponding to the first and second images respectively, the image of the target vehicle can be determined from the images of at least one candidate vehicle. This can include calculating the distance or similarity between the feature maps of the first and second images, and based on the calculated distance or similarity, identifying candidate vehicle images included in the second image whose distance or similarity is less than a feature threshold, and then determining these candidate vehicles as the target vehicle. In other words, the image of the candidate vehicle is determined as the image of the target vehicle.

[0096] The re-identification model can include a feature extraction module. The first and second images are processed by this module to obtain feature maps corresponding to each image. The re-identification model uses a pre-trained convolutional neural network (CNN) architecture as its basic feature extraction framework.

[0097] The feature extraction module can consist of a basic feature extraction unit and an enhanced feature extraction unit. The basic feature extraction unit efficiently captures low-level visual features (such as edges and textures) of an image through a three-step process: single convolution operation → batch normalization → activation function operation. The basic feature extraction unit may include, for example, a Conv component. The enhanced feature extraction unit employs a fusion of variable convolution kernel technology and channel separation strategy for feature extraction. The enhanced feature extraction unit can be optimized from a cross-stage partial network with 3 convolutions (C3) module, significantly improving the ability to capture multi-level, fine-grained features in complex scenes, especially suitable for deep feature extraction tasks in scenarios with changing external lighting and viewing angles. The enhanced feature extraction unit can also be referred to as the signature feature extraction enhancement unit of the YOLO11 model. The enhanced feature extraction unit may include, for example, a C3k2 component. In other words, the feature extraction module can adopt a combined structure design of "Conv component + C3k2 component".

[0098] For example, the network structure of the feature extraction module may include Conv, Conv, C3k2, Conv, C3k2, Conv, C3k2.

[0099] In some embodiments, the re-identification model may further include a feature repair (FR) module. Before inputting the first and second images into the feature extraction module, the first and second images are first input into the feature repair module to obtain the first and second images output by the feature repair module. Then, the first and second images output by the feature repair module are input into the feature extraction module for subsequent processing. This avoids feature loss due to interference factors such as occlusion by other vehicles, sudden changes in lighting, or changes in viewpoint in actual driving scenarios, which could lead to significant differences compared to the complete original features and affect the extraction by the feature extraction module. Feature repair in the image can be understood as generating new feature values ​​or pixel values ​​to complete the image, making occluded or missing features closer to the true features. The feature repair module can also be called a feature restoration module, used to restore the features.

[0100] For example, see Figure 2 , Figure 2 This document illustrates a flowchart of the model processing procedure for the re-identification model in a vehicle tracking method provided in an embodiment of this application. Figure 2 In the process, the images (first image and second image) are input into the feature repair module, and then the feature extraction module obtains the feature maps of the images (first image and second image) output by the feature extraction module.

[0101] The feature inpainting network can also include a missing feature identification mechanism. After receiving the input image, the missing feature identification mechanism first identifies the extent of feature loss in the image. If the missing feature level is below a threshold, no inpainting is performed, and the image is directly input into the feature extraction module. If the missing feature level is above or equal to the threshold, the feature inpainting network performs feature inpainting on the image. The threshold can be obtained empirically or predefined, setting a threshold for whether or not to inpaint the image.

[0102] Training methods for re-identification networks can include using triplet loss. This training process ensures that when input images contain the same vehicle, the output feature maps are more similar; conversely, when input images do not contain the same vehicle, the output feature maps are more distinct.

[0103] For example, during the training phase of the re-identification network, three images can be input into the re-identification network simultaneously, where two images contain the same vehicle and the other contains a different vehicle. The network is trained using triplet loss, which makes the feature maps of the two images containing the same vehicle more similar and the feature maps of the two images containing different vehicles more different.

[0104] The network structure of the feature inpainting module can include a generative adversarial network (GAN). The generator is used to generate entirely new features for the occluded parts of the image to complete the feature inpainting process.

[0105] The generator can be structured around an "encode-decode" architecture. The specific execution flow and structural design of the generator include: Input processing, where the image is first used as the generator's raw input data; Encoding stage, used to learn the features of the input image and generate preliminary corrected page features based on these features; Fully connected layers, which may include two fully connected layers, used to pass the encoded features to the decoding network; Decoding stage, where the decoding network has a symmetrical structure to the encoding network, the difference being that the pooling layers in the encoding network are replaced with unpooling layers, used to decode the features passed from the encoding stage into a complete image.

[0106] The input data to the generator can be, for example, image content of a page region cropped from vehicle detection bounding boxes. The vehicle detection bounding boxes can be obtained based on an object detection model. The encoding network can be, for example, MobileNetV4.

[0107] In some embodiments, the image may be subjected to pixel discarding before being input into the generator's encoding network. The image after pixel discarding may be an image that has been occluded, has missing features, or has lost pixels. That is, the image input into the encoding network may be an image that has undergone multi-pixel discarding.

[0108] In some embodiments, the feature inpainting module may further include a discriminator. The discriminator is responsible for comparing the differences between the inpainted image and the original image. Although the generator can repair missing features, the repaired features may not effectively match the essential features of the original image. For an excellent generative adversarial network, it not only needs to make the generated image of the missing region highly similar to the real image, but also needs to accurately characterize the relationship between vehicles, signs, and the surrounding environment. By setting a discriminator in the feature inpainting module, the authenticity of the inpainted image can be determined. That is, after the generator generates new features for the occluded parts of the image to complete feature inpainting, the image is sent to the discriminator so that the discriminator can compare it with the original image to determine the accuracy of the inpainted image.

[0109] The basic network structure of the discriminator can be, for example, MobileNetV4. A sigmoid binary classifier can be added to the end of the discriminator's network structure.

[0110] During the inference phase, the feature inpainting module can perform feature inpainting on occluded parts of the image based on the generator. In other words, during the inference phase, the only network structure that actually functions in the feature inpainting module is the generator.

[0111] The feature repair module can be implemented during the training phase based on the combination of a generator and a discriminator. That is, during training, the network structure that actually functions in the feature repair module can include both a generator and a discriminator. The following describes one training method for the feature repair module.

[0112] The feature inpainting module can be trained based on a training sample set. The training sample set can include multiple sample images, which may include images of sample vehicles.

[0113] In some embodiments, the sample images may include an image of one sample vehicle or images of multiple sample vehicles.

[0114] One of multiple sample images is designated as the first sample image. Some features in the first sample image are discarded to obtain the second sample image. The second sample image is then input into the generator in the feature restoration module to obtain the restored third sample image. The first and third sample images are then input into the discriminator in the feature restoration module to obtain the discriminant probability value output by the discriminator. The magnitude of the discriminant probability value represents the degree of difference between the first and third sample images. The higher the discriminant probability value, the greater the difference between the first and third sample images. If the discriminant probability value is greater than a discriminant threshold, the process returns to discarding some features from the first sample image to obtain the second sample image, until the discriminant probability value is less than or equal to the discriminant threshold, at which point the iteration stops. In other words, the training of the feature restoration module involves iterative processes between the generator and the discriminator until the discriminator can no longer determine whether the generated new features are true identifier data features. That is, it continues until the discriminator can no longer determine whether there is a difference between the restored image and the true image.

[0115] In some embodiments, the discriminator includes a local discriminator and a global discriminator. That is, the network structure of the feature extraction module may include a generator, a local discriminator, and a global discriminator. The local discriminator focuses on the repaired occluded region and compares the features of this region with the features of the real unoccluded region. The global discriminator compares the repaired whole image with the original whole image. In other words, the local discriminator mainly focuses on the local details of the occluded region and is responsible for determining the authenticity of the features in that region. The global discriminator strives to make the repaired whole image fit the surrounding environment as closely as possible in terms of global structure, ensuring the overall scene harmony. That is, the training of the feature repair module involves iterative processes between the generator, the local discriminator, and the global discriminator until the local and global discriminators can no longer determine whether the newly generated features are genuine identifier data features.

[0116] A local discriminator can also be called a local feature discriminator. A global discriminator can also be called a global feature discriminator.

[0117] The basic network architecture for both the global and local discriminators can be, for example, MobileNetV4. A sigmoid binary classifier can be added to the end of the network architecture for both the global and local discriminators.

[0118] The following describes another training method for the feature repair module.

[0119] The sample images include a global image of the sample vehicle. The method for generating the third sample image is the same as or similar to the steps taken during the training of the generator and discriminator in the feature restoration module, and will not be repeated here. Correspondingly, the first and third sample images are input into the discriminator in the feature restoration module to obtain the discrimination probability value output by the discriminator. This includes: inputting the first and third sample images into the global discriminator to obtain a global discrimination result, where the global discrimination result characterizes the overall difference between the first and third sample images; extracting a first local image of the sample vehicle from the first sample image and a second local image of the sample vehicle from the third sample image; inputting the first and second local images of the sample vehicle into a local discriminator to obtain a local discrimination result, where the local discrimination result characterizes the difference between the first and second local images, reflecting the local differences between the first and third sample images in the image regions corresponding to the restored partial features; and determining the discrimination probability value based on the global and local discrimination results. In other words, both the local and global discriminators will discriminate the generated third sample image, but the areas of discrimination focus are different. This can be understood as follows: the local discriminator focuses on the locally repaired area, while the global discriminator focuses on the global region.

[0120] For example, the network structure and training process of the feature repair module can be found in [reference needed]. Figure 3 . Figure 3 This is a schematic diagram of the training process of the feature repair module in the re-identification model of a vehicle tracking method provided in this application embodiment.

[0121] The acquired sample images include a global image of the sample vehicle. Local images of the sample vehicle are extracted from the global image. This global image and the local images are used as the original image. Pixels are discarded from the global image to obtain occluded sample images. The occluded sample images are input into the encoding network, processed through fully connected layers and the decoding network, to obtain the restored global image. The occluded sample images can also be called occluded sample images. The activation function used in the encoding network and fully connected layer processing can be, for example, h-swish. Local images of the sample vehicle are extracted from the restored global image, i.e., restored local images are obtained. A global discriminator is used to determine whether the vehicles contained in the global image and the restored global image are the same vehicle, i.e., to determine the authenticity of the restored global image. A local discriminator is used to determine whether the vehicles contained in the local image and the restored local image are the same vehicle, i.e., to determine the authenticity of the restored local image.

[0122] The vehicle tracking method provided in this application can be used to track vehicles around a vehicle while the vehicle is in motion. When tracking a target vehicle, factors such as occlusion between vehicles, changes in viewing angle, and changes in lighting may cause the tracking vehicle to lose track of the target vehicle. In other words, the vehicle's movement is a dynamic process, and the effectiveness of multi-target tracking algorithms may decrease in high-speed motion scenarios involving onboard cameras installed in the tracking vehicle.

[0123] For example, when tracking a target vehicle using a single camera, the target vehicle may be lost. Therefore, a re-identification model can be introduced to re-track the target vehicle during single-camera tracking. In other words, the vehicle identified after being lost is re-associated with the target vehicle before it was lost, thus achieving continuous tracking of the target vehicle.

[0124] For example, after losing track of the target vehicle, each vehicle captured by the first camera is assigned a vehicle identifier. After the re-identification model re-identifies the images containing vehicles, it determines that the vehicle identified by the first vehicle identifier is the target vehicle. Then, the first vehicle identifier is associated with the target vehicle's vehicle identifier before it was lost. For example, the association could be updating the first vehicle identifier to the target vehicle's vehicle identifier. This achieves continuous tracking of the target vehicle. It can be understood that multi-target tracking algorithms are simpler to execute and consume fewer resources than re-identification model algorithms, but their performance is slightly inferior. Therefore, during normal tracking of the target vehicle using a single camera, a multi-target tracking algorithm is used; after losing track of the target vehicle, a re-identification model is used for tracking. This combination of two tracking methods ensures both the accuracy and continuity of tracking while significantly reducing resource consumption and execution complexity.

[0125] This application provides an exemplary flow of the system inference logic in a vehicle tracking method. Vehicle detection is performed using six body cameras to detect surrounding vehicles. The driver selects the vehicle to track manually within the vehicle detection bounding box. A multi-target tracking algorithm continuously tracks the driver-selected vehicle. A single camera is used to track the selected vehicle. When the vehicle moves out of the current camera's range, the next camera is used for subsequent tracking according to camera switching logic. A vehicle re-identification model is used to re-identify the vehicle's identifier and continue tracking. If the selected vehicle is briefly lost, the re-identification model re-identifies the vehicle's identifier and continues tracking.

[0126] With the above Figure 1 Corresponding to the vehicle tracking method embodiment shown, this application also provides a vehicle tracking device embodiment. Figure 4 This is a schematic diagram of the structure of a vehicle tracking device provided in an embodiment of this application. Figure 4 As shown, the vehicle tracking device includes: The first determining module 410 is configured to determine the target vehicle to be tracked and the first camera of the currently tracked target vehicle.

[0127] The second determining module 420 is configured to determine the departure direction of the target vehicle based on the first position of the target vehicle and the direction of movement of the target vehicle when the target vehicle leaves the first tracking range of the first camera, wherein the first position is the position of the target vehicle before leaving the first tracking range.

[0128] The third determination module 430 is configured to determine the second camera of the target vehicle to be tracked based on the departure direction.

[0129] In some embodiments, the second determining module 420 is further configured to determine the boundary direction of the first position relative to the first tracking range based on the first position of the target vehicle; and to determine the departure direction of the target vehicle based on the boundary direction and the movement direction of the target vehicle.

[0130] In some embodiments, the second determining module 420 is further configured to determine the target boundary region where the first position is located based on the first position of the target vehicle; and to determine the boundary direction of the first position relative to the first tracking range based on the target boundary region.

[0131] In some embodiments, the first position includes an abscissa and a ordinate, the direction of the abscissa corresponding to a first boundary region and a second boundary region, and the direction of the ordinate corresponding to a third boundary region and a fourth boundary region; determining the target boundary region where the first position is located based on the first position of the target vehicle includes: determining the target boundary region where the first position is located from the first boundary region and the second boundary region based on the abscissa of the first position of the target vehicle; and / or, determining the target boundary region where the first position is located from the third boundary region and the fourth boundary region based on the ordinate of the first position of the target vehicle.

[0132] In some embodiments, the vehicle tracking device further includes a fourth determining module configured to determine multiple second positions of the target vehicle in multiple frames of images; determine a velocity vector of the target vehicle's motion based on the multiple second positions; and determine the direction of motion of the target vehicle based on the velocity vector.

[0133] In some embodiments, the third determining module 430 is further configured to, based on the departure direction, find a camera corresponding to the departure direction from a preset mapping relationship, and determine the corresponding camera as the second camera for subsequent tracking of the target vehicle, wherein the preset mapping relationship includes the correspondence between the direction of departure from the first tracking range of the first camera and at least one adjacent camera.

[0134] In some embodiments, the vehicle tracking device further includes a tracking module configured to: determine a first image during the tracking of a target vehicle by a first camera, wherein the first image includes an image of the target vehicle; determine a second image during the tracking of a target vehicle by a second camera, wherein the second image includes an image of at least one candidate vehicle; input the first image and the second image into a feature restoration module in a re-identification model to obtain a first image and a second image output by the feature restoration module; input the first image and the second image output by the feature restoration module into a feature extraction module in a re-identification model to obtain feature maps corresponding to the first image and the second image respectively; use the feature maps corresponding to the first image and the second image respectively to determine the image of the target vehicle from the images of at least one candidate vehicle, and track the target vehicle based on the image of the target vehicle included in the second image.

[0135] In some embodiments, the vehicle tracking device further includes a training module configured to acquire a training sample set, wherein the training sample set includes multiple sample images, the sample images including images of sample vehicles; for a first sample image among the multiple sample images, discarding some features in the first sample image to obtain a second sample image; inputting the second sample image into a generator in the feature repair module to obtain a third sample image repaired by the generator; inputting the first sample image and the third sample image into a discriminator in the feature repair module to obtain a discrimination probability value output by the discriminator, wherein the magnitude of the discrimination probability value characterizes the degree of difference between the first sample image and the third sample image, the larger the discrimination probability value, the greater the degree of difference between the first sample image and the third sample image; if the discrimination probability value is greater than a discrimination threshold, returning to the step of discarding some features in the first sample image among the multiple sample images to obtain a second sample image, until the discrimination probability value is less than or equal to the discrimination threshold, then stopping the iteration.

[0136] In some embodiments, the discriminator includes a global discriminator and a local discriminator; the sample images include a global image of the sample vehicle; the training module is further configured to input a first sample image and a third sample image into the global discriminator to obtain a global discrimination result, wherein the global discrimination result characterizes the overall difference between the first sample image and the third sample image; extract a first local image of the sample vehicle from the first sample image, and extract a second local image of the sample vehicle from the third sample image; input the first local image and the second local image into the local discriminator to obtain a local discrimination result, wherein the local discrimination result characterizes the difference between the first local image and the second local image, and the difference reflects the local difference between the first sample image and the third sample image in the image regions corresponding to the repaired partial features; and determine a discrimination probability value based on the global discrimination result and the local discrimination result.

[0137] In this application, when the target vehicle leaves the first tracking range of the first camera, the first camera can no longer track the target vehicle. Based on the target vehicle's first position before leaving the first tracking range and the target vehicle's direction of movement, the departure direction of the target vehicle before leaving the first tracking range can be determined, so that a second camera that can subsequently track the target vehicle can be determined based on the departure direction. That is, through the coordinated tracking and detection between multiple cameras, the loss of the target vehicle is avoided, ensuring the continuity and stability of tracking.

[0138] The above is an illustrative scheme of a vehicle tracking device according to this embodiment. It should be noted that the technical solution of this vehicle tracking device is similar to that described above. Figure 1 The technical solutions for the vehicle tracking methods shown belong to the same concept. Details not described in the technical solutions for the vehicle tracking devices can be found in the above descriptions. Figure 1 Description of the technical solution of the vehicle tracking method shown.

[0139] Figure 5 This is a schematic structural diagram of a vehicle provided in an embodiment of this application. Figure 5 The dashed lines in the diagram indicate that the unit or module is optional. The vehicle 500 can be used to implement the methods described in the above method embodiments.

[0140] Vehicle 500 may include one or more processors 510. The processor 510 can support vehicle 500 in implementing the methods described in the preceding method embodiments. The processor 510 can be a general-purpose processor or a special-purpose processor. For example, the processor can be a central processing unit (CPU). Alternatively, the processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0141] The vehicle 500 may also include one or more memories 520. The memories 520 store a computer program that can be executed by the processor 510, causing the processor 510 to perform the methods described in the preceding method embodiments. The memories 520 may be independent of the processor 510 or integrated within the processor 510.

[0142] The vehicle 500 may also include a transceiver 530, through which the processor 510 can communicate with other devices. For example, the processor 510 can send and receive data with other devices through the transceiver 530.

[0143] In one embodiment of this application, the aforementioned components of vehicle 500 and Figure 5 Other components not shown can also be connected to each other. It should be understood that... Figure 5 The vehicle structure diagram shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.

[0144] The above is an illustrative scheme of a vehicle according to this embodiment. It should be noted that the technical solution of this vehicle and the technical solution of the vehicle tracking method described above belong to the same concept. For details not described in detail in the technical solution of the vehicle, please refer to the description of the technical solution of the vehicle tracking method described above.

[0145] In addition, this application also proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, it implements the operations in the vehicle tracking method provided in the above embodiments. The specific steps will not be described in detail here.

[0146] This application also provides a computer program product. The computer program product includes a program / instructions. When executed by a processor, the computer program / instructions implement the steps of the vehicle tracking method described above.

[0147] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity / operation / object from another, and do not necessarily require or imply any such actual relationship or order between these entities / operations / objects; the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0148] For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and relevant details can be found in the description of the method embodiments. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate. Some or all of the modules can be selected according to actual needs to achieve the purpose of this application. Those skilled in the art can understand and implement this without creative effort.

[0149] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0150] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods in the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, television, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0151] The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A vehicle tracking method, characterized in that, The method includes: Identify the target vehicle to be tracked and the first camera currently tracking the target vehicle; When the target vehicle leaves the first tracking range of the first camera, the departure direction of the target vehicle is determined based on the first position of the target vehicle and the direction of movement of the target vehicle, wherein the first position is the position of the target vehicle before leaving the first tracking range; Based on the direction of departure, a second camera is determined to subsequently track the target vehicle.

2. The method according to claim 1, characterized in that, Determining the departure direction of the target vehicle based on its first position and direction of motion includes: Based on the first position of the target vehicle, determine the boundary direction of the first position relative to the first tracking range; The departure direction of the target vehicle is determined based on the boundary direction and the movement direction of the target vehicle.

3. The method according to claim 2, characterized in that, Determining the direction of the first position relative to the boundary of the first tracking range based on the first position of the target vehicle includes: Based on the first position of the target vehicle, determine the target boundary area where the first position is located; Based on the target boundary region, the boundary direction of the first position relative to the first tracking range is determined.

4. The method according to claim 3, characterized in that, The first position includes an abscissa and a ordinate, the direction of the abscissa corresponds to a first boundary region and a second boundary region, and the direction of the ordinate corresponds to a third boundary region and a fourth boundary region; Determining the target boundary region where the first position is located based on the first position of the target vehicle includes: Based on the abscissa of the first position of the target vehicle, the target boundary region where the first position is located is determined from the first boundary region and the second boundary region; And / or, Based on the ordinate of the first position of the target vehicle, the target boundary region where the first position is located is determined from the third boundary region and the fourth boundary region.

5. The method according to any one of claims 1-4, characterized in that, Following the determination of the target vehicle to be tracked and the first camera used to track the target vehicle, the method further includes: Determine multiple second positions of the target vehicle in multiple frames of images; Based on the multiple second positions, the velocity vector of the target vehicle is determined; The direction of motion of the target vehicle is determined based on the velocity vector.

6. The method according to claim 1, characterized in that, The step of determining the second camera for subsequent tracking of the target vehicle based on the departure direction includes: Based on the departure direction, a camera corresponding to the departure direction is found from a preset mapping relationship, and the corresponding camera is determined as the second camera for subsequent tracking of the target vehicle. The preset mapping relationship includes the correspondence between the direction of departure from the first tracking range of the first camera and at least one adjacent camera.

7. The method according to claim 1, characterized in that, After determining the second camera for subsequently tracking the target vehicle based on the departure direction, the method further includes: Determine a first image during the process of the first camera tracking the target vehicle, wherein the first image includes an image of the target vehicle; Determine a second image during the process of the second camera tracking the target vehicle, wherein the second image includes an image of at least one candidate vehicle; The first image and the second image are input into the feature restoration module in the re-identification model to obtain the first image and the second image output by the feature restoration module; The first image and the second image output by the feature repair module are input into the feature extraction module in the re-identification model to obtain the feature maps corresponding to the first image and the second image respectively; Using the feature maps corresponding to the first image and the second image respectively, the image of the target vehicle is determined from the images of at least one candidate vehicle, and the target vehicle is tracked based on the image of the target vehicle included in the second image.

8. The method according to claim 7, characterized in that, The feature repair module is trained using the following method: Obtain a training sample set, wherein the training sample set includes multiple sample images, and the sample images include images of sample vehicles; For a first sample image among multiple sample images, discard some features of the first sample image to obtain a second sample image; The second sample image is input into the generator in the feature repair module to obtain the third sample image repaired by the generator. The first sample image and the third sample image are input into the discriminator in the feature repair module to obtain the discrimination probability value output by the discriminator. The magnitude of the discrimination probability value represents the degree of difference between the first sample image and the third sample image. The larger the discrimination probability value, the greater the degree of difference between the first sample image and the third sample image. If the discrimination probability value is greater than the discrimination threshold, return to the step of discarding some features in the first sample image among multiple sample images to obtain the second sample image, until the discrimination probability value is less than or equal to the discrimination threshold, then stop the iteration.

9. The method according to claim 8, characterized in that, The discriminator includes a global discriminator and a local discriminator; the sample image includes a global image of the sample vehicle; The step of inputting the first sample image and the third sample image into the discriminator in the feature repair module to obtain the discrimination probability value output by the discriminator includes: The first sample image and the third sample image are input into the global discriminator to obtain a global discrimination result, wherein the global discrimination result characterizes the overall difference between the first sample image and the third sample image; Extract a first partial image of the sample vehicle from the first sample image, and extract a second partial image of the sample vehicle from the third sample image; The first local image and the second local image are input into the local discriminator to obtain a local discrimination result, wherein the local discrimination result characterizes the difference between the first local image and the second local image, and the difference reflects the local difference between the first sample image and the third sample image in the image region corresponding to the repaired partial features; Based on the global discrimination result and the local discrimination result, the discrimination probability value is determined.

10. A vehicle tracking device, characterized in that, The device includes: The first determining module is configured to determine the target vehicle to be tracked and the first camera currently tracking the target vehicle; The second determining module is configured to, when the target vehicle leaves the first tracking range of the first camera, determine the departure direction of the target vehicle based on the first position of the target vehicle and the direction of movement of the target vehicle, wherein the first position is the position of the target vehicle before leaving the first tracking range; The third determining module is configured to determine the second camera that will subsequently track the target vehicle based on the departure direction.

11. A vehicle, characterized in that, The vehicle includes a memory and a processor, the memory being used to store program code, and the processor being used to invoke the program code in the memory to cause the vehicle to perform the method as described in any one of claims 1-9.