Method and device for analyzing portrait files, storage medium and electronic device
By calculating the distance between the checkpoints and the time difference to determine the moving speed, setting the moving speed threshold and combining it with portrait feature clustering, the problem of multiple people in one portrait file in the existing technology is solved and the clustering accuracy is improved.
Patent Information
- Application Number
- CN202210264561.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-03-17
AI Technical Summary
Existing portrait clustering technologies fail to effectively utilize information in the temporal and spatial dimensions, resulting in the problem of multiple people being included in one portrait file.
The moving speed of the target object is determined by calculating the distance difference and time difference between the camera ports, and the moving speed threshold is set to determine whether adjacent snapshots belong to the same target object. The convolutional neural network is used to extract portrait features for clustering, and the snapshots that do not belong to the portrait file are excluded by combining the time-space contradiction judgment.
It effectively reduces the error rate of multiple people in one portrait file and improves the accuracy and reliability of portrait clustering.
Smart Images

Figure CN114612703B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a method and device for analyzing a portrait file, a storage medium, and an electronic device. Background Art
[0002] In recent years, with the continuous innovation and development of facial recognition technology, relevant industries and departments have developed facial recognition-based surveillance technologies. Currently, these facial recognition-based portrait monitoring systems can not only identify people and extract attributes such as age and gender from images, but also cluster people to depict their travel trajectories.
[0003] In the security industry, highly accurate portrait clustering technology can greatly facilitate subsequent work. Conversely, a high error rate can lead to deviations in travel trajectories. Existing portrait clustering technology typically only utilizes facial features for comparison, failing to consider temporal and spatial dimensions, which can easily lead to problems such as multiple people being included in a single profile.
[0004] Regarding related technologies, the existing portrait clustering technology cannot effectively utilize information in dimensions such as time, which leads to the problem of multiple people existing in one portrait file. No effective solution has yet been proposed. Summary of the Invention
[0005] Embodiments of the present invention provide a method and device for analyzing portrait files, a storage medium, and an electronic device, to at least solve the problem that existing portrait clustering technology cannot effectively use information in dimensions such as time, which leads to the presence of multiple people in one portrait file.
[0006] According to an embodiment of the present invention, a method for analyzing a portrait file is provided, comprising: clustering pictures captured at multiple checkpoints to obtain a portrait file of a target object, wherein the portrait file comprises: multiple snapshot pictures; for any two adjacent snapshot pictures among the multiple snapshot pictures, determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to the any two adjacent snapshot pictures, wherein the two checkpoints correspond to the any two adjacent snapshot pictures respectively; when the moving speed is greater than a moving speed threshold, determining that there is a snapshot picture that does not belong to the portrait file among the any two adjacent snapshot pictures, wherein the moving speed threshold is determined according to the positions of the two checkpoints.
[0007] In an exemplary embodiment, determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to any two adjacent captured images includes: obtaining the first position and first time of the target object at the first checkpoint, and the second position and second time of the target object at the second checkpoint, wherein the two checkpoints include: the first checkpoint and the second checkpoint; determining the checkpoint distance difference based on the second position and the first position, and taking the difference between the second time and the first time as the time difference; and taking the quotient of the checkpoint distance difference and the time difference as the moving speed of the target object between the two checkpoints.
[0008] In an exemplary embodiment, when the moving speed is greater than the moving speed threshold, before determining whether there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures, the method further includes: again obtaining the checkpoint distance difference and time difference corresponding to the any two adjacent captured pictures; when the checkpoint distance difference and time difference obtained again are different from the checkpoint distance difference and time difference obtained last time, determining the target moving speed based on the checkpoint distance difference and time difference obtained again, and determining the size relationship between the target moving speed and the moving speed threshold.
[0009] In an exemplary embodiment, after determining the size relationship between the target moving speed and the moving speed threshold, the method further includes: when the size relationship indicates that the target moving speed is greater than the moving speed threshold, determining that there is a captured picture that does not belong to the portrait file among any two adjacent captured pictures.
[0010] In an exemplary embodiment, after determining that there is a snapshot that does not belong to the portrait file in any two adjacent snapshots, the method further includes: obtaining the first facial feature and the second facial feature respectively corresponding to the any two adjacent snapshots; obtaining the similarity of the first facial feature and the second facial feature; when the similarity is less than a similarity threshold, again determining that there is a snapshot that does not belong to the portrait file in any two adjacent snapshots; when the similarity is greater than a similarity threshold, correcting and determining that both of the any two adjacent snapshots belong to the portrait file.
[0011] In an exemplary embodiment, before or after obtaining the similarity between the first facial feature and the second facial feature, the method further includes: determining the similarity threshold in the following manner: determining the target possible probability that there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures based on the difference in the bayonet distance between the two bayonet pictures and the moving speed of the target object between the two bayonet pictures; and determining the similarity threshold corresponding to the target possible probability in the corresponding relationship between the possible probability and the similarity threshold.
[0012] In an exemplary embodiment, after determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to any two adjacent snapshots, the method further includes: when the moving speed is less than or equal to the moving speed threshold, determining that both of the any two adjacent snapshots belong to the portrait file.
[0013] In an exemplary embodiment, before determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to any two adjacent snapshot pictures, the method also includes: sorting the multiple snapshot pictures in the portrait file according to the capture time to obtain sorted snapshot pictures; and determining the any two adjacent snapshot pictures from the sorted snapshot pictures.
[0014] According to another embodiment of the present invention, a method and device for analyzing a portrait file is also provided, including: a clustering module, used to perform portrait clustering on pictures captured at multiple checkpoints to obtain a portrait file of a target object, wherein the portrait file includes: multiple captured pictures; a first determination module, used to determine, for any two adjacent captured pictures among the multiple captured pictures, the moving speed of the target object between the two checkpoints according to the checkpoint distance difference and time difference corresponding to the any two adjacent captured pictures, wherein the two checkpoints correspond to the any two adjacent captured pictures respectively; a second determination module, used to determine, when the moving speed is greater than a moving speed threshold, whether there is a captured picture that does not belong to the portrait file among the any two adjacent captured pictures, wherein the moving speed threshold is determined according to the positions of the two checkpoints.
[0015] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned portrait profile analysis method when running.
[0016] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned method for analyzing a portrait file through the computer program.
[0017] In an embodiment of the present application, the images captured at multiple checkpoints are clustered to obtain a portrait file of the target object including multiple snapshots; for any two adjacent snapshot images among the multiple snapshot images, the moving speed of the target object between the two checkpoints is determined based on the checkpoint distance difference and time difference corresponding to the two adjacent snapshot images, wherein the two checkpoints correspond to the two adjacent snapshot images respectively; when the moving speed is greater than a moving speed threshold, it is determined that there is a snapshot image that does not belong to the portrait file among the two adjacent snapshot images, wherein the moving speed threshold is determined based on the locations of the two checkpoints. The above technical solution solves the problem that the existing portrait clustering technology cannot effectively use information in dimensions such as time, which leads to the existence of multiple people in one file in the portrait file. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1 This is a hardware structure block diagram of a computer terminal for a method for analyzing a portrait file according to an embodiment of the present invention;
[0020] Figure 2 is a flow chart of a method for analyzing a portrait file according to an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of a method for analyzing a portrait file according to an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of a process for calculating the actual moving speed of a target object according to an embodiment of the present invention;
[0023] Figure 5 is a schematic diagram of a process for setting a speed threshold according to an embodiment of the present invention;
[0024] Figure 6 4 is a structural block diagram of a device for analyzing a portrait file according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or similar computing device. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of a computer terminal for analyzing a portrait file according to an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include Figure 1 More or fewer components than shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 Shown are different configurations with more functionality.
[0028] Memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the method for analyzing a portrait profile in the embodiments of the present invention. Processor 102 executes the computer programs stored in memory 104 to execute various functional applications and data processing, thereby implementing the aforementioned method. Memory 104 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some embodiments, memory 104 may further include memory remotely located relative to processor 102, and such remote memory may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0029] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by a computer terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0030] In this embodiment, a method for analyzing a portrait file is provided, which is applied to the above-mentioned computer terminal. Figure 2 FIG. 1 is a flow chart of a method for analyzing a portrait file according to an embodiment of the present invention, the flow chart comprising the following steps:
[0031] Step S202: clustering the images captured at the plurality of camera positions to obtain a portrait file of the target object, wherein the portrait file includes: a plurality of captured images;
[0032] It should be noted that the above-mentioned target objects can be understood as objects within the home area, which may include people, robots, etc., and this application does not impose any restrictions on this.
[0033] It's important to note that this portrait clustering technology is an important technology used in real-world scenarios such as photo album management, identity authentication, and security. Current portrait clustering technology uses whether faces in an image belong to the same person as the clustering criteria. It clusters multiple images containing people, merging images containing faces of the same person into a single group.
[0034] Step S204: for any two adjacent snapshot images among the plurality of snapshot images, determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to the two adjacent snapshot images, wherein the two checkpoints correspond to the two adjacent snapshot images respectively;
[0035] It should be noted that the two checkpoints mentioned above correspond to any two adjacent captured pictures respectively. It can be understood that the photos are captured at the checkpoints, that is, the photos are captured using the checkpoint capture method, so the two checkpoints correspond to any two adjacent captured photos respectively.
[0036] Step S206, when the moving speed is greater than a moving speed threshold, determining whether there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures, wherein the moving speed threshold is determined according to the positions of the two checkpoints.
[0037] It should be noted that the above-mentioned moving speed threshold is the limit value of the target object's moving speed. According to common sense, the target object cannot exceed this moving speed threshold. For example, if the target object reaches the checkpoint 1 by walking or running, the moving speed threshold of the target object is the maximum running speed of a person.
[0038] It should be noted that the above-mentioned "the moving speed threshold is determined according to the positions of the two checkpoints, wherein the moving speed threshold is determined according to the positions of the two checkpoints" can be understood as, since the positions of the checkpoints are different, the moving speed threshold is different. Furthermore, if the means of transportation used by the target object between the two checkpoints can be determined (which can be understood as a way of moving the target object between the two checkpoints), then the moving speed threshold can be determined synchronously according to the positions of the two checkpoints and the means of transportation used by the target object between the two checkpoints. The embodiment of the present invention does not limit this.
[0039] It should be noted that the above-mentioned "when the moving speed is greater than the moving speed threshold, determining that there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures" can be understood as: when the moving speed is greater than the moving speed threshold, it means that the target object cannot move the corresponding checkpoint distance difference within the time difference corresponding to the two adjacent snapshot pictures, so it can be determined that there is a time-space contradiction. Furthermore, since the speed of the target object cannot reach the moving speed threshold, it is determined that there is a snapshot picture that does not belong to the portrait file in the two adjacent snapshot pictures.
[0040] To facilitate understanding, the concept of spatiotemporal contradiction is clarified here. Spatiotemporal contradiction refers to a relatively long movement distance occurring within a relatively short time frame. In the embodiments of the present invention, spatiotemporal contradiction can be understood as: the target object cannot move to the corresponding checkpoint distance difference within the time difference corresponding to two adjacent snapshots, wherein the time difference corresponding to two adjacent snapshots refers to the difference between the times when the snapshots were taken, and the checkpoint distance difference is the distance difference between the checkpoints where the two adjacent snapshots were taken.
[0041] Through the above steps, the images captured at multiple checkpoints are clustered to obtain a portrait profile of the target subject. For any two adjacent snapshots from the multiple snapshots, the target subject's movement speed between the two checkpoints is determined based on the checkpoint distance difference and time difference corresponding to the two adjacent snapshots. If the movement speed is greater than a movement speed threshold, it is determined that one of the two adjacent snapshots does not belong to the portrait profile. The above technical solution solves the problem that existing portrait clustering technologies cannot effectively utilize information in dimensions such as time, which leads to the presence of multiple people in a single portrait profile.
[0042] Optionally, in an exemplary embodiment, the method for clustering portraits from images captured at multiple checkpoints in step S202 includes, but is not limited to, extracting features from the captured portrait images using a convolutional neural network (CNN). A CNN for face recognition typically maps facial images E to a high-dimensional vector and then trains them using a linear classifier, for example, using an activation function and cross-entropy loss. After mapping, faces are distributed in different cones in the feature space, so cosine similarity can be used to measure similarity. Alternatively, if the facial features are normalized using the L2 norm, they are distributed on a sphere, allowing L2 distance to be used for measurement. With the features and metrics in place, it's time to consider selecting a clustering algorithm. Existing clustering algorithms include the K-Means clustering algorithm and its variants. After clustering using these methods, samples within each class are assigned the same label, while samples in different classes are assigned different labels. This allows the samples to be used as a training set.
[0043] Optionally, in an exemplary embodiment, the method for determining the moving speed threshold in step S206 includes but is not limited to: on urban roads, when the target object is riding in a vehicle, the moving speed threshold v1 is the maximum speed limit of the road section where the checkpoint is located + X (taking into account the possibility of speeding during driving); when the target object is walking, the moving speed threshold v2 is the maximum speed that a person can reach when running.
[0044] In an exemplary embodiment, before determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to any two adjacent snapshots, the multiple snapshots in the portrait file are sorted according to the capture time to obtain sorted snapshots; and the any two adjacent snapshots are determined from the sorted snapshots.
[0045] Optionally, in this embodiment, after clustering, the portrait file A is obtained, and all snapshot records in the portrait file are sorted in chronological order and numbered to obtain pictures A1, ..., A n , in pictures A1,…,A n A1 and A2, A2 and A3 are adjacent snapshots.
[0046] In an exemplary embodiment, determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to any two adjacent captured images includes: obtaining the first position and first time of the target object at the first checkpoint, and the second position and second time of the target object at the second checkpoint, wherein the two checkpoints include: the first checkpoint and the second checkpoint; determining the checkpoint distance difference based on the second position and the first position, and taking the difference between the second time and the first time as the time difference; and taking the quotient of the checkpoint distance difference and the time difference as the moving speed of the target object between the two checkpoints.
[0047] Optionally, in this embodiment, when the first position and first time of the target object at the first checkpoint and the second position and second time of the target object at the second checkpoint are obtained, the longitude and latitude of the first checkpoint and the second checkpoint are also obtained.
[0048] It should be noted that the reason for obtaining the latitude and longitude of the first checkpoint and the second checkpoint is: according to the latitude and longitude of the first checkpoint and the second checkpoint, the blocks where the first checkpoint and the second checkpoint are located can be determined, and then the speed limit of motor vehicles in the blocks can be known, so the moving rate threshold v1 of the target object when riding in a means of transportation can be calculated, where v1 is the maximum speed limit of the road section where the checkpoint is located + X (taking into account the possibility of speeding during driving).
[0049] Optionally, in this embodiment, the method for calculating the target object moving speed may be: Figure 4 For example, Figure 4 is a flow chart of calculating the actual moving speed of a target object according to an embodiment of the present invention. Figure 4 middle:
[0050] Step S402: Obtain two adjacent snapshot records A i and A i-1(2≤i≤n), and obtain A i Its capture time information and the capture device's card slot and longitude and latitude information, among which A i is the snapshot record of the i-th camera, A i-1 This is the snapshot record of the i-1th camera mount;
[0051] Step S404: Calculate the actual moving speed of the target object, where the actual moving speed v = A i With A i-1 The difference in the distance between the camera and the camera lens ÷ (A i Snapshot Time-A i-1 capture time).
[0052] In an exemplary embodiment, the method for setting the moving speed threshold may be to Figure 5 For example, Figure 5 is a flow chart of setting a speed threshold according to an embodiment of the present invention; Figure 5 middle:
[0053] Step S502: Setting different maximum thresholds for movement speed according to the block where the checkpoint is located;
[0054] Step S504: Determine whether there is a possibility of time-space contradiction based on the block where the checkpoint is located and the distance to the checkpoint.
[0055] In an exemplary embodiment, before or after obtaining the similarity between the first facial feature and the second facial feature, the similarity threshold is determined in the following manner: the target possible probability that there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures is determined based on the difference in the bayonet distance between the two bayonet pictures and the moving speed of the target object between the two bayonet pictures; and the similarity threshold corresponding to the target possible probability is determined in the corresponding relationship between the possible probability and the similarity threshold.
[0056] It should be noted that in determining the similarity threshold corresponding to the target probability in the correspondence between the possible probability and the similarity threshold, it can be understood that the greater the possible probability of a spatiotemporal contradiction, the greater the similarity threshold corresponding to the target probability. For example, the possible probability of a spatiotemporal contradiction can be divided into: 0-25%, 25%-50%, 50%-75%, and 75%-100%. Among them, the similarity threshold corresponding to the possible probability of 75%-100% can be determined to be 95%.
[0057] It should be noted that, the above-mentioned determination of the target possible probability that there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures based on the difference in the bayonet distance between the two bayonet pictures and the moving speed of the target object between the two bayonet pictures can be placed before or after "obtaining the similarity between the first facial feature and the second facial feature".
[0058] In an exemplary embodiment, a method for determining the possible probability that there is a target snapshot that does not belong to the portrait file in any two adjacent snapshots based on the difference in the checkpoint distance between the two checkpoints and the moving speed of the target object between the two checkpoints includes but is not limited to: ① When the actual moving speed v of the target object is greater than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located, the probability of determining that there is a time-space contradiction is 100%, where v1 = the maximum speed limit of the road section where the checkpoint is located + X (taking into account the possibility of speeding during driving); ② When the distance between the checkpoints where the two adjacent snapshot records are located is less than the threshold β, when ... speed of a person walking ③ When the distance between the checkpoints where two adjacent snapshot records are located is less than the threshold α and greater than the threshold β, where the value range of the threshold α is the distance that people usually choose to take a motor vehicle, when the actual moving speed v of the target object is greater than the maximum moving speed threshold v2 when walking and less than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located, it is determined that there may be a time-space contradiction, and the closer the distance between the checkpoints, the greater the probability of a time-space contradiction.
[0059] It should be noted that, when the distance between the checkpoints where two adjacent snapshot records are located is less than the threshold β, it can be determined that the target object has a high probability of choosing to walk or run between the two checkpoints. Therefore, when the actual movement speed v of the target object is greater than the maximum threshold v2 of the movement speed when a person walks, it is determined that there is a time-space contradiction.
[0060] It should be noted that if the distance between the checkpoints of two adjacent snapshots is less than a threshold α and greater than a threshold β, it can be determined that the target subject is likely to walk or run, or to ride a vehicle, between the two checkpoints. The closer the distance between the checkpoints, the more likely the target subject is to walk or run rather than ride a vehicle. Therefore, when the target subject's actual movement speed v is greater than the maximum walking speed threshold v2 and less than the vehicle movement speed threshold v1 for the road where the checkpoints are located, the closer the distance between the checkpoints, the greater the probability of a spatiotemporal paradox.
[0061] In an exemplary embodiment, after determining the size relationship between the target moving speed and the moving speed threshold, the method further includes: when the size relationship indicates that the target moving speed is greater than the moving speed threshold, determining that there is a captured picture that does not belong to the portrait file among any two adjacent captured pictures.
[0062] Optionally, in this embodiment, two adjacent snapshot records are A i and A i-1 (2≤i≤n), where A i The capture time is A i-1 Afterwards, in the A i and A i-1 If the moving speed of the target object between the two is greater than the moving speed threshold of the motor vehicle, it is determined that A i Candid photos that do not belong to the portrait profile.
[0063] In an exemplary embodiment, after determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to any two adjacent snapshots, if the moving speed is less than or equal to the moving speed threshold, it is determined that any two adjacent snapshots belong to the portrait file.
[0064] It should be noted that the above-mentioned moving speed threshold depends on the road where the checkpoint where the snapshot is recorded is located, and when the distance between the checkpoints is different, the moving speed threshold is also different.
[0065] Optionally, in this embodiment, two adjacent snapshot records are A i and A i-1 (2≤i≤n), where A i The capture time is A i-1 Afterwards, when the snapshot record A i and A i-1 If it does not belong to the following three situations, confirm the snapshot record A i and A i-1All of them are snapshots of people's portraits. These three situations are: ① The actual moving speed v of the target object is greater than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located, where v1 = the maximum speed limit of the road section where the checkpoint is located + X (taking into account the possibility of speeding during driving); ② When the distance between the checkpoints of two adjacent snapshot records is less than the threshold β, when the actual moving speed v of the target object is greater than the maximum moving speed threshold v2 when a person is walking, where the value range of β is the distance that a person usually chooses to walk to, such as 1KM; ③ When the distance between the checkpoints of two adjacent snapshot records is less than the threshold α and greater than the threshold β, where the value range of the threshold α is the distance that a person usually chooses to take a motor vehicle, when the actual moving speed v of the target object is greater than the maximum moving speed threshold v2 when walking and less than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located.
[0066] In an exemplary embodiment, when the moving speed is greater than the moving speed threshold, before determining whether there is a snapshot that does not belong to the portrait file among any two adjacent snapshots, the checkpoint distance difference and time difference corresponding to the any two adjacent snapshots are obtained again; when the checkpoint distance difference and time difference obtained again are different from the checkpoint distance difference and time difference obtained last time, the target moving speed is determined based on the checkpoint distance difference and time difference obtained again, and the size relationship between the target moving speed and the moving speed threshold is determined.
[0067] It should be noted that the purpose of the above exemplary embodiment is: before determining whether there is a snapshot that does not belong to the portrait file between two adjacent snapshots, check whether there is a problem in the recording of the camera mount distance difference and time difference between the two adjacent snapshots, so as to eliminate errors caused by errors in the recording of the camera mount distance difference and time difference.
[0068] Optionally, in this embodiment, the checkpoint time record and distance measurement record may be recorded a second time by manual confirmation to obtain again the checkpoint distance difference and time difference corresponding to any two adjacent snapshot images.
[0069] In an exemplary embodiment, after determining that there is a snapshot that does not belong to the portrait file among any two adjacent snapshots, the first facial feature and the second facial feature respectively corresponding to the any two adjacent snapshots are obtained; the similarity between the first facial feature and the second facial feature is obtained; if the similarity is less than a similarity threshold, it is again determined that there is a snapshot that does not belong to the portrait file among any two adjacent snapshots; if the similarity is greater than the similarity threshold, it is corrected to determine that both of the any two adjacent snapshots belong to the portrait file.
[0070] It should be noted that the above scheme can be understood as a similarity comparison of facial features of any two adjacent snapshots. If the similarity comparison is successful, it is determined that there is no time-space contradiction, and the two snapshot records being compared are considered to belong to the portrait file; if the similarity comparison fails, it is determined that there is a time-space contradiction, and the two snapshot records being compared are considered not to belong to the portrait file.
[0071] Optionally, in this embodiment, the similarity between the first and second facial features can be obtained by the following method: Step 1: Two adjacent snapshots; Step 2: Obtain facial features from the two images using a neural network model and output key features, storing them in a first matrix; Step 3: Obtain key features from a facial feature database and store them in a second matrix; Step 4: Compare the first and second matrices using cosine similarity; Step 5: Take the maximum value and corresponding bit sequence of each column of the compared matrices to obtain a comparison value for each facial feature in the first matrix, complete the comparison, and output the key features in Step 2 as 512 dimensions. The first matrix includes m rows, each row including 512-dimensional key features. Furthermore, the second matrix includes n rows, each row including 512-dimensional key features.
[0072] In order to better understand the process of the above-mentioned portrait file analysis method, the implementation method flow of the above-mentioned portrait file analysis method is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present invention.
[0073] In this embodiment, a method for analyzing a portrait file is provided. Figure 3 is a schematic diagram of a method for analyzing a portrait file according to an embodiment of the present invention, such as Figure 3 As shown, the specific steps are as follows:
[0074] Step S302: Obtain the face file A obtained by clustering, which includes n pictures A1, ..., A1 sorted by capture time. n ;
[0075] Step S304: Record A based on two adjacent snapshots i and A i-1 The actual moving rate is calculated based on the time difference and the bayonet distance difference of 1 (2≤i≤n);
[0076] Step S306: Determine whether the actual moving speed is greater than the moving speed threshold. If so, proceed to step S308; if not, proceed to step S314.
[0077] Step S308: Verify the checkpoint time and spacing; if the verification is correct, proceed to step S310; if the verification is incorrect, proceed to step S318;
[0078] Step S310: Perform similarity comparison on the snapshot records that may have temporal and spatial contradictions; if the similarity comparison fails, proceed to step S312; if the similarity comparison succeeds, proceed to step S316;
[0079] Step S312: Determine that there is a time-space contradiction and consider that the snapshot record A i Facial images that do not belong to file A;
[0080] S314: Clustering is successful, and it is determined that there is no time-space contradiction;
[0081] S316: Determine that there is no time-space contradiction, and consider that the captured record A i A facial image belonging to file A;
[0082] S318: Calibrate the mount time and mount distance, and return to step S304.
[0083] Through the above steps, the problem that the existing portrait clustering technology cannot effectively use information in dimensions such as time and space, which leads to the existence of multiple people in one portrait file, is solved. Through the above technical solution of the present invention, the vehicle speed limit of the block where the checkpoint is located and the distance between adjacent checkpoints are used to set a dynamic movement rate threshold, and the possibility of using different travel modes is used to judge whether there is a possibility of time-space contradiction. In this way, the misjudgment caused by using only a fixed movement rate threshold to judge time-space contradiction is improved, and the error rate is reduced. In the process of comparing the actual movement rate with the movement rate threshold, the concept of the possibility of time-space contradiction is proposed. Since different travel modes may be selected within different travel distance ranges, this proposal proposes a variety of movement rate threshold comparison methods under different scenarios, corresponding to the possibility of different time-space contradictions.
[0084] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
[0085] This embodiment also provides a device for analyzing a portrait profile. This device is used to implement the above-described embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0086] Figure 6 FIG. 1 is a structural block diagram of a device for analyzing a portrait file according to an embodiment of the present invention; FIG. Figure 6 Shown, including:
[0087] The clustering module 62 is used to cluster the images captured at multiple camera positions to obtain a portrait file of the target object, wherein the portrait file includes: multiple captured images;
[0088] It should be noted that the above-mentioned target objects can be understood as objects within the home area, which may include people, robots, etc., and this application does not impose any restrictions on this.
[0089] It's important to note that this portrait clustering technology is an important technology used in real-world scenarios such as photo album management, identity authentication, and security. Current portrait clustering technology uses whether faces in an image belong to the same person as the clustering criteria. It clusters multiple images containing people, merging images containing faces of the same person into a single group.
[0090] A first determining module 64 is configured to determine, for any two adjacent snapshot images among the plurality of snapshot images, a moving speed of the target object between the two checkpoints according to a checkpoint distance difference and a time difference corresponding to the two adjacent snapshot images, wherein the two checkpoints correspond to the two adjacent snapshot images, respectively;
[0091] It should be noted that the two checkpoints mentioned above correspond to any two adjacent captured pictures respectively. It can be understood that the photos are captured at the checkpoints, that is, the photos are captured using the checkpoint capture method, so the two checkpoints correspond to any two adjacent captured photos respectively.
[0092] The second determining module 66 determines that there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures when the moving speed is greater than a moving speed threshold, wherein the moving speed threshold is determined according to the positions of the two checkpoints.
[0093] It should be noted that the above-mentioned moving speed threshold is the limit value of the target object's moving speed. According to common sense, the target object cannot exceed this moving speed threshold. For example, if the target object reaches the checkpoint 1 by walking or running, the moving speed threshold of the target object is the maximum running speed of a person.
[0094] It should be noted that the above-mentioned "the moving speed threshold is determined according to the positions of the two checkpoints, wherein the moving speed threshold is determined according to the positions of the two checkpoints" can be understood as, since the positions of the checkpoints are different, the moving speed threshold is different. Furthermore, if the means of transportation used by the target object between the two checkpoints can be determined (which can be understood as a way of moving the target object between the two checkpoints), then the moving speed threshold can be determined synchronously according to the positions of the two checkpoints and the means of transportation used by the target object between the two checkpoints. The embodiment of the present invention does not limit this.
[0095] It should be noted that the above-mentioned "when the moving speed is greater than the moving speed threshold, determining that there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures" can be understood as: when the moving speed is greater than the moving speed threshold, it means that the target object cannot move the corresponding checkpoint distance difference within the time difference corresponding to the two adjacent snapshot pictures, so it can be determined that there is a time-space contradiction. Furthermore, since the speed of the target object cannot reach the moving speed threshold, it is determined that there is a snapshot picture that does not belong to the portrait file in the two adjacent snapshot pictures.
[0096] To facilitate understanding, the concept of spatiotemporal contradiction is clarified here. Spatiotemporal contradiction refers to a relatively long movement distance occurring within a relatively short time frame. In the embodiments of the present invention, spatiotemporal contradiction can be understood as: the target object cannot move to the corresponding checkpoint distance difference within the time difference corresponding to two adjacent snapshots, wherein the time difference corresponding to two adjacent snapshots refers to the difference between the times when the snapshots were taken, and the checkpoint distance difference is the distance difference between the checkpoints where the two adjacent snapshots were taken.
[0097] The above-mentioned device clusters portraits of images captured at multiple checkpoints to obtain a portrait profile of the target subject. For any two adjacent captured images from the multiple checkpoints, the target subject's movement speed between the two checkpoints is determined based on the checkpoint distance difference and time difference corresponding to the two adjacent captured images. If the movement speed exceeds a movement speed threshold, it is determined that one of the two adjacent captured images does not belong to the portrait profile. The above-mentioned device solves the problem that existing portrait clustering technologies cannot effectively utilize information in dimensions such as time, which leads to the presence of multiple people in a single portrait profile.
[0098] Optionally, in an exemplary embodiment, clustering module 62 is also used to cluster portraits from images captured at multiple checkpoints, including but not limited to extracting features from captured portrait images using a convolutional neural network (CNN). A CNN for face recognition typically maps facial images E to a high-dimensional vector and then trains them using a linear classifier, for example, using an activation function and cross-entropy loss. After mapping, faces are distributed in different cones in feature space, so cosine similarity can be used to measure similarity. Alternatively, if facial features are normalized using the L2 norm, they are distributed on a sphere, allowing L2 distance to be used for measurement. With the features and metrics in place, it's time to consider selecting a clustering algorithm. Existing clustering algorithms include the K-Means clustering algorithm and its variants. After clustering using these methods, samples in each class are assigned the same label, while different classes are assigned different labels, allowing them to serve as a training set.
[0099] Optionally, in an exemplary embodiment, the second determination module 66 is also used to set, on urban roads, a moving speed threshold v1 when the target object is riding a vehicle to the maximum speed limit + X of the road section where the checkpoint is located (taking into account the possibility of speeding during driving); and to set a moving speed threshold v2 when the target object is walking to the maximum speed that a person can reach when running.
[0100] In an exemplary embodiment, the first determination module 64 is also used to sort the multiple snapshots in the portrait file according to the snapshot time before determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to the any two adjacent snapshots to obtain sorted snapshots; and determine the any two adjacent snapshots from the sorted snapshots.
[0101] Optionally, in this embodiment, the apparatus further comprises: an acquisition module, which is used to acquire the portrait file A after clustering is completed, sort all the snapshot records in the portrait file in chronological order and label them, and obtain pictures A1, ..., A n , in pictures A1,…,A n A1 and A2, A2 and A3 are adjacent snapshots.
[0102] In an exemplary embodiment, the first determination module 64 is also used to obtain the first position and first time of the target object at the first checkpoint, and the second position and second time of the target object at the second checkpoint, wherein the two checkpoints include: the first checkpoint and the second checkpoint; determine the checkpoint distance difference based on the second position and the first position, and use the difference between the second time and the first time as the time difference; and use the quotient of the checkpoint distance difference and the time difference as the moving speed of the target object between the two checkpoints.
[0103] Optionally, in this embodiment, the above-mentioned device also includes: an acquisition module, which is used to obtain the first position and first time of the target object at the first checkpoint, and the second position and second time of the target object at the second checkpoint, and the longitude and latitude of the first checkpoint and the second checkpoint are also obtained.
[0104] It should be noted that the reason for obtaining the latitude and longitude of the first checkpoint and the second checkpoint is: according to the latitude and longitude of the first checkpoint and the second checkpoint, the blocks where the first checkpoint and the second checkpoint are located can be determined, and then the speed limit of motor vehicles in the blocks can be known, so the moving rate threshold v1 of the target object when riding in a means of transportation can be calculated, where v1 is the maximum speed limit of the road section where the checkpoint is located + X (taking into account the possibility of speeding during driving).
[0105] Optionally, in this embodiment, the above device further includes a calculation module, which is used to calculate the moving speed of the target object. Figure 4 For example, Figure 4 is a flow chart of calculating the actual moving speed of a target object according to an embodiment of the present invention. Figure 4 middle:
[0106] Step S402: Obtain two adjacent snapshot records A i and A i-1 (2≤i≤n), and obtain A i Its capture time information and the capture device's card slot and longitude and latitude information, among which A i is the snapshot record of the i-th camera, A i-1 This is the snapshot record of the i-1th camera mount;
[0107] Step S404: Calculate the actual moving speed of the target object, where the actual moving speed v = A i With A i-1 The difference in the distance between the camera and the camera lens ÷ (A i Snapshot Time-A i-1 capture time).
[0108] In an exemplary embodiment, the second determining module 66 is further configured to set a rate threshold. Figure 5 For example, Figure 5 is a flow chart of setting a speed threshold according to an embodiment of the present invention; Figure 5 middle:
[0109] Step S502: Setting different maximum thresholds for movement speed according to the block where the checkpoint is located;
[0110] Step S504: Determine whether there is a possibility of time-space contradiction based on the block where the checkpoint is located and the distance to the checkpoint.
[0111] In an exemplary embodiment, the second determination module 66 is also used to determine the similarity threshold in the following manner: determining the target possible probability that there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures based on the difference in the bayonet distance between the two bayonet pictures and the moving speed of the target object between the two bayonet pictures; and determining the similarity threshold corresponding to the target possible probability in the corresponding relationship between the possible probability and the similarity threshold.
[0112] It should be noted that in determining the similarity threshold corresponding to the target probability in the correspondence between the possible probability and the similarity threshold, it can be understood that the greater the possible probability of a spatiotemporal contradiction, the greater the similarity threshold corresponding to the target probability. For example, the possible probability of a spatiotemporal contradiction can be divided into: 0-25%, 25%-50%, 50%-75%, and 75%-100%. Among them, the similarity threshold corresponding to the possible probability of 75%-100% can be determined to be 95%.
[0113] It should be noted that, the above-mentioned determination of the target possible probability that there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures based on the difference in the bayonet distance between the two bayonet pictures and the moving speed of the target object between the two bayonet pictures can be placed before or after "obtaining the similarity between the first facial feature and the second facial feature".
[0114] In an exemplary embodiment, the second determination module 66 is further used to determine the target probability that there is a snapshot image that does not belong to the portrait file in any two adjacent snapshot images based on the difference in the checkpoint distance between the two checkpoints and the moving speed of the target object between the two checkpoints in one of the following ways: ① When the actual moving speed v of the target object is greater than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located, the probability of determining that there is a time-space contradiction is 100%, where v1 = the maximum speed limit of the road section where the checkpoint is located + X (taking into account the possibility of speeding during driving); ② When the distance between the checkpoints where the two adjacent snapshot records are located is less than the threshold β, when the actual moving speed v of the target object is greater than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located, the probability of determining that there is a time-space contradiction is 100%, where v1 = the maximum speed limit of the road section where the checkpoint is located + X (taking into account the possibility of speeding during driving); When it is greater than the maximum threshold v2 of the moving speed when a person is walking, it is judged that the probability of the existence of a spatiotemporal contradiction is greater, and the greater the actual moving speed v of the target object, the greater the probability of the existence of a spatiotemporal contradiction, where the value range of β is the distance that people usually choose to walk to, such as 1KM; ③ When the distance between the checkpoints where two adjacent snapshot records are located is less than the threshold α and greater than the threshold β, where the value range of the threshold α is the distance that people usually choose to take a motor vehicle, when the actual moving speed v of the target object is greater than the maximum threshold v2 of the moving speed when walking and less than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located, it is judged that there may be a spatiotemporal contradiction, and the closer the distance between the checkpoints, the greater the probability of the existence of a spatiotemporal contradiction.
[0115] It should be noted that, when the distance between the checkpoints where two adjacent snapshot records are located is less than the threshold β, it can be determined that the target object has a high probability of choosing to walk or run between the two checkpoints. Therefore, when the actual movement speed v of the target object is greater than the maximum threshold v2 of the movement speed when a person walks, it is determined that there is a time-space contradiction.
[0116] It should be noted that if the distance between the checkpoints of two adjacent snapshots is less than a threshold α and greater than a threshold β, it can be determined that the target subject is likely to walk or run, or to ride a vehicle, between the two checkpoints. The closer the distance between the checkpoints, the more likely the target subject is to walk or run rather than ride a vehicle. Therefore, when the target subject's actual movement speed v is greater than the maximum walking speed threshold v2 and less than the vehicle movement speed threshold v1 for the road where the checkpoints are located, the closer the distance between the checkpoints, the greater the probability of a spatiotemporal paradox.
[0117] In an exemplary embodiment, the second determining module 66 is further configured to determine that there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures when the size relationship indicates that the target moving speed is greater than the moving speed threshold.
[0118] Optionally, in this embodiment, the second determining module 66 is further configured to: i and A i-1 (2≤i≤n), where A i The capture time is A i-1 Afterwards, in the A i and A i-1 If the moving speed of the target object between the two is greater than the moving speed threshold of the motor vehicle, it is determined that A i Candid photos that do not belong to the portrait profile.
[0119] In an exemplary embodiment, the second determination module 66 is also used to determine the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to any two adjacent snapshots, and when the moving speed is less than or equal to the moving speed threshold, determine that any two adjacent snapshots belong to the portrait file.
[0120] It should be noted that the above-mentioned moving speed threshold depends on the road where the checkpoint where the snapshot is recorded is located, and when the distance between the checkpoints is different, the moving speed threshold is also different.
[0121] Optionally, in this embodiment, the second determining module 66 is further configured to: i and A i-1 (2≤i≤n), where A i The capture time is A i-1 Afterwards, when the snapshot record A i and A i-1 If it does not belong to the following three situations, confirm the snapshot record A i and A i-1 All of them are snapshots of people's portraits. These three situations are: ① The actual moving speed v of the target object is greater than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located, where v1 = the maximum speed limit of the road section where the checkpoint is located + X (taking into account the possibility of speeding during driving); ② When the distance between the checkpoints of two adjacent snapshot records is less than the threshold β, when the actual moving speed v of the target object is greater than the maximum moving speed threshold v2 when a person is walking, where the value range of β is the distance that a person usually chooses to walk to, such as 1KM; ③ When the distance between the checkpoints of two adjacent snapshot records is less than the threshold α and greater than the threshold β, where the value range of the threshold α is the distance that a person usually chooses to take a motor vehicle, when the actual moving speed v of the target object is greater than the maximum moving speed threshold v2 when walking and less than the motor vehicle moving speed threshold v1 of the road where the checkpoint is located.
[0122] In an exemplary embodiment, the second determination module 66 is also used to, when the moving speed is greater than the moving speed threshold, before determining whether there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures, again obtain the checkpoint distance difference and time difference corresponding to the any two adjacent snapshot pictures; when the checkpoint distance difference and time difference obtained again are different from the checkpoint distance difference and time difference obtained last time, determine the target moving speed based on the checkpoint distance difference and time difference obtained again, and determine the size relationship between the target moving speed and the moving speed threshold.
[0123] It should be noted that the purpose of the above exemplary embodiment is: before determining whether there is a snapshot that does not belong to the portrait file between two adjacent snapshots, check whether there is a problem in the recording of the camera mount distance difference and time difference between the two adjacent snapshots, so as to eliminate errors caused by errors in the recording of the camera mount distance difference and time difference.
[0124] Optionally, in this embodiment, the checkpoint time record and distance measurement record may be recorded a second time by manual confirmation to obtain again the checkpoint distance difference and time difference corresponding to any two adjacent snapshot images.
[0125] In an exemplary embodiment, the above-mentioned device also includes: an acquisition module, which is used to: obtain the first facial feature and the second facial feature respectively corresponding to any two adjacent captured pictures; obtain the similarity between the first facial feature and the second facial feature; when the similarity is less than the similarity threshold, again determine that there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures; when the similarity is greater than the similarity threshold, correct and determine that both of the two adjacent captured pictures belong to the portrait file.
[0126] It should be noted that the above scheme can be understood as a similarity comparison of facial features of any two adjacent snapshots. If the similarity comparison is successful, it is determined that there is no time-space contradiction, and the two snapshot records being compared are considered to belong to the portrait file; if the similarity comparison fails, it is determined that there is a time-space contradiction, and the two snapshot records being compared are considered not to belong to the portrait file.
[0127] Optionally, in this embodiment, the acquisition module is further configured to obtain the similarity between the first and second facial features in the following manner: Step 1: Two adjacent snapshots; Step 2: Acquire facial features in the two images using a neural network model and output key features, storing them in a first matrix; Step 3: Acquire key features from a facial feature database and store them in a second matrix; Step 4: Compare the first and second matrices using cosine similarity; Step 5: Take the maximum value and corresponding bit sequence of each column of the compared matrices to obtain a comparison value for each facial feature in the first matrix, complete the comparison, and output the key features in Step 2 as 512 dimensions. The first matrix includes m rows, each row including 512-dimensional key features. Furthermore, the second matrix includes n rows, each row including 512-dimensional key features.
[0128] An embodiment of the present invention further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0129] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0130] S1, clustering portraits of images captured at multiple camera locations to obtain a portrait file of a target object, wherein the portrait file includes: multiple captured images;
[0131] S2, for any two adjacent snapshot images among the plurality of snapshot images, determining a moving speed of the target object between the two checkpoints based on a checkpoint distance difference and a time difference corresponding to the two adjacent snapshot images, wherein the two checkpoints correspond to the two adjacent snapshot images, respectively;
[0132] S3, when the moving speed is greater than a moving speed threshold, determining whether there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures, wherein the moving speed threshold is determined according to the positions of the two checkpoints.
[0133] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0134] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0135] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0136] S1, clustering portraits of images captured at multiple camera locations to obtain a portrait file of a target object, wherein the portrait file includes: multiple captured images;
[0137] S2, for any two adjacent snapshot images among the plurality of snapshot images, determining a moving speed of the target object between the two checkpoints based on a checkpoint distance difference and a time difference corresponding to the two adjacent snapshot images, wherein the two checkpoints correspond to the two adjacent snapshot images, respectively;
[0138] S3, when the moving speed is greater than a moving speed threshold, determining whether there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures, wherein the moving speed threshold is determined according to the positions of the two checkpoints.
[0139] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0140] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0141] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, centralized on a single computing device, or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0142] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for analyzing a portrait file, characterized in that: include: Performing portrait clustering on the pictures captured at multiple checkpoints to obtain a portrait file of the target object, wherein the portrait file includes: multiple captured pictures; For any two adjacent snapshot images among the plurality of snapshot images, determining the moving speed of the target object between the two checkpoints according to the checkpoint distance difference and time difference corresponding to the two adjacent snapshot images, wherein the two checkpoints correspond to the two adjacent snapshot images respectively; When the moving speed is greater than a moving speed threshold, determining that there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures, wherein the moving speed threshold is determined according to the positions of the two checkpoints; After determining that there is a captured picture that does not belong to the portrait file among any two adjacent captured pictures, the method further includes: Obtaining the first facial feature and the second facial feature corresponding to any two adjacent captured images respectively; Obtaining a similarity between the first facial feature and the second facial feature; When the similarity is less than the similarity threshold, determining again whether there is a captured picture that does not belong to the portrait file among the any two adjacent captured pictures; In the case where the similarity is greater than a similarity threshold, correcting and determining that any two adjacent captured pictures belong to the captured pictures of the portrait file; Before or after obtaining the similarity between the first facial feature and the second facial feature, the method further includes: The similarity threshold is determined by: Determining a probability that there is a target captured image that does not belong to the portrait file in any two adjacent captured images based on a difference in the distance between the two capture ports and a moving speed of the target object between the two capture ports; The similarity threshold corresponding to the target possible probability is determined in the corresponding relationship between the possible probability and the similarity threshold.
2. The method for analyzing a portrait file according to claim 1, characterized in that: Determining the moving speed of the target object between the two checkpoints according to the checkpoint distance difference and the time difference corresponding to any two adjacent captured images includes: Acquire a first position and a first time of the target object at a first bayonet, and a second position and a second time of the target object at a second bayonet, wherein the two bayonet ports include: the first bayonet and the second bayonet; determining the bayonet distance difference according to the second position and the first position, and taking the difference between the second time and the first time as the time difference; The quotient of the checkpoint distance difference and the time difference is used as the moving speed of the target object between the two checkpoints.
3. The method for analyzing a portrait file according to claim 1, wherein: When the moving speed is greater than the moving speed threshold, before determining that there is a captured picture that does not belong to the portrait file in any two adjacent captured pictures, the method further includes: Obtain the camera distance difference and time difference corresponding to any two adjacent captured images again; When the reacquired bayonet distance difference and time difference are different from the bayonet distance difference and time difference acquired last time, the target moving speed is determined according to the reacquired bayonet distance difference and time difference, and the magnitude relationship between the target moving speed and the moving speed threshold is determined.
4. The method for analyzing a portrait file according to claim 3, characterized in that: After determining the magnitude relationship between the target moving speed and the moving speed threshold, the method further includes: When the size relationship indicates that the target moving speed is greater than the moving speed threshold, it is determined that there is a captured picture that does not belong to the portrait file among the any two adjacent captured pictures.
5. The method for analyzing a portrait file according to claim 1, wherein: After determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and the time difference corresponding to any two adjacent captured images, the method further includes: In a case where the moving speed is less than or equal to a moving speed threshold, it is determined that both of the any two adjacent captured pictures belong to the captured pictures of the portrait file.
6. The method for analyzing a portrait file according to claim 1, wherein: Before determining the moving speed of the target object between the two checkpoints based on the checkpoint distance difference and time difference corresponding to any two adjacent captured images, the method further includes: Sorting the plurality of snapshot images in the portrait file according to the capture time to obtain sorted snapshot images; Determine the arbitrary two adjacent captured images from the sorted captured images.
7. A device for analyzing a portrait file, characterized in that: include: A clustering module is used to cluster portraits of the pictures captured at multiple checkpoints to obtain a portrait file of the target object, wherein the portrait file includes: multiple captured pictures; A first determining module is configured to determine, for any two adjacent snapshot images among the plurality of snapshot images, a moving speed of the target object between the two checkpoints according to a checkpoint distance difference and a time difference corresponding to the two adjacent snapshot images, wherein the two checkpoints correspond to the two adjacent snapshot images respectively; a second determining module, configured to determine, when the moving speed is greater than a moving speed threshold, whether there is a captured picture that does not belong to the portrait file among the any two adjacent captured pictures, wherein the moving speed threshold is determined according to the positions of the two checkpoints; The second determining module is further configured to obtain first facial features and second facial features corresponding to the two adjacent captured images, respectively; obtain similarity between the first facial features and the second facial features; if the similarity is less than a similarity threshold, re-determine that there is a captured image that does not belong to the portrait file in the two adjacent captured images; and if the similarity is greater than the similarity threshold, correct and determine that both of the two adjacent captured images belong to the portrait file. Among them, the second determination module is also used to determine the similarity threshold in the following manner: determine the target possible probability that there is a snapshot picture that does not belong to the portrait file in any two adjacent snapshot pictures based on the difference in the bayonet distance between the two bayonet pictures and the moving speed of the target object between the two bayonet pictures; and determine the similarity threshold corresponding to the target possible probability in the corresponding relationship between the possible probability and the similarity threshold.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein the method according to any one of claims 1 to 6 is executed when the program is executed.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
Citation Information
Patent Citations
Face image clustering method, system, product and medium
CN110516586A
Face clustering method and device and computer readable storage medium
CN111738221A
Regional foothold determination method, system and device based on portrait grading, and medium
CN112232178A