Target re-identification method, target re-identification device and computer-readable storage medium
By using position deviation information and appearance similarity evaluation in target re-identification technology, the matching degree of candidate targets is determined, which solves the problem of insufficient appearance similarity discrimination in the existing technology and improves the accuracy of target re-identification.
Patent Information
- Application Number
- CN202110786261.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-12
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-07-12
AI Technical Summary
Existing target re-identification technology has shortcomings in accuracy. Especially in multi-camera device linkage scenarios, insufficient appearance similarity discrimination results in cumbersome recognition and low accuracy.
By obtaining the image to be recognized and the reference image, the mapping position of the preset target in the image to be recognized is determined, and based on the position deviation information and appearance similarity of the candidate target, the matching degree of the candidate target is evaluated, thereby determining the target that matches the preset target. candidate target.
It improves the accuracy of target re-identification, avoids the problem of insufficient discrimination of appearance similarity, enhances the discrimination between candidate targets and preset targets, and reduces the difficulty of recognition.
Smart Images

Figure CN113673321B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a target re-identification method, a target re-identification device, and a computer-readable storage medium. Background Art
[0002] Target re-identification is a computer vision technology that achieves target recognition by matching targets in images or videos across lenses. It can free camera equipment from the limitations of installation position and angle to a certain extent, and is of great significance for realizing the linkage function of multiple camera devices. It has very important application value in the fields of smart retail, intelligent transportation, public security and criminal investigation.
[0003] The inventors of the present application have discovered that, although there are many studies on target re-identification technology at present, the accuracy of target re-identification still needs to be further improved in many studies. Summary of the invention
[0004] In view of this, the present application provides a target re-identification method, a target re-identification device and a computer-readable storage medium, which can improve the accuracy of target re-identification.
[0005] In a first aspect, an embodiment of the present application provides a target re-identification method, the method comprising: acquiring an image to be identified and a reference image; determining a preset target in the reference image, and identifying at least one candidate target in the image to be identified, the candidate target and the preset target being targets of the same type; determining a mapping position of the preset target in the image to be identified; determining position deviation information of each candidate target in the at least one candidate target, the position deviation information being determined based on the position of the corresponding candidate target and the mapping position; and determining a candidate target that matches the preset target from the at least one candidate target based on the position deviation information of each candidate target.
[0006] In a second aspect, an embodiment of the present application provides a target re-identification device, which includes a processor, a memory, and a communication circuit, wherein the processor is coupled to the memory and the communication circuit, respectively, and program data is stored in the memory. The processor implements the steps in the above method by executing the program data in the memory.
[0007] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the above method.
[0008] The beneficial effect is: after determining the preset target in the reference image, the target re-identification method of the present application first determines the mapping position of the preset target in the image to be identified, then determines the position deviation information of each candidate target in the image to be identified, and finally determines the candidate target that matches the preset target from at least one candidate target based on the position deviation information of each candidate target, that is, target re-identification is performed through the position deviation information of each candidate target. Compared with the prior art of performing target re-identification only through the appearance similarity of the candidate targets, the problem of insufficient distinction between candidate targets with similar appearances can be avoided, thereby improving the accuracy of target re-identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0010] Figure 1 It is a flowchart of an implementation method of the target re-identification method of the present application;
[0011] Figure 2 yes Figure 1 A partial flow chart of step S140;
[0012] Figure 3 yes Figure 1 A schematic diagram of a flow chart of the method in the implementation mode for calculating appearance similarity;
[0013] Figure 4 yes Figure 1 Schematic diagram of the process of step S130;
[0014] Figure 5 yes Figure 4 A schematic diagram of the process of step S131 in an application scenario;
[0015] Figure 6 yes Figure 4 A flow chart of step S131 in another application scenario;
[0016] Figure 7 yes Figure 4 Schematic diagram of the process of step S131 in another application scenario;
[0017] Figure 8 yes Figure 4 Schematic diagram of the process of step S131 in another application scenario;
[0018] Fig. 9It is a flowchart of another implementation method of the target re-identification method of the present application;
[0019] Fig.10 It is a structural schematic diagram of an implementation method of a target re-identification device of the present application;
[0020] Fig.11 It is a structural schematic diagram of another embodiment of the target re-identification device of the present application;
[0021] Fig.12 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] See also Figure 1 , Figure 1 : is a flow chart of an implementation method of a target re-identification method of the present application, the method comprising:
[0024] S110: Acquire the image to be recognized and the reference image.
[0025] In one application scenario, step S110 may specifically include: performing frame extraction processing on two channels of video data respectively to obtain an image to be identified and a reference image, wherein the two channels of video data are obtained by two different camera devices respectively shooting the same scene, wherein the shooting angles of the two different camera devices are the same or different; in another application scenario, step S110 may also specifically include: performing frame extraction processing on the same channel of video data to obtain an image to be identified and a reference image, that is, performing frame extraction processing on video data shot by the same camera device to obtain an image to be identified and a reference image, and at this time, the camera device can adjust the shooting angle during the shooting process.
[0026] The reference image and the image to be processed may be images acquired at different angles or images acquired at the same angle at different times.
[0027] In summary, the present application does not limit the method for obtaining the image to be identified and the reference image.
[0028] S120: Determine a preset target in the reference image, and identify at least one candidate target in the image to be identified, wherein the candidate target and the preset target are targets of the same type.
[0029] Among them, the preset target is the object to be re-identified, and the preset target can be a person, a car, an animal, etc. At the same time, the purpose of the target re-identification method is to identify the preset target from the image to be identified.
[0030] Meanwhile, the candidate target and the preset target are targets of the same type. For example, when the preset target is a person, the candidate target is also a person; when the preset target is a car, the candidate target is also a car.
[0031] In an application scenario, step S120 specifically includes: identifying all targets in the image to be identified that are of the same type as the preset target.
[0032] In one application scenario, in order to improve recognition efficiency and accuracy, a target detection model is pre-trained, and the target detection model is used to identify candidate targets in an image to be identified.
[0033] Therein, the preset target in the reference image may be one or more than two. When there are more than two preset targets, the subsequent steps are performed respectively for each preset target.
[0034] S130: Determine a mapping position of a preset target in the image to be recognized.
[0035] Specifically, the mapping position of the preset target in the image to be identified refers to the theoretical position of the preset target in the image to be identified. It can also be understood that, under ideal conditions, the target at the mapping position in the image to be identified is the same target as the preset target in the reference image.
[0036] S140: Determine position deviation information of each candidate target in at least one candidate target, where the position deviation information is determined based on the position and the mapping position of the corresponding candidate target.
[0037] Specifically, the position deviation information indicates the distance between the position of the corresponding candidate target in the image to be identified and the mapping position. It can be understood that the closer the position of the candidate target in the image to be identified and the mapping position, the greater the probability that the candidate target is the preset target.
[0038] S150: Based on the position deviation information of each candidate target, determine a candidate target that matches the preset target from at least one candidate target.
[0039] Specifically, the candidate target that matches the preset target refers to the candidate target that is most likely to be the preset target among at least one candidate target.
[0040] From the above analysis, it can be seen that the closer the position of the candidate target in the image to be identified is to the mapping position, the greater the probability that the candidate target is the preset target. Therefore, based on the position deviation information of each candidate target, the candidate target that is most likely to be the preset target can be determined from at least one candidate target.
[0041] In the prior art, when performing target re-identification, the mainstream approach is to use the candidate target in the image to be identified that is most similar in appearance to the preset target as the preset target. This approach has the problem of insufficient distinction between similar targets, which is particularly common in scenes such as traffic. For example, when there are many vehicles in the image to be identified that are similar to the preset vehicles (i.e., preset targets) in the reference image, the identification process is cumbersome and the accuracy of target re-identification will be reduced.
[0042] The present embodiment performs target re-identification through position deviation information of each candidate target, which can avoid the problem of insufficient distinction between targets with similar appearances during target re-identification in the prior art, thereby improving the accuracy of target re-identification.
[0043] In this embodiment, in order to further increase the degree of distinction between the candidate target and the preset target, before determining the candidate target matching the preset target from at least one candidate target in step S150, the following steps are further included:
[0044] S160: Determine the appearance similarity corresponding to each candidate target, where the appearance similarity is determined based on the similarity between the appearance of the corresponding candidate target and the appearance of the preset target.
[0045] As an embodiment, the appearance of the target (candidate target and preset target) in the embodiment of the present application may include but is not limited to at least one of the target's shape, material, color, size, area, posture, etc. In other words, the appearance similarity corresponding to each candidate target may be determined based on at least one parameter of shape, material, color, size, area, posture, etc.
[0046] Among them, the appearance similarity is the degree of appearance similarity. The higher the appearance similarity, the more similar the appearance of the candidate target is to the appearance of the preset target. It can be understood that the more similar the appearance of the candidate target is to the appearance of the preset target, the greater the probability that the candidate target is the preset target.
[0047] At this time, step S150 determines a candidate target matching the preset target from at least one candidate target based on the determined position deviation information of each candidate target, specifically including:
[0048] Based on the position deviation information of each candidate target and the appearance similarity corresponding to each candidate target, a candidate target matching the preset target is determined from at least one candidate target.
[0049] Specifically, the two parameters of comprehensive position deviation information and appearance similarity can further increase the degree of distinction between candidate targets and preset targets, which can make several candidate targets that are similar in appearance to the preset target ultimately have a degree of distinction different from the preset target, and can also make several candidate targets that are similar in position deviation information ultimately have a degree of distinction different from the preset target, thereby reducing the difficulty of target re-identification and improving the accuracy of target re-identification.
[0050] In an application scenario, step S150 determines a candidate target that matches a preset target from the candidate targets based on the position deviation information of each candidate target and the appearance similarity corresponding to each candidate target, and specifically includes:
[0051] S151: performing the following evaluation operation on each candidate target respectively to determine the evaluation value of each candidate target; the evaluation operation includes: determining the evaluation value of a candidate target based on the position deviation information of a candidate target among the candidate targets and the appearance similarity corresponding to the candidate target.
[0052] S152: Based on the determined sizes of the evaluation values, a candidate target matching the preset target is determined from among the candidate targets.
[0053] Specifically, the candidate target is evaluated based on the position deviation information and appearance similarity corresponding to the candidate target to obtain a corresponding evaluation value.
[0054] In one application scenario, when the position deviation information is the same, the higher the appearance similarity, the larger the evaluation value corresponding to the candidate target. When the appearance similarity is the same, the closer the position of the candidate target in the image to be identified is to the mapping position, the larger the evaluation value corresponding to the candidate target. At this time, the candidate target with the largest corresponding evaluation value can be determined as the candidate target that matches the preset target. Alternatively, in another application scenario, when the position deviation information is the same, the higher the appearance similarity, the smaller the evaluation value corresponding to the candidate target. When the appearance similarity is the same, the closer the position of the candidate target in the image to be identified is to the mapping position, the smaller the evaluation value corresponding to the candidate target. At this time, the candidate target with the smallest corresponding evaluation value can be determined as the candidate target that matches the preset target.
[0055] In an application scenario, the evaluation value corresponding to the candidate target can be calculated using the following formula:
[0056] S i =α×L io +β×Sim io ; Among them, S i represents the evaluation value of candidate target i, L iorepresents the deviation position information corresponding to the candidate target i, α represents the weight of the position deviation information, Sim io represents the appearance similarity corresponding to the candidate target i, and β represents the weight of the appearance similarity.
[0057] From the above, it can be seen that when determining the evaluation value, corresponding weights can be set for the corresponding position deviation information and appearance similarity, wherein different weights can be set for the position deviation information and appearance similarity according to different actual needs. In a specific application scenario, α+β=1, and α and β are both positive numbers.
[0058] In this embodiment, combined with Figure 2 Step S140 of calculating the position deviation information specifically includes:
[0059] S141: Obtaining first areas occupied by first image frames that respectively select at least one candidate target in the image to be identified.
[0060] Specifically, the first image frame selects a preset target in the image to be recognized and is an external frame of the preset target.
[0061] S142: Determine a second image frame of a mapping object formed by selecting a preset target at a mapping position in the image to be recognized, and obtain a second area occupied by the second image frame in the image to be recognized.
[0062] Specifically, the mapping object formed by the preset target at the mapping position is completely identical to the preset target, and similar to the first image frame, the second image frame selects the mapping object in the image to be identified and is an external frame of the mapping object.
[0063] S143: Determine an intersection-and-union ratio between the first area and the second area corresponding to each first image frame, and obtain position deviation information of each candidate target in at least one candidate target.
[0064] Specifically, the intersection-over-combination ratio of the first region and the second region is calculated using the following formula:
[0065] Among them, rect o Represents the first area, rect i Indicates the second area.
[0066] This application scenario uses the intersection-and-union ratio of the first area and the second area to represent the position deviation information between the position of the corresponding candidate target in the image to be identified and the mapping position. The larger the position deviation information, the closer the position of the candidate target in the image to be identified is to the mapping position.
[0067] In this embodiment, combined with Figure 3 Step S160 of calculating the appearance similarity specifically includes:
[0068] S161: Extracting the appearance feature vectors of each candidate target and the appearance feature vectors of the preset target.
[0069] Specifically, feature extraction is performed on the image to be identified and the reference image respectively to obtain the appearance feature vector of each candidate target and the appearance feature vector of the preset target.
[0070] S162: Determine a second distance value between the appearance feature vector of each candidate target and the appearance feature vector of the preset target.
[0071] Specifically, the second distance value dis between the appearance feature vector of each candidate target and the appearance feature vector of the preset target is determined using the following formula: ab :
[0072] Among them, a i Represents the element in the appearance feature vector of the preset target, b i represents an element in the appearance feature vector of the candidate target, and i represents the bit value corresponding to the element in the appearance feature vector of the preset target or the appearance feature vector of the candidate target.
[0073] S163: Determine, according to the second distance value, the appearance similarity corresponding to each candidate object, wherein the appearance similarity corresponding to the candidate object is negatively correlated with the corresponding second distance value.
[0074] Specifically, from the above analysis, it can be seen that the higher the appearance similarity, the more similar the appearance of the candidate target is to the appearance of the preset target. Given that the smaller the second distance value, the more similar the appearance of the corresponding candidate target is to the appearance of the preset target, the appearance similarity corresponding to the candidate target is set to be negatively correlated with the corresponding second distance value, so that the smaller the second distance value, the higher the appearance similarity corresponding to the candidate target.
[0075] In an application scenario, the appearance similarity Sim can be calculated using the following formula: ab :
[0076] Sim ab =1-dis ab , where dis ab The second distance value representing the appearance feature vector of the candidate target and the appearance feature vector of the preset target.
[0077] In this embodiment, combined with Figure 4 Step S130 of determining the mapping position specifically includes:
[0078] S131: Calculate a homography matrix between the reference image and the image to be identified based on background features of the reference image and background features of the image to be identified.
[0079] Specifically, the homography matrix represents the mapping relationship between the reference image and the image to be identified, and represents the conversion relationship between the positions of the same target object in the reference image and the image to be identified.
[0080] S132: Determine a mapping position of the preset target in the image to be recognized according to the homography matrix and the position of the preset target in the reference image.
[0081] Specifically, the mapping position of the preset target in the image to be identified is determined using the following formula:
[0082] Where, N represents the homography matrix between the reference image and the image to be identified, x a The horizontal coordinate of the position of the preset target in the reference image, y a Indicates the vertical coordinate of the position of the preset target in the reference image, x b The horizontal coordinate of the mapping position of the preset target in the image to be identified, y b The vertical coordinate representing the mapping position of the preset target in the image to be identified.
[0083] This embodiment calculates the homography matrix based on the background features of the reference image and the background features of the image to be identified, so that the homography matrix is independent of other information such as the shooting angle and shooting position of the image to be identified and the reference image, thereby making the method of the present application more flexible to apply, for example, it can be applied to a camera device with a gimbal.
[0084] In one application scenario, see Figure 5 Step S131 is a step of calculating a homography matrix, specifically comprising:
[0085] S1301: Identify a plurality of first background feature points distributed around a preset target in a reference image.
[0086] Specifically, first background feature points distributed in a background within a certain area around a preset target in a reference image are identified.
[0087] S1302: Identify a plurality of second background feature points in the image to be identified.
[0088] Specifically, all feature points on the background of the image to be identified are identified to obtain second background feature points.
[0089] S1303: Match the multiple first background feature points with the multiple second background feature points to obtain multiple groups of matching feature point pairs.
[0090] Specifically, a plurality of first background feature points are matched one by one with a plurality of second background feature points, and the matched first background feature points and second background feature points form a group of matching feature point pairs, thereby obtaining a plurality of groups of matching feature point pairs.
[0091] The first background feature point matches the second background feature point, indicating that the first background feature point and the second background feature point may correspond to the same actual position point.
[0092] S1304: Calculate the homography matrix between the reference image and the image to be identified based on the multiple sets of matching feature point pairs.
[0093] Specifically, the homography matrix between the reference image and the image to be identified is calculated based on at least 4 sets of matching feature point pairs, wherein the process of calculating the homography matrix based on the matching feature point pairs can refer to the prior art and will not be repeated here.
[0094] In another application scenario, see Figure 6 Step S131 is a step of calculating a homography matrix, specifically comprising:
[0095] S1305: Identify a plurality of first background feature points distributed around a preset target in a reference image.
[0096] S1306: Identify a plurality of second background feature points in the image to be identified.
[0097] S1307: Screening the plurality of first background feature points to select a plurality of first background feature points that are arranged in front of a preset number of the first sequence and are evenly distributed around the preset target.
[0098] The first sequence is obtained by arranging the plurality of first background feature points in advance from large to small according to the confidence level.
[0099] Specifically, the confidence level is a probability that the first background feature point is a feature point, wherein when the first background feature point is identified, a corresponding confidence level is generated.
[0100] At the same time, when screening, the multiple first background feature points obtained in step S1305 are first sorted in order from large to small according to the confidence level to obtain a first sequence, and then a preset number of first background feature points in front of the first sequence are screened out, and then the screened first background feature points are screened again to screen out the first background feature points that are evenly distributed around the preset target.
[0101] S1308: Match the selected multiple first background feature points with the multiple second background feature points to obtain multiple groups of matching feature point pairs.
[0102] S1309: Calculate the homography matrix between the reference image and the image to be identified based on the multiple sets of matching feature point pairs.
[0103] Specifically, different from the above application scenarios, in order to reduce the amount of calculation, this application scenario will screen the first background feature points before matching them with the second background feature points. On the basis of ensuring a high confidence level, the first background feature points that are evenly distributed around the preset target are screened out. The screened first background feature points are subsequently matched with the second background feature points to calculate the homography matrix.
[0104] In another application scenario, see Figure 7 Step S131 is a step of calculating a homography matrix, specifically comprising:
[0105] S1310: Identify a plurality of first background feature points distributed around a preset target in a reference image.
[0106] S1311: Identify a plurality of second background feature points in the image to be identified.
[0107] S1312: Match the multiple first background feature points with the multiple second background feature points to obtain multiple groups of matching feature point pairs.
[0108] S1313: Screening multiple groups of matching feature point pairs to select multiple groups of matching feature point pairs that are arranged in front of a preset number in the second sequence and correspond to the first background feature points that are evenly distributed around the preset target.
[0109] The matching feature point pairs are pre-sorted from large to small according to the matching degree to obtain a second sequence.
[0110] Specifically, the multiple groups of matching feature point pairs obtained in step S1312 are first sorted in order of matching degree from large to small to obtain a second sequence, and then a preset number of matching feature point pairs arranged in front of the second sequence are filtered out, and then the filtered matching feature point pairs are filtered out again to filter out matching feature point pairs corresponding to the first background feature points that are evenly distributed around the preset target.
[0111] S1314: Calculate the homography matrix between the image to be identified and the reference image based on the selected multiple sets of matching feature point pairs.
[0112] Specifically, different from the above application scenarios, in order to reduce the amount of calculation, this application scenario screens the multiple groups of matching feature point pairs obtained after matching the first background feature points with the second background feature points. On the basis of ensuring a high degree of matching, the matching feature point pairs corresponding to the first background feature points that are evenly distributed around the preset target are screened out, and the homography matrix is subsequently calculated based on the screened matching feature point pairs.
[0113] In another application scenario, see Figure 8 Step S131 is a step of calculating a homography matrix, specifically comprising:
[0114] S1315: Identify a plurality of first background feature points distributed around a preset target in a reference image.
[0115] S1316: Identify multiple second background feature points in the image to be identified.
[0116] S1317: Screening the plurality of first background feature points to select a plurality of first background feature points that are arranged in front of a preset number of the first sequence and are evenly distributed around the preset target.
[0117] The first sequence is obtained by arranging the plurality of first background feature points in advance from large to small according to the confidence level.
[0118] S1318: Match the selected multiple first background feature points with the multiple second background feature points to obtain multiple groups of matching feature point pairs.
[0119] S1319: Screening the multiple sets of matching feature point pairs to select the multiple sets of matching feature point pairs that are arranged in front of a preset number in the second sequence and correspond to the first background feature points that are evenly distributed around the preset target.
[0120] The matching feature point pairs are pre-sorted from large to small according to the matching degree to obtain a second sequence.
[0121] S1320: Calculate the homography matrix between the image to be identified and the reference image based on the selected multiple sets of matching feature point pairs.
[0122] Specifically, different from the above application scenarios, in order to further reduce the amount of calculation, this application scenario will screen the first background feature points before matching them with the second background feature points, and then match the screened first background feature points with the second background feature points to obtain multiple groups of matching feature point pairs, and then screen the multiple groups of matching feature point pairs again, and finally calculate the homography matrix based on the screened matching feature point pairs.
[0123] That is to say, the method of calculating the homography matrix in this application scenario is equivalent to Figure 6 The methods and Figure 7 Combine the methods in .
[0124] In one application scenario, the step S1303 of matching the first background feature point with the second background feature point specifically includes:
[0125] (a): Extract the feature vector of the first background feature point and the feature vector of the second background feature point.
[0126] (b): Calculate a first distance value between the feature vector of the first background feature point and the feature vector of the second background feature point.
[0127] (c): If the first distance value is less than the distance threshold, it is determined that the corresponding first background feature point matches the second background feature point to form a matching feature point pair.
[0128] Specifically, the first distance value dis between the feature vector of the first background feature point and the feature vector of the second background feature point is calculated using the following formula: xy :
[0129] Among them, x i The element in the feature vector representing the first background feature point, y i represents an element in the feature vector of the second background feature point, and i represents the bit value corresponding to the element in the feature vector of the first background feature point or the feature vector of the second background feature point.
[0130] At this time, the first distance value between the feature vector of the first background feature point and the feature vector of the second background feature point is used to represent the matching degree between the first background feature point and the second background feature point: the smaller the first distance value, the higher the matching degree between the corresponding first background feature point and the second background feature point.
[0131] At the same time, the distance threshold is preset. If the first distance value is less than the distance threshold, it is determined that the corresponding first background feature point matches the second background feature point, otherwise it is determined that the corresponding first background feature point does not match the second background feature point.
[0132] It can be understood that when the first distance value between the feature vector of the first background feature point and the feature vector of the second background feature point is used to represent the matching degree between the first background feature point and the second background feature point, the above-mentioned step of sorting the matching feature point pairs from large to small according to the matching degree to obtain the second sequence can specifically be: sorting the matching feature point pairs from small to large according to the corresponding first distance values to obtain the second sequence.
[0133] See also Fig. 9 , Fig. 9 FIG. 1 is a flow chart of another embodiment of the target re-identification method of the present application. In this embodiment, the target re-identification method includes:
[0134] S210: Acquire the image to be recognized and the reference image.
[0135] S220: Determine a preset target in the reference image, and identify at least one candidate target in the image to be identified, wherein the candidate target and the preset target are targets of the same type.
[0136] S230: Determine a mapping position of a preset target in the image to be recognized.
[0137] S240: Determine position deviation information of each candidate target in at least one candidate target, where the position deviation information is determined based on the position and the mapping position of the corresponding candidate target.
[0138] S250: Screen at least one candidate target to select a candidate target whose corresponding position deviation information meets preset requirements.
[0139] Specifically, the candidate targets are screened according to the corresponding position deviation information, and the candidate targets whose positions are within a certain area around the mapped position are screened out.
[0140] In one application scenario, when using Figure 2 When the method in the embodiment calculates the position deviation information between the position of the candidate target in the image to be identified and the mapping position, step S250 specifically includes screening at least one candidate target to screen out the candidate target whose corresponding intersection-and-union ratio is greater than a preset threshold, or screening at least one candidate target to screen out the candidate target whose corresponding intersection-and-union ratio is not zero.
[0141] S260: Determine the appearance similarity corresponding to each of the screened candidate objects.
[0142] S270: Determine a candidate target that matches the preset target from at least one candidate target based on the position deviation information of each candidate target and the appearance similarity corresponding to each candidate target.
[0143] It can be understood that since step S260 only determines the appearance similarity corresponding to the screened candidate targets, step S270 specifically determines the candidate targets that match the preset target from the screened candidate targets.
[0144] Considering Figure 1 The amount of calculation in the implementation will increase linearly with the increase in the number of candidate targets, because in the implementation, before calculating the appearance similarity, the candidate targets are first filtered based on the position information, which greatly reduces the calculation of the appearance similarity and reduces the calculation time. And if there are more than one preset targets to be re-identified in the reference image, the time consumption of the method in the implementation will not increase significantly.
[0145] See also Fig.10 , Fig.103 is a schematic diagram of the structure of an embodiment of the target re-identification device of the present application. The target re-identification device 300 includes a processor 310, a memory 320 and a communication circuit 330. The processor 310 is coupled to the memory 320 and the communication circuit 330 respectively. The memory 320 stores program data. The processor 310 executes the program data in the memory 320 to implement the steps in any of the above-mentioned implementation methods. The detailed steps can be referred to the above-mentioned implementations and will not be repeated here.
[0146] The target re-identification device 300 may be any device with image processing capability, such as a computer or a mobile phone, and is not limited here.
[0147] See also Fig.11 , Fig.11 The target re-identification device 400 includes an image acquisition module 410 , a target recognition module 420 , a position determination module 430 , a position deviation information determination module 440 and a matching module 450 .
[0148] The image acquisition module 410 is used to acquire the image to be recognized and the reference image.
[0149] The target recognition module 420 is connected to the image acquisition module 410 and is used to determine the preset target in the reference image and recognize at least one candidate target in the image to be recognized, where the candidate target and the preset target are targets of the same type.
[0150] The position determination module 430 is connected to the target recognition module 420 and is used to determine the mapping position of the preset target in the image to be recognized.
[0151] The position deviation information determination module 440 is connected to the position determination module 430 and is used to determine the position deviation information of each candidate target in at least one candidate target, where the position deviation information is determined based on the position and the mapping position of the corresponding candidate target.
[0152] The matching module 450 is connected to the position deviation information determining module 440 and is used to determine a candidate target that matches the preset target from at least one candidate target based on the position deviation information of each candidate target.
[0153] In one embodiment, an appearance similarity determination module is also connected between the position deviation information determination module 440 and the matching module 450, which is used to determine the appearance similarity corresponding to each candidate target, and the appearance similarity is determined based on the degree of similarity between the appearance of the corresponding candidate target and the appearance of the preset target; at this time, the matching module 450 is specifically used to determine a candidate target that matches the preset target from at least one candidate target based on the position deviation information of each candidate target and the appearance similarity corresponding to each candidate target.
[0154] In one embodiment, the appearance similarity determination module includes a screening unit and an appearance similarity determination unit, wherein the screening unit is used to screen at least one candidate target and screen out candidate targets whose corresponding position deviation information meets preset requirements; the appearance similarity determination unit is used to determine the appearance similarity corresponding to each screened candidate target.
[0155] In one embodiment, the matching module 450 is specifically used to perform the following evaluation operations on each candidate target respectively to determine the evaluation value of each candidate target; the evaluation operation includes: determining the evaluation value of a candidate target based on the position deviation information of a candidate target among the candidate targets and the appearance similarity corresponding to a candidate target; based on the size of each determined evaluation value, determining the candidate target that matches the preset target among the candidate targets.
[0156] In one embodiment, the position determination module 430 specifically includes a homography matrix calculation unit and a position determination unit; the homography matrix calculation unit is used to calculate the homography matrix between the reference image and the image to be identified based on the background features of the reference image and the background features of the image to be identified; the position determination unit is used to determine the mapping position of the preset target in the image to be identified based on the homography matrix and the position of the preset target in the reference image.
[0157] In one embodiment, the homography matrix calculation unit is specifically used to identify multiple first background feature points distributed around a preset target in a reference image; identify multiple second background feature points in an image to be identified; match the multiple first background feature points with the multiple second background feature points to obtain multiple groups of matching feature point pairs; and calculate the homography matrix between the reference image and the image to be identified based on the multiple groups of matching feature point pairs.
[0158] In one embodiment, the homography matrix calculation unit is also specifically used to screen multiple first background feature points, and screen out multiple first background feature points that are arranged in front of a preset number in the first sequence and are evenly distributed around a preset target; match the screened multiple first background feature points with multiple second background feature points to obtain multiple groups of matching feature point pairs; wherein the first sequence is obtained by pre-arranging the multiple first background feature points from large to small according to confidence levels.
[0159] In one embodiment, the homography matrix calculation unit is also specifically used to screen multiple groups of matching feature point pairs, and screen out multiple groups of matching feature point pairs that are arranged in front of a preset number in the second sequence and correspond to the first background feature points evenly distributed around the preset target; based on the screened multiple groups of matching feature point pairs, the homography matrix between the image to be identified and the reference image is calculated; wherein the matching feature point pairs are pre-sorted from large to small according to the degree of matching to obtain the second sequence.
[0160] In one embodiment, the homography matrix calculation unit is also specifically used to extract the eigenvector of the first background feature point and the eigenvector of the second background feature point; calculate the first distance value between the eigenvector of the first background feature point and the eigenvector of the second background feature point; if the first distance value is less than the distance threshold, it is determined that the corresponding first background feature point matches the second background feature point to form a matching feature point pair.
[0161] In one embodiment, the position deviation information determination module 440 is specifically used to obtain a first area occupied by each first image frame that respectively selects at least one candidate target in the image to be identified; determine a second image frame of a mapping object formed by selecting a preset target at a mapping position in the image to be identified, and obtain a second area occupied by the second image frame in the image to be identified; determine the intersection and union ratio of the first area and the second area corresponding to each first image frame, and obtain the position deviation information of each candidate target in at least one candidate target.
[0162] The target re-identification device 400 may be any device with image processing capability, such as a computer or a mobile phone, and is not limited here.
[0163] See also Fig.12 , Fig.12 The computer-readable storage medium 500 stores a computer program 510, which can be executed by a processor to implement the steps in any of the above methods.
[0164] The computer-readable storage medium 500 may specifically be a device that can store the computer program 510, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the computer program 510. The server may send the stored computer program 510 to other devices for execution, or may also execute the stored computer program 510 by itself.
[0165] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A target re-identification method, characterized in that: The method comprises: Obtaining an image to be identified and a reference image; Determining a preset target in the reference image, and identifying at least one candidate target in the image to be identified, wherein the candidate target and the preset target are targets of the same type; Determining a mapping position of the preset target in the image to be identified; Determining position deviation information of each candidate target in the at least one candidate target, wherein the position deviation information is determined based on a position of the corresponding candidate target and the mapping position; Based on the position deviation information of each candidate target, determining a candidate target that matches the preset target from the at least one candidate target; Wherein, before determining the candidate target that matches the preset target from the at least candidate targets based on the position deviation information of each candidate target, the method further includes: determining the appearance similarity corresponding to each candidate target, wherein the appearance similarity is determined based on the degree of similarity between the appearance of the corresponding candidate target and the appearance of the preset target; determining the candidate target that matches the preset target from the at least one candidate target based on the determined position deviation information of each candidate target includes: determining the candidate target that matches the preset target from the at least one candidate target based on the position deviation information of each candidate target and the appearance similarity corresponding to each candidate target; Determining the appearance similarity corresponding to each candidate target includes: screening the at least one candidate target to screen out candidate targets whose corresponding position deviation information meets preset requirements; and determining the appearance similarity corresponding to each screened candidate target.
2. The method according to claim 1, characterized in that The determining, from the candidate targets, a candidate target matching the preset target based on the position deviation information of each candidate target and the appearance similarity corresponding to each candidate target, comprises: Performing the following evaluation operations on each of the candidate targets respectively to determine the evaluation value of each of the candidate targets; the evaluation operation includes: determining the evaluation value of one of the candidate targets based on the position deviation information of the one candidate target and the appearance similarity corresponding to the one candidate target; Based on the sizes of the determined evaluation values, a candidate target matching the preset target is determined from among the candidate targets.
3. The method according to claim 1, characterized in that The step of determining the mapping position of the preset target in the image to be identified includes: Calculating a homography matrix between the reference image and the image to be identified based on background features of the reference image and background features of the image to be identified; The mapping position of the preset target in the image to be identified is determined according to the homography matrix and the position of the preset target in the reference image.
4. The method according to claim 3, characterized in that The step of calculating the homography matrix between the reference image and the image to be identified based on the background features of the reference image and the background features of the image to be identified comprises: Identifying a plurality of first background feature points distributed around the preset target in the reference image; Identifying a plurality of second background feature points in the image to be identified; Matching a plurality of the first background feature points with a plurality of the second background feature points to obtain a plurality of sets of matching feature point pairs; The homography matrix between the reference image and the image to be identified is calculated according to the multiple sets of matching feature point pairs.
5. The method according to claim 4, characterized in that The step of matching the plurality of first background feature points with the plurality of second background feature points to obtain a plurality of sets of matching feature point pairs comprises: Screening the plurality of first background feature points to select a plurality of first background feature points that are arranged in front of a preset number in the first sequence and are evenly distributed around the preset target; Matching the screened first background feature points with the second background feature points to obtain a plurality of matching feature point pairs; The first sequence is obtained by arranging a plurality of the first background feature points in advance according to the confidence levels from large to small.
6. The method according to claim 4, characterized in that The step of calculating the homography matrix between the reference image and the image to be identified according to the multiple sets of matching feature point pairs comprises: Screening the plurality of groups of matching feature point pairs, screening out the plurality of groups of matching feature point pairs that are arranged in front of a preset number in the second sequence and that correspond to the first background feature points and are evenly distributed around the preset target; Calculating the homography matrix between the image to be identified and the reference image according to the selected multiple groups of matching feature point pairs; The matching feature point pairs are pre-sorted from large to small according to the matching degree to obtain the second sequence.
7. The method according to claim 4, characterized in that The step of matching the plurality of first background feature points with the plurality of second background feature points to obtain a plurality of sets of matching feature point pairs comprises: Extracting a feature vector of the first background feature point and a feature vector of the second background feature point; Calculate a first distance value between a feature vector of the first background feature point and a feature vector of the second background feature point; If the first distance value is less than a distance threshold, it is determined that the corresponding first background feature point matches the second background feature point to form the matching feature point pair.
8. The method according to claim 1, characterized in that The step of determining the position deviation information of each candidate target in the at least one candidate target comprises: Acquire a first area in the image to be identified that is occupied by each first image frame that respectively selects the at least one candidate target in the image to be identified; Determine a second image frame of a mapping object formed by selecting the preset target at the mapping position in the image to be recognized, and obtain a second area occupied by the second image frame in the image to be recognized; The intersection-and-union ratio of the first area and the second area corresponding to each of the first image frames is determined to obtain the position deviation information of each candidate target in the at least one candidate target.
9. A target re-identification device, characterized in that: The target re-identification device includes a processor, a memory and a communication circuit, the processor is coupled to the memory and the communication circuit respectively, the memory stores program data, and the processor implements the steps in the method according to any one of claims 1 to 8 by executing the program data in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Target automatically recognizing and tracking method based on affine invariant point and optical flow calculation
CN101770568A
Multi-video-camera target tracking method based on position perception and distinguish appearance model
CN104318588A
Seal matching method and device
CN108596197A
Repositioning method and device in camera attitude tracking process, equipment and storage medium
CN108615248A
Pedestrian re-identification method and device, computer equipment and readable medium
CN110175527A
