Database image updating method, electronic device and computer readable storage medium
By determining the target angle interval from multiple candidate angle intervals in the database image update method, and updating the database image using similarity and count values, the problems of low accuracy and high consumption of database image update in the prior art are solved, and the improvement is achieved Efficient database image updates and improvements in accuracy.
Patent Information
- Application Number
- CN202411130605.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-08-16
AI Technical Summary
The existing database image update method is updated in a fixed cycle, which makes it difficult to guarantee the quality of newly added database images, with low accuracy, and high update consumption.
By acquiring the image to be identified, the target angle interval of the object to be matched is determined from multiple candidate angle intervals, the database image is updated using similarity and count values, and only match and update within the target angle interval, reduce consumption, and the image is Reset count value when replaced.
Improve the accuracy of database images, reduce consumption during updates, and realize automatic update of database images and higher accuracy.
Smart Images

Figure CN118673168B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a database image updating method, an electronic device and a computer-readable storage medium. Background Art
[0002] Database matching is an important way to identify objects, which places high demands on the accuracy of database images in the database. Since many types of objects will change over time, database images need to be updated in a timely manner. In the prior art, images are usually re-collected at a fixed period for unified updates, but this update method consumes a lot of energy and it is difficult to guarantee the quality of newly added database images, resulting in low accuracy of database images. In view of this, how to improve the accuracy of database images and reduce the consumption during updates has become an urgent problem to be solved. Summary of the invention
[0003] The main technical problem solved by the present application is to provide a database image updating method, an electronic device and a computer-readable storage medium, which can improve the accuracy of the database image and reduce the consumption during the update.
[0004] To solve the above technical problems, the first aspect of the present application provides a database image updating method, comprising: obtaining an image to be identified, and determining a target angle interval corresponding to an object to be matched in the image to be identified from multiple candidate angle intervals; wherein the database includes multiple reference objects, and each of the reference objects includes at least one database image within the candidate angle interval; obtaining the similarity between the image to be identified and the database image within the target angle interval, and determining the target object matched by the object to be matched from all the reference objects based on the similarity; obtaining a count value corresponding to the database image of the target object within the target angle interval, and updating the database image and its corresponding count value based on the similarity and the count value; wherein the count value is incremented when the database image is paired with the similarity of the image to be identified, and is reset when the database image is replaced and updated.
[0005] To solve the above technical problems, the second aspect of the present application provides an electronic device, which includes: a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method described in the first aspect.
[0006] In order to solve the above technical problem, the third aspect of the present application provides a computer-readable storage medium on which program data is stored. When the program data is executed by a processor, the method described in the first aspect is implemented.
[0007] The above scheme obtains an image to be identified, selects a corresponding candidate angle interval for the object to be matched in the image to be identified from multiple candidate angle intervals as the target angle interval of the object to be matched, wherein the database includes multiple reference objects, and the angles corresponding to the reference objects are divided into multiple candidate angle intervals, and each reference object is pre-collected with at least one database image in the candidate angle interval, obtains the similarity between the image to be identified and the database image in the target angle interval, and determines the reference object matching the object to be matched from all reference objects based on the similarity as the target object of the object to be matched, so that when determining the target object, only matching within the target angle interval is required, reducing the consumption during matching, and obtaining the count value corresponding to the database image of the target object in the target object interval, wherein the count value is incremented when the database image and the image to be identified are paired in similarity, and is reset when the database image is replaced and updated, and based on the similarity and the count value, the database image in the database and the count value of the database image are updated, so that the similarity between the images and the number of times the database image is matched can be integrated within the target angle interval, and the database image in the database can be automatically updated to a better image, thereby realizing automatic update of the database image, so that the database image has higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0009] Figure 1 It is a flowchart of an implementation method of a database image updating method of the present application;
[0010] Figure 2 It is a flowchart of another implementation method of the database image updating method of the present application;
[0011] Figure 3 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0012] Figure 4 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments, and different implementation methods can be adaptively combined. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0014] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0015] The database image updating method provided in the present application is used to update the database image in the database, and its corresponding execution subject is a terminal capable of performing image processing.
[0016] See also Figure 1 , Figure 1 1 is a flow chart of an implementation method of a database image updating method of the present application, the method comprising:
[0017] S101: Acquire an image to be identified, and determine a target angle interval corresponding to an object to be matched in the image to be identified from multiple candidate angle intervals; wherein a database includes multiple reference objects, and each reference object includes at least one database image within a candidate angle interval.
[0018] Specifically, an image to be identified is obtained, and a corresponding candidate angle interval is selected for an object to be matched in the image to be identified from multiple candidate angle intervals as a target angle interval for the object to be matched, wherein a database includes multiple reference objects, and the angles corresponding to the reference objects are divided into multiple candidate angle intervals, and each reference object is pre-collected with at least one database image within the candidate angle interval.
[0019] It can be understood that the images to be identified have the same size and are located in the same coordinate system after preprocessing.
[0020] In some implementation scenarios, an image to be identified is obtained, an angle parameter corresponding to an object to be matched in the image to be identified is determined, and a candidate angle interval corresponding to the angle parameter is obtained as a target angle interval of the object to be matched. The angle parameter includes the Euler angle of the object to be matched.
[0021] In some implementation scenarios, an image to be identified is obtained, the identification coordinates of the identification points on the object to be matched in the image to be identified are determined, the detection angle of the object to be matched in the detection coordinate system is determined based on the identification coordinates, and the candidate angle interval corresponding to the detection angle is obtained as the target angle interval of the object to be matched.
[0022] In a specific implementation scenario, an image to be identified is obtained, and the angle parameters corresponding to the object to be matched in the image to be identified are determined, wherein the angle parameters include the Euler angles of the object to be matched, and the Euler angles correspond to rotation values around three axes: pitch, yaw, and roll. The reference object is divided into five angle intervals, namely, the facing angle, the left angle (yaw 0~90 degrees), the right angle (yaw 0~ -90 degrees), the upward angle (pitch 0~90 degrees), and the downward angle (pitch 0~ -90 degrees). Among them, in other specific implementation scenarios, it can also include the left tilt angle (roll 0~90 degrees) and the right tilt angle (roll 0~ -90), and different angle intervals can be customized, and this application does not impose specific restrictions on this.
[0023] It can be understood that the database includes multiple reference objects, and the angles corresponding to the reference objects are divided into multiple candidate angle intervals, wherein it is more preferred that each reference object includes at least one database image within each angle interval, thereby facilitating matching, and each reference object including at least one database image within the candidate angle interval is the minimum requirement during pre-configuration in the initial stage, thereby reducing the difficulty of data preparation.
[0024] S102: Obtain the similarity between the image to be identified and the database image within the target angle interval, and determine the target object that matches the object to be matched from all reference objects based on the similarity.
[0025] Specifically, the similarity between the image to be identified and the database image within the target angle interval is obtained, and based on the similarity, a reference object matching the object to be matched is determined from all reference objects as the target object of the object to be matched.
[0026] It is understandable that when determining the target object, it is only necessary to perform matching within the target angle range, thereby reducing the consumption during matching.
[0027] In some implementation scenarios, a neural network model is used to extract image features of the image to be identified and the database image within the target angle interval, and the similarity between the image to be identified and the database image within the target angle interval is determined based on the extracted image features. The neural network model may include but is not limited to convolutional neural networks (CNNs) and recurrent neural networks (RNNs).
[0028] In some implementation scenarios, the image to be identified and the database image within the target angle range are input into the large language model to obtain the similarity between the image to be identified and the database image within the target angle range output by the large language model. The large language model may include but is not limited to deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), long short-term memory networks (LSTM), and generative pre-trained Transformer models, etc. The specific construction and specific deployment of the large language model are not specifically limited here.
[0029] Furthermore, after obtaining the similarity between the image to be identified and the database image within the target angle interval, a reference object matching the object to be matched is determined from all reference objects based on the similarity as a target object of the object to be matched.
[0030] In some implementation scenarios, a reference object whose similarity exceeds a first recognition threshold is obtained, and the reference object whose similarity to the object to be matched is the highest and exceeds the first recognition threshold is used as a target object to be matched with the object to be matched.
[0031] In some implementation scenarios, the average similarity between all database images of the reference object within the target angle range and the image to be identified is obtained, and the reference object with the highest average similarity is used as the target object to be matched by the object to be matched.
[0032] S103: Obtain the count value corresponding to the database image of the target object within the target angle range, and update the database image and its corresponding count value based on the similarity and the count value; wherein the count value is incremented when the database image is paired with the similarity of the image to be identified, and is reset when the database image is replaced and updated.
[0033] Specifically, a count value corresponding to a database image of the target object within the target object interval is obtained, wherein the count value is incremented when the database image is paired with the image to be identified in similarity, and is reset when the database image is replaced and updated.
[0034] Furthermore, based on the similarity and count value, the database image in the database and the count value of the database image are updated, so that within the target angle range, the similarity between the images and the number of times the database image is matched can be integrated to automatically update the database image in the database to a better image, thereby realizing automatic updating of the database image and making the database image have higher accuracy.
[0035] In some implementation scenarios, the count value corresponding to the database image of the target object within the target angle range is obtained, the count sum value corresponding to the count value is determined, and it is judged whether the count sum value exceeds the count threshold. If it does not exceed, the count value of the database image paired with the similarity of the image to be identified is incremented. If it exceeds, the database image with the smallest count value is replaced and updated with the image to be identified, and the count value corresponding to the newly added database image is reset. Therefore, when the database image of the target object within the target angle range is matched multiple times, the database image with the lowest number of matches is replaced to improve the accuracy of the database image.
[0036] In some implementation scenarios, the count values corresponding to the database images of the target object within the target angle interval are obtained, the count difference between the maximum count value and the minimum count value is determined, and it is judged whether the count difference exceeds the difference threshold. If not, the count value of the database image paired with the similarity of the image to be identified is incremented. If exceeded, the database image with the smallest count value is replaced and updated with the image to be identified, and the count value corresponding to each database image of the target object within the target angle interval is reset, so that the database image is re-counted as a whole after the database image is updated, and when the count difference exceeds the difference threshold, the database image with the lowest number of matches is replaced to improve the accuracy of the database image.
[0037] It should be noted that the similarity pairing condition between the database image and the image to be identified can be that the similarity is maximum, or that the similarity exceeds a preset similarity threshold, and this application does not impose any specific restrictions on this.
[0038] The above scheme obtains an image to be identified, selects a corresponding candidate angle interval for the object to be matched in the image to be identified from multiple candidate angle intervals as the target angle interval of the object to be matched, wherein the database includes multiple reference objects, and the angles corresponding to the reference objects are divided into multiple candidate angle intervals, and each reference object is pre-collected with at least one database image in the candidate angle interval, obtains the similarity between the image to be identified and the database image in the target angle interval, and determines the reference object matching the object to be matched from all reference objects based on the similarity as the target object of the object to be matched, so that when determining the target object, only matching within the target angle interval is required, reducing the consumption during matching, and obtaining the count value corresponding to the database image of the target object in the target object interval, wherein the count value is incremented when the database image and the image to be identified are paired in similarity, and is reset when the database image is replaced and updated, and based on the similarity and the count value, the database image in the database and the count value of the database image are updated, so that the similarity between the images and the number of times the database image is matched can be integrated within the target angle interval, and the database image in the database can be automatically updated to a better image, thereby realizing automatic update of the database image, so that the database image has higher accuracy.
[0039] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of another embodiment of the method for updating the database image of the present application, the method comprising:
[0040] S201: Acquire an image to be identified, determine an angle parameter corresponding to an object to be matched in the image to be identified, and acquire an angle threshold corresponding to the angle parameter.
[0041] Specifically, an image to be identified is obtained, an angle parameter corresponding to an object to be matched in the image to be identified is determined, and an angle threshold pre-set for the angle parameter is obtained.
[0042] It can be understood that the image to be identified includes the object to be matched, and the object to be matched corresponds to different postures, and the different postures are ultimately accurately reflected through angle parameters, thereby achieving quantitative processing of different postures.
[0043] S202: In response to the angle parameter exceeding the angle threshold, the process ends.
[0044] Specifically, it is determined whether the angle parameter exceeds the corresponding angle threshold. If so, the process is terminated, thereby eliminating the image to be identified corresponding to the object to be matched with a poor angle.
[0045] Optionally, the angle parameter includes Euler angles, and the Euler angles correspond to rotation values about three axes: pitch, yaw, and roll. Therefore, each rotation value corresponds to its own angle threshold. When any rotation value exceeds the angle threshold, the process ends. When all rotation values do not exceed the corresponding angle threshold, it is determined that the angle parameter does not exceed the angle threshold.
[0046] S203: In response to the angle parameter not exceeding the angle threshold, selecting a target angle interval corresponding to the to-be-matched object from a plurality of candidate angle intervals based on the angle parameter.
[0047] Specifically, when the angle parameter does not exceed the angle threshold, the candidate angle interval matched by the angle parameter is determined based on the angle parameter of the object to be identified. For example, when the pitch angle is 20 degrees, it is determined that the angle parameter belongs to the upward viewing angle (pitch 0~90 degrees).
[0048] It should be noted that the database includes multiple reference objects, and the angles corresponding to the reference objects are divided into multiple candidate angle intervals. Each reference object has a database image in at least one candidate angle interval collected in advance.
[0049] S204: Obtain the similarity between the image to be identified and the database image within the target angle interval, and determine the target object that matches the object to be matched from all reference objects based on the similarity.
[0050] Specifically, the similarity between the image to be identified and the database image within the target angle interval is obtained, and based on the similarity, a reference object matching the object to be matched is determined from all reference objects as the target object of the object to be matched.
[0051] In some implementation scenarios, before obtaining the similarity between the image to be identified and the database image within the target angle interval, and determining the target object that matches the object to be matched from all reference objects based on the similarity, it also includes: obtaining an image quality score of the image to be identified, and a first quality threshold corresponding to the image quality score; in response to the image quality score not exceeding the first quality threshold, terminating the process; in response to the image quality score exceeding the first quality threshold, entering the step of obtaining the similarity between the image to be identified and the database image within the target angle interval, and determining the target object that matches the object to be matched from all reference objects based on the similarity.
[0052] Specifically, an image quality score of the image to be identified and a first quality threshold corresponding to the image quality score are obtained.
[0053] Optionally, the image quality score is determined based on the clarity, resolution and occlusion of the object to be matched in the image to be identified.
[0054] Further, it is determined whether the image quality score exceeds the first quality threshold. When the image quality score does not exceed the first quality threshold, the process is terminated to eliminate the images to be identified with lower quality. When the image quality score exceeds the first quality threshold, the subsequent process is executed.
[0055] Furthermore, after obtaining the similarity between the image to be identified and the database image within the target angle interval, and determining the target object that matches the object to be matched from all reference objects based on the similarity, it also includes: obtaining a second quality threshold corresponding to the image quality score; wherein the second quality threshold is greater than the first quality threshold; in response to the image quality score not exceeding the second quality threshold, outputting the target object that matches the object to be matched and terminating the process; in response to the image quality score exceeding the second quality threshold, entering the step of obtaining the count value corresponding to the database image of the target object within the target angle interval, and updating the database image and its corresponding count value based on the similarity and the count value.
[0056] Specifically, a second quality threshold corresponding to the image quality score is obtained, and the second quality threshold is greater than the first quality threshold, which is used to further screen the image to be identified, and determine whether the image quality score exceeds the second quality threshold. When the image quality score does not exceed the second quality threshold, the target object matched by the object to be matched is output and the process ends. When the image quality score exceeds the second quality threshold, the subsequent process is executed. Therefore, the image to be identified whose image quality score is between the first quality threshold and the second quality threshold can be used to identify the object in the image, and the image exceeding the second quality threshold can be used to subsequently update the database image in the database, thereby improving the quality of the database image while ensuring the object recognition function during the update process.
[0057] In some implementation scenarios, the similarity between the image to be identified and the database image within the target angle interval is obtained, and the target object that matches the object to be matched is determined from all reference objects based on the similarity, including: obtaining a first image feature of the image to be identified, and a second image feature of the database image within the target angle interval; based on the first image feature and the second image feature, determining the similarity and obtaining a first recognition threshold corresponding to the similarity; in response to all similarities not exceeding the first recognition threshold, ending the process; in response to at least one similarity exceeding the first recognition threshold, determining the target object that matches the object to be matched from the reference objects included in the database image whose similarity exceeds the first recognition threshold.
[0058] Specifically, a first image feature of the image to be identified and a second image feature of the database image within the target angle interval are obtained, the first image feature and the second image feature are compared, the similarity between the image to be identified and the database image is determined, and a first recognition threshold corresponding to the similarity is obtained. The first image feature and the second image feature can be extracted by a pre-trained neural network model, and the first image feature and the second image feature are usually feature vectors of the same dimension.
[0059] Further, it is determined whether at least one similarity exceeds the first recognition threshold. If all similarities do not exceed the first recognition threshold, the process is terminated, thereby eliminating the images to be identified whose similarities with all database images are not high. If at least one similarity exceeds the first recognition threshold, a reference object matching the object to be matched is determined from the reference objects included in the database images whose similarities exceed the first recognition threshold as the target object of the object to be matched.
[0060] It can be understood that the first recognition threshold is a preliminary screening condition for object matching. The first recognition threshold will not be set to a value that is too high to facilitate subsequent object matching. When there are multiple database images that exceed the first recognition threshold, and the database images that exceed the first recognition threshold correspond to different reference objects, the reference object with the highest similarity can be selected as the target object, or the reference object with the highest average similarity can be selected as the target object.
[0061] Optionally, before obtaining the count value corresponding to the database image of the target object within the target angle interval, and updating the database image and its corresponding count value based on the similarity and the count value, it also includes: obtaining a second recognition threshold corresponding to the similarity; wherein the second recognition threshold is greater than the first recognition threshold; in response to all similarities not exceeding the second recognition threshold, terminating the process; in response to at least one similarity exceeding the second recognition threshold, entering the step of obtaining the count value corresponding to the database image of the target object within the target angle interval, and updating the database image and its corresponding count value based on the similarity and the count value.
[0062] Specifically, a second recognition threshold corresponding to the similarity is obtained, wherein the second recognition threshold is greater than the first recognition threshold, and the second recognition threshold is used to further screen the image to be recognized, thereby reducing the probability of causing an error in the reference object when the database image is updated.
[0063] It can be understood that it is determined whether at least one similarity exceeds the second recognition threshold. If all similarities do not exceed the second recognition threshold, the process is terminated, thereby improving the standard for the object to be identified to replace the reference object and reducing the probability of causing errors in the reference object when the database image is updated. If at least one similarity exceeds the second recognition threshold, the subsequent steps are continued.
[0064] S205: Obtain the count value corresponding to the database image of the target object within the target angle range, and update the database image and its corresponding count value based on the similarity and the count value; wherein the count value is incremented when the database image is paired with the similarity of the image to be identified, and is reset when the database image is replaced and updated.
[0065] Specifically, a count value corresponding to a database image of the target object within a target object interval is obtained, wherein the count value is incremented when the database image is paired with the similarity of the image to be identified, and is reset when the database image is replaced and updated, and based on the similarity and the count value, the database image in the database and the count value of the database image are updated.
[0066] In some implementation scenarios, before obtaining the count value corresponding to the database image of the target object within the target angle interval and updating the database image and its corresponding count value based on the similarity and the count value, it also includes: obtaining the number of images corresponding to the database image of the target object within the target angle interval, and a number threshold corresponding to the target angle interval; in response to the number of images not exceeding the number threshold, adding the image to be identified to the target angle interval corresponding to the target object as a database image and resetting the corresponding count value; in response to the number of images exceeding the number threshold, entering the step of obtaining the count value corresponding to the database image of the target object within the target angle interval, and updating the database image and its corresponding count value based on the similarity and the count value.
[0067] Specifically, the number of images corresponding to all database images of the target object within the target angle interval and the number threshold corresponding to the target angle interval are obtained. Different angle intervals can be set with their own corresponding number thresholds, so that more database images are set in more important angle intervals.
[0068] Furthermore, it is determined whether the number of images exceeds a quantity threshold. When the number of images does not exceed the quantity threshold, the image to be identified is added to the target angle interval corresponding to the target object as a database image and the corresponding count value is reset, so that the image to be identified is directly added to the database when it is not fully filled, so as to expand the database image and match the same number of images for the same angle interval after it is fully filled, so that the count value can be compared with the same standard.
[0069] It is understandable that when the number of images exceeds the number threshold, the step of obtaining the count value corresponding to the database image of the target object within the target angle interval is entered, and the database image and its corresponding count value are updated based on the similarity and the count value.
[0070] It should be noted that based on the similarity and the count value, the database image and its corresponding count value are updated, including: obtaining the count threshold corresponding to the target angle interval, and the count sum value corresponding to the count value of the database image of the target object in the target angle interval; in response to the count sum value not exceeding the count threshold, keeping the database image in the database, and increasing the count value of the database image paired with the similarity of the image to be identified; in response to the count sum value exceeding the count threshold, replacing and updating the database image with the smallest count value with the image to be identified, and resetting the corresponding count value.
[0071] Specifically, a counting threshold corresponding to the target angle interval is obtained, and a count sum value corresponding to the count value of the database image of the target object in the target angle interval is obtained, and it is determined whether the count sum value exceeds the counting threshold value. When the count sum value does not exceed the counting threshold value, the database image in the database is maintained, and the count value of the database image paired with the similarity of the image to be identified is incremented, so that when the count sum value is small, the count value of each database image is first accumulated, and the count value is used to feed back the number of times the database image is paired with the object to be matched, so that the count value can directly represent the accuracy of the database image.
[0072] Furthermore, when the count sum exceeds the count threshold, the database image with the smallest count value is replaced and updated with the image to be identified, and the corresponding count value is reset. Thus, when the count sum exceeds the count threshold, the database image with lower accuracy is updated to the image to be identified, thereby realizing adaptive updating of the database image and improving the accuracy of the database image.
[0073] It can be understood that when a target angle interval corresponds to a quantity threshold, the counting threshold is positively correlated with the quantity threshold, so that when the number of images within the angle interval is greater, a larger counting threshold is set.
[0074] It should be noted that the multiple implementation scenarios in this application can be integrated with each other to obtain a better solution. For the sake of convenience, this application provides a specific implementation scenario to demonstrate one of the better implementation schemes. This implementation scenario includes the following steps:
[0075] S301: Acquire an image to be identified, determine an angle parameter corresponding to an object to be matched in the image to be identified, and acquire an angle threshold corresponding to the angle parameter.
[0076] S302: Determine whether the angle parameter exceeds an angle threshold.
[0077] S303: In response to the angle parameter exceeding the angle threshold, the process ends.
[0078] S304: In response to the angle parameter not exceeding the angle threshold, selecting a target angle interval corresponding to the to-be-matched object from a plurality of candidate angle intervals based on the angle parameter.
[0079] S305: Obtain an image quality score of the image to be identified and a first quality threshold corresponding to the image quality score.
[0080] S306: Determine whether the image quality score exceeds a first quality threshold.
[0081] S307: In response to the image quality score not exceeding the first quality threshold, the process ends.
[0082] S308: In response to the image quality score exceeding the first quality threshold, obtain a first image feature of the image to be identified and a second image feature of the database image within the target angle range; based on the first image feature and the second image feature, determine the similarity and obtain a first recognition threshold corresponding to the similarity.
[0083] S309: Determine whether at least one similarity exceeds a first recognition threshold.
[0084] S310: In response to all similarities not exceeding the first recognition threshold, the process ends.
[0085] S311: In response to at least one similarity exceeding a first recognition threshold, determining a target object to be matched by the object to be matched from reference objects included in the database image whose similarity exceeds the first recognition threshold.
[0086] S312: Obtain a second quality threshold corresponding to the image quality score; wherein the second quality threshold is greater than the first quality threshold.
[0087] S313: Determine whether the image quality score exceeds a second quality threshold.
[0088] S314: In response to the image quality score not exceeding the second quality threshold, output the target object matched by the to-be-matched object and terminate the process.
[0089] S315: In response to the image quality score exceeding the second quality threshold, obtaining a second recognition threshold corresponding to the similarity; wherein the second recognition threshold is greater than the first recognition threshold.
[0090] S316: Determine whether at least one similarity exceeds a second recognition threshold.
[0091] S317: In response to all similarities not exceeding the second recognition threshold, the process ends.
[0092] S318: In response to at least one similarity exceeding a second recognition threshold, obtaining the number of images corresponding to the database image of the target object within the target angle interval and a number threshold corresponding to the target angle interval.
[0093] S319: Determine whether the number of images exceeds a number threshold.
[0094] S320: In response to the number of images not exceeding the number threshold, the image to be identified is added to the target angle interval corresponding to the target object as a database image and the corresponding count value is reset.
[0095] S321: In response to the number of images exceeding the number threshold, obtaining a count threshold corresponding to the target angle interval and a count sum value corresponding to the count value of the database image of the target object in the target angle interval.
[0096] S322: Determine whether the count and value exceeds the count threshold.
[0097] S323: In response to the count sum value not exceeding the count threshold, retain the database image in the database, and increment the count value of the database image that is paired with the similarity of the image to be recognized.
[0098] S324: In response to the count sum value exceeding the count threshold, the database image with the smallest count value is replaced and updated with the image to be identified, and the corresponding count value is reset.
[0099] In this embodiment, an image to be identified is obtained, a corresponding candidate angle interval is selected from multiple candidate angle intervals for the object to be matched in the image to be identified as the target angle interval of the object to be matched, an image quality score of the image to be identified is obtained, and the image to be identified is screened in two stages using a first quality threshold and a second quality threshold corresponding to the image quality score, so that the image to be identified with an image quality score between the first quality threshold and the second quality threshold can be used to identify the object in the image, and the image exceeding the second quality threshold can be used to subsequently update the database image in the database, thereby improving the quality of the database image and ensuring the object recognition function in the update process. The similarity between the image to be identified and the database image in the target angle interval is obtained, and the first recognition threshold and the second recognition threshold corresponding to the similarity are used to screen the object to be matched in two stages, and a reference object matching the object to be matched is determined from the reference objects included in the database image with a similarity exceeding the first recognition threshold as the target object of the object to be matched, and the second recognition threshold is used to improve the standard that the object to be identified can replace the reference object, thereby reducing the probability of causing an error in the reference object when the database image is updated. The count value is used to feedback the number of times the database image is paired with the object to be matched, so that the count value can directly represent the accuracy of the database image. When the count sum exceeds the count threshold, the database image with the smallest count value is replaced by the image to be identified, and the corresponding count value is reset. Therefore, when the count sum exceeds the count threshold, the database image with lower accuracy is updated to the image to be identified, thereby realizing adaptive update of the database image and improving the accuracy of the database image.
[0100] See also Figure 3 , Figure 3 It is a structural diagram of an embodiment of an electronic device of the present application, wherein the electronic device 30 includes a memory 301 and a processor 302 coupled to each other, wherein the memory 301 stores program data (not shown), and the processor 302 calls the program data to implement the method in any of the above embodiments. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0101] See also Figure 4 , Figure 4 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 40 stores program data 400. When the program data 400 is executed by a processor, the method in any of the above embodiments is implemented. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0102] It should be noted that the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
[0103] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0105] The above description is only an implementation method of the present application, and does not limit the protection scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the protection scope of the present application.
Claims
1. A database image updating method, characterized in that: The method comprises: Acquire an image to be identified, and determine a target angle interval corresponding to an object to be matched in the image to be identified from a plurality of candidate angle intervals; wherein the database includes a plurality of reference objects, and each of the reference objects includes at least one database image within the candidate angle interval; Acquire the similarity between the image to be identified and the database image within the target angle interval, and determine the target object matched by the object to be matched from all the reference objects based on the similarity; Obtaining a count value corresponding to the database image of the target object within the target angle interval, and updating the database image and its corresponding count value based on the similarity and the count value; wherein the count value is incremented when the database image is paired with the similarity of the image to be identified, and is reset when the database image is replaced and updated; Among them, the updating of the database image and its corresponding count value based on the similarity and the count value includes: obtaining a count threshold corresponding to the target angle interval, and a count sum value corresponding to the count value of the database image of the target object in the target angle interval; in response to the count sum value not exceeding the count threshold value, maintaining the database image in the database, and incrementing the count value of the database image paired with the similarity of the image to be identified; in response to the count sum value exceeding the count threshold value, replacing and updating the database image with the smallest count value with the image to be identified, and resetting the corresponding count value.
2. The method according to claim 1, characterized in that Before obtaining the count value corresponding to the database image of the target object within the target angle interval and updating the database image and its corresponding count value based on the similarity and the count value, the method further includes: Acquire the number of images of the target object in the database corresponding to the image in the target angle interval, and a number threshold corresponding to the target angle interval; In response to the number of images not exceeding the number threshold, adding the image to be identified to the target angle interval corresponding to the target object as the database image and resetting the corresponding count value; In response to the number of images exceeding the number threshold, the step of obtaining the count value corresponding to the database image of the target object within the target angle interval and updating the database image and its corresponding count value based on the similarity and the count value is entered.
3. The method according to claim 1, characterized in that The step of acquiring an image to be identified and determining a target angle interval corresponding to an object to be matched in the image to be identified from a plurality of candidate angle intervals includes: Acquire an image to be identified, determine an angle parameter corresponding to an object to be matched in the image to be identified, and acquire an angle threshold corresponding to the angle parameter; In response to the angle parameter exceeding the angle threshold, ending the process; In response to the angle parameter not exceeding the angle threshold, the target angle interval corresponding to the to-be-matched object is selected from a plurality of the candidate angle intervals based on the angle parameter.
4. The method according to claim 1, characterized in that: Before obtaining the similarity between the image to be identified and the database image within the target angle interval and determining the target object matched by the object to be matched from all the reference objects based on the similarity, the method further includes: Obtaining an image quality score of the image to be identified and a first quality threshold corresponding to the image quality score; In response to the image quality score not exceeding the first quality threshold, ending the process; In response to the image quality score exceeding the first quality threshold, the step of obtaining the similarity between the image to be identified and the database image within the target angle interval is entered, and based on the similarity, a target object that matches the object to be matched is determined from all the reference objects.
5. The method according to claim 4, characterized in that After obtaining the similarity between the image to be identified and the database image within the target angle interval, and determining the target object matched by the object to be matched from all the reference objects based on the similarity, the method further includes: Acquire a second quality threshold corresponding to the image quality score; wherein the second quality threshold is greater than the first quality threshold; In response to the image quality score not exceeding the second quality threshold, outputting the target object matched by the to-be-matched object and ending the process; In response to the image quality score exceeding the second quality threshold, the step of obtaining the count value corresponding to the database image of the target object within the target angle interval and updating the database image and its corresponding count value based on the similarity and the count value is entered.
6. The method according to claim 1 or 5, characterized in that: The obtaining of the similarity between the image to be identified and the database image within the target angle interval, and determining the target object matched by the object to be matched from all the reference objects based on the similarity, comprises: Acquire a first image feature of the image to be recognized and a second image feature of the database image within the target angle interval; Based on the first image feature and the second image feature, determining the similarity and acquiring a first recognition threshold corresponding to the similarity; In response to all the similarities not exceeding the first recognition threshold, ending the process; In response to at least one of the similarities exceeding the first recognition threshold, a target object to be matched by the object to be matched is determined from reference objects included in the database image whose similarity exceeds the first recognition threshold.
7. The method according to claim 6, characterized in that Before obtaining the count value corresponding to the database image of the target object within the target angle interval and updating the database image and its corresponding count value based on the similarity and the count value, the method further includes: Obtaining a second recognition threshold corresponding to the similarity; wherein the second recognition threshold is greater than the first recognition threshold; In response to all the similarities not exceeding the second recognition threshold, ending the process; In response to at least one of the similarities exceeding the second recognition threshold, the step of obtaining the count value corresponding to the database image of the target object in the target angle interval is entered, and based on the similarity and the count value, the database image and its corresponding count value are updated.
8. An electronic device, characterized in that: include: A memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
