Self-adaptive image sharpening method based on noise calibration
Through the adaptive image sharpening method based on noise calibration, the problem of details loss and sharpness gain value parameters in the prior art need to be manually adjusted, and the effective retention of image detail information and the adaptability of the sharpening process is achieved.
Patent Information
- Application Number
- CN202311069996.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art will sharpen noise together during the image sharpening process, resulting in the loss of image detail information, and the sharpness gain value parameters need to be manually adjusted, which is insufficient adaptability.
An adaptive image sharpening method based on noise calibration is proposed. The image noise calibration module obtains the noise level under different gain values and exposure time, and uses the adaptive sharpening module to calculate the image sharpness gain value based on the noise calibration results to realize adaptive image sharpening.
It effectively avoids the sharpening and enhancement of noise, improves the retention rate of image detail information, and improves the adaptability and automation of image sharpening by automatically adjusting the sharpness gain value.
Smart Images

Figure CN119540092A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to an adaptive image sharpening method based on noise calibration. Background Art
[0002] In the prior art, the original image obtained by the image sensor often has insufficient details and lower clarity compared with the user image, so detail enhancement is achieved through back-end image sharpening operations. The current mainstream image sharpening method is USM (unsharp mask, also known as unsharp masking), the principle of which is to obtain image detail components through various methods (such as Sobel operator, Laplace operator, etc.), multiply the component with the sharpness gain value to obtain an enhanced image, and then add the basic image and the enhanced detail image to obtain the sharpened image.
[0003] However, the original image obtained by the sensor generally has Poisson noise and Gaussian noise. The existing technology will sharpen the noise together, resulting in the loss of image-related detail information, and the sharpness gain value parameter generally needs to be manually adjusted.
[0004] In addition, common terminology explanations in the prior art include:
[0005] 1. Image noise calibration: Calibrate the noise conditions of different grayscale areas under different lighting scenes. The calibration results can be measured by parameters such as mean or variance;
[0006] 2. Scenarios with different gain values and exposure times: Under different ambient light conditions, the overall brightness of the image mainly depends on the multiplied gain value and the image exposure time (the aperture value and sensitivity are often fixed with the imaging system); therefore, the gain value and exposure time can be used to distinguish the overall brightness of the image under different lighting conditions;
[0007] Standard grayscale test card: a test card printed with different grayscale levels, including but not limited to 13-level or 256-level grayscale contrast test charts; and the standard grayscale image mentioned in the article is the image formed by the imaging system. Summary of the invention
[0008] The purpose of the present application is to provide an adaptive image sharpening method and device based on noise calibration, which adaptively guides image sharpening based on the image noise calibration result to solve the problems raised in the above-mentioned background technology.
[0009] Specifically, the present invention proposes an adaptive image sharpening method based on noise calibration, wherein the method comprises an image noise calibration module and an adaptive sharpening module;
[0010] The image noise calibration module obtains the standard grayscale test card shot by the imaging system, counts the mean and variance corresponding to each grayscale of a single standard grayscale image, then counts the average mean and average variance corresponding to each grayscale of multiple standard grayscale images, and finally saves the average mean and average variance corresponding to each grayscale into a parameter file, and corresponds to a specific gain value and exposure time;
[0011] The adaptive sharpening module obtains the gain value and exposure time of the current imaging system, and automatically reads the average mean and average variance saved in the parameter file, calculates the sharpness gain value under the current grayscale according to the read average mean and average variance, and adaptively sharpens the image according to the sharpness gain value.
[0012] The method further comprises the following steps:
[0013] S1: Image noise calibration, obtaining the noise level at different gain values and exposure times;
[0014] The noise level of the imaging system at different grayscales is calibrated at different gain values and exposure times, including the following steps:
[0015] S101: The imaging system photographs a standard grayscale test card, the standard grayscale test card includes M grayscales, and the size of different grayscale blocks of the resulting standard grayscale image is W*W;
[0016] S102: Count the mean and variance of each grayscale of a single standard grayscale image. Assume that the pixel value of the mth grayscale block at the point (p, q) on the nth image is Y m,n,p,q , then the mean and variance corresponding to the mth grayscale block on the nth image are:
[0017]
[0018]
[0019] S103: In the scenario of fixed gain value and exposure time, repeat step S102 to obtain the mean and variance of the grayscale corresponding to another standard grayscale image, and then calculate the mean and variance corresponding to each grayscale of N standard grayscale images, and obtain the average mean and average variance corresponding to each grayscale as follows:
[0020]
[0021]
[0022] S104: Switch to another gain value and exposure time scenario, and repeat step S103, and save the average mean and average variance corresponding to each grayscale to a parameter file, and correspond to the specific gain value and exposure time;
[0023] S2: Image sharpness gain value calculation;
[0024] Combined with the above noise calibration results, the image sharpness gain values of different grayscale pixels in the image to be processed in different gain values and exposure time scenes are determined. Assuming that the grayscale value of the current pixel in the current scene is i, and it falls within the grayscale range of (m-1, m), the average variance corresponding to the grayscale value i is:
[0025]
[0026] Then the image sharpness gain value k corresponding to the current scene gray value i i , K and σ are user-fixed parameters, and e is a natural constant, also known as Euler's number:
[0027]
[0028] S3: Image sharpening;
[0029] Using the USM algorithm, combined with the aforementioned image sharpness gain value, the image is sharpened and enhanced. Assuming that the original image is f(u, v), the gray value of the pixel (u, v) is i, the sharpened image is g(u, v), and the high-frequency component of the original image is z(u, v), then the sharpening process is:
[0030] g(u,v)=f(u,v)+k i ×z(u,v)
[0031] S4: Output the final image sharpening result.
[0032] The USM algorithm is an unsharp mask, also known as unsharp masking, and its principle is to obtain the high-frequency component of the image through various methods including the Sobel operator and the Laplace operator, multiply the component with the sharpness gain value to obtain the enhanced image, and then add the basic image and the enhanced image high-frequency component to obtain the sharpened image.
[0033] The step S1 realizes the function of the image noise calibration module; the steps S2 and S3 realize the function of the adaptive sharpening module.
[0034] Therefore, the advantages of this application are:
[0035] 1. According to the noise conditions in different areas of the image in different scenes, set appropriate sharpness gain value parameters to avoid noise being sharpened and enhanced;
[0036] 2. Image sharpening intensity is adaptive to the noise situation, which facilitates the adjustment of sharpness gain value parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0038] Figure 1 It is a flowchart schematic diagram of the method of this application.
[0039] Figure 2 It is a schematic diagram of the method flow of an embodiment of the present application. DETAILED DESCRIPTION
[0040] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.
[0041] like Figure 1 As shown, the present application provides an adaptive image sharpening method based on noise calibration, the method comprising an image noise calibration module and an adaptive sharpening module;
[0042] The image noise calibration module obtains the standard grayscale test card shot by the imaging system, counts the mean and variance corresponding to each grayscale of a single standard grayscale image, then counts the average mean and average variance corresponding to each grayscale of multiple standard grayscale images, and finally saves the average mean and average variance corresponding to each grayscale into a parameter file, and corresponds to a specific gain value and exposure time;
[0043] The adaptive sharpening module obtains the gain value and exposure time of the current imaging system, and automatically reads the average mean and average variance saved in the parameter file, calculates the sharpness gain value under the current grayscale according to the read average mean and average variance, and adaptively sharpens the image according to the sharpness gain value.
[0044] like Figure 2 As shown, the specific method further comprises the following steps:
[0045] S1: Image noise calibration, obtaining the noise level at different gain values and exposure times;
[0046] S2: Image sharpness gain value calculation;
[0047] S3: Image sharpening;
[0048] S4: Output the final image sharpening result.
[0049] Among them, step S1 is image noise calibration, which is mainly to calibrate the noise level of the imaging system at different grayscales under different gain values and exposure times, including the steps of:
[0050] S101: The imaging system photographs a standard grayscale test card, which includes M grayscales. The size of different grayscale blocks in the resulting standard grayscale image is W*W. The standard grayscale test card is a commonly used calibration tool in the art, generally consisting of M grayscale blocks, and is used to test the response of different grayscales in the current scene.
[0051] S102: Count the mean and variance corresponding to each grayscale of a single standard grayscale image. Assume that the pixel value of the mth grayscale block at the point (p, q) on the nth image is Y m,n,p,q , then the mean and variance corresponding to the mth grayscale block on the nth image are:
[0052]
[0053]
[0054] S103: In the scenario of fixed gain value and exposure time, repeat step S102 to obtain the mean and variance of the grayscale corresponding to another standard grayscale image, and then calculate the result according to the mean and variance corresponding to each grayscale of N standard grayscale images. Generally, the larger the N value, the more accurate the result, and generally 20 images are sufficient; the average mean and average variance corresponding to each grayscale are obtained as follows:
[0055]
[0056]
[0057] S104: switch to another gain value and exposure time scene, and repeat step S103, and save the average mean and average variance corresponding to each grayscale to the parameter file, and correspond to the specific gain value and exposure time; each scene refers to changing the lighting conditions of the scene under the same scene layout; due to different lighting conditions, the gain value and exposure time of the imaging system will change relatively; when the scene lighting conditions change, due to the existence of the automatic exposure module AE of the imaging system, the system will automatically converge to a suitable gain value and exposure time, thereby meeting the final imaging effect requirements; more specifically, the gain value is divided into analog gain and digital gain, which directly amplifies the light intensity response; exposure time refers to the photosensitivity time of the pixel;
[0058] The above briefly describes that the automatic exposure module automatically converges to a suitable gain value and exposure time when the lighting conditions change; the average mean and average variance calculated for the current scene are matched with the gain value and exposure time at this time and recorded in a table.
[0059] Among them, step S2 is the calculation of the image sharpness gain value, which is mainly to determine the image sharpness gain values of different grayscale pixels in the image to be processed in different gain value and exposure time scenes in combination with the aforementioned noise calibration results. Assuming that the grayscale value of the current pixel in the current scene is i, and it falls within the grayscale range of (m-1, m), the average variance corresponding to the grayscale value i is:
[0060]
[0061] Then the image sharpness gain value k corresponding to the current scene gray value i i , K and σ are user-fixed parameters:
[0062]
[0063] The current formula is a Gaussian function, that is, the inventor assumes that the sharpness gain value of the current grayscale value of the image and the average variance of the current grayscale value conform to the Gaussian distribution model;
[0064] Ke is not a parameter name. K is a user-fixed parameter that needs to be debugged according to actual conditions. e is a natural constant, also known as the Euler number.
[0065] Among them, step S3 is image sharpening, which mainly uses the USM algorithm and combines the aforementioned image sharpness gain value to sharpen and enhance the image. Assuming that the original image is f(u, v), the gray value of the pixel (u, v) is i, the sharpened image is g(u, v), and the high-frequency component of the original image is z(u, v), then the sharpening process is:
[0066] g(u,v)=f(u,v)+k i ×z(u,v)
[0067] Image sharpening can also be described as image detail enhancement, so it can also be called "detail component";
[0068] The process example is as follows:
[0069]
[0070] The USM algorithm is an unsharp mask, also known as unsharp masking, and its principle is to obtain the high-frequency component of the image through various methods including the Sobel operator and the Laplace operator, multiply the component with the sharpness gain value to obtain the enhanced image, and then add the basic image and the enhanced image high-frequency component to obtain the sharpened image.
[0071] The step S1 realizes the function of the image noise calibration module; the steps S2 and S3 realize the function of the adaptive sharpening module.
[0072] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An adaptive image sharpening method based on noise calibration, characterized in that: The method includes an image noise calibration module and an adaptive sharpening module; The image noise calibration module obtains the standard grayscale test card shot by the imaging system, counts the mean and variance corresponding to each grayscale of a single standard grayscale image, then counts the average mean and average variance corresponding to each grayscale of multiple standard grayscale images, and finally saves the average mean and average variance corresponding to each grayscale into a parameter file, and corresponds to a specific gain value and exposure time; The adaptive sharpening module obtains the gain value and exposure time of the current imaging system, and automatically reads the average mean and average variance saved in the parameter file, calculates the sharpness gain value under the current grayscale according to the read average mean and average variance, and adaptively sharpens the image according to the sharpness gain value.
2. The method for adaptive image sharpening based on noise calibration according to claim 1, characterized in that: The method further comprises the following steps: S1: Image noise calibration, obtaining the noise level at different gain values and exposure times; The noise level of the imaging system at different grayscales is calibrated at different gain values and exposure times, including the following steps: S101: The imaging system photographs a standard grayscale test card, the standard grayscale test card includes M grayscales, and the size of different grayscale blocks of the resulting standard grayscale image is W*W; S102: Count the mean and variance corresponding to each grayscale of a single standard grayscale image. Assume that the pixel value of the mth grayscale block at the point (p, q) on the nth image is Y m,n,p,q , then the mean and variance corresponding to the mth grayscale block on the nth image are: S103: In the scenario of fixed gain value and exposure time, repeat step S102 to obtain the mean and variance of the grayscale corresponding to another standard grayscale image, and then calculate the mean and variance corresponding to each grayscale of N standard grayscale images, and obtain the average mean and average variance corresponding to each grayscale as follows: S104: Switch to another gain value and exposure time scenario, and repeat step S103, and save the average mean and average variance corresponding to each grayscale to a parameter file, and correspond to the specific gain value and exposure time; S2: Image sharpness gain value calculation; Combined with the above noise calibration results, the image sharpness gain values of different grayscale pixels in the image to be processed in different gain values and exposure time scenes are determined. Assuming that the grayscale value of the current pixel in the current scene is i, and it falls within the grayscale range of (m-1, m), the average variance corresponding to the grayscale value i is: Then the image sharpness gain value k corresponding to the current scene gray value i i , K and σ are user-fixed parameters, and e is a natural constant, also known as Euler's number: S3: Image sharpening; Using the USM algorithm, combined with the aforementioned image sharpness gain value, the image is sharpened and enhanced. Assuming that the original image is f(u, v), the gray value of the pixel (u, v) is i, the sharpened image is g(u, v), and the high-frequency component of the original image is z(u, v), then the sharpening process is: g(u,v)=f(u,v)+k i ×z(u,v) S4: Output the final image sharpening result.
3. The method for adaptive image sharpening based on noise calibration according to claim 2, characterized in that: The USM algorithm is an unsharp mask, also known as unsharp masking, and its principle is to obtain the high-frequency component of the image through various methods including the Sobel operator and the Laplace operator, multiply the component with the sharpness gain value to obtain the enhanced image, and then add the basic image and the enhanced image high-frequency component to obtain the sharpened image.
4. The method for adaptive image sharpening based on noise calibration according to claim 2, characterized in that: The step S1 realizes the function of the image noise calibration module; the steps S2 and S3 realize the function of the adaptive sharpening module.