Image recognition method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202310197845.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-02-22
AI Technical Summary
[0003]不过,实际中,受待处理图像的图像质量的影响,图像匹配的准确率会有明显波动,从而导致图像识别的准确率不稳定
[0047] In the aforementioned image recognition methods, devices, electronic devices, and storage media, feature extraction is performed on the image to be processed to obtain image features corresponding to each region of the image to be processed; the weight of each image feature is determined based on the image quality corresponding to each region of the image to be processed; image features whose weights meet a first threshold are preferentially matched with target features; if the matching result meets preset conditions, the recognition result of the image to be processed is obtained; wherein, the weight of each image feature is positively correlated with the image quality of the corresponding region. That is, considering that some regions of an image with poor overall image quality may have better image quality, the weights of image features in different regions of the target image are different according to their image quality. The image features in regions with better image quality have correspondingly higher weights and higher priority in matching, thereby allowing image regions with better image quality to be matched and calculated more preferentially, thus improving the matching accuracy and the accuracy of image recognition.
Smart Images

Figure CN116385745B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition technology, and in particular to an image recognition method, apparatus, electronic device and storage medium. Background Technology
[0002] Image recognition refers to the technology of using computers to process, analyze, and understand images in order to identify targets and objects of various patterns. Image matching is a crucial step in image recognition. It involves analyzing the similarity and consistency of image content, features, structure, relationships, texture, and grayscale to find similar image targets. With the rapid development of computer technology, image recognition technology is being applied more and more widely. For example, it is involved in fields such as fingerprint recognition, image retrieval, multi-attribute recognition, and pedestrian re-identification.
[0003] However, in practice, the accuracy of image matching can fluctuate significantly due to the quality of the image to be processed, resulting in unstable accuracy of image recognition. Summary of the Invention
[0004] Therefore, it is necessary to provide an image recognition method, apparatus, electronic device, and storage medium that can reduce or even avoid the impact of image quality on image recognition accuracy in response to the above-mentioned technical problems.
[0005] In a first aspect, embodiments of this application provide an image recognition method, the method comprising:
[0006] Feature extraction is performed on the image to be processed to obtain the image features corresponding to each region of the image to be processed;
[0007] The weights of each image feature are determined based on the image quality of each region in the image to be processed; wherein the weights of each image feature are positively correlated with the image quality of the corresponding region.
[0008] Image features whose weights satisfy the first threshold are preferentially matched with the target features. If the matching result meets the preset conditions, the recognition result of the image to be processed is obtained.
[0009] Secondly, embodiments of this application also provide an image recognition device, the device comprising:
[0010] The feature extraction module is used to extract features from the image to be processed, and obtain the image features corresponding to each region of the image to be processed.
[0011] The weight calculation module is used to determine the weight of each image feature based on the image quality corresponding to each region in the image to be processed; wherein the weight of each image feature is positively correlated with the image quality of the corresponding region;
[0012] The matching and recognition module is used to prioritize matching the image features whose weights meet the first threshold with the target features. If the matching result meets the preset conditions, the recognition result of the image to be processed is obtained.
[0013] In one embodiment, when the weight calculation module determines the weight of each image feature based on the image quality corresponding to each region in the image to be processed, it is specifically used for:
[0014] The image to be processed is divided into regions to obtain multiple image blocks, and the image quality of each image block is calculated; wherein, different image blocks correspond to different regions;
[0015] The weights of each image feature corresponding to each region in the image to be processed are determined based on the image quality of each image block.
[0016] In one embodiment, when the weight calculation module determines the weights of each image feature corresponding to each region in the image to be processed based on the image quality of each image block, it is specifically used for:
[0017] Based on the relative position of each image block with respect to its neighboring image blocks, the degree of influence of each image block on its neighboring image blocks is determined; wherein, the degree of influence of any image block on its neighboring image blocks is negatively correlated with the distance between the image block and its neighboring image blocks;
[0018] The weight of each image block is determined based on its image quality and its influence on adjacent image blocks.
[0019] In one embodiment, when the matching and recognition module prioritizes matching image features whose weights satisfy a first threshold with target features, and obtains the recognition result of the image to be processed if the matching result meets a preset condition, it is specifically used for:
[0020] Image features whose weights satisfy the first threshold are determined from each of the image features;
[0021] The image features whose weights satisfy the first threshold are matched with the target features to obtain the first matching result;
[0022] If the first matching result meets the first preset condition, then the recognition result of the image to be processed is obtained.
[0023] In one embodiment, the matching and recognition module is further configured to:
[0024] If the first matching result does not meet the first preset condition, but meets the second preset condition, then each image feature whose weight meets the first threshold and at least one image feature whose weight does not meet the first threshold are matched together with the target feature to obtain the second matching result.
[0025] If the second matching result satisfies the first preset condition, then the recognition result of the image to be processed is obtained.
[0026] In one embodiment, when the matching and recognition module determines image features whose weights satisfy a first threshold from the image features, it is specifically used to:
[0027] Image features whose weights satisfy the first threshold are assigned to a first feature set, and image features whose weights do not satisfy the first threshold are assigned to a second feature set.
[0028] When the matching and recognition module matches each image feature whose weight satisfies the first threshold with at least one image feature whose weight does not satisfy the first threshold with the target feature to obtain a second matching result, it is specifically used for:
[0029] At least one image feature from the second feature set is added to the first feature set to update the first feature set;
[0030] The updated first feature set is matched with the target feature to obtain a second matching result.
[0031] In one embodiment, the device further includes a pose calibration module; the pose calibration module is used for:
[0032] Before prioritizing the matching of image features whose weights satisfy a first threshold with the target features, multiple candidate features and multiple auxiliary features of the image to be processed are obtained; the candidate features are at least some of the features in the image features, and the auxiliary features are features in the image features that are not the candidate features, or the auxiliary features are features that are re-extracted and are different from the image features;
[0033] From multiple features corresponding to a preset image template, a reference feature is determined that satisfies a preset matching condition with each of the candidate features and each of the auxiliary features;
[0034] Based on the positional relationship between each candidate feature, each auxiliary feature, and the reference feature, pose calibration processing is performed on each image feature;
[0035] Accordingly, when the matching and recognition module prioritizes matching image features whose weights satisfy the first threshold with the target features, it is specifically used for:
[0036] Image features whose weights satisfy the first threshold among the image features after pose calibration are preferentially matched with the target features.
[0037] In one embodiment, when the pose calibration module determines a reference feature from multiple features corresponding to a preset image template that satisfies a preset matching condition with each candidate feature and each auxiliary feature, it is specifically used for:
[0038] Select one of the candidate features in sequence as the target candidate feature, and determine all associated auxiliary features within a first preset radius and all associated candidate features within a second preset radius, with the target candidate feature as the center.
[0039] Extract the feature association parameters between the target candidate feature and each of the associated auxiliary features, and the feature association parameters between the target candidate feature and each of the associated candidate features;
[0040] Based on the feature association parameters, the feature with the highest matching degree with each candidate feature and each auxiliary feature is determined from multiple features corresponding to the preset image template, and is used as the reference feature.
[0041] In one embodiment, when the pose calibration module performs pose calibration processing on each of the image features based on the positional relationship between each of the candidate features and each of the auxiliary features and the reference features, it is specifically used for:
[0042] Based on the coordinate and angle information of each candidate feature and its corresponding reference feature, as well as the coordinate and angle information of each auxiliary feature and its corresponding reference feature, the translation and rotation parameters corresponding to the image to be processed are calculated.
[0043] Based on the translation and rotation parameters, pose calibration processing is performed on each of the image features of the image to be processed.
[0044] Thirdly, embodiments of this application also provide an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the image recognition method as described in the first aspect.
[0045] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the image recognition method as described in the first aspect.
[0046] Fifthly, embodiments of this application also provide a computer program product or computer program, the computer program product or computer program including computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, it implements the steps of the image recognition method as described in the first aspect.
[0047] In the aforementioned image recognition methods, devices, electronic devices, and storage media, feature extraction is performed on the image to be processed to obtain image features corresponding to each region of the image to be processed; the weight of each image feature is determined based on the image quality corresponding to each region of the image to be processed; image features whose weights meet a first threshold are preferentially matched with target features; if the matching result meets preset conditions, the recognition result of the image to be processed is obtained; wherein, the weight of each image feature is positively correlated with the image quality of the corresponding region. That is, considering that some regions of an image with poor overall image quality may have better image quality, the weights of image features in different regions of the target image are different according to their image quality. The image features in regions with better image quality have correspondingly higher weights and higher priority in matching, thereby allowing image regions with better image quality to be matched and calculated more preferentially, thus improving the matching accuracy and the accuracy of image recognition. Attached Figure Description
[0048] Figure 1 This is a diagram illustrating the implementation environment of an image recognition method in one embodiment;
[0049] Figure 2 This is a flowchart illustrating an image recognition method in one embodiment;
[0050] Figure 3 This is a flowchart illustrating a specific implementation method of step S202 in one embodiment;
[0051] Figure 4 This is a schematic diagram illustrating the weighting principle for calculating image features in one embodiment;
[0052] Figure 5 This is a flowchart illustrating a specific implementation method of step S203 in one embodiment;
[0053] Figure 6 This is a flowchart illustrating the image recognition method in another embodiment;
[0054] Figure 7 This is a flowchart illustrating the pose calibration process in one embodiment;
[0055] Figure 8 This is a flowchart illustrating the specific implementation method of step S302 in one embodiment;
[0056] Figure 9 This is a schematic diagram illustrating the specific application process of an image recognition method in one application scenario, as shown in one embodiment.
[0057] Figure 10 This is a schematic diagram illustrating the principle of sorting fingerprint features according to weights and then outputting the result.
[0058] Figure 11 A schematic diagram illustrating the principle of determining the associated auxiliary features and associated candidate features of the target candidate features in the pose calibration step;
[0059] Figure 12 This is a schematic diagram of the structure of an image recognition device in one embodiment;
[0060] Figure 13 This is a schematic diagram of the image recognition device in another embodiment;
[0061] Figure 14 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0063] Application Overview
[0064] As described in the background section, some image recognition processes require the application of image matching technology, which involves matching the image to be processed with a target image to determine whether they point to the same object. For example, in the field of fingerprint recognition, a user's fingerprint image needs to be pre-collected and recorded as a template (i.e., the target image). When a user uses their fingerprint for identification purposes such as unlocking access control, unlocking smart devices, or making quick payments, the corresponding device performs a series of processes after acquiring the user's currently input fingerprint to obtain the image features of the user's fingerprint image. These image features are then matched with the features corresponding to the fingerprint template. If a match is successful, identification is completed, and subsequent processing can proceed.
[0065] However, in practice, due to various reasons, the image quality of some areas of the image to be processed is poor, affecting the overall image quality and leading to matching failure or incorrect results. For example, during fingerprint recognition, a user's finger may be sweaty or have wounds, resulting in fewer fingerprint ridges in some areas of the acquired fingerprint image compared to the actual situation. Consequently, during feature extraction, the ideal fingerprint image features may not be correctly extracted, causing a matching failure even if the fingerprint is correct, resulting in a poor user experience.
[0066] To address the aforementioned problems, this application provides an image recognition method, apparatus, device, and storage medium, aiming to reduce or even avoid the impact of image quality on image recognition accuracy. The specific solutions are described in detail below through embodiments.
[0067] Exemplary Implementation Environment
[0068] The image recognition method provided in this application can be applied to, for example... Figure 1 The implementation environment shown includes one or more image acquisition devices 100 for acquiring images to be processed. The acquired image data is sent to a processing device 110 for subsequent processing, such as feature extraction and subsequent matching and recognition. The image acquisition device 100 and the processing device 110 can be integrated into a single smart device, or they can be independent devices connected via wired or wireless means. Specific wireless communication methods include, but are not limited to, ZIGBEE, WIFI, or Bluetooth. Furthermore, the image acquisition device 100 and the processing device 110 can be directly connected or indirectly connected through a gateway or other relay device.
[0069] Depending on the specific application scenario, the image acquisition device 100 may be, but is not limited to, a camera, an image sensor, or a fingerprint collector, etc. There are no restrictions here, as long as it can acquire the required image to be processed.
[0070] The processing device 110 may be, but is not limited to, a smart mobile terminal that integrates the image acquisition device 100, such as a mobile phone or a tablet computer, or a bridging device (such as a smart gateway), server, or cloud server that has data processing capabilities and is connected to the image acquisition device 100.
[0071] However, it is understandable that in some implementation environments, the image acquisition device 100 may not be included. Accordingly, the processing device 110 may obtain the image to be processed from the network or other means by means of downloading, and then perform a series of subsequent recognition processes on the obtained image to be processed.
[0072] Exemplary methods
[0073] Please see Figure 2 In one exemplary embodiment, an image recognition method is provided, suitable for... Figure 1 The processing equipment in the implementation environment shown is, for example, a smart terminal, a server, or a cloud server. That is, the image recognition method of this embodiment can be executed by these processing devices. The purpose of the method in this embodiment is to achieve a high recognition accuracy when dealing with images of poor quality, avoiding deviations or errors in the final recognition result caused by low-quality images to be processed. Figure 2 As shown, the method in this embodiment may include the following steps:
[0074] Step S201: The processing device extracts features from the image to be processed to obtain the image features corresponding to each region of the image to be processed.
[0075] Feature extraction involves performing image analysis and transformation on the image to be processed to achieve dimensionality reduction. The goal is to extract representative features required for subsequent matching and recognition from the large number of features contained in the image to be processed.
[0076] Depending on the specific scenario, different feature extraction methods may be used. For example, for general images, feature extraction algorithms such as SIFT (Scale-invariant feature transform), ORB (Oriented Fast and Rotated Brief), or AKAZE (Accelerated KAZE) can be employed. For fingerprint images, eight-neighbor templates or lookup tables can be used to extract minutiae features (endpoints, bifurcation points, etc.). In practice, the appropriate feature extraction algorithm can be selected based on the actual needs, without specific limitations.
[0077] Furthermore, it should be noted that in some embodiments, the processing device may perform preprocessing before feature extraction from the image to be processed, in order to improve the effectiveness and reliability of subsequent processing. Preprocessing includes, but is not limited to, image filtering, image denoising, and image enhancement. Image filtering and image denoising can suppress noise in the image to be processed while preserving the detailed features of the image, while image enhancement can emphasize the overall or local characteristics of the image, amplify the differences between different features in the image, suppress features of no interest, and highlight the features that are needed.
[0078] After image preprocessing and feature extraction, the image features of each region of the image to be processed can be obtained, so as to perform image matching in subsequent steps.
[0079] Step S202: The processing device determines the weight of each image feature based on the image quality of each region in the image to be processed. The weight of each image feature is positively correlated with the image quality of the corresponding region.
[0080] Specifically, considering that the image quality of different regions of the image to be processed may be different, and that the confidence level of image features corresponding to regions with lower image quality is also lower.
[0081] Therefore, in this embodiment, the processing device determines different weights for different image features according to the image quality corresponding to each region in the image to be processed. The higher the image quality of a certain region, the greater the weight of the image features corresponding to that region, which means a higher confidence level in subsequent feature matching. In this way, the accuracy of subsequent matching can be improved.
[0082] In some embodiments, such as Figure 3 As shown, the specific implementation method of step S202 may include:
[0083] Step S2021: The processing device divides the image to be processed into regions, obtaining multiple image blocks, and calculates the image quality of each image block. Different image blocks correspond to different regions.
[0084] Specifically, when dividing the image into regions, the processing device can choose an appropriate division method according to actual needs. For example, it can perform grid-like division, where each grid is an image block corresponding to an image region. The size of each region can be set as needed. Generally, the smaller the size of each image region, the more image regions are divided, the more complex the image quality calculation steps become, and the longer it takes, but the more accurate the final weights of each image feature are.
[0085] After dividing the image into blocks, the image quality of each block (region) is calculated separately. In practice, a pre-built quality assessment model can be used to calculate the image quality of each block.
[0086] In some embodiments, the quality assessment model can be constructed by integrating factors such as image sharpness, global mean and variance, local mean and variance, and signal-to-noise ratio. For a given image patch, its image quality is positively correlated with sharpness and signal-to-noise ratio, and negatively correlated with variance.
[0087] In other embodiments, the quality assessment model can also be obtained by training a pre-built neural network model. The trained quality assessment model can score different image patches, with different scores corresponding to different image qualities.
[0088] Of course, in addition to the methods mentioned above, other commonly used methods can be used to determine the image quality of different regions of the image to be processed. There are no restrictions on these methods, and they will not be listed one by one.
[0089] In addition, to facilitate subsequent processing, in some embodiments, after calculating the image quality of different regions of the image to be processed, normalization processing can be performed to normalize each image quality score to the range of (0, 1). In this way, the amount of computation can be reduced when calculating the weight of each image feature in the subsequent process.
[0090] Step S2022: The processing device determines the weight of each image feature corresponding to each region in the image to be processed based on the image quality of each image block.
[0091] The higher the image quality of each image patch, the greater the weight of the corresponding image feature, which can improve the accuracy of subsequent image matching.
[0092] In some embodiments, the specific implementation method of step S2022 may include: determining the degree of influence of each image block on each adjacent image block according to the relative position of each image block with respect to adjacent image blocks; wherein, the degree of influence of any image block on adjacent image blocks is negatively correlated with the distance from the image block to the adjacent image blocks; and determining the weight of each image block according to the image quality of each image block and the degree of influence on adjacent image blocks.
[0093] Specifically, while theoretically the weights of image features corresponding to different image patches can be calculated solely based on the image quality of each patch, in practice, the image quality of adjacent image patches is correlated and influences each other. For example, if an image patch has high image quality but its neighboring image patches have low image quality, the overall image quality of the larger image region formed by these patches will be poor. Consequently, the likelihood of matching failure during subsequent matching processing will be higher, resulting in poor matching performance.
[0094] Therefore, to address the aforementioned potential problems, this embodiment first determines the specific degree of influence of each image block on its neighboring image blocks based on the relative position of each image block with respect to the neighboring image blocks. The closer two image blocks are (the smaller the distance), the greater their mutual influence. After determining the degree of influence of each image block on its neighboring image blocks, the weight of each image block is determined based on its image quality and its degree of influence on neighboring image blocks. In this way, the image quality of a large image region can be comprehensively considered to determine the weight of the image features corresponding to the image blocks in each smaller region.
[0095] For easier understanding, refer to Figure 4 As shown, in one embodiment, when calculating the weights of image features in each image block, the eight adjacent image blocks (i.e., eight-neighborhoods) directly connected to each image block on the top, bottom, left, right, and two diagonals are first determined. These are then used as the neighboring image blocks (P1 to P8) that influence the central image block P0. Therefore, for image feature m located in the central image block P0... i Its weight The calculation formula is as follows:
[0096] ∑α i =1
[0097] In the formula, Q i Image quality for each image patch; α i The influence factor of each image block on image block P0 is the degree of influence. Among them, image block P0 has the greatest influence on itself. The influence of image blocks P2, P4, P5 and P7 located above, below, left and right of image block P0 is the next greatest. The influence of image blocks P1, P3, P6 and P8 located diagonally opposite image block P0 is the least.
[0098] Of course, it is understandable that, in addition to the eight-neighbor method mentioned above, other methods (combining other adjacent image blocks, such as combining only the four adjacent image blocks above, below, left, and right) can be used to determine the weight of the image features corresponding to each image block, and there are no restrictions on this.
[0099] By using the above method, the weights of image features corresponding to each image region can be better determined based on the influence of images in different regions on surrounding image regions, which is beneficial for improving matching accuracy in the future.
[0100] Step S203: The processing device prioritizes matching the image features whose weights meet the first threshold with the target features. If the matching result meets the preset conditions, the recognition result of the image to be processed is obtained.
[0101] The target features are those extracted from the target image. The target image can be an image used for matching with the image to be processed; for example, it can be a pre-collected template image used for subsequent identity verification. The target features can be the template features corresponding to the template image. The specific feature extraction method is the same as the feature extraction method for the image to be processed, and will not be elaborated here.
[0102] Specifically, after determining the weights of each image feature in the aforementioned steps, the processing device can identify all image features whose weights satisfy the first threshold, i.e., image features with larger weights. These image features have higher confidence levels and are more accurate when used for image matching. The specific value of the first threshold can be set according to actual needs, but care should be taken not to set it too high, otherwise, an abnormal situation may occur where matching fails due to a small number of image features participating in the matching.
[0103] For example, in some embodiments, all image features can be sorted according to their weights, and then, based on the sorting results, a weight at a suitable proportion (such as the top 60% sorted from largest to smallest) can be selected as the first threshold. Then, each image feature that meets the first threshold can be determined from all the image features.
[0104] After identifying all image features whose weights meet the first threshold, these image features are prioritized for matching with the target features because they have high confidence. This improves matching speed by using fewer image features for matching (compared to matching all image features) and improves matching accuracy by primarily using image features with higher weights.
[0105] If the matching result meets the preset conditions, indicating a successful match, the recognition result of the image to be processed can be further obtained. The preset conditions may include that the similarity between the image features corresponding to the image to be processed and the target features is greater than a first set threshold. This indicates that the image to be processed and the target image have a high similarity, and therefore the match is successful. Furthermore, when determining the similarity between the image features and the target features, existing and commonly used methods such as calculating their Euclidean distance or cosine similarity can be used, without any restrictions.
[0106] After a successful match, further processing can be performed according to subsequent requirements to obtain the recognition result of the image. For example, when using fingerprint unlocking for access control devices or terminal devices, if the input fingerprint successfully matches a pre-stored fingerprint, it can be determined that the user's fingerprint meets the unlocking requirements, and the image recognition result can be determined as successful identity verification.
[0107] More specifically, in some embodiments, such as Figure 5As shown, the specific implementation method of step S203 may include:
[0108] Step S2031: The processing device determines the image features whose weights satisfy the first threshold from each image feature.
[0109] Specifically, the method by which the processing device determines the image features whose weights satisfy the first threshold can refer to the scheme in the foregoing embodiments, and will not be repeated here.
[0110] Step S2032: The processing device matches each image feature whose weight meets the first threshold with the target feature to obtain the first matching result.
[0111] Before matching, features whose weights satisfy a first threshold are also determined from the target features. Therefore, during matching, only the image features whose weights satisfy the first threshold are used to match the target features whose weights satisfy the first threshold, resulting in a first matching result. The first matching result may include the similarity between features.
[0112] Step S2033: If the first matching result satisfies the first preset condition, the processing device obtains the recognition result of the image to be processed.
[0113] Specifically, if the first matching result includes similarity, the first preset condition can be the first similarity threshold T1 corresponding to a successful match. That is, if the similarity of the first matching result is greater than the first similarity threshold T1, it indicates that the similarity between the two parties is very high, and the two parties can be considered to have matched successfully. Therefore, subsequent processing can be performed to obtain the recognition result of the image to be processed.
[0114] In addition, in some embodiments, if the similarity of the first matching result is less than the second similarity threshold T2, it indicates that the similarity between the two parties is very low, and it can be directly considered that the two are completely mismatched. At this time, no further processing is performed, but a matching failure prompt is directly given.
[0115] Furthermore, based on the above scheme, such as Figure 6 As shown, in some embodiments, the above method may further include:
[0116] Step S2034: If the first matching result does not meet the first preset condition, but meets the second preset condition, the processing device will match each image feature whose weight meets the first threshold with at least one image feature whose weight does not meet the first threshold with the target feature to obtain the second matching result.
[0117] Specifically, if the first matching result does not meet the first similarity threshold T1 but meets the second similarity threshold T2, it indicates that the similarity between the two matching parties is high, but has not yet reached the level of successful matching. Therefore, further judgment is required. In this implementation, the further judgment method is to match the image features whose weights do not meet the first threshold with the image features that meet the first threshold together with the target features. That is, after increasing the number of image features participating in the matching, the matching is performed again to obtain the second matching result.
[0118] Furthermore, in practice, when selecting from image features whose weights do not meet the first threshold, priority is given to selecting those with larger weights. This increases the likelihood of a successful match when matching is performed again, thus reducing the number of matching attempts.
[0119] Step S2035: If the second matching result satisfies the first preset condition, the processing device obtains the recognition result of the image to be processed.
[0120] Specifically, if the similarity of the second matching result is greater than the first similarity threshold T1, then the two can be considered to be successfully matched, and subsequent processing can be performed to obtain the recognition result of the image to be processed.
[0121] Furthermore, if the similarity of the second matching result is still between the first similarity threshold T1 and the second similarity threshold T2, then a portion of the image features that did not participate in the matching and whose weights do not meet the first threshold are selected again and matched with the target feature along with the previously matched image features. Matching is considered successful when the similarity of the matching result is greater than the first similarity threshold T1, or matching is considered unsuccessful when all image features participate in the matching but the similarity of the matching result is still less than the first similarity threshold T1.
[0122] In some embodiments, when determining image features whose weights satisfy a first threshold from various image features, the specific method may include: classifying image features whose weights satisfy the first threshold into a first feature set, and classifying image features that do not satisfy the first threshold into a second feature set.
[0123] Accordingly, in the above embodiment, during the initial matching, all image features in the first feature set can be matched with the target feature to obtain a first matching result. If the similarity of the first matching result is greater than a first similarity threshold T1, the matching is considered successful. When the similarity of the first matching result is between the first similarity threshold T1 and the second similarity threshold T2, at least one image feature from the second feature set is added to the first feature set to update the first feature set (and simultaneously update the second feature set). Then, the updated first feature set is used again to match with the target feature to obtain a second matching result. In this way, by setting a feature set, the first feature set is used for matching each time, which simplifies the processing and improves efficiency.
[0124] As can be seen, by adopting the above scheme, considering that some areas of an image with poor overall image quality may have better image quality, the weight of image features in different areas of the target image is different according to the different image quality of those areas. The image features of areas with good image quality have a higher weight and a higher priority when matching, so that image areas with good image quality can be matched and calculated more preferentially, thereby improving the matching accuracy and the accuracy of image recognition.
[0125] Based on the above embodiments, it is considered that the acquisition angle or direction of the image to be processed and the target image corresponding to the target feature may not be exactly the same, which may affect the matching accuracy. For example, when performing fingerprint enrollment and fingerprint recognition, the angle, direction, and force of the user's finger on the fingerprint scanner may be different. As a result, some fingerprint ridges in the acquired fingerprint image may be offset or deformed to a certain extent, which may affect the success rate of fingerprint recognition.
[0126] To address the aforementioned issues and further improve matching accuracy, in some embodiments, after extracting the image features of the image to be processed and before matching them with the target features, the acquired image features can be subjected to pose calibration processing. That is, the pose calibration of image features of the image to be processed that have shifted or deformed is performed to improve the accuracy of subsequent matching.
[0127] In some embodiments, such as Figure 7 As shown, the pose calibration process may include the following steps:
[0128] Step S301: The processing device acquires multiple candidate features and multiple auxiliary features of the image to be processed.
[0129] Candidate features can be at least a portion of the image features that have not been matched, such as detail features corresponding to the image to be processed; auxiliary features can be features in the image features that have not been matched and are other than the candidate features, such as features related to shape and texture attributes corresponding to the image to be processed. In another embodiment, candidate features and auxiliary features can be features that are re-extracted and different from the image features.
[0130] It should be noted that, generally speaking, candidate features are better able to reflect the characteristics of the image to be processed than auxiliary features, and are less susceptible to noise, thus improving the accuracy of subsequent processing.
[0131] In practice, after feature extraction from the image to be processed, a subset of the obtained image features can be selected as candidate features. These candidate features are used for both pose calibration and matching. Auxiliary features can be any features other than the candidate features, features of a different type than the candidate features, or features obtained using different feature extraction algorithms. Auxiliary features may participate in subsequent feature matching or may not participate in feature matching, but may only be used for pose calibration in this embodiment.
[0132] For example, in fingerprint recognition, candidate features can include minutiae, such as the endpoints and bifurcation points of fingerprint ridges, while auxiliary features can include shape features within the fingerprint ridges, such as concave points, convex points, or points of maximum curvature. This is because even if the fingerprint ridges experience some degree of shift, rotation, or deformation, the endpoints and bifurcation points of the ridges will not change significantly and will still reflect the characteristics of the fingerprint; therefore, they can be used as candidate features. When the fingerprint ridges are deformed, the concave and convex points within them may change noticeably; for example, convex points may disappear, becoming straighter line segments. Therefore, these are used as auxiliary features and can participate in subsequent auxiliary judgment.
[0133] Step S302: The processing device determines, from multiple features corresponding to the preset image template, reference features that satisfy the preset matching conditions with each candidate feature and each auxiliary feature.
[0134] The preset image template is a reference image used when calibrating the pose of the image to be processed. It is pre-acquired and stored in the device.
[0135] If a certain feature exists in the image to be processed, then a matching feature generally exists in the preset image template. However, the two features may not be completely consistent. In this embodiment, pose calibration processing is implemented based on this principle.
[0136] For example, continuing with fingerprint recognition, when a user pre-enrolls their fingerprint, if there is a bifurcation point at a specific position of a fingerprint ridge in their fingerprint template, then the fingerprint image re-collected during fingerprint recognition will definitely contain the same fingerprint ridge, and that fingerprint ridge will definitely also have a bifurcation point. However, the bifurcation point in the fingerprint image and the bifurcation point in the fingerprint template may have some differences in shape and other parameters, but they must also have similar parameters.
[0137] Based on the above principles, the purpose of this step is to find feature points in the image features of the image to be processed that match multiple features of the preset image template, and then perform pose calibration processing on the image features of the image to be processed based on these features.
[0138] In some embodiments, such as Figure 8 As shown, the specific implementation method of step S302 may include:
[0139] Step S3021: The processing device sequentially selects a candidate feature as the target candidate feature, and uses the target candidate feature as the center to determine all associated auxiliary features within a first preset radius and all associated candidate features within a second preset radius.
[0140] Specifically, the associated auxiliary features of the target candidate feature are all auxiliary features located within a first preset radius of the target candidate feature. Correspondingly, the associated candidate features of the target candidate feature are all candidate features located within a second preset radius of the target candidate feature.
[0141] In this step, determining the associated auxiliary features and associated candidate features is for the purpose of calculating the feature association parameters between each target candidate feature and its corresponding associated auxiliary features and associated candidate features in subsequent steps, so as to determine the reference features from multiple features corresponding to the preset image template. The specific process and principle will be explained in subsequent steps.
[0142] Furthermore, generally, the first preset radius is smaller than the second preset radius. Optionally, the first preset radius is half of the second preset radius; that is, if the first preset radius is R, then the second preset radius can be 2R. This is because candidate features participate in subsequent feature matching, so the validity of the candidate features needs to be guaranteed. If the distance between two extracted candidate features is small, one of the candidate features may be a spurious feature (i.e., a feature extracted for various reasons but which does not actually exist).
[0143] For example, during fingerprint recognition, a fingerprint ridge might be broken due to dry fingers or other reasons, resulting in the extraction of two additional endpoints. These two endpoints are considered false features. If false features are used for pose calibration, the calibration effect will be worse. Therefore, when extracting associated candidate features, it is preferable to use a larger radius range to reduce the adverse effects of false features.
[0144] Step S3022: The processing device extracts the feature association parameters between the target candidate feature and each associated auxiliary feature, as well as the feature association parameters between the target candidate feature and each associated candidate feature.
[0145] Feature association parameters are parameters used to represent the relationship between two features when they are considered as a pair. Examples include the distance between two features (e.g., Euclidean distance), the angular difference between their orientations, and their respective feature types. There are no restrictions on these parameters, as long as they reflect the relationship between the two features. For example, in fingerprint recognition, this could also include the number of fingerprint ridges between the two features.
[0146] In this embodiment, one or more parameters such as distance, angle difference, and type between the target candidate feature and its associated auxiliary features and candidate features can be extracted as feature association parameters.
[0147] Step S3023: Based on the feature association parameters, the processing device determines the feature with the highest matching degree with each candidate feature and each auxiliary feature from multiple features corresponding to the preset image template, and uses it as a reference feature.
[0148] Specifically, in the aforementioned steps, after extracting the required feature association parameters, each target candidate feature and its corresponding feature association parameters can be compared with multiple features corresponding to a preset image template. When the feature association parameters of a certain feature in the image to be processed are similar to the feature association parameters of a certain feature corresponding to a certain feature in the preset image template, it indicates that the two may correspond to the same feature of the matching target (such as the same endpoint of a fingerprint ridge). Furthermore, the closer the feature association parameters are, that is, the higher the matching degree, the greater the probability that the two correspond to the same feature.
[0149] For example, for a fingerprint image to be identified, if there is another endpoint B at a distance x1 from endpoint A in the a° direction and at a distance x2 from endpoint A in the b° direction; and for a fingerprint template image, if there is an endpoint A′, and there is another endpoint B′ at a distance x1±x0 from endpoint A′ in the (a±a0)° direction and at a distance x2±x0 from endpoint A′, and there is another endpoint C′ at a distance x2±x0 from endpoint A′ in the (b±b0)° direction, then endpoint A and endpoint A′ can be considered to match, and they correspond to the same feature.
[0150] Furthermore, as explained above, for the same target candidate parameter, the more types of feature-related parameters collected, the higher the accuracy of matching reference features, but the processing speed will decrease.
[0151] Step S303: The processing device performs pose calibration processing on each image feature according to the positional relationship between each candidate feature, each auxiliary feature and the reference feature.
[0152] Specifically, after obtaining the reference features in the aforementioned steps, the positions, directions, and angles of each candidate feature and each auxiliary feature can be adjusted according to their positional relationship with the reference features to make them as consistent as possible with the reference features. In this way, when prioritizing the matching of image features whose weights meet the first threshold with the target features, the image features whose weights meet the first threshold after pose calibration can be prioritized for matching with the target features, thereby effectively improving the accuracy of image matching.
[0153] In some embodiments, the specific implementation method of step S303 may include: calculating the translation parameters and rotation parameters corresponding to the image to be processed based on the coordinate information and angle information of each candidate feature and its corresponding reference feature, as well as the coordinate information and angle information of each auxiliary feature and its corresponding reference feature; and performing pose calibration processing on each image feature of the image to be processed based on the translation parameters and rotation parameters.
[0154] Specifically, each image feature and its corresponding reference feature have corresponding coordinate and angle information. By comparing the coordinate and angle information of the matching image feature and reference feature, the corresponding translation and rotation parameters can be calculated. That is, after calculating the direction and distance to which the image to be processed needs to be moved (translation parameter) and the direction and angle to which it needs to be rotated (rotation parameter), the extracted image features will be closer to the reference features, thus enabling pose calibration.
[0155] The solutions described in the above embodiments can effectively improve the accuracy of subsequent image matching by calibrating the pose of the extracted image features.
[0156] Exemplary application scenarios
[0157] Reference Figure 9 , Figure 10 and Figure 11 This application also provides an application scenario in which the above-described image recognition method is applied to improve the accuracy of matching and recognizing images of poor quality. Specifically, in this application scenario, the image recognition method is used for fingerprint unlocking of intelligent access control devices.
[0158] like Figures 9 to 11 As shown, the image recognition method is applied in this application scenario as follows:
[0159] Step S401: The processing device acquires the user's fingerprint image.
[0160] The processing device can be a smartphone, smart terminal, smart access control device, or other device with fingerprint collection and image processing capabilities.
[0161] Specifically, the user places their finger on the fingerprint sensor so that the processing device can capture the user's fingerprint image.
[0162] Step S402: Extract features from the user's fingerprint image to obtain fingerprint features.
[0163] Fingerprint features can include image features (such as SIFT, ORB, or AKAZE features), detail features (such as endpoints, bifurcation points, etc.), or ridge features (ridge protrusions and depressions, points of maximum curvature, etc.). The specific feature extraction process can be implemented using existing technologies, and will not be elaborated further.
[0164] Step S403: Determine the weight of fingerprint features based on the image quality of each region of the fingerprint image, and sort them according to the weight.
[0165] Among them, such as Figure 10 As shown, after acquiring the input fingerprint image, the fingerprint image can be divided into blocks, and the quality of each image block can be evaluated separately. Then, the weight of the fingerprint features corresponding to each image block is determined. The specific methods and processes can be referred to the relevant content in the aforementioned exemplary method section. Then, the extracted fingerprint features and their corresponding weights are combined and weighted, and finally, the fingerprint features sorted according to their weights are output.
[0166] Step S404: Determine the current processing mode. Determine whether the current mode is registration mode or identification mode. If it is registration mode, proceed to step S405; if it is identification mode, proceed to step S406.
[0167] The registration mode is for users to register their fingerprints, while the recognition mode is for users to unlock their devices using their fingerprints. In practice, the default mode is recognition mode. To enter registration mode, users need to perform the corresponding operation beforehand.
[0168] Step S405: Mark the collected fingerprint features as fingerprint template features, and classify them according to the weight of each fingerprint template feature.
[0169] Among them, priority classification means determining the high-priority fingerprint template features whose weights meet the set first threshold and the low-priority fingerprint template features whose weights do not meet the set first threshold.
[0170] Step S406: Mark the collected fingerprint features as fingerprint features to be identified, and classify them according to the weight of each fingerprint feature to be identified, and perform pose calibration on each fingerprint feature to be identified.
[0171] Among them, priority classification means determining the high-priority fingerprint features whose weights meet the set first threshold and the low-priority fingerprint features whose weights do not meet the set first threshold.
[0172] Furthermore, during pose calibration, multiple candidate features and multiple auxiliary features of the fingerprint image are obtained through feature extraction, and then sequentially as follows: Figure 11 As shown, one candidate feature is selected as the target candidate feature. Taking the target candidate feature as the center, all auxiliary features within its radius R are determined as associated auxiliary features. Then, all candidate features within its radius 2R are determined as associated candidate features.
[0173] Then, following the description in the aforementioned exemplary method section, feature association parameters between each target candidate feature and associated candidate feature, as well as feature association parameters between each target candidate feature and associated auxiliary feature, are calculated, such as the distance between features, the angle difference between features, the number of ridges between two features, and the type of features.
[0174] Next, the feature association parameters from these two parts are compared with the corresponding feature association parameters in the fingerprint template. The point pair with the highest matching degree in the set is selected, and the translation and rotation parameters of the fingerprint image are calculated using the coordinate and angle information of the point pair. Finally, pose calibration is performed on the fingerprint feature set to be identified. Pose calibration helps improve the accuracy of subsequent recognition.
[0175] Step S407: Use high-priority fingerprint features for matching to obtain the first similarity Sim1.
[0176] In this matching process, the two parties involved are the high-priority fingerprint feature to be identified and the high-priority fingerprint template feature.
[0177] Step S408: Determine whether the first similarity Sim1 is greater than the first similarity threshold T1. If yes, proceed to step S412; otherwise, proceed to step S409.
[0178] The first similarity threshold T1 is preset.
[0179] Step S409: Determine whether the first similarity Sim1 is less than the second similarity threshold T2. If yes, then directly determine that the match has failed; if no, then proceed to step S410.
[0180] The second similarity threshold T2 is also preset, and the second similarity threshold T2 is less than the first similarity threshold T1.
[0181] Step S410: Use high-priority fingerprint features and some low-priority fingerprint features to perform matching to obtain the second similarity Sim2.
[0182] The matching process involves two parties: a high-priority fingerprint feature to be identified and a portion of low-priority fingerprint features to be identified, as well as a high-priority fingerprint template feature and a portion of low-priority fingerprint template features.
[0183] Step S411: Determine whether the second similarity Sim2 is greater than the first similarity threshold T1. If yes, the match is successful, and step S412 is executed; otherwise, the match fails until all the fingerprint features to be identified participate in the matching and the corresponding similarity is still less than the first similarity threshold T1.
[0184] Step S412: If fingerprint recognition is successful, perform the corresponding processing.
[0185] For example, taking fingerprint recognition in access control devices as an example, if the fingerprint recognition is successful, the access control will be unlocked.
[0186] The above method can improve the accuracy of matching and recognizing fingerprint images of poor quality in some areas.
[0187] It should be understood that although the steps in the flowcharts above are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0188] Exemplary device
[0189] In one embodiment, such as Figure 12 As shown, an image recognition device 500 is provided, which includes: a feature extraction module 501, a weight calculation module 502, and a matching recognition module 503; wherein:
[0190] The feature extraction module 501 is used to extract features from the image to be processed, and obtain the image features corresponding to each region of the image to be processed.
[0191] The weight calculation module 502 is used to determine the weight of each image feature based on the image quality of each region in the image to be processed; wherein the weight of each image feature is positively correlated with the image quality of the corresponding region.
[0192] The matching and recognition module 503 is used to prioritize matching the image features whose weights meet the first threshold with the target features. If the matching result meets the preset conditions, the recognition result of the image to be processed is obtained.
[0193] In one embodiment, when determining the weight of each image feature based on the image quality corresponding to each region in the image to be processed, the weight calculation module 502 is specifically used for:
[0194] The image to be processed is divided into regions to obtain multiple image blocks, and the image quality of each image block is calculated; different image blocks correspond to different regions.
[0195] Based on the image quality of each image patch, the weights of each image feature corresponding to each region in the image to be processed are determined.
[0196] In one embodiment, when determining the weights of each image feature corresponding to each region in the image to be processed based on the image quality of each image block, the weight calculation module 502 is specifically used for:
[0197] Based on the relative position of each image block with respect to its neighboring image blocks, the degree of influence of each image block on its neighboring image blocks is determined; wherein, the degree of influence of any image block on its neighboring image blocks is negatively correlated with the distance between the image block and its neighboring image blocks;
[0198] The weight of each image block is determined based on its image quality and its influence on adjacent image blocks.
[0199] In one embodiment, when the matching and recognition module 503 prioritizes matching image features whose weights meet a first threshold with target features, and obtains the recognition result of the image to be processed if the matching result meets preset conditions, it is specifically used for:
[0200] Image features whose weights satisfy the first threshold are determined from each image feature;
[0201] The image features whose weights satisfy the first threshold are matched with the target features to obtain the first matching result;
[0202] If the first matching result meets the first preset condition, the recognition result of the image to be processed is obtained.
[0203] In one embodiment, the matching and recognition module 503 is further configured to:
[0204] If the first matching result does not meet the first preset condition but meets the second preset condition, then each image feature whose weight meets the first threshold and at least one image feature whose weight does not meet the first threshold are matched together with the target feature to obtain the second matching result.
[0205] If the second matching result meets the first preset condition, the recognition result of the image to be processed is obtained.
[0206] In one embodiment, when the matching and recognition module 503 determines the image features whose weights satisfy the first threshold from the image features, it is specifically used for:
[0207] Image features whose weights satisfy the first threshold are assigned to the first feature set, while image features whose weights do not satisfy the first threshold are assigned to the second feature set.
[0208] When the matching and recognition module 503 matches each image feature whose weight meets the first threshold with at least one image feature whose weight does not meet the first threshold with the target feature to obtain a second matching result, it is specifically used for:
[0209] At least one image feature from the second feature set is added to the first feature set to update the first feature set;
[0210] The updated first feature set is matched with the target feature to obtain the second matching result.
[0211] In one embodiment, such as Figure 13 As shown, the image recognition device further includes a pose calibration module 504; the pose calibration module 504 is used for:
[0212] Before prioritizing the matching of image features whose weights satisfy the first threshold with the target features, multiple candidate features and multiple auxiliary features of the image to be processed are obtained; the candidate features are at least some of the features in the image features, and the auxiliary features are features in the image features that are not candidate features, or the auxiliary features are features that are re-extracted and are different from the image features;
[0213] From multiple features corresponding to the preset image template, determine the reference features that satisfy the preset matching conditions with each candidate feature and each auxiliary feature;
[0214] Based on the positional relationship between each candidate feature, each auxiliary feature, and the reference feature, pose calibration is performed on each image feature.
[0215] Accordingly, when the matching and recognition module 503 prioritizes matching image features whose weights satisfy the first threshold with the target features, it specifically performs the following:
[0216] Image features whose weights meet the first threshold among the image features after pose calibration are preferentially matched with the target features.
[0217] In one embodiment, when the pose calibration module 504 determines a reference feature from multiple features corresponding to a preset image template that satisfies a preset matching condition with each candidate feature and each auxiliary feature, it is specifically used for:
[0218] Select one candidate feature at a time as the target candidate feature, and determine all associated auxiliary features within the first preset radius and all associated candidate features within the second preset radius, with the target candidate feature as the center.
[0219] Extract the feature association parameters between the target candidate feature and each associated auxiliary feature, as well as the feature association parameters between the target candidate feature and each associated candidate feature;
[0220] Based on the feature association parameters, the feature with the highest matching degree with each candidate feature and each auxiliary feature is determined from multiple features corresponding to the preset image template, and is used as the reference feature.
[0221] In one embodiment, when the pose calibration module 504 performs pose calibration processing on each image feature based on the positional relationship between each candidate feature and each auxiliary feature and the reference feature, it is specifically used for:
[0222] Based on the coordinate and angle information of each candidate feature and its corresponding reference feature, as well as the coordinate and angle information of each auxiliary feature and its corresponding reference feature, the translation and rotation parameters corresponding to the image to be processed are calculated.
[0223] Based on translation and rotation parameters, pose calibration is performed on various image features of the image to be processed.
[0224] For specific limitations regarding the image recognition device, please refer to the limitations of the image recognition method above, which will not be repeated here. Each module in the aforementioned image recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0225] Exemplary electronic devices
[0226] In one embodiment, an electronic device is provided, which may be a smart access control device, a smartphone, a tablet, a gateway, a server, or a cloud server, etc. Its internal structure diagram can be as follows: Figure 14 As shown, the electronic device may include a processor, memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an image recognition method. The display screen may be a liquid crystal display (LCD) or an e-ink display. The input device may be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0227] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. Specifically, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0228] In one embodiment, an electronic device is provided, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when executed by the processor, the computer program implements the steps of the image recognition method as described in any embodiment of the "Exemplary Methods" section.
[0229] The electronic device may be the processing device described in the foregoing embodiments, used to implement the steps of the method executed by the processing device in the "Exemplary Method" section.
[0230] Exemplary computer program products and computer-readable storage media
[0231] In one embodiment, a computer program product is provided, comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps of the image recognition methods according to various embodiments of this application as described in the "Exemplary Methods" section of this specification.
[0232] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the device or as a standalone software package.
[0233] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the various steps of the image recognition method shown in the embodiments of the exemplary method section above.
[0234] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0235] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0236] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. An image recognition method, characterized in that, The method includes: The image to be processed is divided into regions, resulting in multiple image blocks; different image blocks correspond to different regions. Feature extraction is performed on the image to be processed to obtain the image features corresponding to each image block of the image to be processed; Calculate the image quality of each image block; The weight of each image feature is determined based on the image quality corresponding to each image block in the image to be processed; wherein, the weight of each image feature is positively correlated with the image quality of the corresponding image block, and the weight of each image feature is determined based on the image quality of each image block and the degree of influence on adjacent image blocks; Image features whose weights satisfy the first threshold are preferentially matched with the target features. If the matching result meets the preset conditions, the recognition result of the image to be processed is obtained.
2. The method according to claim 1, characterized in that, The step of determining the weight of each image feature based on the image quality corresponding to each image block in the image to be processed includes: Based on the relative position of each image block with respect to its neighboring image blocks, the degree of influence of each image block on its neighboring image blocks is determined; wherein, the degree of influence of any image block on its neighboring image blocks is negatively correlated with the distance between the image block and its neighboring image blocks; The weight of each image block is determined based on its image quality and its influence on adjacent image blocks.
3. The method according to claim 1, characterized in that, The step of preferentially matching image features whose weights satisfy a first threshold with target features, and obtaining the recognition result of the image to be processed if the matching result meets a preset condition, includes: Image features whose weights satisfy the first threshold are determined from each of the image features; The image features whose weights satisfy the first threshold are matched with the target features to obtain the first matching result; If the first matching result meets the first preset condition, then the recognition result of the image to be processed is obtained.
4. The method according to claim 3, characterized in that, The method further includes: If the first matching result does not meet the first preset condition, but meets the second preset condition, then each image feature whose weight meets the first threshold and at least one image feature whose weight does not meet the first threshold are matched together with the target feature to obtain the second matching result. If the second matching result satisfies the first preset condition, then the recognition result of the image to be processed is obtained.
5. The method according to claim 4, characterized in that, The step of determining the image features whose weights satisfy the first threshold from each of the image features includes: Image features whose weights satisfy the first threshold are assigned to a first feature set, and image features whose weights do not satisfy the first threshold are assigned to a second feature set. The step of matching each image feature whose weight satisfies the first threshold with at least one image feature whose weight does not satisfy the first threshold together with the target feature to obtain a second matching result includes: At least one image feature from the second feature set is added to the first feature set to update the first feature set; The updated first feature set is matched with the target feature to obtain a second matching result.
6. The method according to any one of claims 1 to 5, characterized in that, Before prioritizing the matching of image features whose weights satisfy the first threshold with the target features, the method further includes: Obtain multiple candidate features and multiple auxiliary features of the image to be processed; the candidate features are at least some of the features in the image features, and the auxiliary features are features in the image features that are not the candidate features, or the auxiliary features are features that are re-extracted and are different from the image features; From multiple features corresponding to a preset image template, a reference feature is determined that satisfies a preset matching condition with each of the candidate features and each of the auxiliary features; Based on the positional relationship between each candidate feature, each auxiliary feature, and the reference feature, pose calibration processing is performed on each image feature; The step of preferentially matching image features whose weights satisfy a first threshold with target features includes: Image features whose weights satisfy the first threshold among the image features after pose calibration are preferentially matched with the target features.
7. The method according to claim 6, characterized in that, The step of determining reference features from multiple features corresponding to a preset image template that satisfy preset matching conditions with each candidate feature and each auxiliary feature includes: Select one of the candidate features in sequence as the target candidate feature, and determine all associated auxiliary features within a first preset radius and all associated candidate features within a second preset radius, with the target candidate feature as the center. Extract the feature association parameters between the target candidate feature and each of the associated auxiliary features, and the feature association parameters between the target candidate feature and each of the associated candidate features; Based on the feature association parameters, the feature with the highest matching degree with each candidate feature and each auxiliary feature is determined from multiple features corresponding to the preset image template, and is used as the reference feature.
8. The method according to claim 6, characterized in that, The step of performing pose calibration processing on each image feature based on the positional relationship between each candidate feature, each auxiliary feature, and the reference feature includes: Based on the coordinate and angle information of each candidate feature and its corresponding reference feature, as well as the coordinate and angle information of each auxiliary feature and its corresponding reference feature, the translation and rotation parameters corresponding to the image to be processed are calculated. Based on the translation and rotation parameters, pose calibration processing is performed on each of the image features of the image to be processed.
9. An image recognition device, characterized in that, The device includes: The image segmentation module is used to divide the image to be processed into regions, resulting in multiple image blocks; different image blocks correspond to different regions. The feature extraction module is used to extract features from the image to be processed, and obtain the image features corresponding to each image block of the image to be processed; A quality calculation module is used to calculate the image quality of each of the image blocks; The weight calculation module is used to determine the weight of each image feature based on the image quality corresponding to each image block in the image to be processed; wherein, the weight of each image feature is positively correlated with the image quality of the corresponding image block, and the weight of each image feature is determined based on the image quality of each image block and the degree of influence on adjacent image blocks; The matching and recognition module is used to prioritize matching the image features whose weights meet the first threshold with the target features. If the matching result meets the preset conditions, the recognition result of the image to be processed is obtained.
10. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when executed by the processor, the computer program implements the steps of the image recognition method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the image recognition method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Face identification method and device, electronic device and storage medium
CN107292287A
Selective extension-based fingerprint image matching method
CN107679494A