Image enhancement method and device, electronic equipment and storage medium
By iteratively applying image enhancement algorithms with varying priorities, the method addresses the inconsistency in image quality, enhancing images to meet predefined conditions and improve recognition accuracy.
Patent Information
- Application Number
- CN202410054570.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-15
- Publication Date
- 2025-07-15
AI Technical Summary
In existing biometric technologies, when the image quality is poor, the use of the same image enhancement algorithm leads to excessive enhancement or insufficient enhancement effect, affecting the recognition effect.
Algorithms with different priorities in the image enhancement algorithm library are used to enhance the images step by step until preset conditions are met to ensure that the image quality meets the requirements.
Improve image enhancement effect, ensure the accuracy and user experience of subsequent recognition, and avoid the problem of excessive or insufficient image enhancement.
Smart Images

Figure CN120318120A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology. Specifically, it relates to a method, device, electronic device and storage medium for image enhancement. Background Art
[0002] Biometric technology is a technology that closely combines computers with high-tech means such as optics, acoustics, biosensors, and biostatistics principles, and uses the inherent physiological characteristics of the human body (such as fingerprints, facial images, irises, etc.) and behavioral characteristics (such as handwriting, voice, gait, etc.) to identify personal identities.
[0003] In practical applications, biometric technology can be applied to unlocking. During the unlocking process, the user can place their palm or finger on the palm vein or fingerprint input position on the door lock, or align their face with the camera, so that the door lock can obtain images of the user's current palm vein, face, fingerprint, etc. for biometric identification. However, often due to reasons such as dim light, water on the palm or fingerprint, the image quality directly obtained by the door lock is low and cannot be accurately identified. For images with poor quality, in the prior art, the door lock may directly prompt the user that no available image has been successfully recorded and prompt the user to re-enter. If the entry is unsuccessful multiple times, the door lock will be temporarily locked and unable to be unlocked, resulting in poor user experience.
[0004] To solve this problem, most existing biometric methods use different image enhancement methods for preprocessing. However, there is a problem when using image enhancement methods: using the same algorithm to enhance each image will cause over-enhancement or insufficient enhancement effect of some images, resulting in a decrease in image recognition effect. Summary of the Invention
[0005] This application provides a method, device, electronic device and storage medium for image enhancement to at least solve the technical problem that a single image enhancement algorithm cannot meet the enhancement requirements of images.
[0006] According to the first aspect of the embodiments of this application, a method for image enhancement is provided, including:
[0007] Obtain an image to be enhanced;
[0008] For the image to be enhanced, start from the enhancement algorithm with the set priority in the image enhancement algorithm library for enhancement to obtain the enhanced image; the enhancement algorithms in the image enhancement algorithm library have different priorities;
[0009] In the case where it is determined that the enhanced image does not meet the first preset condition, the image to be enhanced is enhanced using the enhancement algorithm with the next priority level in the image enhancement algorithm library, and the enhanced image is obtained again until the enhanced image meets the first preset condition, or until all the enhancement algorithms in the image enhancement algorithm library are traversed.
[0010] According to the second aspect of the embodiments of the present application, an electronic device is provided, including a memory and a processor. The memory is used to store a computer program, and the processor is used to execute the computer program to implement the image enhancement method described above.
[0011] According to the third aspect of the embodiments of the present application, a device for image enhancement is provided, including an acquisition module for acquiring an image to be enhanced;
[0012] An enhancement module for enhancing the image to be enhanced starting from the enhancement algorithm with the set priority level in the image enhancement algorithm library to obtain an enhanced image; the enhancement algorithms in the image enhancement algorithm library have different priority levels;
[0013] A detection module for, in the case where it is determined that the enhanced image does not meet the first preset condition, enhancing the image to be enhanced using the enhancement algorithm with the next priority level in the image enhancement algorithm library, and obtaining the enhanced image again until the enhanced image meets the first preset condition, or until all the enhancement algorithms in the image enhancement algorithm library are traversed.
[0014] Optionally, the device further includes a preprocessing module for acquiring an original image;
[0015] Performing feature extraction on the original image;
[0016] Based on the result of the feature extraction, determining the image to be enhanced in the original image.
[0017] Optionally, the device further includes a first priority module for acquiring a test image;
[0018] Performing image enhancement on the test image using the enhancement algorithms in the image enhancement algorithm library;
[0019] Determining the matching accuracy between the image obtained after enhancement by the enhancement algorithm and the test image;
[0020] Determining the enhancement rate of the enhancement algorithm;
[0021] Combining the matching accuracy and the enhancement rate of the enhancement algorithm to perform priority sorting on the enhancement algorithms.
[0022] Optionally, the first priority module includes a matching accuracy unit for determining the false recognition rate and the false rejection rate of the image obtained after enhancement by the enhancement algorithm and the test image;
[0023] The first priority module further includes a first priority unit for sorting the enhancement algorithms in ascending order of false recognition rate;
[0024] For enhancement algorithms with the same false recognition rate, sort them in ascending order of false rejection rate;
[0025] For enhancement algorithms with the same false rejection rate, sort them in descending order of enhancement rate.
[0026] Optionally, the device further includes a second priority module for obtaining the pixel values of the image obtained after enhancement by the enhancement algorithm;
[0027] Determine the mean value of the pixel values of each enhanced image;
[0028] Sort the enhancement algorithms in descending order of the mean value of the pixel values of the enhanced image; and / or, the device further includes a third priority module for obtaining the pixel values of the image obtained after enhancement by the enhancement algorithm;
[0029] Determine the variance of the pixel values of each enhanced image;
[0030] Sort the enhancement algorithms in descending order of the variance of the pixel values of the enhanced image.
[0031] Optionally, the device further includes a fourth priority module for obtaining a test image;
[0032] Perform image enhancement on the test image using the enhancement algorithms in the image enhancement algorithm library;
[0033] Determine the structural similarity between the image obtained after enhancement by the enhancement algorithm and the test image;
[0034] Sort the enhancement algorithms in descending order of the structural similarity between the image obtained after enhancement and the test image; or
[0035] Determine the peak signal-to-noise ratio between the image obtained after enhancement by the enhancement algorithm and the test image;
[0036] Sort the enhancement algorithms in descending order of the peak signal-to-noise ratio between the image obtained after enhancement and the test image.
[0037] Optionally, the first preset condition includes requirements for various attribute features extracted from the enhanced image, where the attribute features include quality parameters and / or the number of feature points of the enhanced image;
[0038] The device further includes a detection module, configured to determine whether the quality parameter of the enhanced image is higher than a preset first threshold, and / or determine whether the number of feature points of the enhanced image is higher than a preset second threshold, so as to determine whether the enhanced image meets the first preset condition;
[0039] The device further includes a determination module, configured to determine the quality parameter of the enhanced image, and / or
[0040] extract feature points from the enhanced image to determine the number of feature points of the enhanced image.
[0041] Optionally, the determination module includes a determination unit, configured to obtain the pixel values of the enhanced image and determine the mean value of the pixel values of the enhanced image;
[0042] obtain the pixel values of the enhanced image and determine the variance of the pixel values of the enhanced image;
[0043] determine the structural similarity between the enhanced image and the image to be enhanced;
[0044] determine the peak signal-to-noise ratio between the enhanced image and the image to be enhanced.
[0045] According to a fourth aspect of the embodiments of the present application, there is provided a storage medium storing a computer program, which when executed by a processor implements the above-mentioned image enhancement method.
[0046] In the embodiments of the present application, the enhancement algorithms in the image enhancement algorithm library have priorities, that is, they have an arrangement order. According to the arrangement order, different enhancement algorithms are selected to enhance the image to be enhanced, which helps different images to be enhanced to select an enhancement algorithm suitable for the image for enhancement, improves the image enhancement effect, and ensures the subsequent image recognition effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a schematic diagram of an application scenario of an image enhancement method provided by an embodiment of the present application.
[0048] Figure 2 is a flowchart of an image enhancement method provided by an embodiment of the present application.
[0049] Figure 3 is an overall flowchart of an image enhancement method provided by an embodiment of the present application.
[0050] Figure 4 is a flowchart block diagram of an image enhancement method provided by an embodiment of the present application.
[0051] Figure 5It is a schematic structural diagram of an image enhancement device provided by an embodiment of the present application.
[0052] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0053] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0054] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these process, method, product or device.
[0055] An embodiment of the present application provides an image enhancement method. The application environment of this method can be an environment where an electronic device interacts with a server, or an environment where a user interacts with an electronic device, or multi-terminal interaction, etc. Among them, the environment where an electronic device interacts with a server is such that the electronic device uploads the collected image, that is, the image to be enhanced, to the server, and the server implements the steps of the image enhancement method to perform enhancement processing on the image to be enhanced. The environment where a user interacts with an electronic device is such that the user inputs the image to be enhanced, that is, the image to be enhanced, into the electronic device, and the electronic device implements the steps of the image enhancement method to perform enhancement processing on the image to be enhanced. The multi-terminal interaction environment is such that the first terminal is used to collect an image and interact with the second terminal, and based on the image acquisition request transmitted by the second terminal, transmits the collected image to the second terminal, and then the second terminal implements the steps of the image enhancement method to perform enhancement processing on the image to be enhanced.
[0056] For the sake of easy understanding, the image enhancement method provided by the present application can be applied to, for example Figure 1In the application environment shown, it includes a terminal 001 and a server 002. A communication link is established between the terminal 001 and the server 002, enabling data interaction. The terminal 001 is used to collect or receive the image to be enhanced, and then transmit the image to be enhanced to the server 002. After receiving the image to be enhanced, the server 002 performs enhancement processing on the image to be enhanced. Specifically, in the enhancement processing process, for the image to be enhanced, start with the enhancement algorithm with a set priority from the image enhancement algorithm library for enhancement to obtain the enhanced image; the enhancement algorithms in the image enhancement algorithm library have different priorities; when it is determined that the enhanced image does not meet the first preset condition, use the enhancement algorithm with the next priority in the image enhancement algorithm library to enhance the image to be enhanced, and re-obtain the enhanced image until the enhanced image meets the first preset condition, or until all the enhancement algorithms in the image enhancement algorithm library are traversed. Thus, the image enhancement task is completed.
[0057] Among them, the terminal 001 can be a smart phone, a notebook computer, a personal computer, a tablet computer, a smart control panel or other electronic devices that can implement network connection. Specifically, the terminal 001 can be a smart home device and a device with fingerprint, palmprint or face recognition functions. For example, a fingerprint door lock will generate an image with a fingerprint, palmprint or face after recognizing features such as a fingerprint, palmprint or face, as the image to be enhanced. The server 002 can be implemented by an independent server or a server cluster composed of multiple servers.
[0058] Currently, in many fields, user feature recognition technology is used to identify the identity of users. For example, in the field of smart home devices, door lock devices usually record features such as the fingerprints, palmprints or faces of users. When the user opens the door later, the door lock device recognizes the features of the user again and compares them with the previously recorded fingerprints, palmprints or faces and other features to confirm the identity of the user and perform the unlocking action. However, when recognizing the features of users, the images containing information such as user fingerprints, palmprints or faces are often of low quality, mostly because the light is dim, there are foreign objects on the palm, etc. Therefore, the images need to be enhanced. However, the current image enhancement technology uses the same algorithm for each image, which is likely to cause over-enhancement or insufficient enhancement effect of some images and is difficult to meet the image enhancement requirements.
[0059] Based on this, the image enhancement method provided in this embodiment is as Figure 2 shown. For the sake of easy understanding, taking the smart door lock in the smart home device as an example, the smart door lock has a palmprint recognition function and generates an image containing the user's palmprint. The method includes:
[0060] S101. Obtain the image to be enhanced.
[0061] In this embodiment, the image to be enhanced can be obtained by a smart door lock. For example, after the user places the palm on the palmprint acquisition area of the smart door lock, the smart door lock takes a picture to obtain the image to be enhanced. In addition, it can also be transmitted to the smart door lock by other devices so that the smart door lock obtains the image to be enhanced. The specific acquisition method of the image to be enhanced in this embodiment is not limited. It should be noted that in other embodiments, the current execution subject may be a terminal such as a smart phone or a server, which can directly retrieve the image taken by the smart door lock as the image to be enhanced.
[0062] Among them, the image to be enhanced refers to the image that needs to be enhanced. That is to say, in one embodiment, all images can be defaulted to the images to be enhanced. In another embodiment, the images can be judged first, and if enhancement is needed, the corresponding images are determined as the images to be enhanced.
[0063] Among them, the image to be enhanced refers to the image containing the user's biometric features. The biometric feature in this embodiment is the palmprint. In other embodiments, the biometric feature can also be a fingerprint, a face image, an iris, a note, a voice, a gait, etc. This embodiment does not make specific limitations on this.
[0064] S102. For the image to be enhanced, start from the enhancement algorithm with the set priority in the image enhancement algorithm library, perform enhancement, and obtain the enhanced image; the enhancement algorithms in the image enhancement algorithm library have different priorities.
[0065] Among them, there is a preset image enhancement algorithm library for storing enhancement algorithms. The so-called enhancement algorithm refers to an algorithm that can enhance an image, such as a local histogram equalization algorithm, an image enhancement algorithm based on deep learning, an image edge enhancement algorithm, etc. Specifically, being able to enhance an image means being able to enhance the resolution, local features, clarity, etc. of the image. That is to say, as long as it is an algorithm that can improve the image quality, it can be regarded as an enhancement algorithm.
[0066] Each enhancement algorithm has a corresponding priority in the image enhancement algorithm library. Specifically, the high or low priority can be determined according to the enhancement effect of each enhancement algorithm on the image. For example, set the priority of the enhancement algorithm with high enhancement efficiency to high, and the priority of the enhancement algorithm with low enhancement efficiency to low; for another example, set the priority of the enhancement algorithm with low enhancement error rate to high, and the one with high enhancement error rate to low; for another example, set the priority of the enhancement algorithm with a large number of features after enhancement to high, and the one with a small number of features to low; it is also possible to comprehensively use multiple consideration factors (such as enhancement efficiency, error rate, number of features, etc.) as the evaluation criteria for the priority to set the priority for each enhancement algorithm. Therefore, the priority evaluation criteria for the enhancement algorithm can be selected according to specific requirements or calculation costs. This embodiment does not make specific limitations on this.
[0067] It should be noted that there can be multiple numbers of priorities, and the number of priorities can increase as the number of enhancement algorithms increases. For example, when there are 10 enhancement algorithms stored in the image enhancement algorithm library, 5 priorities can be set. When the number of enhancement algorithms stored in the image enhancement algorithm library increases to 100, 10 priorities can be set. That is to say, the specific number of levels included in the priorities is not specifically limited in this embodiment and can be set according to the actual situation. In addition, each level of priority can have one enhancement algorithm, multiple enhancement algorithms, or even no enhancement algorithm. Specifically, for example, the priorities include three levels: A, B, and C, where A is the highest level and C is the lowest level. After calculating the image enhancement efficiency of each enhancement algorithm, it is obtained that there is 1 enhancement algorithm with priority A, 10 enhancement algorithms with priority B, and 0 enhancement algorithms with priority C.
[0068] In one embodiment, when an image to be enhanced needs to be enhanced, start enhancing the image to be enhanced from the enhancement algorithm with the set priority. Among them, the set priority can be the priority of any level in the priority levels. Taking the enhancement of an image containing a palmprint in this embodiment as an example, if there are 10 levels of enhancement algorithms stored in the image enhancement algorithm library, it can be defaulted to start enhancing the image containing the palmprint from the highest level, that is, the enhancement algorithm of the first priority. At this time, the first priority is the set priority; similarly, it can also start enhancing from the enhancement algorithm of the third priority set by the user.
[0069] Since each priority can correspond to multiple enhancement algorithms, therefore, after determining the set priority, any one of all the enhancement algorithms with the set priority can be selected to start enhancing the image to be enhanced. Similarly, it can also start enhancing the image to be enhanced from the first enhancement algorithm with the set priority. As for how to set the arrangement order of the enhancement algorithms for each priority, it is not specifically limited in this embodiment.
[0070] S103. When it is determined that the enhanced image does not meet the first preset condition, use the enhancement algorithm of the next priority in the image enhancement algorithm library to enhance the image to be enhanced, and re-obtain the enhanced image until the enhanced image meets the first preset condition, or until all the enhancement algorithms in the image enhancement algorithm library are traversed.
[0071] Among them, the first preset condition is used to restrict whether the enhanced image meets the requirements. That is to say, the first preset condition is the standard for judging whether the enhanced image meets the standard. If the enhanced image meets the first preset condition, it proves that the enhanced image meets the requirements or the standard, and there is no need to enhance it again; on the contrary, if the enhanced image does not meet the first preset condition, it needs to be enhanced again. Therefore, the specific content of the first preset condition can be set according to the enhancement requirements or enhancement standards for the image. Specifically, the enhancement requirements are, for example, the requirements for the number of features in the image, such as the number of features in the image cannot be less than n, where n is a positive integer, or the similarity between the enhanced image and the original image should be greater than m, where m is a positive number. Therefore, the specific content of the first preset condition in this embodiment is not limited, and the purpose is to be able to know whether the image to be enhanced or the enhanced image needs to be further enhanced through the first preset condition.
[0072] Among them, the next priority is not a limitation on the priority level. That is to say, the priority level of the next priority can be higher than the current priority level or lower than the current priority level. For example, if the image is enhanced according to the enhancement algorithm from the lower priority level to the higher priority level, the next priority refers to the enhancement algorithm that is one level higher than the priority level of the current enhancement algorithm. Usually, it is preferably to start enhancing the image to be enhanced from the enhancement algorithm corresponding to the higher level of priority.
[0073] For the sake of easy understanding, after the image to be enhanced is enhanced using the enhancement algorithm with the set priority and the enhanced image does not meet the first preset condition, the enhancement algorithm with the next priority is used for enhancement, and so on.
[0074] It should be noted that in one embodiment, after all enhancement algorithms with set priorities are used first, if the first preset condition is still not satisfied, the enhancement algorithm of the next priority is used for enhancement. If an enhancement algorithm with a set priority makes the enhanced image satisfy the first preset condition, it is not necessary to use the enhancement algorithm of the next priority. Moreover, only when all enhancement algorithms of the next priority cannot make the image to be enhanced satisfy the first preset condition, will the enhancement algorithm of the next priority level be used to enhance the image to be enhanced. Similarly, if an enhancement algorithm in the next priority makes the enhanced image satisfy the first preset condition, it is not necessary to replace the enhancement algorithm of the next priority level. For example, the enhancement algorithms of priority A include algorithm 1 and algorithm 2, the enhancement algorithms of priority B include algorithm 3 and algorithm 4, the enhancement algorithms of priority C include algorithm 5 and algorithm 6, and priority A is the set priority, priority B is the next priority of priority A, and priority C is the next priority of priority B. Then, first use algorithm 1 in priority A (because priority A is the set priority) to enhance the image to be enhanced to obtain the enhanced image. If the enhanced image does not satisfy the first preset condition, use algorithm 2 to enhance the image to be enhanced. If it still does not satisfy the first preset condition, then use the enhancement algorithm of the next priority, that is, priority B, for enhancement. Algorithm 3 can be used first to enhance the image to be enhanced. If the enhanced image satisfies the first preset condition, no further enhancement is required. If it does not satisfy the first preset condition, since priority B also includes algorithm 4, algorithm 4 is used for enhancement until the enhanced image satisfies the first preset condition or all enhancement algorithms are traversed.
[0075] In another embodiment, only one enhancement algorithm is selected from each priority level to perform enhancement processing on the image. If the first preset condition is not satisfied, one enhancement algorithm of the next priority is used to perform enhancement processing on the image until the enhanced image satisfies the first preset condition or all enhancement algorithms corresponding to the priority levels are traversed.
[0076] Through the above content, the enhancement algorithms in the image enhancement algorithm library have priorities, that is, they have an arrangement order. According to the arrangement order, different enhancement algorithms are selected to enhance the image to be enhanced, which helps different images to be enhanced to select suitable enhancement algorithms for enhancement, improves the image enhancement effect, and ensures the subsequent image recognition effect.
[0077] In another implementation manner of the present application, before obtaining the image to be enhanced, it further includes:
[0078] S201. Obtain the original image.
[0079] Among them, the original image refers to the image obtained before the image to be enhanced is determined. That is to say, before obtaining the image to be enhanced, it is necessary to first identify the image that needs to be enhanced from the obtained images, because not all images need to be enhanced. These images that need to be judged whether there is an enhancement requirement are regarded as the original images.
[0080] Specifically, in this embodiment, the original image refers to a palm vein image. In other embodiments, the original image can also be a fingerprint image or a face image, etc.
[0081] S202. Extract features from the original image.
[0082] Among them, the features in the original image refer to the features that are helpful for judging whether the original image needs to be enhanced. For example, when focusing on the clarity of the original image, the feature in the original image can be the resolution of the image; when focusing on the clarity of the palm vein in the original image, the feature in the original image can be the information of the pixel points related to the palm vein. That is to say, which information in the original image can be regarded as a feature should be determined by the use or requirement of the image. For example, if the image is used to identify the user's identity through the palm vein, then when judging whether the image needs to be enhanced, it should mainly consider whether the palm vein in the image is clear, and secondly, it can consider whether other aspects of the image need to be enhanced, so as to determine the features that need to be extracted.
[0083] Specifically, the features that need to be extracted are such as palm vein image quality features, the number of features, and feature quality, etc. There can be various types of extracted features. For example, both image quality features and the number of features are extracted, so that it is possible to comprehensively judge whether the original image needs to be enhanced. The extraction methods are such as the scale-invariant feature transform method, the ORB algorithm (Oriented FAST and Rotated BRIEF), and the convolutional neural network algorithm, etc. This embodiment does not make specific limitations on this.
[0084] S203. Based on the result of feature extraction, determine the image to be enhanced in the original image.
[0085] After obtaining the features of each original image, it is possible to judge whether each original image needs to be enhanced according to the extracted features, so as to determine the original images that need to be enhanced as the images to be enhanced. Specifically, it is possible to judge whether the result of feature extraction meets the requirements by setting a threshold, so as to determine the original images that do not meet the requirements or meet the requirements as the images to be enhanced. In addition, it is also possible to directly use the first preset condition to judge whether the result of feature extraction meets the requirements. If the first preset condition is satisfied, the original image does not need to be enhanced, otherwise the original image is determined as the image to be enhanced.
[0086] Through the above content, by extracting features from the original image and identifying the original image that needs to be enhanced based on the result of feature extraction, the original image that needs to be enhanced is determined as the image to be enhanced. On the one hand, different from enhancing the original image without discrimination, it helps to reduce the cost of enhancement and the required resources; on the other hand, using the result of the extracted features to determine the image to be enhanced helps to improve the accuracy and avoid mixing a large number of images that do not need to be enhanced in the image to be enhanced.
[0087] In another embodiment of the present application, the method further includes determining the priority of the enhancement algorithms in the image enhancement algorithm library in the following manner:
[0088] S301. Obtain a test image.
[0089] Among them, the test image refers to the image used to evaluate the enhancement algorithms in the image enhancement algorithm library. That is to say, when evaluating the priority of each enhancement algorithm in the image enhancement algorithm library, it is necessary to first obtain the evaluation of each enhancement algorithm, and then determine the priority of each enhancement algorithm according to the evaluation. In this embodiment, the enhancement algorithm is evaluated by the enhancement situation of the algorithm on the image, so it is necessary to use the image that needs to be enhanced, that is, it is necessary to use the test image.
[0090] It should be noted that the test images are all images that need to be enhanced, that is to say, the test images do not meet the first preset condition. In addition, the test image can be a palm vein image, a fingerprint image or a face image.
[0091] S302. Use the enhancement algorithms in the image enhancement algorithm library to perform image enhancement on the test image.
[0092] Among them, there may be many enhancement algorithms in the image enhancement algorithm library. If all the algorithms in the image enhancement algorithm library need to be evaluated for priority, then all the enhancement algorithms are used to perform image enhancement on the test image respectively. If only one or several enhancement algorithms in the image enhancement algorithm library need to be evaluated for priority, then only the enhancement algorithms that need to be evaluated for priority are used to perform image enhancement on the test image.
[0093] It should be noted that since the enhancement algorithm is an algorithm used to enhance the image, as long as the test image is processed by the enhancement algorithm or the test image is input into the enhancement algorithm, the specific enhancement process is related to the enhancement algorithm, so the enhancement process is not specifically limited in this embodiment.
[0094] S303. Determine the matching accuracy between the image obtained after enhancement by the enhancement algorithm and the test image.
[0095] Among them, the matching accuracy refers to the similarity between the enhanced image and the test image, mainly including the corresponding relationships in aspects such as content, features, structure, relationships, texture, and gray scale. Specifically, the matching accuracy is evaluated by the FAR (False Acceptance Rate) and FRR (False Rejection Rate) of the pre-tested palm vein dataset. Among them, FAR refers to the false acceptance rate, which can also be called the mis-identification rate. FRR refers to the false rejection rate, which can also be called the rejection of true rate. The specific calculation process is not specifically limited in this embodiment.
[0096] S304. Determine the enhancement rate of the enhancement algorithm.
[0097] Among them, the enhancement rate is calculated through the complexity of the enhancement algorithm.
[0098] S305. Combine the matching accuracy and enhancement rate of the enhancement algorithm to perform a priority ranking on the enhancement algorithm.
[0099] Among them, when evaluating the priority of the enhancement algorithm, both the matching accuracy and the enhancement rate need to be considered. Therefore, in one embodiment, by setting multiple thresholds for the matching accuracy and the enhancement rate, if the matching accuracy of the enhancement algorithm falls into the corresponding range, and at the same time, the enhancement rate also falls into this range, then the priority of the enhancement algorithm is determined. Specifically, for the sake of easy understanding, for example, in this embodiment, 5000 palm vein images are used as test images to evaluate the priority levels of each enhancement algorithm. The priority levels include level 1, level 2, level 3, level 4, and level 5. There are multiple thresholds for FAR and multiple thresholds for FRR, as shown in the following table:
[0100]
[0101] If the matching accuracy of the enhancement algorithm meets FAR < 1 / 1000w and FRR < 1%, and at the same time, the enhancement rate of the enhancement algorithm meets < 0.5s, then the priority of the enhancement algorithm is level 1. The priority evaluation methods for other levels are the same and will not be elaborated here.
[0102] In another embodiment, the matching accuracy can also be used as the main evaluation factor, and the enhancement rate can be used as the secondary evaluation factor. That is to say, the enhancement algorithm with high matching accuracy and high enhancement rate is rated as the highest priority level, the enhancement algorithm with high matching accuracy but low enhancement rate is rated as the second priority level, the enhancement algorithm with low matching accuracy and low enhancement rate is rated as the third priority level, and so on. The specific evaluation method can be adaptively changed and is not specifically limited in this embodiment.
[0103] Through the above, the matching accuracy and enhancement rate of the enhancement algorithms are used to perform priority sorting, making the priorities of the respective enhancement algorithms more reasonable. When enhancing the image to be enhanced subsequently, it is possible to preferentially use the enhancement algorithms with both high matching accuracy and high enhancement rate, thereby helping to save the time spent on image enhancement and improving the image enhancement efficiency.
[0104] In another embodiment of the present application, determining the matching accuracy between the image obtained after enhancement by the enhancement algorithm and the test image includes:
[0105] Determining the false recognition rate and the false rejection rate between the image obtained after enhancement by the enhancement algorithm and the test image.
[0106] Among them, the false recognition rate is FAR, and the false rejection rate is FRR. The specific calculation process is not limited in this embodiment. After obtaining the false recognition rate and the false rejection rate, the false recognition rate and the false rejection rate are used as the matching accuracy corresponding to the enhancement algorithm.
[0107] Combining the matching accuracy and enhancement rate of the enhancement algorithms to perform priority sorting on the enhancement algorithms includes:
[0108] S401. Sort the enhancement algorithms in ascending order of false recognition rate.
[0109] That is to say, sort the respective enhancement algorithms according to the false recognition rate of each enhancement algorithm, and those with a smaller false recognition rate are arranged in the front, and those with a larger false recognition rate are arranged in the back. Specifically, for example, if the false recognition rate of enhancement algorithm 1 is 0.1, the false recognition rate of enhancement algorithm 2 is 0.2, and the false recognition rate of enhancement algorithm 3 is 0.3, when sorting enhancement algorithms 1, 2, and 3, since 0.1 < 0.2 < 0.3, the sorting result is enhancement algorithm 1 - enhancement algorithm 2 - enhancement algorithm 3.
[0110] S402. For the enhancement algorithms with the same false recognition rate, sort them in ascending order of false rejection rate.
[0111] When the false recognition rates of at least two enhancement algorithms are the same, then sort them according to the false rejection rate of the enhancement algorithms. Continuing with the example in step S401, if the false recognition rate of enhancement algorithm 1 is 0.1 and the false rejection rate is 0.02, and the false recognition rate of enhancement algorithm 4 is 0.1 and the false rejection rate is 0.03, because the false rejection rate of enhancement algorithm 1 is less than the false rejection rate of enhancement algorithm 4, the obtained sorting result is enhancement algorithm 1 - enhancement algorithm 4 - enhancement algorithm 2 - enhancement algorithm 3.
[0112] S403. For the enhancement algorithms with the same false rejection rate, sort them in descending order of enhancement rate.
[0113] Similarly, when the false recognition rates of at least two enhancement algorithms are the same and the false rejection rates are also the same, sort them according to the enhancement rate, and no further description will be given.
[0114] When prioritizing each enhancement algorithm through the above, only the magnitude relationship between the matching accuracy and the enhancement rate is considered. The computational amount required for sorting is small, which helps save computing resources and improve the efficiency of priority sorting.
[0115] In another embodiment of the present application, the method further includes determining the priority of the enhancement algorithms in the image enhancement algorithm library in the following manner:
[0116] S501. Obtain the pixel values of the image obtained after enhancement by the enhancement algorithm.
[0117] Images all have pixel values. Obtain the pixel values of each pixel point of the image obtained after enhancement. In addition, it is also possible to only obtain the pixel values of the pixel points corresponding to the palm vein in the image obtained after enhancement. In other embodiments, it may also be the pixel values of the pixel points corresponding to fingerprints or faces.
[0118] S502. Determine the mean value of the pixel values of each enhanced image.
[0119] Among them, the mean value can be obtained by averaging all the obtained pixel values. It should be noted that when it is necessary to prioritize multiple enhancement algorithms, since each enhancement algorithm has performed enhancement processing on the test image, each enhancement algorithm corresponds to an enhanced image. Therefore, when calculating the mean value, calculate the mean value of the pixel values of each image, and this mean value is the mean value corresponding to the enhancement algorithm.
[0120] S503. Sort the enhancement algorithms in descending order according to the mean value of the pixel values of the enhanced images.
[0121] Since each enhancement algorithm corresponds to a mean value, after sorting the mean values from large to small, the sorting of multiple enhancement algorithms is completed. That is to say, if the mean value corresponding to the enhancement algorithm is the largest, it is arranged in the front of other enhancement algorithms; if the mean value corresponding to the enhancement algorithm is the smallest, it is arranged at the end of other enhancement algorithms.
[0122] And / or
[0123] S504. Obtain the pixel values of the image obtained after enhancement by the enhancement algorithm.
[0124] Similarly, the image obtained after enhancement has pixel values, which can be directly obtained and will not be elaborated. If there are multiple enhancement algorithms, each enhancement algorithm corresponds to a set of pixel values.
[0125] S505. Determine the variance of the pixel values of each enhanced image.
[0126] Calculate the variance of the pixel values of each enhanced image. The calculation formula for variance will not be elaborated here. After calculating the variance, the variance corresponding to each enhancement algorithm can be obtained.
[0127] S506. Sort the enhancement algorithms in descending order according to the variance of the pixel values of the enhanced images.
[0128] After sorting the variances, since each variance corresponds to an enhancement algorithm, the sorting of each enhancement algorithm is thus completed, and the result of the priority sorting of each enhancement algorithm is obtained. Determine the priority of each enhancement algorithm according to the priority sorting. For example, the top 5 enhancement algorithms have the highest priority, which is level 1, and the enhancement algorithms ranked 6 - 15 have a priority of level 2, and so on.
[0129] Through the above content, in addition to using the false recognition rate and rejection rate corresponding to the enhancement algorithm for priority sorting, the mean or variance corresponding to the enhancement algorithm can also be used for priority sorting. There are many sorting methods, which improves the flexibility of priority sorting selection. At the same time, the mean and variance are easier to calculate, which helps to reduce the calculation pressure and save computing resources.
[0130] In another implementation manner of the present application, the method further includes determining the priority of the enhancement algorithms in the image enhancement algorithm library in the following manner:
[0131] S601. Obtain a test image.
[0132] The test image has been described above and will not be elaborated here.
[0133] S602. Use the enhancement algorithms in the image enhancement algorithm library to perform image enhancement on the test image.
[0134] Each enhancement algorithm in the image enhancement algorithm library can perform enhancement processing on the test image. The specific enhancement process is determined by the specific enhancement algorithm, so this embodiment does not limit it.
[0135] S603. Determine the structural similarity between the image obtained after enhancement by the enhancement algorithm and the test image.
[0136] Structural Similarity (SSIM) is an index for measuring the similarity between two images. By calculating the structural similarity between the image obtained after enhancement and the test image, the enhancement effect and enhancement ability of the enhancement algorithm can be obtained, and thus the priority of the enhancement algorithm can be determined according to the structural similarity. Specifically, the calculation method of the structural similarity is not specifically limited in this embodiment.
[0137] S604. Sort the enhancement algorithms in descending order according to the structural similarity between the enhanced image and the test image.
[0138] Or,
[0139] S605. Determine the peak signal-to-noise ratio of the enhanced image obtained by the enhancement algorithm and the test image.
[0140] The peak signal-to-noise ratio (PSNR) can measure the quality of an image. Therefore, by determining the peak signal-to-noise ratio, the enhancement effect or enhancement ability of the enhancement algorithm can be determined, and thus the priority of the enhancement algorithm can be determined. Specifically, the calculation method of the peak signal-to-noise ratio is not specifically limited in this embodiment.
[0141] S606. Sort the enhancement algorithms in descending order according to the peak signal-to-noise ratio of the enhanced image obtained by the enhancement algorithm and the test image.
[0142] Whether sorting by structural similarity or peak signal-to-noise ratio, the sorting of the corresponding enhancement algorithms can be obtained, so that the priority of each enhancement algorithm can be determined. The specific sorting process and the determination process of the priority have been exemplified above and will not be elaborated here.
[0143] Through the above content, using the structural similarity or peak signal-to-noise ratio between images to determine the priority of the enhancement algorithm helps to ensure the rationality and accuracy of the determined priority.
[0144] In another implementation manner of the present application, the first preset condition includes requirements for various attribute features extracted from the enhanced image, where the attribute features include quality parameters and / or the number of feature points of the enhanced image.
[0145] Among them, the quality parameter of the image refers to a parameter that can characterize the quality of the image, such as parameters like signal-to-noise ratio. The number of feature points refers to the number of features or the number of feature points. After the image is enhanced, the image quality will change, and the number of recognizable features will also change accordingly. Therefore, the first preset condition including quality parameters and / or the number of feature points can constrain the enhancement degree of the image, so that the image that meets the first preset condition does not need to be enhanced further, saving processing resources and improving the image enhancement efficiency.
[0146] After obtaining the enhanced image, the method further includes:
[0147] Judge whether the quality parameter of the enhanced image is higher than a preset first threshold, and / or judge whether the number of feature points of the enhanced image is higher than a preset second threshold to determine whether the enhanced image meets the first preset condition.
[0148] Among them, the first preset condition includes a first threshold for the quality parameter and / or a second threshold for the number of feature points. When the first preset condition only includes the first threshold, if the quality parameter of the enhanced image is higher than the first threshold, it proves that the enhanced image meets the first preset condition, otherwise it proves that the enhanced image does not meet the first preset condition. For an image that does not meet the first preset condition, other enhancement algorithms need to be used to enhance the image to be enhanced. When the first preset condition includes the second threshold, if the number of feature points of the enhanced image exceeds the second threshold, it proves that the enhanced image meets the first preset condition, otherwise it proves that the enhanced image does not meet the first preset condition. Similarly, if the first preset condition includes the first threshold and the second threshold, the enhanced image needs to have both the quality parameter higher than the first threshold and the number of feature points higher than the second threshold to be regarded as meeting the first preset condition.
[0149] For the image to be enhanced, starting from the enhancement algorithm with the set priority in the image enhancement algorithm library, after enhancement, the method further includes:
[0150] Determine the quality parameter of the enhanced image, and / or
[0151] Extract the feature points of the enhanced image to determine the number of feature points of the enhanced image.
[0152] That is to say, obtain the enhanced image, that is, calculate the quality parameter and / or the number of feature points of the image, so as to judge whether the enhanced image meets the first preset condition.
[0153] Through the above content, use the quality parameter and the number of feature points to judge whether the enhanced image needs to be re-enhanced using other enhancement algorithms. Since the quality parameter and the number of feature points can reflect the enhancement effect of the image, unnecessary re-enhancement processes can be reduced, and the processing effect of the image can be improved.
[0154] In another embodiment of the present application, determining the quality parameter of the enhanced image includes at least one of the following:
[0155] Obtain the pixel values of the enhanced image and determine the mean value of the pixel values of the enhanced image.
[0156] Among them, the pixel values can be obtained using image pixel value recognition software or programs, and this embodiment does not make specific limitations on this. The pixel values that need to be obtained can be all of the image or part of the image. For example, as mentioned above, only obtain the pixel values of the pixel points related to the palm vein or biometric features such as fingerprints that can prove the user's identity. The mean value is the average value, and the calculation method will not be elaborated.
[0157] Obtain the pixel values of the enhanced image and determine the variance of the pixel values of the enhanced image.
[0158] Similarly, after obtaining the pixel values, the variance can be calculated, and the calculation method of the variance will not be elaborated here.
[0159] Determine the structural similarity between the enhanced image and the image to be enhanced.
[0160] Specifically, the calculation method of the structural similarity is not specifically limited in this embodiment.
[0161] Determine the peak signal-to-noise ratio between the enhanced image and the image to be enhanced.
[0162] Similarly, the calculation method of the peak signal-to-noise ratio is not specifically limited in this embodiment.
[0163] Through the above content, using parameters such as the mean, variance, structural similarity, and peak signal-to-noise ratio of pixel values to reflect the quality parameters of the image helps to ensure the reliability of the quality parameters of the image and is not likely to have a large deviation from the actual quality of the image.
[0164] For ease of understanding, take a door lock that identifies palm vein images as an example to illustrate this method.
[0165] First, collect enhancement algorithms that have an enhancing effect on images, such as local histogram equalization, deep learning-based image enhancement, image edge enhancement, etc., and build an image enhancement algorithm library so that the image enhancement algorithm library contains the vast majority of enhancement algorithms.
[0166] Then, use the test images to calculate the enhancement ability or enhancement effect of each enhancement algorithm on the images. Specifically, the enhancement ability or enhancement effect is reflected by the matching accuracy and enhancement rate of the images. That is, take the images containing palm veins stored in the door lock before as test images, and use each enhancement algorithm in the image enhancement algorithm library to perform enhancement processing on the test images. After obtaining the enhanced images, calculate the matching accuracy and enhancement rate of the enhanced images respectively. Among them, the matching accuracy is reflected by FAR (false recognition rate) and FRR (false rejection rate), and the enhancement rate is reflected by the complexity of the enhancement algorithm; finally, comprehensively consider the complexity of the enhancement algorithm and the matching accuracy, and sort each enhancement algorithm to obtain the priority of each enhancement algorithm. Specifically, the priority includes five levels, namely level 1-5.
[0167] In addition, sorting methods based on weighted average, confidence, etc. can also be used. The weights of the weighted average and the acquisition of confidence can be set through parameters such as SSIM and PSNR of the two images before and after enhancement, and the calculation method is specifically expressed as:
[0168] (1) Use SSIM to represent the similarity between two images. By calculating SSIM, the similarity between the two images can be known. The more similar the two images are, the larger this value is. The value of this similarity can be used as a weight to sort the enhancement algorithms.
[0169] (2) It is also possible to sort the image enhancement algorithms according to the image quality score, by calculating weights or confidence levels based on ratios such as the mean and variance of the images before and after enhancement.
[0170] Such as Figure 3 and 4 As shown, attribute feature extraction: After obtaining the image to be enhanced (i.e., the palm vein image that needs to be enhanced), use existing image quality assessment methods (such as PSNR, SSIM, SNR, etc.) and feature extraction methods (such as SIFT, ORB, and CNN, etc.) to obtain various attribute features such as the palm vein image quality and the number of feature points; it is also possible to extract the attribute features of the image through machine learning, deep learning, etc.
[0171] Multi-attribute decision-making: Then, determine whether the enhanced image meets the first preset condition based on the image quality and the number of feature points. For example, determine whether the image quality of the enhanced image is greater than the threshold of 0.8, and determine whether the number of feature points is greater than the threshold of 10. If both are greater, it meets the first preset condition.
[0172] Specifically, methods such as decision trees, polynomial weights, and Bayesian estimation can also be used to determine whether it meets the first preset condition. Among them, the general process of a decision tree:
[0173] (1) Collect data: Collect sample data of known categories, including features and category labels.
[0174] (2) Prepare data: Preprocess the collected data, including operations such as data cleaning, feature selection, and feature transformation, in order to better construct a decision tree.
[0175] (3) Construct a decision tree: Use various decision tree algorithms (such as ID3, C4.5, CART, etc.) to construct a decision tree from the training data. The nodes of this decision tree represent a feature or attribute, the branches represent the values of this feature or attribute, and the leaf nodes represent category labels.
[0176] (4) Test the decision tree: Use the samples in the test set to test the constructed decision tree, obtain the classification results, and calculate evaluation indicators such as classification accuracy.
[0177] (5) Use the decision tree: Use the constructed decision tree for the classification of new unknown samples, that is, divide according to the branch rules of the decision tree based on the feature values of the sample, and finally reach a leaf node, which is the category to which the sample belongs.
[0178] General process of polynomial weight decision-making:
[0179] (1) Assign weights to samples: According to the category to which each sample belongs, assign a weight to it. Generally speaking, the weight is inversely proportional to the number of categories, that is, the more categories there are, the smaller the weight of the corresponding sample, and vice versa. Various weight assignment methods can be used, such as exponential functions based on the number of categories, etc.
[0180] (2) Train a classifier: Use the weighted training data to train a classifier. Various classification algorithms can be adopted, such as support vector machines, decision trees, random forests, etc.
[0181] (3) Classify test samples: For a new test sample, use the trained classifier to classify it and obtain the category to which it belongs.
[0182] (4) Output the classification result: Output the classification result. Evaluation metrics such as classification accuracy, recall rate, F1 value, etc. can be calculated to evaluate the performance of the classifier.
[0183] General process of Bayesian estimation decision-making:
[0184] (1) Collect data: Collect sample data with known categories, including features and category labels.
[0185] (2) Prepare data: Preprocess the collected data, including operations such as data cleaning, feature selection, and feature transformation, in order to better build a classification model.
[0186] (3) Learn class-conditional probabilities: According to the training data, calculate the prior probability of each category and the conditional probability of each feature under each category. Methods such as maximum likelihood estimation or Bayesian estimation can be used.
[0187] (4) Calculate the posterior probability: For a new test sample, according to the learned class-conditional probabilities and prior probabilities, calculate its posterior probability of belonging to each category, and then select the category with the maximum posterior probability as the classification result of this sample.
[0188] (5) Output the classification result: Output the classification result. Evaluation metrics such as classification accuracy, recall rate, F1 value, etc. can be calculated to evaluate the performance of the classifier.
[0189] Select enhancement algorithm: For the palm vein image that needs to be enhanced, an enhancement algorithm needs to be adaptively selected from the constructed enhancement algorithm library, and then multi-attribute features are extracted from the enhanced image until the multi-attribute features extracted from the enhanced image meet the requirements of attribute decision-making. For example, if the requirement of attribute decision-making is that the number of feature points is greater than the set threshold, and the number of feature points extracted from the image enhanced by the enhancement algorithm meets the number of feature points required for attribute decision-making, then the enhanced image is the final image; otherwise, an enhancement algorithm is re-selected from the image enhancement algorithm library to re-enhance the image until the number of extracted feature points meets the requirements of attribute decision-making.
[0190] Specific steps for selecting the enhancement algorithm: In the previous configuration stage, each enhancement algorithm was sorted, in order from level 1 to level 5 (if there are more types of enhancement algorithms, the number of levels will be correspondingly more). In the execution stage, first use the enhancement algorithm corresponding to level 1 to enhance the original image to obtain an enhanced image. Then, perform feature extraction on the enhanced image again and make a multi-attribute decision on the enhanced image to determine whether the attribute features of the enhanced image meet the requirements. Generally, it is preferred to ensure the attribute of image quality first. For example, judge the similarity between the enhanced image and the original image through SSIM. If the similarity is greater than the threshold (assumed to be 0.8), then it is considered that the enhancement result is good and the image quality attribute of the enhanced image meets the requirements. If the image quality does not reach the set threshold, then change to the enhancement algorithm corresponding to level 2, and so on, until the image quality of the image enhanced by a certain enhancement algorithm meets the conditions, and then enter the judgment of the next attribute (number of feature points). If the number of feature points does not meet the requirements (for example, the number of feature points is less than 10), then an enhancement algorithm needs to be re-selected again in the subsequent levels, and so on, until all the preset conditions of all attributes are met.
[0191] For some original images, after enhancement, the attributes of the obtained enhanced images can meet the usage requirements, and there is no need to prompt the user to re-enter the image. However, for some original images, after exhausting all the enhancement algorithms in the image enhancement algorithm library, the image quality or image features of the obtained enhanced images still do not meet the requirements, which indicates that the quality of this image is indeed too low. The door lock system will determine that the image obtained this time is an invalid image, and the door lock end will prompt the user to re-enter.
[0192] The embodiment of the present application also provides a device for image enhancement, as Figure 5 shown, including an acquisition module 1 for acquiring the image to be enhanced;
[0193] An enhancement module 2 for enhancing the image to be enhanced starting from the enhancement algorithm with a set priority in the image enhancement algorithm library to obtain an enhanced image; the enhancement algorithms in the image enhancement algorithm library have different priorities;
[0194] The detection module 3 is configured to, when it is determined that the enhanced image does not meet the first preset condition, enhance the image to be enhanced using the enhancement algorithm with the next priority in the image enhancement algorithm library, and re-obtain the enhanced image until the enhanced image meets the first preset condition, or until all the enhancement algorithms in the image enhancement algorithm library are traversed.
[0195] Optionally, the device further includes a preprocessing module configured to obtain the original image;
[0196] Extract features from the original image;
[0197] Based on the result of feature extraction, determine the image to be enhanced in the original image.
[0198] Optionally, the device further includes a first priority module configured to obtain a test image;
[0199] Perform image enhancement on the test image using the enhancement algorithm in the image enhancement algorithm library;
[0200] Determine the matching accuracy between the image obtained after enhancement by the enhancement algorithm and the test image;
[0201] Determine the enhancement rate of the enhancement algorithm;
[0202] Combine the matching accuracy and enhancement rate of the enhancement algorithm to perform priority sorting on the enhancement algorithms.
[0203] Optionally, the first priority module includes a matching accuracy unit configured to determine the false recognition rate and rejection rate between the image obtained after enhancement by the enhancement algorithm and the test image;
[0204] The first priority module further includes a first priority unit configured to sort the enhancement algorithms in ascending order of false recognition rate;
[0205] For the enhancement algorithms with the same false recognition rate, sort them in ascending order of rejection rate;
[0206] For the enhancement algorithms with the same rejection rate, sort them in descending order of enhancement rate.
[0207] Optionally, the device further includes a second priority module configured to obtain the pixel values of the image obtained after enhancement by the enhancement algorithm;
[0208] Determine the mean of the pixel values of each enhanced image;
[0209] Sort the enhancement algorithms in descending order of the mean of the pixel values of the enhanced image; and / or, the device further includes a third priority module configured to obtain the pixel values of the image obtained after enhancement by the enhancement algorithm;
[0210] Determine the variance of the pixel values of each enhanced image;
[0211] Sort the enhancement algorithms in descending order according to the variance of the pixel values of the enhanced image.
[0212] Optionally, the apparatus further includes a fourth priority module for obtaining a test image;
[0213] Perform image enhancement on the test image using the enhancement algorithms in the image enhancement algorithm library;
[0214] Determine the structural similarity between the image obtained after enhancement by the enhancement algorithm and the test image;
[0215] Sort the enhancement algorithms in descending order according to the structural similarity between the image obtained after enhancement and the test image; or
[0216] Determine the peak signal-to-noise ratio between the image obtained after enhancement by the enhancement algorithm and the test image;
[0217] Sort the enhancement algorithms in descending order according to the peak signal-to-noise ratio between the image obtained after enhancement and the test image.
[0218] Optionally, the first preset condition includes requirements for various attribute features extracted from the enhanced image, where the attribute features include the quality parameters and / or the number of feature points of the enhanced image;
[0219] The apparatus further includes a detection module 3 for determining whether the quality parameters of the enhanced image are higher than a preset first threshold, and / or determining whether the number of feature points of the enhanced image is higher than a preset second threshold, so as to determine whether the enhanced image meets the first preset condition;
[0220] The apparatus further includes a determination module for determining the quality parameters of the enhanced image, and / or
[0221] Extract feature points from the enhanced image to determine the number of feature points of the enhanced image.
[0222] Optionally, the determination module includes a determination unit for obtaining the pixel values of the enhanced image and determining the mean value of the pixel values of the enhanced image;
[0223] Obtain the pixel values of the enhanced image and determine the variance of the pixel values of the enhanced image;
[0224] Determine the structural similarity between the enhanced image and the image to be enhanced;
[0225] Determine the peak signal-to-noise ratio between the enhanced image and the image to be enhanced.
[0226] After obtaining the image to be enhanced by the above-mentioned obtaining module 1, the enhancement module 2 starts to enhance the image to be enhanced from the enhancement algorithm with a set priority. After the enhancement, for the image that does not meet the first preset condition, the detection module 3 re-enhances it with the enhancement algorithm of the next priority, so that the image to be enhanced is sequentially enhanced by multiple enhancement algorithms, which helps to improve the enhancement effect of the image.
[0227] An embodiment of the present application also provides an electronic device, as Figure 6 shown. The electronic device includes a processor 100, at least one communication bus 200, a user interface 300, at least one external communication interface 400, and a memory 500. Among them, the communication bus 200 is configured to implement connection communication between these components. Among them, the user interface 300 may include a display screen, and the external communication interface 400 may include a standard wired interface and a wireless interface. Among them, the method for image enhancement is stored in the memory 500. Among them, the processor 100 is used to adopt the above method when executing the method for image enhancement stored in the memory 500.
[0228] An embodiment of the present application also provides a computer-readable storage medium, storing a computer program that can be loaded and executed by a processor to perform the above method.
[0229] The serial numbers in the embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0230] In the above embodiments of the present application, the descriptions of the embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0231] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0232] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0233] In addition, the functional units in the embodiments of the present application may be integrated into one processing unit, may exist separately as individual units physically, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.
[0234] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The foregoing storage medium includes: USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs, etc., which are media that can store program codes.
[0235] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for image enhancement, characterized in that, Including: Obtain the image to be enhanced; For the image to be enhanced, start from the enhancement algorithm with the set priority in the image enhancement algorithm library, perform enhancement, and obtain the enhanced image; The enhancement algorithms in the image enhancement algorithm library have different priorities; When it is determined that the enhanced image does not meet the first preset condition, use the enhancement algorithm with the next priority in the image enhancement algorithm library to enhance the image to be enhanced, and re-obtain the enhanced image until the enhanced image meets the first preset condition, or until all the enhancement algorithms in the image enhancement algorithm library are traversed.
2. The method for image enhancement according to claim 1, wherein Before obtaining the image to be enhanced, it further includes: Obtain the original image; Extract features from the original image; Based on the result of the feature extraction, determine the image to be enhanced in the original image.
3. The method for image enhancement according to claim 1, characterized in that The method further includes determining the priority of the enhancement algorithms in the image enhancement algorithm library in the following manner: Obtain the test image; Use the enhancement algorithms in the image enhancement algorithm library to perform image enhancement on the test image; Determine the matching accuracy between the image obtained after the enhancement algorithm enhances and the test image; Determine the enhancement rate of the enhancement algorithm; Combine the matching accuracy and the enhancement rate of the enhancement algorithm to perform priority sorting on the enhancement algorithms.
4. The method for image enhancement according to claim 3, characterized in that The determination of the matching accuracy between the image obtained after the enhancement algorithm enhances and the test image includes: Determine the false recognition rate and the rejection rate of the image obtained after the enhancement algorithm enhances and the test image; The combination of the matching accuracy and the enhancement rate of the enhancement algorithm to perform priority sorting on the enhancement algorithms includes: Sort the enhancement algorithms in ascending order of the false recognition rate; For the enhancement algorithms with the same false recognition rate, sort them in ascending order of the rejection rate; For the enhancement algorithms with the same rejection rate, sort them in descending order of the enhancement rate.
5. The method for image enhancement according to claim 1, wherein The method further includes determining the priority of the enhancement algorithms in the image enhancement algorithm library in the following manner: Obtain the pixel values of the image obtained after the enhancement algorithm enhances; Determine the mean value of the pixel values of each enhanced image; Sort the enhancement algorithms in descending order of the mean value of the pixel values of the enhanced image; and / or, Obtain the pixel values of the image obtained after the enhancement algorithm enhances; Determine the variance of the pixel values of each enhanced image; Sort the enhancement algorithms in descending order of the variance of the pixel values of the enhanced image.
6. The method for image enhancement according to claim 1, wherein The method further includes determining the priority of the enhancement algorithms in the image enhancement algorithm library in the following manner: Obtain the test image; Use the enhancement algorithms in the image enhancement algorithm library to perform image enhancement on the test image; Determine the structural similarity between the image obtained after the enhancement algorithm enhances and the test image; Sort the enhancement algorithms in descending order of the structural similarity between the image obtained after the enhancement and the test image; or Determine the peak signal-to-noise ratio between the image obtained after the enhancement algorithm enhances and the test image; Sort the enhancement algorithms in descending order of the peak signal-to-noise ratio between the image obtained after the enhancement and the test image.
7. The method for image enhancement according to any one of claims 1 to 6, characterized in that The first preset condition includes requirements for various attribute features extracted from the enhanced image, where the attribute features include quality parameters and / or the number of feature points of the enhanced image; After obtaining the enhanced image, the method further includes: Determining whether the quality parameter of the enhanced image is higher than a preset first threshold, and / or determining whether the number of feature points of the enhanced image is higher than a preset second threshold, to determine whether the enhanced image meets the first preset condition; After enhancing the image to be enhanced starting from the enhancement algorithm with a set priority in the image enhancement algorithm library, the method further includes: Determining the quality parameter of the enhanced image, and / or Performing feature point extraction on the enhanced image to determine the number of feature points of the enhanced image.
8. The method for image enhancement according to claim 7, wherein Determining the quality parameter of the enhanced image includes at least one of the following: Obtaining the pixel values of the enhanced image and determining the mean of the pixel values of the enhanced image; Obtaining the pixel values of the enhanced image and determining the variance of the pixel values of the enhanced image; Determining the structural similarity between the enhanced image and the image to be enhanced; Determining the peak signal-to-noise ratio between the enhanced image and the image to be enhanced.
9. An electronic device, characterized in that, Comprising a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program to implement the image enhancement method according to any one of claims 1 to 8.
10. An apparatus for image enhancement, characterized in that, Comprising an acquisition module for acquiring the image to be enhanced; An enhancement module for enhancing the image to be enhanced starting from the enhancement algorithm with a set priority in the image enhancement algorithm library to obtain the enhanced image; The enhancement algorithms in the image enhancement algorithm library have different priorities; A detection module for, when it is determined that the enhanced image does not meet the first preset condition, enhancing the image to be enhanced using the enhancement algorithm with the next priority in the image enhancement algorithm library to re-obtain the enhanced image until the enhanced image meets the first preset condition, or until all the enhancement algorithms in the image enhancement algorithm library are traversed.
11. A storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by a processor, it implements the image enhancement method according to any one of claims 1 to 8.