A vehicle re-identification method, device and equipment

By obtaining the target region of interest in vehicle re-identification and combining it with vehicle feature and sub-attribute recognition models, the problem of low accuracy in vehicle re-identification is solved. This enables the recognition of local vehicle features and vehicle retrieval in user-specified regions, thereby improving recognition accuracy.

CN116012790BActive Publication Date: 2025-12-19NEUSOFT CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310073683.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-03
Publication Date
2025-12-19
Estimated Expiration
2043-02-03

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of vehicle re-identification is low, especially when using global vehicle coding, it is difficult to identify differences in detailed vehicle features, and it is impossible to achieve vehicle identification based on user-specified areas of interest.

Method used

By acquiring the target region of interest in the image of the vehicle to be identified, the vehicle feature extraction model is used to extract global and local features. Combined with the vehicle sub-attribute recognition model, the region of interest in the candidate vehicle image is determined, and image feature matching is performed to improve the recognition accuracy.

Benefits of technology

It improves the accuracy of vehicle re-identification, can identify local detailed features of vehicles, and supports vehicle retrieval based on user-specified areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116012790B_ABST
    Figure CN116012790B_ABST
Patent Text Reader

Abstract

The application discloses a vehicle re-identification method, device and equipment to improve the accuracy of vehicle re-identification. The method comprises the following steps: firstly, obtaining a to-be-identified vehicle image and a target attention region in the to-be-identified vehicle image, finding a candidate vehicle image matched with the target vehicle feature of the to-be-identified vehicle image, and completing the preliminary screening of the vehicle image. And identifying the vehicle sub-attribute region of the to-be-identified image and the candidate vehicle image. According to the target attention region of the to-be-identified image, the vehicle sub-attribute region of the to-be-identified image and the candidate vehicle image, the attention region in each candidate vehicle image can be determined. Then, by performing feature matching on the image features of the target attention region of the to-be-identified vehicle image and the attention regions of each candidate vehicle image, the candidate vehicle image matched with the to-be-identified vehicle image can be determined, and the vehicle re-identification result of the to-be-identified vehicle image is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of re-identification, in particular to a vehicle re-identification method, device and equipment. BACKGROUND

[0002] Vehicle re-identification (Vehicle re-identification) refers to a technology for finding a specified vehicle in images captured by different cameras. The technology has a strong application scenario in an intelligent video monitoring system and can track the trajectory of a specified vehicle to find the location of the specified vehicle.

[0003] Conventional vehicle re-identification mainly uses global coding of a vehicle as a matching basis. However, the accuracy of vehicle re-identification using global coding of a vehicle is low. SUMMARY

[0004] Therefore, the embodiments of the present application provide a vehicle re-identification method, device and equipment to improve the accuracy of vehicle re-identification.

[0005] To solve the above problems, the technical solutions provided by the embodiments of the present application are as follows:

[0006] A vehicle re-identification method, the method comprising:

[0007] obtaining a to-be-identified vehicle image and a target attention region in the to-be-identified vehicle image;

[0008] performing feature matching on a target vehicle feature of the to-be-identified vehicle image and vehicle features in a vehicle feature library, and determining a vehicle image corresponding to a vehicle feature meeting a first matching condition as a candidate vehicle image;

[0009] identifying a target vehicle sub-attribute region of the to-be-identified vehicle image and a vehicle sub-attribute region of the candidate vehicle image by using a vehicle sub-attribute recognition model;

[0010] determining an attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region and the vehicle sub-attribute region of the candidate vehicle image;

[0011] performing feature matching on a target image feature of the target attention region and an image feature of the attention region of the candidate vehicle image, and determining a candidate vehicle image corresponding to an image feature meeting a second matching condition as a vehicle re-identification result of the to-be-identified vehicle image.

[0012] In a possible implementation manner, the process of obtaining the target vehicle feature of the to-be-identified vehicle image comprises:

[0013] input the vehicle image to be identified into a vehicle feature extraction model, the vehicle feature extraction model being configured to extract a global feature of the vehicle image to be identified and a local feature of the vehicle image to be identified, and splice the global feature of the vehicle image to be identified and the local feature of the vehicle image to be identified to generate a target vehicle feature of the vehicle image to be identified;

[0014] acquire the target vehicle feature of the vehicle image to be identified from the vehicle feature extraction model.

[0015] In a possible implementation, the determining of the attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region, and the vehicle sub-attribute region of the candidate vehicle image comprises:

[0016] determining a relative position relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region;

[0017] determining the attention region of the candidate vehicle image according to the vehicle sub-attribute region of the candidate vehicle image and the relative position relationship.

[0018] In a possible implementation, the determining of the relative position relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region comprises:

[0019] when the coincidence degree of the target attention region and a first target vehicle sub-attribute region reaches a target threshold, determining the relative position relationship between the target attention region and the first target vehicle sub-attribute region;

[0020] the determining of the attention region of the candidate vehicle image according to the vehicle sub-attribute region of the candidate vehicle image and the relative position relationship comprises:

[0021] determining the attention region of the candidate vehicle image according to a first vehicle sub-attribute region of the candidate vehicle image and the relative position relationship between the target attention region and the first target vehicle sub-attribute region; the category of the first vehicle sub-attribute corresponds to the category of the first target vehicle sub-attribute.

[0022] In a possible implementation, the determining of the relative position relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region comprises:

[0023] determine a relative position relationship between the target attention region and two second target vehicle sub-attribute regions when the overlap degree of the target attention region and each target vehicle sub-attribute region does not reach a target threshold;

[0024] The determining of the attention region of the candidate vehicle image according to the vehicle sub-attribute region of the candidate vehicle image and the relative position relationship comprises:

[0025] determining the attention region of the candidate vehicle image according to two second vehicle sub-attribute regions of the candidate vehicle image and the relative position relationship between the target attention region and two second target vehicle sub-attribute regions; the category of the second vehicle sub-attribute corresponds to the category of the second target vehicle sub-attribute.

[0026] In a possible implementation, the determining of the relative position relationship between the target attention region and two second target vehicle sub-attribute regions when the overlap degree of the target attention region and each target vehicle sub-attribute region does not reach a target threshold comprises:

[0027] determining minimum circumscribed rectangles of two second target vehicle sub-attribute regions closest to the target attention region when the overlap degree of the target attention region and each target vehicle sub-attribute region does not reach a target threshold;

[0028] determining a relative position relationship between the target attention region and the minimum circumscribed rectangles.

[0029] In a possible implementation, the method further comprises:

[0030] obtaining a vehicle image and a vehicle feature of the vehicle image;

[0031] adding the vehicle image and the vehicle feature of the vehicle image to a vehicle feature library.

[0032] A vehicle re-identification device, the device comprises:

[0033] a first obtaining unit configured to obtain a to-be-identified vehicle image and a target attention region in the to-be-identified vehicle image;

[0034] a first determining unit configured to perform feature matching on a target vehicle feature of the to-be-identified vehicle image and a vehicle feature in a vehicle feature library, and determine a vehicle image corresponding to a vehicle feature meeting a first matching condition as a candidate vehicle image;

[0035] a recognition unit configured to recognize a target vehicle sub-attribute region of the to-be-identified vehicle image and a vehicle sub-attribute region of the candidate vehicle image by using a vehicle sub-attribute recognition model;

[0036] A second determining unit is configured to determine a target attention region of the target vehicle image according to the target attention region, the target vehicle sub-attribute region, and the vehicle sub-attribute region of the candidate vehicle image.

[0037] A third determining unit is configured to perform feature matching on the target image feature of the target attention region and the image feature of the attention region of the candidate vehicle image, and determine the candidate vehicle image corresponding to the image feature pair meeting the second matching condition as the vehicle re-identification result of the target vehicle image.

[0038] A vehicle re-identification device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the vehicle re-identification method as described above when executing the computer program.

[0039] A computer readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device performs the vehicle re-identification method as described above.

[0040] Therefore, the embodiments of the present application have the following beneficial effects:

[0041] The embodiments of the present application first acquire a target vehicle image and a target attention region in the target vehicle image, find a candidate vehicle image matching the target vehicle feature of the target vehicle image, and complete preliminary screening of the vehicle image. The vehicle sub-attribute region of the target vehicle image and the candidate vehicle image is identified. According to the target attention region of the target vehicle image, the target vehicle image, and the vehicle sub-attribute region of the candidate vehicle image, the attention region in each candidate vehicle image can be determined. Then, by performing feature matching on the target attention region of the target vehicle image and the image feature of the attention region of each candidate vehicle image, the candidate vehicle image matching the target vehicle image can be determined, and the vehicle re-identification result of the target vehicle image is obtained. When performing vehicle re-identification, the embodiments of the present application not only focus on the overall feature of the vehicle, but also determine the local attention region of the vehicle based on the vehicle sub-attribute region, and perform vehicle retrieval according to the attention region, so that the vehicle re-identification result is more accurate. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 A schematic diagram of an exemplary application scenario provided by the embodiments of the present application;

[0043] Figure 2 A flowchart of a vehicle re-identification method provided by the embodiments of the present application;

[0044] Figure 3 A schematic diagram of a vehicle feature extraction model provided by the embodiments of the present application;

[0045] Figure 4 FIG. 1 is a schematic diagram of a vehicle sub-attribute region in an embodiment of the present application;

[0046] Figure 5 FIG. 2 is a schematic diagram of a vehicle re-identification device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the above objectives, characteristics and advantages of the present application more apparent, comprehensible and easy to understand, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0048] In order to facilitate understanding and explaining the technical solutions provided in the embodiments of the present application, the background art of the embodiments of the present application will be described first.

[0049] Vehicle re-identification can search for a specified vehicle in images captured by different cameras. Conventional vehicle re-identification mainly uses global coding of a vehicle as a matching basis, that is, generally only the overall image features of a vehicle image are extracted as global coding for vehicle re-identification, but the detailed features on the vehicle are not recognized. For example, two vehicles have the same vehicle model and the same color, but only have different parts on the front windshield. It is difficult to identify the difference in the part using global coding, which limits the accuracy of vehicle re-identification. In addition, in actual applications, a user will specify a region of interest, and it is necessary to identify vehicles with the same region of interest. For example, it is known that the vehicle light of a specified vehicle is damaged, and it is necessary to focus on searching for vehicles with damaged vehicle light regions. However, in the prior art, this requirement cannot be met.

[0050] Based on this, the embodiments of the present application provide a vehicle re-identification method, device and equipment. When performing vehicle re-identification, first, the image features of a vehicle image are used as vehicle features to complete the preliminary screening of the vehicle image. Then, the attention region of the vehicle is determined based on the vehicle sub-attribute region, and vehicle retrieval is performed again according to the attention region, so that the vehicle re-identification result is more accurate. At the same time, vehicle re-identification based on the attention region specified by the user can also be realized.

[0051] In order to facilitate understanding the vehicle re-identification method provided in the embodiments of the present application, the embodiments of the present application will be described below with reference to the scene examples shown in FIGS. 3 to 5. Figure 1 Figure 1 FIG. 3 is a schematic diagram of an example application scene provided in an embodiment of the present application.

[0052] ​Firstly, a to-be-identified vehicle image is acquired, and the to-be-identified vehicle image includes a specified vehicle to be identified. A user can specify a target attention region in the to-be-identified vehicle image, for example, the target attention region is a vehicle lamp region. An image feature of the to-be-identified vehicle image is acquired as a target vehicle feature, and a vehicle feature library stores vehicle images and vehicle features of the vehicle images. Similarly, the vehicle features of the vehicle images are image features of the vehicle images. By comparing the target vehicle feature of the to-be-identified vehicle image with the vehicle features of the vehicle images, candidate vehicle images can be preliminarily screened out. A target vehicle sub-attribute region of the to-be-identified vehicle image and vehicle sub-attribute regions of the candidate vehicle images are identified, and the vehicle sub-attribute regions include different local regions of a vehicle, for example, a vehicle head, a vehicle tail, a license plate, a vehicle window, and the like. According to the target attention region of the to-be-identified vehicle image, the target vehicle sub-attribute region of the to-be-identified vehicle image, and the vehicle sub-attribute regions of the candidate vehicle images, attention regions in the candidate vehicle images can be determined. Then, by performing feature matching between the target attention region of the to-be-identified vehicle image and image features of the attention regions of the candidate vehicle images, a candidate vehicle image that matches the to-be-identified vehicle image can be determined, and a vehicle re-identification result of the to-be-identified vehicle image is obtained.

[0053] Those skilled in the art can understand that Figure 1 The framework diagram shown is only one example in which embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.

[0054] In order to facilitate understanding of the present application, a vehicle re-identification method provided by an embodiment of the present application is described below with reference to the accompanying drawings.

[0055] Referring to Figure 2 As shown in the figure, a flowchart of a vehicle re-identification method provided by an embodiment of the present application is shown, and as Figure 2 As shown in the figure, the method can include S201-S205:

[0056] S201: Acquire a to-be-identified vehicle image and a target attention region in the to-be-identified vehicle image.

[0057] Embodiments of the present application can be applied to a terminal or a server for vehicle re-identification. First, an input to-be-identified vehicle image is acquired, and the to-be-identified vehicle image includes a specified vehicle to be identified. The to-be-identified vehicle image is generally a close-up image of a vehicle, that is, an image including only one specified vehicle, which can be obtained by cutting from an image captured by a road monitoring device. At the same time, a user can specify any local region of a vehicle as a target attention region according to actual needs, for example, a vehicle lamp region. Thus, the position of the target attention region in the to-be-identified vehicle image can also be acquired.

[0058] S202: Perform feature matching between the target vehicle features of the vehicle image to be identified and the vehicle features in the vehicle feature library, and determine the vehicle image corresponding to the vehicle features that meet the first matching condition as the candidate vehicle image.

[0059] This application embodiment can extract image features from an image of a vehicle to be identified, obtaining target vehicle features of the image. Target vehicle features can characterize the basic information of the image, enabling comparison between images. Target vehicle features may include global features of the image of the vehicle to be identified, and / or may also include local features of the image of the vehicle to be identified.

[0060] In one possible implementation, the process of acquiring the target vehicle features of the vehicle image to be identified may include:

[0061] The vehicle image to be identified is input into the vehicle feature extraction model, which extracts the global features and local features of the vehicle image to be identified. The global features and local features of the vehicle image to be identified are then concatenated to generate the target vehicle features of the vehicle image to be identified. The target vehicle features of the vehicle image to be identified are then obtained from the vehicle feature extraction model.

[0062] In this embodiment, a vehicle feature extraction model can be pre-established, which can extract both global and local features of the image. See also Figure 3 The diagram illustrates a vehicle feature extraction model. This model may include a CNN (Convolutional Neural Network), which extracts image features from the input image to generate a feature map. Then, a global feature extraction branch and a local feature extraction branch are connected in parallel. The global feature extraction branch includes a global feature extraction network that extracts global features from the generated image. The local feature extraction branch includes a local feature extraction network that extracts local features from the generated image. Both the global and local feature extraction branches are finally joined with 1x1 convolutional layers. These convolutional layers can perform feature dimensionality reduction, for example, reducing the feature dimension to 256. Finally, the global and local features are concatenated to generate a fused feature, for example, a 512-dimensional fused feature. The vehicle feature extraction model is designed to achieve high recognition accuracy.

[0063] The vehicle feature extraction model can be trained using an open source dataset and a self-built dataset, so that the trained vehicle feature extraction model is more suitable for the vehicle re-identification scene. In addition, in the process of training the vehicle feature extraction model, a random erasing data enhancement method is adopted, that is, the training images used in the training process are locally randomly occluded, which can simulate the situation of local occlusion of vehicle images, so that the trained vehicle feature extraction model is closer to the actual application scene.

[0064] After obtaining the target vehicle feature of the vehicle image to be identified, the target vehicle feature can be compared with the vehicle features in the vehicle feature library. The vehicle feature library stores vehicle images and vehicle features of the vehicle images. The vehicle in the vehicle image is associated with the specified vehicle to be identified, for example, it is a vehicle driving on the same road as the specified vehicle. The vehicle image is generally a close-up image of a vehicle, that is, an image including only one vehicle, which can be obtained by cutting from an image captured by a road monitoring device. The vehicle feature of the vehicle image can include the global feature of the vehicle image, and can also include the local feature of the vehicle image.

[0065] Specifically, the target vehicle feature of the vehicle image to be identified can be compared with each vehicle feature in the vehicle feature library to determine vehicle features that meet a first matching condition, and the vehicle images corresponding to these vehicle features are determined as candidate vehicle images. The first matching condition can be greater than a matching degree threshold.

[0066] In actual application, the feature matching can be performed by calculating a first similarity between the target vehicle feature and each vehicle feature in the vehicle feature library. When the first similarity is used for feature matching, the first matching condition can be greater than a similarity threshold. The similarity threshold can be a fixed value, for example, the similarity threshold is 90%, or the similarity threshold can be a dynamic value, for example, the first similarities are sorted in descending order, and the first similarity value corresponding to the 100th position is taken as the similarity threshold.

[0067] The first matching condition is not limited in the embodiments of the present application, and can be set according to actual conditions. Then, vehicle features with high matching degrees with the target vehicle feature can be found from the vehicle features in the vehicle feature library, the vehicle images corresponding to these vehicle features are determined as candidate vehicle images, and preliminary screening of the vehicle images is completed.

[0068] In some possible implementation manners, the vehicle feature library can be established in advance. Then, the embodiments of the present application can further include:

[0069] Obtaining a vehicle image and a vehicle feature of the vehicle image; and adding the vehicle image and the vehicle feature of the vehicle image to the vehicle feature library.

[0070] In the embodiment of the present application, the vehicle image can be input into the vehicle feature extraction model pre-established in the above embodiment. The vehicle feature extraction model is also used to extract the global feature of the vehicle image and the local feature of the vehicle image, and the global feature of the vehicle image and the local feature of the vehicle image are spliced to generate the vehicle feature of the vehicle image. The vehicle feature of the vehicle image is obtained from the vehicle feature extraction model. Finally, each vehicle image and the vehicle feature corresponding to each vehicle image are added to the vehicle feature library, thereby generating the vehicle feature library.

[0071] S203: identifying the target vehicle sub-attribute region of the to-be-identified vehicle image and the vehicle sub-attribute region of the candidate vehicle image by using the vehicle sub-attribute recognition model.

[0072] Since the user has specified the target attention region in the to-be-identified vehicle image, in order to more accurately perform vehicle re-identification, it is also necessary to locate the attention region in the candidate vehicle image, and the target attention region corresponds to the attention region in the candidate vehicle image. Since the user specifies an arbitrary local region of the vehicle as the target attention region, in order to be able to locate the attention region in the candidate vehicle image, the attention region can be located based on the vehicle sub-attribute region. The vehicle sub-attribute region includes a plurality of local regions known of the vehicle. In actual application, the categories of the vehicle sub-attribute can include 29 categories of vehicle sub-attributes, such as vehicle head, vehicle tail, license plate, vehicle window, vehicle lamp, vehicle logo, exemption mark, main and auxiliary drivers, sun visor, pendant, perfume box, paper towel box, vehicle sticker, doll, sunroof standing person, roof luggage rack, vehicle antenna, roof luggage, vehicle event data recorder, vehicle window parabolic, dangerous goods sign lamp, dangerous goods sign plate, sunroof, rearview mirror, umbrella, taxi light plate, pillow, spare tire, enlarged license plate, etc.

[0073] In the embodiment of the present application, the vehicle sub-attribute recognition model for identifying the vehicle sub-attribute region can be pre-established. The vehicle sub-attribute recognition model can include a plurality of target detection sub-models, and each target detection sub-model is used to identify at least one vehicle sub-attribute. Then, by using the vehicle sub-attribute recognition model, the region of each vehicle sub-attribute that can be identified in the to-be-identified vehicle image and the region of each vehicle sub-attribute that can be identified in the vehicle image can be obtained. Each vehicle sub-attribute region can be identified by the category of the vehicle sub-attribute and the position coordinates of the vehicle sub-attribute in the image. Referring to FIG. 2, a schematic diagram of the vehicle sub-attribute region is shown. Figure 4

[0074] S204: determining the attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region, and the vehicle sub-attribute region of the candidate vehicle image.

[0075] ​The relative positional relationship between the target attention region and the target vehicle sub-attribute region in the to-be-identified vehicle image can be obtained, and then, after the vehicle sub-attribute region of the candidate vehicle image is obtained, the attention region in each candidate vehicle image can also be obtained based on the same relative positional relationship. For example, the target attention region, the vehicle head region position, and the license plate region position in the to-be-identified vehicle image are known, and the relative positions between the target attention region and the vehicle head region position and the license plate region position are fixed. When the vehicle head region position and the license plate region position of the candidate vehicle image are also known, the same attention region in the candidate vehicle image can be located.

[0076] The specific implementation process of S204 of determining the attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region, and the vehicle sub-attribute region of the candidate vehicle image can be referred to in subsequent embodiments, which will not be described here.

[0077] S205: Feature matching is performed on the target image features of the target attention region and the image features of the attention region of the candidate vehicle image, and the candidate vehicle image corresponding to the image feature pair that meets the second matching condition is determined as the vehicle re-identification result of the to-be-identified vehicle image.

[0078] After the attention region of the candidate vehicle image is determined, the target image features of the target attention region and the image features of the attention region of the candidate vehicle image can be extracted. The target image features of the target attention region are compared with the image features of the attention region of the candidate vehicle image.

[0079] In actual applications, the target image features of the target attention region and the image features of the attention region of the candidate vehicle image can be extracted by using the vehicle feature extraction model pre-established in the above embodiments. Specifically, the target attention region is input into the vehicle feature extraction model, and the vehicle feature extraction model is also used to extract the global features of the target attention region and the local features of the target attention region, and the global features of the target attention region and the local features of the target attention region are spliced to generate the target image features of the target attention region; the target image features of the target attention region are obtained from the vehicle feature extraction model. The attention region of the candidate vehicle image is input into the vehicle feature extraction model, and the vehicle feature extraction model is also used to extract the global features of the attention region of the candidate vehicle image and the local features of the attention region of the candidate vehicle image, and the global features of the attention region of the candidate vehicle image and the local features of the attention region of the candidate vehicle image are spliced to generate the image features of the attention region of the candidate vehicle image; the image features of the attention region of the candidate vehicle image are obtained from the vehicle feature extraction model.

[0080] Then, feature matching can be performed on the target image feature of the target attention region and the image features of the attention regions of the candidate vehicle images, image features meeting a second matching condition are determined, and candidate vehicle images corresponding to the image features are determined as the vehicle re-identification result of the to-be-identified vehicle image. The second matching condition can be greater than a matching degree threshold.

[0081] In actual application, feature matching can be performed by calculating a second similarity between the target image feature of the target attention region and the image features of the attention regions of the candidate vehicle images. When feature matching is performed by using the second similarity, the second matching condition can be greater than a similarity threshold. The similarity threshold can be a fixed value, for example, the similarity threshold is 90%. The similarity threshold can also be a dynamic value, for example, the second similarities are sorted in descending order, and a second similarity value corresponding to the 100th position in the sorting is taken as the similarity threshold.

[0082] Embodiments of the present application do not limit the second matching condition, which can be set according to actual conditions. Then, image features with high matching degrees can be found from the image features of the attention regions of the candidate vehicle images, the candidate vehicle images corresponding to the image features are determined as the vehicle re-identification result, and the process of vehicle re-identification is completed.

[0083] Based on the description of S201 to S205, embodiments of the present application first acquire the to-be-identified vehicle image and the target attention region in the to-be-identified vehicle image, find candidate vehicle images matching the target vehicle feature of the to-be-identified vehicle image, and complete preliminary screening of the vehicle image. The vehicle sub-attribute regions of the to-be-identified image and the candidate vehicle image are identified. According to the target attention region of the to-be-identified image, the to-be-identified image, and the vehicle sub-attribute region of the candidate vehicle image, the attention regions in the candidate vehicle images can be determined. Then, feature matching is performed on the target attention region of the to-be-identified vehicle image and the image features of the attention regions of the candidate vehicle images, candidate vehicle images matching the to-be-identified vehicle image can be determined, and the vehicle re-identification result of the to-be-identified vehicle image is obtained. When performing vehicle re-identification, embodiments of the present application not only focus on the overall features of the vehicle, but also determine the attention regions of the local vehicle based on the vehicle sub-attribute region, and perform vehicle retrieval according to the attention region, so that the vehicle re-identification result is more accurate.

[0084] In a possible implementation, the specific implementation of S204 of determining the attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region, and the vehicle sub-attribute region of the candidate vehicle image can include:

[0085] A1: determining a relative position relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region.

[0086] In the to-be-identified vehicle image, the target attention region and the target vehicle sub-attribute region have a relative positional relationship. For example, the target attention region is a vehicle lamp region, and the target vehicle sub-attribute region includes a vehicle head region and a license plate region. In the to-be-identified vehicle image, the vehicle lamp region and the vehicle head region and the license plate region have a relative positional relationship.

[0087] A2: According to the vehicle sub-attribute region of the candidate vehicle image and the relative positional relationship, the attention region of the candidate vehicle image is determined.

[0088] After the vehicle sub-attribute region of the candidate vehicle image is obtained, based on the same relative positional relationship, the attention region in each candidate vehicle image can be obtained. For example, it is known that the vehicle lamp region and the vehicle head region and the license plate region have a relative positional relationship in the to-be-identified vehicle image, and it is also known that the vehicle head region and the license plate region in each candidate vehicle image. The vehicle lamp region in each candidate vehicle image can be located.

[0089] Since the user can arbitrarily specify the target attention region in the to-be-identified vehicle image, two cases will occur. The first case is that the target attention region specified by the user is substantially coincident with any vehicle sub-attribute region, for example, the target attention region specified by the user is a vehicle lamp region, and the vehicle lamp region is a kind of vehicle sub-attribute region. The second case is that the target attention region specified by the user does not belong to the vehicle sub-attribute region, for example, the target attention region specified by the user is a vehicle door region, and the vehicle door region does not belong to any vehicle sub-attribute region.

[0090] For the first case, in a possible implementation, A1 target attention region and target vehicle sub-attribute region, the specific implementation of determining the relative positional relationship between the target attention region and the target vehicle sub-attribute region can include:

[0091] When the coincidence degree of the target attention region and the first target vehicle sub-attribute region reaches the target threshold, the relative positional relationship between the target attention region and the first target vehicle sub-attribute region is determined.

[0092] That is, when the coincidence degree of the target attention region and any target vehicle sub-attribute region reaches the target threshold, the target vehicle sub-attribute region that has a coincidence degree reaching the target threshold with the target attention region is the first target vehicle sub-attribute region. At this time, only the relative positional relationship between the target attention region and the first target vehicle sub-attribute region needs to be determined. The target threshold can be set according to actual conditions.

[0093] A2: According to the vehicle sub-attribute region of the candidate vehicle image and the relative positional relationship, the attention region of the candidate vehicle image is determined. The specific implementation of A2 can include:

[0094] According to the first vehicle sub-attribute region of the candidate vehicle image and the relative position relationship between the target attention region and the first target vehicle sub-attribute region, the attention region of the candidate vehicle image is determined; and the category of the first vehicle sub-attribute corresponds to the category of the first target vehicle sub-attribute.

[0095] Since the target attention region substantially coincides with the first target vehicle sub-attribute region, the attention region in the candidate vehicle image substantially coincides with the corresponding first vehicle sub-attribute region. Thus, according to the first vehicle sub-attribute region of the candidate vehicle image and the above relative position relationship, the attention region in the candidate vehicle image can be determined. The category of the first vehicle sub-attribute corresponds to the category of the first target vehicle sub-attribute, for example, the first target vehicle sub-attribute region in the vehicle image to be recognized is a vehicle lamp region, and the first vehicle sub-attribute region in the candidate vehicle image is also a vehicle lamp region.

[0096] For the second case, in a possible implementation, the specific implementation of A1 for determining the relative position relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region can include:

[0097] When the coincidence degree of the target attention region and each target vehicle sub-attribute region does not reach the target threshold, the relative position relationship between the target attention region and two second target vehicle sub-attribute regions is determined.

[0098] That is, when the target attention region does not coincide with each target vehicle sub-attribute region, since the shooting angles of different vehicle images are different, the relative position relationship between the target attention region and at least two second target vehicle sub-attribute regions needs to be determined to locate the attention region in the candidate vehicle image.

[0099] In a possible implementation, when the coincidence degree of the target attention region and each target vehicle sub-attribute region does not reach the target threshold, the relative position relationship between the target attention region and two second target vehicle sub-attribute regions is determined, including:

[0100] When the coincidence degree of the target attention region and each target vehicle sub-attribute region does not reach the target threshold, the minimum circumscribed rectangle of the two second target vehicle sub-attribute regions closest to the target attention region is determined; and the relative position relationship between the target attention region and the minimum circumscribed rectangle is determined.

[0101] In actual applications, the two target vehicle sub-attribute regions closest to the target attention region can be selected as the second target vehicle sub-attribute regions, the minimum circumscribed rectangle of the two second target vehicle sub-attribute regions is determined, and thus the relative position relationship between the target attention region and the minimum circumscribed rectangle can be obtained.

[0102] The specific implementation of determining the attention region of the candidate vehicle image according to the vehicle sub-attribute region and the relative position relationship of the candidate vehicle image can include the following steps.

[0103] determining the attention region of the candidate vehicle image according to the two second vehicle sub-attribute regions of the candidate vehicle image and the relative position relationship between the target attention region and the two second target vehicle sub-attribute regions.

[0104] Similarly, the category of the second vehicle sub-attribute corresponds to the category of the second target vehicle sub-attribute. For example, the second target vehicle sub-attribute region in the vehicle image to be recognized is the position of the vehicle head region and the position of the vehicle light region, and the second vehicle sub-attribute region in the candidate vehicle image is also the position of the vehicle head region and the position of the vehicle light region.

[0105] According to the two second vehicle sub-attribute regions of the candidate vehicle image and the above relative position relationship, the attention region in the candidate vehicle image can be determined.

[0106] The embodiment of the present application can determine the attention region in the candidate vehicle image based on the vehicle sub-attribute region, and perform vehicle re-identification by using the attention region in the vehicle image to be recognized and the candidate vehicle image, so that more detailed information can be used in the vehicle re-identification process, and the accuracy of vehicle re-identification is improved.

[0107] Based on the vehicle re-identification method provided in the above method embodiment, the embodiment of the present application further provides a vehicle re-identification device, which will be described below in combination with the drawings.

[0108] Referring to FIG. 1, Figure 5 As shown in the figure, the vehicle re-identification device provided by the embodiment of the present application includes: Figure 5 As shown in the figure, the vehicle re-identification device includes:

[0109] The first acquisition unit 501 is configured to acquire a vehicle image to be recognized and a target attention region in the vehicle image to be recognized.

[0110] The first determination unit 502 is configured to perform feature matching on the target vehicle feature of the vehicle image to be recognized and the vehicle features in the vehicle feature library, and determine the vehicle image corresponding to the vehicle feature meeting the first matching condition as a candidate vehicle image.

[0111] The identification unit 503 is configured to identify the target vehicle sub-attribute region of the vehicle image to be recognized and the vehicle sub-attribute region of the candidate vehicle image by using a vehicle sub-attribute identification model.

[0112] The second determination unit 504 is configured to determine a target attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region, and a vehicle sub-attribute region of the candidate vehicle image.

[0113] The third determination unit 505 is configured to perform feature matching on a target image feature of the target attention region and an image feature of the target attention region of the candidate vehicle image, and determine a candidate vehicle image corresponding to an image feature pair that meets a second matching condition as a vehicle re-identification result of the vehicle image to be recognized.

[0114] In a possible implementation, the process of obtaining the target vehicle feature of the vehicle image to be recognized includes:

[0115] inputting the vehicle image to be recognized into a vehicle feature extraction model, the vehicle feature extraction model being configured to extract a global feature of the vehicle image to be recognized and a local feature of the vehicle image to be recognized, and splice the global feature of the vehicle image to be recognized and the local feature of the vehicle image to be recognized to generate the target vehicle feature of the vehicle image to be recognized;

[0116] obtaining the target vehicle feature of the vehicle image to be recognized from the vehicle feature extraction model.

[0117] In a possible implementation, the second determination unit includes:

[0118] The first determination sub-unit is configured to determine a relative position relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region.

[0119] The second determination sub-unit is configured to determine the target attention region of the candidate vehicle image according to the vehicle sub-attribute region of the candidate vehicle image and the relative position relationship.

[0120] In a possible implementation, the first determination sub-unit is specifically configured to:

[0121] determine the relative position relationship between the target attention region and the first target vehicle sub-attribute region when an overlapping degree between the target attention region and the first target vehicle sub-attribute region reaches a target threshold.

[0122] The second determination sub-unit is specifically configured to:

[0123] determine the target attention region of the candidate vehicle image according to the first vehicle sub-attribute region of the candidate vehicle image and the relative position relationship between the target attention region and the first target vehicle sub-attribute region; and a category of the first vehicle sub-attribute corresponds to a category of the first target vehicle sub-attribute.

[0124] In a possible implementation, the first determining sub-unit is specifically configured to:

[0125] determine a relative position relationship between the target attention region and two second target vehicle sub-attribute regions when the coincidence degree of the target attention region and each target vehicle sub-attribute region does not reach the target threshold.

[0126] The second determining sub-unit is specifically configured to:

[0127] determine an attention region of the candidate vehicle image according to the two second vehicle sub-attribute regions of the candidate vehicle image and the relative position relationship between the target attention region and the two second target vehicle sub-attribute regions, wherein the category of the second vehicle sub-attribute corresponds to the category of the second target vehicle sub-attribute.

[0128] In a possible implementation, the first determining sub-unit is specifically configured to:

[0129] determine a minimum circumscribed rectangle of two second target vehicle sub-attribute regions closest to the target attention region when the coincidence degree of the target attention region and each target vehicle sub-attribute region does not reach the target threshold.

[0130] determine a relative position relationship between the target attention region and the minimum circumscribed rectangle.

[0131] In a possible implementation, the apparatus further includes:

[0132] a second obtaining unit, configured to obtain a vehicle image and a vehicle feature of the vehicle image.

[0133] an adding unit, configured to add the vehicle image and the vehicle feature of the vehicle image into a vehicle feature library.

[0134] In addition, an embodiment of the present application further provides a vehicle re-identification device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the vehicle re-identification method according to any one of the above when executing the computer program.

[0135] In addition, an embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores instructions, and the instructions make the terminal device execute the vehicle re-identification method according to any one of the above when running on the terminal device.

[0136] In this way, the embodiment of the present application first acquires a to-be-recognized vehicle image and a target attention region in the to-be-recognized vehicle image, finds a candidate vehicle image matched with the target vehicle feature of the to-be-recognized vehicle image, and completes preliminary screening of the vehicle image. The vehicle sub-attribute region of the to-be-recognized image and the candidate vehicle image is identified. According to the target attention region of the to-be-recognized image, the vehicle sub-attribute region of the to-be-recognized image and the candidate vehicle image, the attention region in each candidate vehicle image can be determined. Then, by performing feature matching on the image features of the target attention region of the to-be-recognized vehicle image and the attention region of each candidate vehicle image, the candidate vehicle image matched with the to-be-recognized vehicle image can be determined, and the vehicle re-identification result of the to-be-recognized vehicle image is obtained. When performing vehicle re-identification, the embodiment of the present application not only focuses on the overall feature of the vehicle, but also determines the attention region of the local vehicle based on the vehicle sub-attribute region, and performs vehicle retrieval according to the attention region, so that the vehicle re-identification result is more accurate.

[0137] It should be noted that the embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system or device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.

[0138] It should be understood that in the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the association between the associated objects, which means that there can be three kinds of relationships, for example, "A and / or B" can represent three cases: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and rear associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0139] It is also to be noted that, as used in the specification and the appended claims, the singular forms "a," "an" and "the" include plural referents unless otherwise indicated. Furthermore, to the extent that the terms "including," "includes," "having," "has," "with," or "contains" are used in either the detailed description and the claims, such terms are intended to be inclusive in a manner similar to the term "comprising" as an open transition term without precluding any additional or other elements.

[0140] The embodiments disclosed herein can each be implemented as a method, apparatus, or article of manufacture using programming instructions. The embodiments disclosed herein can be implemented using software, firmware, hardware, or a combination thereof. The various elements of the disclosed embodiments, as well as the procedural aspects of the disclosed embodiments, can be implemented using a variety of programming instructions, software, firmware, or the like. In one embodiment, the programming instructions are implemented using a high-level procedural or object-oriented programming language to

[0141] The above description of disclosed embodiments is intended to be illustrative and not restrictive. Many embodiments will be apparent to those of skill in the art upon reading and understanding the above description, and it is therefore contemplated to be within the scope of the claims to claim any such embodiments. The scope of the claims should not be limited to the foregoing description, and embodiments can be practiced in other than the exemplary embodiments which are implemented in the direction of the claims.

Claims

1. A vehicle re-identification method, characterized in that, The method comprises: acquiring a to-be-identified vehicle image and a target attention region in the to-be-identified vehicle image; performing feature matching on a target vehicle feature of the to-be-identified vehicle image and a vehicle feature in a vehicle feature library, and determining a vehicle image corresponding to a vehicle feature meeting a first matching condition as a candidate vehicle image; identifying a target vehicle sub-attribute region of the to-be-identified vehicle image and a vehicle sub-attribute region of the candidate vehicle image by using a vehicle sub-attribute identification model; determining an attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region, and the vehicle sub-attribute region of the candidate vehicle image; performing feature matching on a target image feature of the target attention region and an image feature of the attention region of the candidate vehicle image, and determining a candidate vehicle image corresponding to an image feature meeting a second matching condition as a vehicle re-identification result of the to-be-identified vehicle image; The determining of the attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region, and the vehicle sub-attribute region of the candidate vehicle image comprises: determining a relative position relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region; determining the attention region of the candidate vehicle image according to the vehicle sub-attribute region of the candidate vehicle image and the relative position relationship.

2. The method of claim 1, wherein, The acquisition process of the target vehicle feature of the to-be-identified vehicle image comprises: inputting the to-be-identified vehicle image into a vehicle feature extraction model, the vehicle feature extraction model being used for extracting a global feature of the to-be-identified vehicle image and a local feature of the to-be-identified vehicle image, and splicing the global feature of the to-be-identified vehicle image and the local feature of the to-be-identified vehicle image to generate the target vehicle feature of the to-be-identified vehicle image; acquiring the target vehicle feature of the to-be-identified vehicle image from the vehicle feature extraction model.

3. The method of claim 1, wherein The determining of the relative position relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region comprises: when an overlapping degree of the target attention region and a first target vehicle sub-attribute region reaches a target threshold, determining the relative position relationship between the target attention region and the first target vehicle sub-attribute region. The determining of the attention region of the candidate vehicle image according to the vehicle sub-attribute region of the candidate vehicle image and the relative position relationship comprises: determining the attention region of the candidate vehicle image according to a first vehicle sub-attribute region of the candidate vehicle image and the relative position relationship between the target attention region and the first target vehicle sub-attribute region; a category of the first vehicle sub-attribute corresponds to a category of the first target vehicle sub-attribute.

4. The method of claim 1, wherein The determining, according to the target attention region and the target vehicle sub-attribute region, of a relative positional relationship between the target attention region and the target vehicle sub-attribute region comprises: When the degree of overlap of the target attention region with each target vehicle sub-attribute region does not reach a target threshold, determining a relative positional relationship between the target attention region and two second target vehicle sub-attribute regions; The determining, according to the vehicle sub-attribute region of the candidate vehicle image and the relative positional relationship, of the attention region of the candidate vehicle image comprises: According to the two second vehicle sub-attribute regions of the candidate vehicle image and the relative positional relationship between the target attention region and the two second target vehicle sub-attribute regions, determining the attention region of the candidate vehicle image, wherein the category of the second vehicle sub-attribute corresponds to the category of the second target vehicle sub-attribute.

5. The method of claim 4, wherein, The determining, according to the target attention region and the target vehicle sub-attribute region, of a relative positional relationship between the target attention region and the target vehicle sub-attribute region comprises: When the degree of overlap of the target attention region with each target vehicle sub-attribute region does not reach a target threshold, determining a minimum circumscribed rectangle of the two second target vehicle sub-attribute regions closest to the target attention region; Determining a relative positional relationship between the target attention region and the minimum circumscribed rectangle.

6. The method of claim 1, wherein, The method further comprises: Obtaining a vehicle image and a vehicle feature of the vehicle image; Adding the vehicle image and the vehicle feature of the vehicle image to a vehicle feature library.

7. A vehicle re-identification apparatus characterized by comprising: The apparatus comprises: A first obtaining unit, configured to obtain a to-be-identified vehicle image and a target attention region in the to-be-identified vehicle image; A first determining unit, configured to perform feature matching on a target vehicle feature of the to-be-identified vehicle image and vehicle features in a vehicle feature library, and determine a vehicle image corresponding to a vehicle feature meeting a first matching condition as a candidate vehicle image; An identifying unit, configured to identify a target vehicle sub-attribute region of the to-be-identified vehicle image and a vehicle sub-attribute region of the candidate vehicle image by using a vehicle sub-attribute identification model; A second determining unit, configured to determine an attention region of the candidate vehicle image according to the target attention region, the target vehicle sub-attribute region, and the vehicle sub-attribute region of the candidate vehicle image; A third determining unit, configured to perform feature matching on a target image feature of the target attention region and an image feature of the attention region of the candidate vehicle image, and determine a candidate vehicle image corresponding to an image feature meeting a second matching condition as a vehicle re-identification result of the to-be-identified vehicle image; The second determining unit comprises: A first determining sub-unit, configured to determine a relative positional relationship between the target attention region and the target vehicle sub-attribute region according to the target attention region and the target vehicle sub-attribute region; A second determining sub-unit, configured to determine the attention region of the candidate vehicle image according to the vehicle sub-attribute region of the candidate vehicle image and the relative positional relationship. 8.A vehicle re-identification device characterized by comprising: Comprise: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the vehicle re-identification method according to any one of claims 1-6 when executing the computer program.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, and when the instructions run on the terminal device, the terminal device executes the vehicle re-identification method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Vehicle re-identification method and device

    CN110458086A

  • Traffic target-oriented vehicle re-identification method and device

    CN111435421A