Person re-identification method, device, computer equipment and storage medium
By comprehensively considering feature similarity and viewpoint similarity in person re-identification, the recognition accuracy problem caused by viewpoint difference is solved, and the accuracy and model efficiency of person re-identification are improved.
Patent Information
- Application Number
- CN202111395373.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-23
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2041-11-23
AI Technical Summary
Existing pedestrian re-identification methods lack accuracy when dealing with perspective differences and cannot effectively identify similar pedestrians from the same perspective or the same pedestrian from different perspectives, resulting in low recognition accuracy.
By obtaining the detection frame and feature perspective in the video data to be processed, combined with the preset perspective feature library, the feature similarity and perspective similarity are calculated to determine the pedestrian re-identification result, and the perspective factor is comprehensively considered to improve the recognition accuracy.
It effectively improves the accuracy of pedestrian re-identification, reduces the adverse effects of perspective factors on matching, and improves the training efficiency and recognition accuracy of the model.
Smart Images

Figure CN114187461B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a pedestrian re-identification method, apparatus, computer equipment, storage medium, and computer program product. Background Art
[0002] With the development of computer vision, person re-identification (PRE) technology has emerged. Pedestrian re-identification (PRE) technology, also known as pedestrian re-identification (RID), uses computer vision to determine whether a specific person exists in an image or video sequence. It is widely considered a sub-problem of image retrieval. Given a surveillance image of a pedestrian, it is necessary to retrieve images of that person across multiple devices. This technology aims to overcome the visual limitations of fixed cameras and can be combined with pedestrian detection and tracking technologies. It has wide applications in intelligent video surveillance, smart security, and other fields.
[0003] In person re-identification tasks, visual factors such as viewpoint, pose, lighting, background, and resolution significantly impact model performance. Because the appearance of the same person varies significantly when captured from different angles (viewpoints), the model struggles to match the same person from two different perspectives. On the other hand, different people captured from the same angle (viewpoint) have similar appearances, making it easier for the model to match two people from the same perspective. Research has shown that during inference, it's easier for the model to match two people from the same perspective than to find the correct match for the same person from different perspectives. Therefore, mitigating the negative impact of viewpoint factors on the model is crucial.
[0004] Currently, most existing methods for person re-identification (PRED) use cosine distance to calculate the similarity between two images. While this distance can factor in differences in appearance, perspective, pose, lighting, and background, it has limitations. It cannot accurately identify similar people from the same perspective, nor can it accurately identify the same person from different perspectives, thus failing to guarantee PRED accuracy. Summary of the Invention
[0005] Based on this, it is necessary to provide a pedestrian re-identification method, device, computer equipment, computer-readable storage medium and computer program product that can effectively improve the accuracy of pedestrian re-identification in response to the above technical problems.
[0006] In a first aspect, the present application provides a method for predicting relative motion of an object in a video. The method comprises:
[0007] Obtaining video data to be processed, and extracting a detection frame containing a pedestrian to be detected in the video data to be processed;
[0008] Acquire a characteristic viewing angle of a pedestrian to be detected within the detection frame and a first pedestrian feature of the pedestrian to be detected;
[0009] Extracting a pedestrian perspective corresponding to the characteristic perspective from a preset perspective feature library, obtaining a second pedestrian feature of each pedestrian under the pedestrian perspective, and obtaining a second pedestrian feature set, wherein the pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective closest to the angle value of the characteristic perspective;
[0010] Obtaining feature similarities between the first pedestrian feature and each of the second pedestrian features in the second pedestrian feature set, and perspective similarities between the feature perspective and the pedestrian perspective;
[0011] A pedestrian re-identification result of the pedestrian to be detected is determined according to the feature similarity and the viewpoint similarity.
[0012] In one embodiment, obtaining a characteristic viewing angle of a pedestrian to be detected in the detection frame includes:
[0013] Estimating the human body posture of the pedestrian to be detected within the detection frame to determine the key points of the torso of the pedestrian to be detected;
[0014] Calculating the normal vector of the body orientation of the pedestrian to be detected based on the torso key points;
[0015] Splitting the normal vector of the body orientation of the pedestrian to be detected into a horizontal component and a vertical component;
[0016] A characteristic viewing angle of the pedestrian to be detected is obtained according to the horizontal component and the vertical component.
[0017] In one embodiment, obtaining the viewpoint similarity between the first pedestrian feature and the second pedestrian feature includes:
[0018] Constructing a Gaussian distribution map based on the feature perspective and the pedestrian perspective;
[0019] The perspective similarity between the first pedestrian feature and the second pedestrian feature is determined based on the Gaussian distribution map.
[0020] In one embodiment, determining the pedestrian re-identification result of the pedestrian to be detected based on the feature similarity and the viewpoint similarity includes:
[0021] determining a matching distance according to the feature similarity and the viewpoint similarity;
[0022] Screening a preset view feature library according to the matching distance to obtain a matching pedestrian corresponding to the pedestrian to be detected;
[0023] Obtain a pedestrian re-identification result of the pedestrian to be detected according to the pedestrian identifier corresponding to the matched pedestrian.
[0024] In one embodiment, after screening in a preset viewing angle feature library according to the matching distance, the method further includes:
[0025] When there is no matching pedestrian corresponding to the pedestrian to be detected in the preset viewing angle feature library, generating a pedestrian identifier corresponding to the pedestrian to be detected;
[0026] The characteristic viewing angle of the pedestrian to be detected and the first pedestrian feature are saved in the preset viewing angle feature library according to the pedestrian identification.
[0027] In one embodiment, after obtaining the pedestrian re-identification result of the pedestrian to be detected according to the pedestrian identifier corresponding to the matched pedestrian, the method further includes:
[0028] When the characteristic perspective of the pedestrian to be detected and the pedestrian perspective of the matched pedestrian are in the same range of perspectives, obtaining a first characteristic quality value of the characteristic perspective of the pedestrian to be detected and a second characteristic quality value of the pedestrian perspective of the matched pedestrian;
[0029] When the first feature quality value is greater than the second feature quality value, the second pedestrian feature of the matching pedestrian in the preset viewing angle feature library is updated according to the first pedestrian feature of the pedestrian to be detected.
[0030] In a second aspect, the present application also provides a pedestrian re-identification device. The device includes:
[0031] A data acquisition module is used to acquire the video data to be processed and extract the detection frame containing the pedestrian to be detected in the video data to be processed;
[0032] A feature extraction module, configured to obtain a feature perspective of a pedestrian to be detected within the detection frame and a first pedestrian feature of the pedestrian to be detected;
[0033] a perspective extraction module, configured to extract a pedestrian perspective corresponding to the characteristic perspective from a preset perspective feature library, obtain a second pedestrian feature of each pedestrian under the pedestrian perspective, and obtain a second pedestrian feature set, wherein the pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective whose angle value is closest to the characteristic perspective;
[0034] a similarity calculation module, configured to obtain a feature similarity between the first pedestrian feature and each of the second pedestrian features in the second pedestrian feature set, and a perspective similarity between the feature perspective and the pedestrian perspective;
[0035] The pedestrian re-identification module is used to determine the pedestrian re-identification result of the pedestrian to be detected according to the feature similarity and the viewpoint similarity.
[0036] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0037] Obtaining video data to be processed, and extracting a detection frame containing a pedestrian to be detected in the video data to be processed;
[0038] Acquire a characteristic viewing angle of a pedestrian to be detected within the detection frame and a first pedestrian feature of the pedestrian to be detected;
[0039] Extracting a pedestrian perspective corresponding to the characteristic perspective from a preset perspective feature library, obtaining a second pedestrian feature of each pedestrian under the pedestrian perspective, and obtaining a second pedestrian feature set, wherein the pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective closest to the angle value of the characteristic perspective;
[0040] Obtaining feature similarities between the first pedestrian feature and each of the second pedestrian features in the second pedestrian feature set, and perspective similarities between the feature perspective and the pedestrian perspective;
[0041] A pedestrian re-identification result of the pedestrian to be detected is determined according to the feature similarity and the viewpoint similarity.
[0042] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0043] Obtaining video data to be processed, and extracting a detection frame containing a pedestrian to be detected in the video data to be processed;
[0044] Acquire a characteristic viewing angle of a pedestrian to be detected within the detection frame and a first pedestrian feature of the pedestrian to be detected;
[0045] Extracting a pedestrian perspective corresponding to the characteristic perspective from a preset perspective feature library, obtaining a second pedestrian feature of each pedestrian under the pedestrian perspective, and obtaining a second pedestrian feature set, wherein the pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective closest to the angle value of the characteristic perspective;
[0046] Obtaining feature similarities between the first pedestrian feature and each of the second pedestrian features in the second pedestrian feature set, and perspective similarities between the feature perspective and the pedestrian perspective;
[0047] A pedestrian re-identification result of the pedestrian to be detected is determined according to the feature similarity and the viewpoint similarity.
[0048] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0049] Obtaining video data to be processed, and extracting a detection frame containing a pedestrian to be detected in the video data to be processed;
[0050] Acquire a characteristic viewing angle of a pedestrian to be detected within the detection frame and a first pedestrian feature of the pedestrian to be detected;
[0051] Extracting a pedestrian perspective corresponding to the characteristic perspective from a preset perspective feature library, obtaining a second pedestrian feature of each pedestrian under the pedestrian perspective, and obtaining a second pedestrian feature set, wherein the pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective closest to the angle value of the characteristic perspective;
[0052] Obtaining feature similarities between the first pedestrian feature and each of the second pedestrian features in the second pedestrian feature set, and perspective similarities between the feature perspective and the pedestrian perspective;
[0053] A pedestrian re-identification result of the pedestrian to be detected is determined according to the feature similarity and the viewpoint similarity.
[0054] The above-mentioned pedestrian re-identification method, device, computer equipment, storage medium and computer program product, wherein the method obtains the video data to be processed, extracts the detection frame containing the pedestrian to be detected in the video data to be processed; obtains the characteristic perspective of the pedestrian to be detected in the detection frame and the first pedestrian feature of the pedestrian to be detected; extracts the pedestrian perspective corresponding to the characteristic perspective from the preset perspective feature library, obtains the second pedestrian feature of each pedestrian under the pedestrian perspective, and obtains a second pedestrian feature set; then obtains the feature similarity and perspective similarity between the first pedestrian feature and the second pedestrian feature; and determines the pedestrian re-identification result of the pedestrian to be detected based on the feature similarity and perspective similarity. When performing pedestrian re-identification, this application comprehensively considers feature similarity and perspective similarity, and additionally introduces perspective similarity to measure the perspective difference between pedestrian features corresponding to different pedestrians, thereby effectively improving the recognition accuracy of the pedestrian re-identification process. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 A diagram showing an application environment of a pedestrian re-identification method according to an embodiment;
[0056] Figure 2 1 is a flow chart of a method for pedestrian re-identification according to an embodiment;
[0057] Figure 3 is a schematic diagram of the viewing angle size in one embodiment;
[0058] Figure 4 A schematic diagram of the division of viewing angle intervals in one embodiment;
[0059] Figure 5 In one embodiment Figure 2 Schematic diagram of the sub-process of step 203;
[0060] Figure 6 In one embodiment Figure 2 Schematic diagram of the sub-process of step 207;
[0061] Figure 7 is a schematic diagram of a Gaussian distribution diagram in one embodiment;
[0062] Figure 8 In one embodiment Figure 2 Schematic diagram of the sub-process of step 209;
[0063] Figure 9 is a structural block diagram of a pedestrian re-identification device in one embodiment;
[0064] Figure 10 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0066] The pedestrian re-identification method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The terminal 102 can send the video data to be processed to the server 104 so that the server 104 can re-identify the pedestrians corresponding to the video data to be processed. The server 104 obtains the video data to be processed, extracts the detection frame containing the pedestrian to be detected in the video data to be processed; obtains the characteristic perspective of the pedestrian to be detected in the detection frame and the first pedestrian feature of the pedestrian to be detected; extracts the pedestrian perspective corresponding to the characteristic perspective from the preset perspective feature library, obtains the second pedestrian feature of each pedestrian under the pedestrian perspective, and obtains the second pedestrian feature set. The pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective that is closest to the characteristic perspective angle value; obtains the feature similarity between the first pedestrian feature and the second pedestrian feature, and the perspective similarity between the characteristic perspective and the pedestrian perspective; determines the pedestrian re-identification result of the pedestrian to be detected based on the feature similarity and the perspective similarity. Terminal 102 may include, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Server 104 may be implemented as a standalone server or a server cluster consisting of multiple servers.
[0067] In one embodiment, Figure 2 As shown, a pedestrian re-identification method is provided, which is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:
[0068] Step 201: Obtain video data to be processed, and extract a detection frame containing a pedestrian to be detected from the video data to be processed.
[0069] Step 203: Acquire the characteristic viewing angle of the pedestrian to be detected in the detection frame and the first pedestrian feature of the pedestrian to be detected.
[0070] Among them, the video data to be processed refers to the target data identified by the pedestrian re-identification method of this application. The pedestrian re-identification method of this application needs to identify the pedestrians in the video data to be processed and determine whether the person appears in another place. The pedestrian to be detected is the identification object of pedestrian re-identification in this application. The video data to be processed may contain multiple different pedestrians to be detected. The detection frame is a rectangular frame used to frame the pedestrian to be detected. In this application, the viewing angle specifically refers to an angle information obtained by observing the direction of the pedestrian at the end of the video acquisition device (such as a camera). For all pedestrians to be detected in the video data to be processed, the corresponding reference coordinate axes are consistent. For specific viewing angle diagrams, please refer to Figure 3 ,in Figure 3 Specifically, for a top view of a pedestrian, this application defines the angle of view directly in front of the pedestrian as 0 degrees. At this time, when viewed from the camera end, the pedestrian's deviation from the 0-degree direction is 60 degrees, so the corresponding viewing angle of the pedestrian is 60 degrees. The first pedestrian feature is the image feature corresponding to the pedestrian to be detected extracted from the detection frame.
[0071] Specifically, when performing pedestrian re-identification, since the existing technology generally performs pedestrian re-identification based on the distance between features, it is impossible to take into account the viewing angle factor of the pedestrian. Therefore, the present application takes the viewing angle factor into account for pedestrian re-identification, thereby improving the recognition accuracy. When performing pedestrian re-identification, it is necessary to first obtain the video data to be processed, so as to perform pedestrian re-identification on the pedestrians in the video data to be processed. After obtaining the video data to be processed, the pedestrian to be detected in the current frame can be detected for each frame of the video sequence in the video data to be processed; and the viewing angle of the pedestrian to be detected is calculated for each detection frame, and at the same time, the first pedestrian feature of the pedestrian to be detected in each detection frame is extracted.
[0072] Step 205: extract the pedestrian perspective corresponding to the feature perspective from the preset perspective feature library, obtain the second pedestrian feature of each pedestrian under the pedestrian perspective, and obtain a second pedestrian feature set. The pedestrian perspective corresponding to the feature perspective is the pedestrian perspective that is closest to the feature perspective angle value.
[0073] The preset view feature library refers to a database pre-established to accommodate a large number of pedestrian view angles and second pedestrian features. Specifically, the present application can pre-divide different pedestrian view angle intervals for each pedestrian, and in the tracking process of pedestrian re-identification, gradually assign corresponding second pedestrian features to each pedestrian view angle interval according to the recognition results of the pedestrian re-identification process. For example, in one embodiment, Figure 4As shown, 12 perspectives can be divided into V1-V12, which are 8 horizontal perspectives and 4 top-down perspectives. The top-down view includes four viewing angles: front (V12, -45°-45°), right (V11, 45°-135°), rear (V10, 135°-225°), and left (V9, 225°-315°). The front view includes eight viewing angles: front (V7, -22.5°-22.5°), right front (V6, 22.5°-67.5°), right (V5, 67.5°-112.5°), right rear (V4, 112.5°-157.5°), rear (V3, 157.5°-202.5°), left rear (V2, 202.5°-247.5°), left (V1, 247.5°-292.5°), and left front (V8, 292.5°-337.5°). The area between each viewing angle is considered the viewing angle interval of the corresponding viewing angle. Then, for each pedestrian, a pedestrian perspective in different viewing angle intervals and the second pedestrian feature corresponding to the perspective are saved. The second pedestrian feature specifically refers to the image feature possessed by the pedestrian in the preset viewing angle feature library. The second pedestrian feature is similar to the first pedestrian feature. The prefixes first and second are only used to distinguish different reference groups. The first pedestrian feature is the current feature, which is the feature possessed by the current pedestrian in the video data to be processed and is the feature that needs to be queried and matched. The second pedestrian feature is a historical feature, which is used to refer to the features possessed by the pedestrians saved in the preset viewing angle feature library, and the features that have been queried have been matched.
[0074] Specifically, when performing pedestrian re-identification, it is generally necessary to match the pedestrian data in the video data to be processed with the data of the pedestrians that have been collected to determine whether the pedestrian appears again. Therefore, it is necessary to pre-establish a feature library of pedestrian data. This application pre-establishes a preset perspective feature library to accommodate pedestrian data. For each pedestrian, its pedestrian features under different pedestrian perspectives can be saved. When performing pedestrian re-identification, the characteristic perspective of the pedestrian to be detected and the first pedestrian feature of the pedestrian to be detected are determined. Based on the characteristic perspective, a pedestrian perspective closest to the characteristic perspective angle value can be found in the preset perspective feature library for all pedestrians for matching.
[0075] Step 207 : Obtain feature similarities between the first pedestrian feature and each second pedestrian feature in the second pedestrian feature set, and obtain perspective similarities between the feature perspective and the pedestrian perspective.
[0076] Step 209 : Determine a pedestrian re-identification result of the pedestrian to be detected based on the feature similarity and the viewpoint similarity.
[0077] Among them, feature similarity is used to characterize the degree of feature similarity between the first pedestrian feature and each second pedestrian feature in the second pedestrian feature set. Feature similarity can be specifically calculated by cosine similarity, adjusted cosine similarity, and Euclidean distance. This application specifically uses cosine similarity as an example to illustrate. Cosine similarity, also known as cosine distance, refers to evaluating the similarity of two vectors by calculating the cosine value of the angle between them. In this application, the similarity between the two features is determined by calculating the cosine value of the angle between the vectors corresponding to the first pedestrian feature and the second pedestrian feature. The perspective similarity is used to represent the difference in perspective between the pedestrian to be detected and the pedestrian in the preset perspective feature library when facing the camera. The pedestrian re-identification result specifically refers to the output of the pedestrian identification of the matched pedestrian when there is a pedestrian matching the pedestrian to be detected in the preset perspective feature library, and the output of no recognition result when there is no pedestrian matching the pedestrian to be detected in the preset perspective feature library.
[0078] Specifically, based on the two parameters of feature similarity between the first pedestrian feature and the second pedestrian feature, and perspective similarity between the feature perspective and the pedestrian perspective, the degree of matching between the pedestrian to be detected and the pedestrians in the preset perspective feature library is determined, thereby obtaining the pedestrian re-identification result of the pedestrian to be detected and improving the accuracy of pedestrian re-identification. In a specific embodiment, the present application can store 12 perspective features for each pedestrian in the preset perspective feature library, so that pedestrian matching in the pedestrian re-identification process can be performed based on the pedestrian perspective, reducing the adverse effects of perspective factors. However, in the preset perspective feature library, not every pedestrian can store features of all perspectives, and when performing feature matching, if the feature perspective angles are close, it means that the difference in the perspective dimension of the pedestrian features is small. Therefore, the pedestrian perspective closest to the feature perspective angle value is selected for optimal matching.
[0079] The above-mentioned pedestrian re-identification method, wherein the method obtains the video data to be processed, extracts the detection frame containing the pedestrian to be detected in the video data to be processed; obtains the characteristic perspective of the pedestrian to be detected in the detection frame and the first pedestrian feature of the pedestrian to be detected; extracts the pedestrian perspective corresponding to the characteristic perspective from the preset perspective feature library, obtains the second pedestrian feature of each pedestrian under the pedestrian perspective, and obtains the second pedestrian feature set; then obtains the feature similarity and perspective similarity between the first pedestrian feature and the second pedestrian feature; and determines the pedestrian re-identification result of the pedestrian to be detected based on the feature similarity and perspective similarity. When performing pedestrian re-identification, the present application comprehensively considers feature similarity and perspective similarity, and additionally introduces perspective similarity to measure the perspective difference between pedestrian features corresponding to different pedestrians, thereby effectively improving the recognition accuracy of the pedestrian re-identification process. At the same time, the influence of perspective factors on pedestrian matching is reduced during the test process, and no adjustment of the model or additional training data is required, which can effectively improve the training efficiency of the model in the pedestrian re-identification process.
[0080] In one embodiment, Figure 5 As shown, step 203 includes:
[0081] Step 502 : Estimating the human body posture of the pedestrian to be detected within the detection frame, and determining the key points of the torso of the pedestrian to be detected.
[0082] Step 504: Calculate the normal vector of the body orientation of the pedestrian to be detected based on the torso key points.
[0083] Step 506 : Split the normal vector of the body orientation of the pedestrian to be detected into a horizontal component and a vertical component.
[0084] Step 508: Acquire the characteristic viewing angle of the pedestrian to be detected based on the horizontal component and the vertical component.
[0085] Pose estimation, also known as human pose estimation, is a branch of computer vision that primarily predicts the coordinates of key points on the human body and determines the spatial relationships between them, thereby obtaining a predicted human skeleton. In this application, human pose estimation primarily determines key points on the human torso. This allows the normal vector of the pedestrian's body orientation to be determined, and further allows the detection of the pedestrian's characteristic viewpoint.
[0086] Specifically, when determining the characteristic perspective of a pedestrian to be detected within a detection frame, calculations can be performed through human body posture estimation. First, it is necessary to determine the three-dimensional coordinates of the key points of the torso of the pedestrian to be detected within the detection frame through human body posture estimation. Then, a vector is formed by the three-dimensional coordinates of the torso key points to calculate its normal vector. Specifically, the normal vector can be calculated by cross-multiplying the vectors corresponding to the torso key points. The normal vector is then divided into a horizontal component and a vertical component. The horizontal component is used to determine the orientation of the body; the vertical component is used to determine the shooting angle. When obtaining the characteristic perspective, if the vertical component obtained by splitting is negative and the modulus is greater than the horizontal component, it is a bird's-eye view, otherwise it is a front view. In this embodiment, the accuracy of the characteristic perspective calculation can be effectively guaranteed by determining the characteristic perspective of the pedestrian to be detected through human body posture.
[0087] In one embodiment, Figure 6 As shown, step 207 includes:
[0088] Step 601: construct a Gaussian distribution map based on the feature perspective and the pedestrian perspective.
[0089] Step 603 : Determine the perspective similarity between the feature perspective and the pedestrian perspective based on the Gaussian distribution map.
[0090] Among them, Gaussian distribution, also known as normal distribution, is a very important probability distribution in mathematics, physics, engineering and other fields, and has a significant influence on many aspects of statistics.
[0091] Specifically, this application uses the method of generating a Gaussian distribution map to calculate the perspective similarity. Two Gaussian distribution maps are generated for the characteristic perspectives of the front view and the top view to determine the perspective similarity. In one embodiment, this application specifically uses 12 perspectives V1-V12 for pedestrian re-identification, V1-V8 is the front view perspective, and V9-V12 is the top view perspective. Figure 7 As shown in , when calculating the perspective similarity, the mean of the Gaussian distribution is the current feature perspective; and the standard deviation of the Gaussian distribution is adaptive. If there are features with the same perspective or adjacent perspectives as the current feature perspective in the preset perspective feature library, the variance is reduced; otherwise, the variance is increased. Figure 7 Taking (a) as an example, when the current feature perspective is V7, if the preset perspective feature library stores historical features of the V7 perspective, then the curve with std=0.447... is used, and the perspective similarity is relatively large. The curve can specifically refer to the curve with the highest vertex in Figure (a); if the system does not have historical features of V7, but has historical features of adjacent V6 or V8 perspectives, then the curve with std=0.707... is used, and the perspective similarity is medium. The curve can specifically refer to the curve with the second highest vertex in Figure (a); if the system does not have historical features of V7, V6, or V8, but has adjacent V5 or V1, V4, V2, or V3 perspectives, then the curve with std=0.1 is used, and the perspective similarity is relatively low. The curve can specifically refer to the curve with the lowest vertex in Figure (a). In this embodiment, by constructing a Gaussian distribution graph, the perspective similarity between the feature perspective and the pedestrian perspective can be effectively calculated, and the accuracy of the similarity calculation can be guaranteed.
[0092] In one embodiment, Figure 8 As shown, step 209 includes:
[0093] Step 801: Determine the matching distance based on the feature similarity and the viewpoint similarity.
[0094] Step 803 : Screening is performed in a preset view feature library according to the matching distance to obtain a matching pedestrian corresponding to the pedestrian to be detected.
[0095] Step 805 : Obtain a pedestrian re-identification result of the pedestrian to be detected according to the pedestrian identifier corresponding to the matched pedestrian.
[0096] Specifically, when calculating the similarity between the pedestrian to be detected and the pedestrians in the preset view feature library, the comprehensive matching distance can be determined based on the feature similarity and the view similarity. The calculation formula of the matching distance is specifically matching distance D = d cos -(1-d view ), where d cos is the feature similarity, d viewis the perspective similarity, α is the balancing factor for balancing feature similarity and perspective calculation, and the balancing factor is set based on the order of magnitude of feature similarity. The process of filtering the preset perspective feature library based on the matching distance to obtain the matching pedestrian corresponding to the pedestrian to be detected is based on whether the matching distance exceeds a preset distance threshold. When the matching distance between the preset perspective feature library and the pedestrian to be detected is less than the preset distance threshold, the pedestrian in the preset perspective feature library that is less than the preset distance threshold can be used as the matching pedestrian corresponding to the pedestrian to be detected. At the same time, a pedestrian identifier can be assigned to each pedestrian in the preset perspective feature library. Once the matching pedestrian corresponding to the pedestrian to be detected is determined, the pedestrian re-identification result of the pedestrian to be detected can be obtained based on the pedestrian identifier corresponding to the matching pedestrian and the final recognition result can be output. In this embodiment, by first determining the matching distance and then filtering the preset perspective feature library based on the matching distance, the matching pedestrian corresponding to the pedestrian to be detected can be effectively determined, completing the entire process of pedestrian re-identification.
[0097] In one embodiment, after screening in a preset perspective feature library according to the matching distance, it also includes: when the characteristic perspective of the pedestrian to be detected and the pedestrian perspective of the matching pedestrian are in the same range of perspectives, obtaining a first feature quality value of the characteristic perspective of the pedestrian to be detected and a second feature quality value of the pedestrian perspective of the matching pedestrian; when the first feature quality value is greater than the second feature quality value, matching the second pedestrian feature of the pedestrian in the preset perspective feature library according to the first pedestrian feature of the pedestrian to be detected.
[0098] Specifically, when there is no matching pedestrian corresponding to the pedestrian to be detected in the preset perspective feature library, it means that there is no identical pedestrian matching the pedestrian to be detected in the preset perspective feature library. At this time, in order to more conveniently perform subsequent pedestrian re-identification, a pedestrian identifier corresponding to the pedestrian to be detected can be generated; based on the pedestrian identifier, the characteristic perspective of the pedestrian to be detected and the first pedestrian feature are saved to the preset perspective feature library. That is, based on the characteristic perspective and feature data of the pedestrian to be detected, pedestrian information in the preset perspective feature library is newly created, and the feature data is stored. In this embodiment, when no matching pedestrian corresponding to the pedestrian to be detected is detected, by creating a pedestrian identifier corresponding to the pedestrian to be detected and saving the corresponding feature to the preset perspective feature library, the accuracy of the subsequent pedestrian re-identification process can be effectively improved.
[0099] In one embodiment, after step 209, it also includes: when the feature perspective of the pedestrian to be detected and the pedestrian perspective of the matching pedestrian are in the same range of perspectives, obtaining a first feature quality value of the feature perspective of the pedestrian to be detected and a second feature quality value of the pedestrian perspective of the matching pedestrian; when the first feature quality value is greater than the second feature quality value, updating the second pedestrian feature of the matching pedestrian in the preset perspective feature library according to the first pedestrian feature of the pedestrian to be detected.
[0100] The present application can divide the characteristic perspective into different perspective intervals. For example, the perspective can be divided into 12 perspective intervals, V1-V12, including 8 horizontal perspectives and 4 top-down perspectives. The process of obtaining the characteristic perspective of the pedestrian to be detected specifically includes obtaining the perspective interval corresponding to the characteristic perspective of the pedestrian to be detected.
[0101] Specifically, during the inference process, the present application performs person re-identification matching by comparing features from the same viewpoint. However, due to issues such as occlusion, lighting, posture, and deformation, the quality of features from different viewpoints for the same pedestrian in the preset viewpoint feature library varies, which may lead to incorrect matching. Therefore, in order to ensure the quality of each pedestrian's matching features, the present application can continuously update the features from the corresponding viewpoint of each pedestrian during the inference and tracking process. Specifically, after determining the pedestrian re-identification result of the pedestrian to be detected and matching the pedestrian corresponding to the pedestrian to be detected from the preset viewpoint feature library, the present application can also compare and judge the quality of features from the same viewpoint. If the input feature quality is better, the feature from the corresponding viewpoint is updated. The feature quality value can be specifically referenced by the following data. The first is feature quality judgment: including the feature distance from the closest viewpoint and the distance from the feature center of the pedestrian ID. The second is occlusion judgment: the number of key points on the human body can be used to determine whether the corresponding feature quality value is completely determined. After determining the feature quality values of the characteristic viewpoint of the detected pedestrian and the pedestrian viewpoint of the matched pedestrian, a comparison can be performed to determine which viewpoint corresponds to the higher feature quality value. The features corresponding to the higher feature quality value are then stored in the preset viewpoint feature library, thereby improving the quality of the features in the preset viewpoint feature library. In this embodiment, by updating the feature data in the preset viewpoint feature library, the quality of the pedestrian matching features can be effectively improved, ensuring the accuracy of pedestrian re-identification.
[0102] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0103] Based on the same inventive concept, embodiments of the present application also provide a person re-identification device for implementing the aforementioned person re-identification method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more of the following embodiments of the person re-identification device can be found in the aforementioned limitations of the person re-identification method and will not be further elaborated here.
[0104] In one embodiment, Figure 9 As shown, a pedestrian re-identification device is provided, comprising:
[0105] The data acquisition module 902 is used to acquire the video data to be processed and extract the detection frame containing the pedestrian to be detected in the video data to be processed;
[0106] A feature extraction module 904 is used to obtain a feature perspective of a pedestrian to be detected in a detection frame and a first pedestrian feature of the pedestrian to be detected;
[0107] A perspective extraction module 906 is configured to extract a pedestrian perspective corresponding to a characteristic perspective from a preset perspective feature library, obtain a second pedestrian feature of each pedestrian under the pedestrian perspective, and obtain a second pedestrian feature set. The pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective whose angle value is closest to the characteristic perspective.
[0108] A similarity calculation module 908 is configured to obtain a feature similarity between the first pedestrian feature and each second pedestrian feature in the second pedestrian feature set, and a perspective similarity between the feature perspective and the pedestrian perspective;
[0109] The pedestrian re-identification module 910 is used to determine the pedestrian re-identification result of the pedestrian to be detected based on the feature similarity and the viewpoint similarity.
[0110] In one embodiment, the feature extraction module is specifically used to: estimate the human posture of the pedestrian to be detected in the detection frame, and determine the torso key points of the pedestrian to be detected; calculate the normal vector of the body orientation of the pedestrian to be detected based on the torso key points; split the normal vector of the body orientation of the pedestrian to be detected into a horizontal component and a vertical component; and obtain the characteristic perspective of the pedestrian to be detected based on the horizontal component and the vertical component.
[0111] In one embodiment, the similarity calculation module 207 is specifically configured to: construct a Gaussian distribution map based on the feature perspective and the pedestrian perspective; and determine the perspective similarity between the feature perspective and the pedestrian perspective based on the Gaussian distribution map.
[0112] In one embodiment, the pedestrian re-identification module 209 is specifically used to: determine the matching distance based on feature similarity and viewpoint similarity; filter in a preset viewpoint feature library based on the matching distance to obtain a matching pedestrian corresponding to the pedestrian to be detected; and obtain a pedestrian re-identification result of the pedestrian to be detected based on the pedestrian identifier corresponding to the matching pedestrian.
[0113] In one embodiment, a feature library update module is also included, which is used to: generate a pedestrian identifier corresponding to the pedestrian to be detected when there is no matching pedestrian corresponding to the pedestrian to be detected in the preset perspective feature library; and save the characteristic perspective of the pedestrian to be detected and the first pedestrian feature to the preset perspective feature library according to the pedestrian identifier.
[0114] In one embodiment, a feature quality inspection module is further included, which is used to: when the feature perspective of the pedestrian to be detected and the pedestrian perspective of the matching pedestrian are in the same range of perspectives, obtain a first feature quality value of the feature perspective of the pedestrian to be detected and a second feature quality value of the pedestrian perspective of the matching pedestrian; when the first feature quality value is greater than the second feature quality value, update the second pedestrian feature of the matching pedestrian in the preset perspective feature library according to the first pedestrian feature of the pedestrian to be detected.
[0115] Each module in the aforementioned person re-identification device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor within a computer device in hardware form, or may be stored in a computer device memory in software form, allowing the processor to call and execute the corresponding operations of each module.
[0116] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 10 As shown. The computer device includes a processor, a memory and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pedestrian re-identification data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a pedestrian re-identification method is implemented.
[0117] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0118] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0119] Obtaining the video data to be processed, and extracting the detection frame containing the pedestrian to be detected in the video data to be processed;
[0120] Obtain the characteristic perspective of the pedestrian to be detected in the detection frame and the first pedestrian feature of the pedestrian to be detected;
[0121] Extracting the pedestrian perspective corresponding to the feature perspective from the preset perspective feature library, obtaining the second pedestrian feature of each pedestrian under the pedestrian perspective, and obtaining a second pedestrian feature set, wherein the pedestrian perspective corresponding to the feature perspective is the pedestrian perspective closest to the feature perspective angle value;
[0122] Obtaining feature similarities between the first pedestrian feature and each second pedestrian feature in the second pedestrian feature set, and perspective similarities between the feature perspective and the pedestrian perspective;
[0123] The pedestrian re-identification result of the pedestrian to be detected is determined based on the feature similarity and viewpoint similarity.
[0124] In one embodiment, when the processor executes the computer program, it also implements the following steps: estimating the human posture of the pedestrian to be detected within the detection frame, and determining the torso key points of the pedestrian to be detected; calculating the normal vector of the body orientation of the pedestrian to be detected based on the torso key points; splitting the normal vector of the body orientation of the pedestrian to be detected into a horizontal component and a vertical component; and obtaining the characteristic perspective of the pedestrian to be detected based on the horizontal component and the vertical component.
[0125] In one embodiment, when the processor executes the computer program, it further implements the following steps: constructing a Gaussian distribution map based on the feature perspective and the pedestrian perspective; and determining the perspective similarity between the feature perspective and the pedestrian perspective based on the Gaussian distribution map.
[0126] In one embodiment, when the processor executes the computer program, it also implements the following steps: determining a matching distance based on feature similarity and viewpoint similarity; screening a preset viewpoint feature library based on the matching distance to obtain a matching pedestrian corresponding to the pedestrian to be detected; and obtaining a pedestrian re-identification result of the pedestrian to be detected based on the pedestrian identifier corresponding to the matching pedestrian.
[0127] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when there is no matching pedestrian corresponding to the pedestrian to be detected in the preset perspective feature library, a pedestrian identifier corresponding to the pedestrian to be detected is generated; and according to the pedestrian identifier, the characteristic perspective of the pedestrian to be detected and the first pedestrian feature are saved to the preset perspective feature library.
[0128] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the characteristic perspective of the pedestrian to be detected and the pedestrian perspective of the matching pedestrian are in the same range of perspectives, a first feature quality value of the characteristic perspective of the pedestrian to be detected and a second feature quality value of the pedestrian perspective of the matching pedestrian are obtained; when the first feature quality value is greater than the second feature quality value, the second pedestrian feature of the matching pedestrian in the preset perspective feature library is updated according to the first pedestrian feature of the pedestrian to be detected.
[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0130] Obtaining the video data to be processed, and extracting the detection frame containing the pedestrian to be detected in the video data to be processed;
[0131] Obtain the characteristic perspective of the pedestrian to be detected in the detection frame and the first pedestrian feature of the pedestrian to be detected;
[0132] Extracting the pedestrian perspective corresponding to the feature perspective from the preset perspective feature library, obtaining the second pedestrian feature of each pedestrian under the pedestrian perspective, and obtaining a second pedestrian feature set, wherein the pedestrian perspective corresponding to the feature perspective is the pedestrian perspective closest to the feature perspective angle value;
[0133] Obtaining feature similarities between the first pedestrian feature and each second pedestrian feature in the second pedestrian feature set, and view similarities between the feature view and the pedestrian view;
[0134] The pedestrian re-identification result of the pedestrian to be detected is determined based on the feature similarity and viewpoint similarity.
[0135] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: estimating the human posture of the pedestrian to be detected within the detection frame, and determining the torso key points of the pedestrian to be detected; calculating the normal vector of the body orientation of the pedestrian to be detected based on the torso key points; splitting the normal vector of the body orientation of the pedestrian to be detected into a horizontal component and a vertical component; and obtaining the characteristic perspective of the pedestrian to be detected based on the horizontal component and the vertical component.
[0136] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: constructing a Gaussian distribution map based on the feature perspective and the pedestrian perspective; and determining the perspective similarity between the feature perspective and the pedestrian perspective based on the Gaussian distribution map.
[0137] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining a matching distance based on feature similarity and viewpoint similarity; screening a preset viewpoint feature library based on the matching distance to obtain a matching pedestrian corresponding to the pedestrian to be detected; and obtaining a pedestrian re-identification result of the pedestrian to be detected based on the pedestrian identifier corresponding to the matching pedestrian.
[0138] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when there is no matching pedestrian corresponding to the pedestrian to be detected in the preset perspective feature library, a pedestrian identifier corresponding to the pedestrian to be detected is generated; and according to the pedestrian identifier, the characteristic perspective of the pedestrian to be detected and the first pedestrian feature are saved to the preset perspective feature library.
[0139] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the characteristic perspective of the pedestrian to be detected and the pedestrian perspective of the matching pedestrian are in the same range of perspectives, a first feature quality value of the characteristic perspective of the pedestrian to be detected and a second feature quality value of the pedestrian perspective of the matching pedestrian are obtained; when the first feature quality value is greater than the second feature quality value, the second pedestrian feature of the matching pedestrian in the preset perspective feature library is updated according to the first pedestrian feature of the pedestrian to be detected.
[0140] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0141] Obtaining the video data to be processed, and extracting the detection frame containing the pedestrian to be detected in the video data to be processed;
[0142] Obtain the characteristic perspective of the pedestrian to be detected in the detection frame and the first pedestrian feature of the pedestrian to be detected;
[0143] Extracting the pedestrian perspective corresponding to the feature perspective from the preset perspective feature library, obtaining the second pedestrian feature of each pedestrian under the pedestrian perspective, and obtaining a second pedestrian feature set, wherein the pedestrian perspective corresponding to the feature perspective is the pedestrian perspective closest to the feature perspective angle value;
[0144] Obtaining feature similarities between the first pedestrian feature and each second pedestrian feature in the second pedestrian feature set, and perspective similarities between the feature perspective and the pedestrian perspective;
[0145] The pedestrian re-identification result of the pedestrian to be detected is determined based on the feature similarity and viewpoint similarity.
[0146] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: estimating the human posture of the pedestrian to be detected within the detection frame, and determining the torso key points of the pedestrian to be detected; calculating the normal vector of the body orientation of the pedestrian to be detected based on the torso key points; splitting the normal vector of the body orientation of the pedestrian to be detected into a horizontal component and a vertical component; and obtaining the characteristic perspective of the pedestrian to be detected based on the horizontal component and the vertical component.
[0147] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: constructing a Gaussian distribution map based on the feature perspective and the pedestrian perspective; and determining the perspective similarity between the feature perspective and the pedestrian perspective based on the Gaussian distribution map.
[0148] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining a matching distance based on feature similarity and viewpoint similarity; screening a preset viewpoint feature library based on the matching distance to obtain a matching pedestrian corresponding to the pedestrian to be detected; and obtaining a pedestrian re-identification result of the pedestrian to be detected based on the pedestrian identifier corresponding to the matching pedestrian.
[0149] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when there is no matching pedestrian corresponding to the pedestrian to be detected in the preset perspective feature library, a pedestrian identifier corresponding to the pedestrian to be detected is generated; and according to the pedestrian identifier, the characteristic perspective of the pedestrian to be detected and the first pedestrian feature are saved to the preset perspective feature library.
[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the characteristic perspective of the pedestrian to be detected and the pedestrian perspective of the matching pedestrian are in the same range of perspectives, a first feature quality value of the characteristic perspective of the pedestrian to be detected and a second feature quality value of the pedestrian perspective of the matching pedestrian are obtained; when the first feature quality value is greater than the second feature quality value, the second pedestrian feature of the matching pedestrian in the preset perspective feature library is updated according to the first pedestrian feature of the pedestrian to be detected.
[0151] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0152] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0153] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0154] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A pedestrian re-identification method, characterized in that: The method comprises: Obtaining video data to be processed, and extracting a detection frame containing a pedestrian to be detected in the video data to be processed; Acquire a characteristic viewing angle of a pedestrian to be detected in the detection frame and a first pedestrian feature of the pedestrian to be detected, wherein the viewing angle in the characteristic viewing angle is angle information obtained by observing the direction of the pedestrian at the video acquisition device end; Extracting a pedestrian perspective corresponding to the characteristic perspective from a preset perspective feature library, obtaining a second pedestrian feature of each pedestrian under the pedestrian perspective, and obtaining a second pedestrian feature set, wherein the pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective with the angle value closest to the characteristic perspective. The preset perspective feature library is pre-divided into different pedestrian perspective intervals for each pedestrian, and then assigning a corresponding second pedestrian feature to each pedestrian perspective interval based on the recognition result of pedestrian re-identification; Obtaining feature similarities between the first pedestrian feature and each of the second pedestrian features in the second pedestrian feature set, and perspective similarities between the feature perspective and the pedestrian perspective; Determining a pedestrian re-identification result of the pedestrian to be detected according to the feature similarity and the viewpoint similarity; The method of obtaining the characteristic perspective of the pedestrian to be detected in the detection frame includes: estimating the human body posture of the pedestrian to be detected in the detection frame to determine the torso key points of the pedestrian to be detected; forming a vector through the three-dimensional coordinates of the torso key points, and cross-multiplying the vectors corresponding to the torso key points to obtain a normal vector; splitting the normal vector of the body orientation of the pedestrian to be detected into a horizontal component and a vertical component, the horizontal component being used to determine the body orientation; the vertical component being used to determine the shooting angle; and obtaining the characteristic perspective of the pedestrian to be detected based on the horizontal component and the vertical component.
2. The method according to claim 1, characterized in that The obtaining of the perspective similarity between the characteristic perspective and the pedestrian perspective includes: Constructing a Gaussian distribution map based on the feature perspective and the pedestrian perspective; The perspective similarity between the feature perspective and the pedestrian perspective is determined based on the Gaussian distribution map.
3. The method according to claim 1, characterized in that Determining a pedestrian re-identification result of the pedestrian to be detected according to the feature similarity and the viewpoint similarity includes: determining a matching distance according to the feature similarity and the viewpoint similarity; Screening a preset view feature library according to the matching distance to obtain a matching pedestrian corresponding to the pedestrian to be detected; Obtain a pedestrian re-identification result of the pedestrian to be detected according to the pedestrian identifier corresponding to the matched pedestrian.
4. The method according to claim 3, characterized in that After screening in a preset viewing angle feature library according to the matching distance, the method further includes: When there is no matching pedestrian corresponding to the pedestrian to be detected in the preset viewing angle feature library, generating a pedestrian identifier corresponding to the pedestrian to be detected; The characteristic viewing angle of the pedestrian to be detected and the first pedestrian feature are saved in the preset viewing angle feature library according to the pedestrian identification.
5. The method according to claim 3, characterized in that After obtaining the pedestrian re-identification result of the pedestrian to be detected according to the pedestrian identifier corresponding to the matched pedestrian, the method further includes: When the characteristic perspective of the pedestrian to be detected and the pedestrian perspective of the matched pedestrian are in the same range of perspectives, obtaining a first characteristic quality value of the characteristic perspective of the pedestrian to be detected and a second characteristic quality value of the pedestrian perspective of the matched pedestrian; When the first feature quality value is greater than the second feature quality value, the second pedestrian feature of the matching pedestrian in the preset viewing angle feature library is updated according to the first pedestrian feature of the pedestrian to be detected.
6. A pedestrian re-identification device, characterized in that: The device comprises: A data acquisition module is used to acquire the video data to be processed and extract the detection frame containing the pedestrian to be detected in the video data to be processed; A feature extraction module is used to obtain a characteristic viewing angle of a pedestrian to be detected in the detection frame and a first pedestrian feature of the pedestrian to be detected, wherein the viewing angle in the characteristic viewing angle is an angle information obtained by observing the direction of the pedestrian at the video acquisition device end; A perspective extraction module is configured to extract a pedestrian perspective corresponding to a characteristic perspective from a preset perspective feature library, obtain a second pedestrian feature of each pedestrian under the pedestrian perspective, and obtain a second pedestrian feature set, wherein the pedestrian perspective corresponding to the characteristic perspective is the pedestrian perspective whose angle value is closest to the characteristic perspective. The preset perspective feature library is pre-divided into different pedestrian perspective intervals for each pedestrian, and then a corresponding second pedestrian feature is assigned to each pedestrian perspective interval based on the recognition results of pedestrian re-identification. a similarity calculation module, configured to obtain a feature similarity between the first pedestrian feature and each of the second pedestrian features in the second pedestrian feature set, and a perspective similarity between the feature perspective and the pedestrian perspective; a pedestrian re-identification module, configured to determine a pedestrian re-identification result of the pedestrian to be detected based on the feature similarity and the viewpoint similarity; The perspective extraction module is specifically used to: estimate the human posture of the pedestrian to be detected in the detection frame and determine the torso key points of the pedestrian to be detected; form a vector through the three-dimensional coordinates of the torso key points, and obtain a normal vector by cross multiplication of the vectors corresponding to the torso key points; split the normal vector of the body orientation of the pedestrian to be detected into a horizontal component and a vertical component, the horizontal component is used to determine the body orientation; the vertical component is used to determine the shooting angle; and obtain the characteristic perspective of the pedestrian to be detected based on the horizontal component and the vertical component.
7. The device according to claim 6, characterized in that The pedestrian re-identification module is specifically used to: construct a Gaussian distribution map based on the characteristic perspective and the pedestrian perspective; and determine the perspective similarity between the characteristic perspective and the pedestrian perspective based on the Gaussian distribution map.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Feature-fusion-based second-generation identity card identification method
CN105184235A
Three-dimensional reconstruction method, device and system, model training method and storage medium
CN111862296A
Face recognition method, device and system, computing equipment and storage medium
CN112016508A
Object identification method and related monitoring camera apparatus
CN113095123A