Image processing method, device, electronic device and storage medium
By using filters with different filter frequencies and preset threshold denoising processing, combined with image brightness adaptive enhancement, the problem of unnecessary details amplification by the existing sharpening algorithm is solved, achieving a more natural sharpening effect and higher image quality.
Patent Information
- Application Number
- CN202210037328.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-01-13
AI Technical Summary
While improving the sharpness of the image edge, existing sharpening algorithms often enlarge unnecessary details in the image, resulting in a degradation of the image quality after sharpening.
The image is filtered by at least two filtering frequencies, combined with a preset threshold, image enhancement is performed according to the brightness of the denoising image, and enhanced images of different filtering frequencies are fused with the original image to suppress noise amplification and adaptively adjust the enhancement intensity.
Improves the image quality after sharpening, makes edge details clearer and sharper edges improve, while suppressing noise amplification in flat areas, making the enhanced image effect more natural.
Smart Images

Figure CN114418879B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image technology, and in particular to image processing methods, devices, electronic devices and storage media. Background Art
[0002] Currently, in many scenarios, images captured by cameras may suffer from poor imaging quality and low image clarity. In the field of image processing, sharpness is often used to describe the speed of image information transition at boundaries. High-contrast images transition very quickly, forming very clear edges, while low-contrast images have a certain transition buffer, which manifests as blurred edges in the image. Image sharpening algorithms are a type of algorithm that can improve image edge sharpness and are therefore widely used to address imaging issues such as poor imaging quality and low image clarity.
[0003] However, in practice, it is found that while existing sharpening algorithms improve the sharpness of image edges, they often also amplify some unimportant or even non-existent details in the image, which in turn leads to a decrease in the quality of the sharpened image. Summary of the Invention
[0004] The embodiments of the present application disclose an image processing method, device, electronic device and storage medium, which can improve the quality of sharpened images.
[0005] The present application discloses an image processing method, which includes:
[0006] Performing filtering processing on the image to be processed by at least two filters to obtain filtered images outputted by the at least two filters respectively; the filtering frequencies of the at least two filters are different;
[0007] Performing denoising on the filtered image output by the target filter according to a preset threshold to obtain a denoised image corresponding to a target frequency; the target filter is any one of the at least two filters, and the target frequency is the filtering frequency of the target filter;
[0008] performing image enhancement processing on the denoised image according to the image brightness of the denoised image to obtain an enhanced image corresponding to the target frequency;
[0009] The enhanced images corresponding to the at least two filtering frequencies and the image to be processed are fused to obtain a processed sharpened image.
[0010] In one embodiment, performing denoising on the filtered image output by the target filter according to a preset threshold to obtain a denoised image corresponding to the target frequency includes:
[0011] extracting a mask image from the filtered image output by the target filter in combination with the image to be processed;
[0012] The mask image is denoised according to a preset threshold to obtain a denoised image corresponding to the target frequency.
[0013] In one embodiment, the denoising process is performed on the mask image according to a preset threshold to obtain a denoised image corresponding to a target frequency, including:
[0014] Comparing pixel values of pixels in the mask image with a first threshold, and retaining pixels in the mask image whose pixel values are greater than the first threshold, to obtain a denoised image corresponding to a target frequency; and / or,
[0015] Comparing pixel values of pixels in the mask image with a second threshold, and retaining pixels in the mask image whose pixel values are less than the second threshold, to obtain a denoised image corresponding to a target frequency;
[0016] The first threshold is a positive value, and the second threshold is a negative value.
[0017] In one embodiment, performing image enhancement processing on the denoised image according to the image brightness of the denoised image to obtain an enhanced image corresponding to the target frequency includes:
[0018] determining an enhancement coefficient corresponding to the denoised image according to the image brightness of the denoised image;
[0019] The denoised image is enhanced according to the enhancement coefficient to obtain an enhanced image corresponding to the target frequency.
[0020] In one embodiment, determining the enhancement coefficient corresponding to the denoised image according to the image brightness of the denoised image includes:
[0021] determining an initial value of a coefficient corresponding to image brightness of the denoised image;
[0022] An enhancement coefficient corresponding to the denoised image is calculated according to the image brightness and the initial value of the coefficient.
[0023] In one embodiment, filtering the image to be processed by at least two filters to obtain filtered images outputted by the at least two filters respectively includes:
[0024] Extracting the brightness components of pixels in the image to be processed to obtain a brightness image corresponding to the image to be processed;
[0025] Performing filtering processing on the brightness image through at least two filters to obtain filtered images outputted by the at least two filters respectively;
[0026] Furthermore, fusing the enhanced images corresponding to the at least two filtering frequencies and the image to be processed to obtain a processed sharpened image includes:
[0027] The enhanced images corresponding to the at least two filtering frequencies and the brightness image are fused to obtain a processed sharpened image.
[0028] In one embodiment, the at least two filters include: a high-frequency filter, a medium-frequency filter, and a low-frequency filter; the filtering frequency of the high-frequency filter is higher than the filtering frequency of the medium-frequency filter, and the filtering frequency of the medium-frequency filter is higher than the filtering frequency of the low-frequency filter.
[0029] The present application discloses an image processing device, including:
[0030] a filtering module, configured to filter the image to be processed using at least two filters to obtain filtered images outputted by the at least two filters respectively; the at least two filters have different filtering frequencies;
[0031] a denoising module, configured to perform denoising processing on a filtered image output by a target filter according to a preset threshold value to obtain a denoised image corresponding to a target frequency; the target filter is any one of the at least two filters, and the target frequency is the filtering frequency of the target filter;
[0032] an enhancement module, configured to perform image enhancement processing on the denoised image according to the image brightness of the denoised image to obtain an enhanced image corresponding to the target frequency;
[0033] The fusion module is used to fuse the enhanced images corresponding to at least two filtering frequencies and the image to be processed to obtain a processed sharpened image.
[0034] An embodiment of the present application discloses an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements any one of the image processing methods disclosed in the embodiments of the present application.
[0035] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, any one of the image processing methods disclosed in the embodiment of the present application is implemented.
[0036] Compared with the related art, the embodiments of the present application have the following beneficial effects:
[0037] In the embodiment of the present application, filters corresponding to different filtering frequencies can be used to filter the image to be processed, thereby obtaining filtered images corresponding to the different filtering frequencies. De-noising can then be performed on each filtered image using a preset threshold to suppress noise amplification. At the same time, image enhancement can be performed on each denoised image based on the image brightness of each denoised image obtained after denoising. That is, adaptive enhancement can be performed based on the image brightness of each denoised image, making the enhanced sharpened image more natural and more in line with the human eye's sensitivity to different brightness levels, thereby improving the overall quality of the sharpened image. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 is a structural diagram of an image processing circuit disclosed in an embodiment;
[0040] Figure 2 is a flowchart of an image processing method disclosed in an embodiment;
[0041] Figure 3 is a flowchart of another image processing method disclosed in an embodiment;
[0042] Figure 4 is a schematic diagram of a method flow of an image processing method disclosed in an embodiment;
[0043] Figure 5 is a structural diagram of an image processing device disclosed in an embodiment;
[0044] Figure 6 The figure is a schematic structural diagram of an electronic device disclosed in an embodiment. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0046] It should be noted that the terms "including," "having," and any variations thereof in the embodiments and drawings of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.
[0047] The embodiments of the present application disclose an image processing method, apparatus, electronic device, and storage medium, which can improve the quality of sharpened images. Detailed descriptions are provided below.
[0048] See also Figure 1 , Figure 1 This is a schematic diagram of the structure of an image processing circuit disclosed in an embodiment. The image processing circuit can be used to implement the image registration method disclosed in the embodiment of this application. For example, the image processing circuit can be applied to electronic devices such as mobile phones, smart wearable devices, tablet computers, personal computers, etc., but is not limited thereto. Figure 1 As shown, the image processing circuit may include an imaging device (camera) 110 , a posture sensor 120 , an image memory 130 , an image signal processing (ISP) processor 140 , a control logic 150 , and a display 160 .
[0049] The image data captured by the imaging device 110 may first be processed by the ISP processor 140. For example, the image data may be analyzed by the ISP processor 140 to obtain image statistics that can be used to determine one or more control parameters of the imaging device 110. The imaging device 110 may include one or more lenses 112 and an image sensor 114. The image sensor 114 may include a color filter array (e.g., a Bayer filter). The image sensor 114 may obtain light intensity and wavelength information captured by each imaging pixel and provide a set of raw image data that can be processed by the ISP processor 140. The posture sensor 120 (e.g., a three-axis gyroscope, a Hall sensor, an accelerometer, etc.) may provide the acquired image processing parameters (e.g., anti-shake parameters) to the ISP processor 140 based on the interface type of the posture sensor 120. The posture sensor 120 interface may adopt an SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above interfaces.
[0050] In addition, the image sensor 114 may also send raw image data to the posture sensor 120 , and the posture sensor 120 may provide the raw image data to the ISP processor 140 or store the raw image data in the image memory 130 based on the interface type of the posture sensor 120 .
[0051] The ISP processor 140 can process raw image data on a pixel-by-pixel basis in a variety of formats. For example, each image pixel can have a bit depth of 8, 10, 12, or 14 bits. The ISP processor 140 can perform one or more image processing operations on the raw image data and collect statistical information about the image data. The image processing operations can be performed at the same or different bit depths of precision.
[0052] The ISP processor 140 may also receive image data from the image memory 130. For example, the gesture sensor 120 interface sends raw image data to the image memory 130, and the raw image data in the image memory 130 is then provided to the ISP processor 140 for processing. The image memory 130 may be part of a memory device, a storage device, or an independent dedicated memory within the electronic device, and may include a DMA (Direct Memory Access) feature.
[0053] Upon receiving raw image data from the image sensor 114 interface, the gesture sensor 120 interface, or the image memory 130, the ISP processor 140 may perform one or more image processing operations, such as time-domain filtering, frequency-domain filtering, and the like. The processed image data may be sent to the image memory 130 for further processing before being displayed. The ISP processor 140 receives processed data from the image memory 130 and performs image data processing on the processed data in the raw domain and in the RGB and YCbCr color spaces. The image data processed by the ISP processor 140 may be output to the display 160 for viewing by a user and / or further processing by a graphics engine or GPU (Graphics Processing Unit). In addition, the output of the ISP processor 140 may also be sent to the image memory 130, and the display 160 may read the image data from the image memory 130. In one embodiment, the image memory 130 may be configured to implement one or more frame buffers.
[0054] The statistical data determined by the ISP processor 140 may be sent to the control logic 150. For example, the statistical data may include image sensor 114 statistics such as gyroscope vibration frequency, auto-exposure, auto-white balance, auto-focus, flicker detection, black level compensation, lens 112 shading correction, and so on. The control logic 150 may include a processor and / or microcontroller that executes one or more routines (e.g., firmware) that may determine control parameters for the imaging device 110 and the ISP processor 140 based on the received statistical data. For example, the control parameters for the imaging device 110 may include attitude sensor 120 control parameters (e.g., gain, integration time for exposure control, anti-shake parameters, etc.), camera flash control parameters, camera anti-shake shift parameters, lens 112 control parameters (e.g., focal length for focus or zoom), or a combination of these parameters. The ISP control parameters may include gain levels and color correction matrices used for auto-white balance and color adjustment (e.g., during RGB processing), as well as lens 112 shading correction parameters.
[0055] In some embodiments, the ISP processor 140 can obtain the image to be processed through the lens 112 and the image sensor 114 in the imaging device (camera) 110, and filter the image to be processed through at least two filters to obtain filtered images output by at least two filters, each of which has a different filtering frequency. The ISP processor 140 can perform denoising and enhancement processing on each filtered image to obtain an enhanced image corresponding to each filtering frequency. In addition, the ISP processor 140 can obtain a processed sharpened image by fusing the enhanced image corresponding to each filtering frequency with the image to be processed. Compared with the image to be processed, the sharpened image has stronger boundary strength and the noise in the flat area can be suppressed and will not be amplified with the enhancement processing. Therefore, the effect of the sharpened image is more natural and the image quality is higher.
[0056] In other embodiments, the ISP processor 140 may further utilize the processed sharpened image to perform further image processing. On this basis, the ISP processor 140 may output the image data after the image processing to the display 160 for viewing by the user.
[0057] See also Figure 2 , see Figure 2 , Figure 2 The flowchart of an image processing method disclosed in an embodiment is as follows. The method can be applied to an electronic device including the above-mentioned image processing circuit. Figure 2 As shown, the image processing method may include the following steps:
[0058] 210. Perform filtering processing on the image to be processed through at least two filters to obtain filtered images output by the at least two filters respectively.
[0059] In the embodiment of the present application, at least two filters have different filtering frequencies, and the specific number of filters is not limited. Each filter can filter the image to be processed using the filtering frequency of the filter and output a filtered image corresponding to the filtering frequency.
[0060] Optionally, the at least two filters may include: a high frequency filter, a medium frequency filter, and a low frequency filter; the filtering frequency of the high frequency filter is higher than the filtering frequency of the medium frequency filter, and the filtering frequency of the medium frequency filter is higher than the filtering frequency of the low frequency filter.
[0061] Exemplarily, the high-frequency filter, the intermediate-frequency filter, and the low-frequency filter may be three different Gaussian low-pass filters whose filtering frequencies are arranged in descending order.
[0062] In some embodiments, the electronic device may select any two filters from a high-frequency filter, a medium-frequency filter, and a low-frequency filter to perform filtering processing on the image to be processed.
[0063] In other embodiments, the electronic device may also perform filter processing on the image to be processed using a high-frequency filter, a medium-frequency filter, and a low-frequency filter respectively.
[0064] After executing step 210, the electronic device may obtain two or more filtered images. For each filtered image output by the filter, the electronic device may execute the following steps 220 to 230.
[0065] 220. Perform denoising on the filtered image output by the target filter according to a preset threshold to obtain a denoised image corresponding to the target frequency.
[0066] The target filter is any one of the at least two filters, and the target frequency is the filtering frequency of the target filter.
[0067] Exemplarily, if the target filter is a high-frequency filter, the electronic device may perform denoising on the filtered image output by the high-frequency filter according to a preset threshold value to obtain a denoised image corresponding to the high frequency.
[0068] In step 220, the preset threshold may be set with reference to a pixel value of noise. The preset threshold may be used to determine whether a pixel in the filtered image is noise. Denoising the filtered image based on the preset threshold may refer to filtering out pixels in the filtered image that are determined to be noise based on the preset threshold, while retaining pixels in the filtered image that are determined to be non-noise.
[0069] It should be noted that when an electronic device performs denoising on filtered images output by different filters, the same or different preset thresholds may be used, without specific limitation. If different preset thresholds are used, the electronic device may determine the preset threshold corresponding to the target filter based on the filtering frequency of the target filter (i.e., the target frequency). The correspondence between the target frequency and the preset threshold may be set based on actual business needs, without specific limitation.
[0070] 230. Perform image enhancement processing on the denoised image according to the image brightness of the denoised image corresponding to the target frequency to obtain an enhanced image corresponding to the target frequency.
[0071] In step 230, image enhancement processing is performed on the denoised image based on the image brightness of the denoised image. This may involve amplifying the pixel values of the pixels in the denoised image based on the image brightness of the denoised image. For example, the pixel value of each pixel may be amplified based on its brightness component; alternatively, the pixel value of each pixel may be amplified based on the average brightness of each pixel in the denoised image. In other words, when performing image enhancement processing on denoised images of different brightness levels, the corresponding enhancement strength may vary.
[0072] The enhanced image obtained after the enhancement process has clearer edge details and improved edge sharpness compared to the denoised image before the enhancement process. In other words, by executing step 230, the electronic device can amplify the filtered images corresponding to different filtering frequencies.
[0073] 240. Fuse the enhanced images corresponding to the at least two filtering frequencies and the image to be processed to obtain a processed sharpened image.
[0074] After executing step 210, the electronic device can obtain multiple filtered images corresponding to different filtering frequencies. For each filtered image, the filtered image can be amplified through steps 220 and 230, thereby obtaining multiple enhanced images corresponding to different filtering frequencies. Therefore, in step 240, the electronic device can fuse the multiple enhanced images corresponding to the different filtering frequencies with the original image to be processed, so that pixels with stronger boundary strength in the image to be processed are enhanced, while pixels with weaker boundary strength remain unchanged, thereby achieving improved edge sharpness and achieving an image sharpening effect.
[0075] Among them, fusing the enhanced images corresponding to multiple different filtering frequencies with the original image to be processed may include superimposing the enhanced images corresponding to multiple different filtering frequencies with the image to be processed. For example, the pixel values of the same pixel point in multiple enhanced images and the pixel value of the pixel point in the image to be processed may be added and normalized to obtain the pixel value of the pixel point in the sharpened image.
[0076] Furthermore, in the aforementioned embodiment, the electronic device first performs denoising on the image using a preset threshold before enhancing the image. This can suppress pixels with weaker boundary intensity in the image and suppress noise amplification in flat areas of the image due to sharpening, making the processed sharpened image more natural. Furthermore, in the aforementioned embodiment, the electronic device can perform image enhancement based on the brightness of the image. Because the human eye has different sensitivities to different image brightnesses, the electronic device may use different enhancement intensities when enhancing denoised images of different brightnesses. This can further make the processed sharpened image more natural and improve image quality.
[0077] See also Figure 3 , Figure 3 This is a flow chart of another image processing method disclosed in an embodiment, which can be applied to an electronic device including the above-mentioned image processing circuit. Figure 3 As shown, the image processing method may include the following steps:
[0078] 310. Extract brightness components of pixels in the image to be processed to obtain a brightness image corresponding to the image to be processed.
[0079] In step 310, the electronic device may extract the Y channel component values of each pixel in the image to be processed, thereby obtaining a luminance image corresponding to the image to be processed. If the image to be processed, acquired from the image sensor or memory by the electronic device, is in a non-YUV format, for example, an RGB format, the electronic device may first convert the RGB format image into a YUV image before extracting the Y channel component values.
[0080] 320. Perform filtering processing on the luminance image using at least two filters to obtain filtered images outputted by the at least two filters respectively.
[0081] In step 320, the implementation of the electronic device filtering the luminance image through at least two filters may be similar to the implementation of the electronic device filtering the image to be processed through at least two filters in the aforementioned step 210, and will not be repeated below.
[0082] 330. In combination with the image to be processed, extract a mask image from the filtered image output by the target filter.
[0083] In one embodiment, the electronic device may subtract the filtered image output by the target filter from the image to be processed to obtain a mask image.
[0084] In another embodiment, the electronic device may also first perform Gaussian blur on the image to be processed, and then subtract the filtered image output by the target filter from the image to be processed after Gaussian blur to obtain a mask image.
[0085] 340. Perform denoising on the mask image according to a preset threshold to obtain a denoised image corresponding to the target frequency.
[0086] In step 340, the preset threshold may include, but is not limited to, a first threshold and / or a second threshold. The first threshold may be greater than the second threshold. The first threshold may be a positive value, used to determine whether pixels corresponding to white edges in the mask image are noise, i.e., the first threshold may be a white edge threshold. The second threshold may be a negative value, used to determine whether pixels corresponding to black edges in the mask image are noise, i.e., the second threshold may be a black edge threshold. The aforementioned white edges may include pixels that appear white in the mask image, and black edges may include pixels that appear black in the mask image.
[0087] In one embodiment, the electronic device may compare the pixel values of pixels in the mask image with a first threshold and retain pixels in the mask image whose pixel values are greater than the first threshold. That is, if the pixel value of a pixel in the mask image is greater than the first threshold, the pixel value of that pixel in the denoised image will be the same as the pixel value in the mask image. Therefore, the first threshold can determine that pixels with weaker intensity in the white edge are noise, and remove this noise.
[0088] In another embodiment, the electronic device may compare the pixel values of pixels in the mask image with a second threshold and retain pixels in the mask image whose pixel values are less than the second threshold. That is, if the pixel value of a pixel in the mask image is less than the second threshold, the pixel value of that pixel in the denoised image will be the same as the pixel value of that pixel in the mask image. Therefore, the second threshold can determine that pixels with weaker black edge intensity are noise, and remove this noise.
[0089] For example, in step 340, the electronic device may perform denoising on the mask image using a first threshold and a second threshold, respectively. For each pixel in the mask image, the electronic device may first determine whether the pixel value of the pixel in the mask image is greater than the first threshold. If so, the electronic device retains the pixel and determines the pixel value of the pixel in the denoised image as the pixel value of the pixel in the mask image. If not, the electronic device may further determine whether the pixel value of the pixel in the mask image is less than the second threshold. If not, the electronic device retains the pixel and determines the pixel value of the pixel in the denoised image as the pixel value of the pixel in the mask image. If the pixel value of the pixel is neither greater than the first threshold nor less than the second threshold, the electronic device sets the pixel value of the pixel in the denoised image to 0. By performing the aforementioned processing on each pixel in the mask image, a denoised image corresponding to the target frequency can be obtained.
[0090] 350. Determine an enhancement coefficient corresponding to the denoised image according to the image brightness of the denoised image corresponding to the target frequency.
[0091] In the embodiment of the present application, the correspondence between different levels of image brightness and enhancement coefficients can be preset, wherein the higher the image brightness, the higher the corresponding level.
[0092] The electronic device may directly search out the enhancement coefficient corresponding to the image brightness of the denoised image from the above correspondence relationship as the enhancement coefficient corresponding to the denoised image.
[0093] Alternatively, the electronic device may find out from the corresponding relationship the enhancement coefficient corresponding to the image brightness of the denoised image and use it as the coefficient initial value, and the electronic device may further use the image brightness of the denoised image and the coefficient initial value to calculate the enhancement coefficient corresponding to the denoised image.
[0094] The electronic device may first find the coefficient initial value A corresponding to the image brightness V of the denoised image from the aforementioned correspondence, and also find the coefficient initial value B corresponding to the image brightness level one level before the image brightness V of the denoised image from the aforementioned correspondence. The enhancement coefficient corresponding to the denoised image may be calculated using the following formula: coefficient initial value B - coefficient initial value A × V.
[0095] 360. Enhance the denoised image according to the enhancement coefficient to obtain an enhanced image corresponding to the target frequency.
[0096] In step 360, the electronic device enhances the denoised image according to the enhancement coefficient, which may include multiplying the denoised image by the enhancement coefficient. The enhancement coefficient determined by the electronic device in step 350 is generally greater than 1. Therefore, multiplying the enhancement coefficient by the denoised image can amplify the pixel values of the pixels in the denoised image, thereby achieving an image enhancement effect.
[0097] For example, if the pixel value of a pixel in the denoised image is greater than a first threshold, the pixel value of that pixel in the enhanced image can be calculated according to the following formula: E1 = (E - T1 * α) / 128. Here, E1 can be used to represent the pixel value of the pixel in the enhanced image; E can be used to represent the pixel value of the pixel in the denoised image, which is also the pixel value of the pixel in the mask image; T1 can be used to represent the first threshold, and α can be used to represent the enhancement coefficient corresponding to the denoised image.
[0098] If the pixel value of a pixel in the denoised image is less than the second threshold, the pixel value of the pixel in the enhanced image can be calculated according to the following formula: E1 = (E + T2 * α) / 128. Where T2 can be used to represent the absolute value of the second threshold.
[0099] 370. Fuse the enhanced images corresponding to the at least two filtering frequencies and the brightness image to obtain a processed sharpened image.
[0100] In step 370, the implementation method of the electronic device fusing the enhanced image and the brightness image corresponding to at least two filtering frequencies respectively may be similar to the implementation method of the electronic device fusing the enhanced image and the image to be processed corresponding to at least two filtering frequencies respectively in step 240, and will not be repeated below.
[0101] It can be seen that in the aforementioned embodiment, the electronic device can first use different filters to filter the brightness component of the image to be processed, thereby obtaining multiple filtered images corresponding to different filtering frequencies, and for each filtered image, the white edge threshold and / or the black edge threshold can be used to suppress the boundary information (such as noise) with smaller intensity in the boundary, so that the pixels with larger boundary intensity in the final sharpened image are enhanced, while the pixels with weaker boundary intensity remain unchanged. In addition, the electronic device can perform adaptive image enhancement processing according to the brightness of the image, and realize image enhancement of different intensities at different brightnesses, so that the final sharpened image is more natural. Furthermore, using the first threshold and the second threshold to participate in the calculation during the image enhancement processing can also better control the sharpening intensity of the black and white edges in the image.
[0102] For example, the following description uses the example of filters including a high-frequency filter, an intermediate-frequency filter, and a low-frequency filter to illustrate the image processing method disclosed in the embodiment of the present application. Figure 4 , Figure 4 The figure is a flow chart of an image processing method disclosed in an embodiment, which can be applied to an electronic device including the above-mentioned image processing circuit. Figure 4 As shown:
[0103] The electronic device extracts the brightness component of the image to be processed 410 to obtain a brightness image 411 corresponding to the image to be processed 410 .
[0104] The electronic device uses a high-frequency filter, an intermediate-frequency filter and a low-frequency filter to filter the brightness image 411, respectively, to obtain a high-frequency filtered image 412 output by the high-frequency filter, an intermediate-frequency filtered image 413 output by the intermediate-frequency filter, and a low-frequency filtered image 414 output by the low-frequency filter.
[0105] The electronic device extracts a high-frequency mask image 415 from the high-frequency filtered image 412, an intermediate-frequency mask image 416 from the intermediate-frequency filtered image 413, and a low-frequency mask image 417 from the low-frequency filtered image. Furthermore, the electronic device can suppress pixels with relatively low intensities in the high-frequency mask image 415, the intermediate-frequency mask image 416, and the low-frequency mask image 417 using a preset first threshold and a preset second threshold, i.e., perform denoising, to obtain high-frequency denoised image 418, intermediate-frequency denoised image 419, and low-frequency denoised image 420.
[0106] The electronic device can determine the corresponding initial value of the first coefficient based on the image brightness of the high-frequency denoised image 418, and calculate the first enhancement coefficient 421 corresponding to the high-frequency denoised image 418 based on the image brightness of the high-frequency denoised image 418 and the corresponding initial value of the first coefficient, and multiply the high-frequency denoised image 418 by the corresponding first enhancement coefficient 421 to obtain a high-frequency enhanced image 424.
[0107] The electronic device can determine the corresponding initial value of the second coefficient based on the image brightness of the intermediate frequency denoised image 419, and calculate the second enhancement coefficient 422 corresponding to the intermediate frequency denoised image 419 based on the image brightness of the intermediate frequency denoised image 419 and the corresponding initial value of the second coefficient, and multiply the intermediate frequency denoised image 419 by the corresponding second enhancement coefficient 422 to obtain the intermediate frequency enhanced image 425.
[0108] The electronic device can determine the corresponding initial value of the third coefficient based on the image brightness of the low-frequency denoised image 420, and calculate the third enhancement coefficient 423 corresponding to the low-frequency denoised image 420 based on the image brightness of the low-frequency denoised image 420 and the corresponding initial value of the third coefficient, and multiply the low-frequency denoised image 420 by the corresponding third enhancement coefficient 423 to obtain a low-frequency enhanced image 426.
[0109] The electronic device may fuse the high-frequency enhanced image 424 , the mid-frequency enhanced image 425 , the low-frequency enhanced image 426 , and the brightness image 411 to obtain a processed sharpened image 427 .
[0110] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an image processing device disclosed in an embodiment, which can be applied to any of the aforementioned electronic devices. Figure 5 As shown, the image processing device 500 may include: a filtering module 510 , a denoising module 520 , an enhancement module 530 , and a fusion module 540 .
[0111] A filtering module 510 is configured to filter the image to be processed using at least two filters to obtain filtered images outputted by the at least two filters, wherein the filtering frequencies of the at least two filters are different;
[0112] a denoising module 520 configured to perform denoising on the filtered image output by the target filter according to a preset threshold value to obtain a denoised image corresponding to a target frequency; the target filter is any one of the at least two filters, and the target frequency is the filtering frequency of the target filter;
[0113] An enhancement module 530 is configured to perform image enhancement processing on the denoised image according to the image brightness of the denoised image to obtain an enhanced image corresponding to the target frequency;
[0114] The fusion module 540 is configured to fuse the enhanced images corresponding to at least two filtering frequencies and the image to be processed to obtain a processed sharpened image.
[0115] In one embodiment, the denoising module 520 may include: an extraction unit and a denoising unit.
[0116] An extraction unit, configured to extract a mask image from a filtered image output by a target filter in combination with an image to be processed;
[0117] The denoising unit can be used to perform denoising on the mask image according to a preset threshold value to obtain a denoised image corresponding to the target frequency.
[0118] In one embodiment, the denoising unit can also be used to compare the pixel values of the pixels in the mask image with a first threshold, retaining the pixels in the mask image whose pixel values are greater than the first threshold, to obtain a denoised image corresponding to the target frequency; and / or, compare the pixel values of the pixels in the mask image with a second threshold, retaining the pixels in the mask image whose pixel values are less than the second threshold, to obtain a denoised image corresponding to the target frequency; wherein the first threshold is a positive value and the second threshold is a negative value.
[0119] In one embodiment, the enhancement module 530 may include: a determination unit and an enhancement unit.
[0120] a determination unit, configured to determine an enhancement coefficient corresponding to the denoised image based on the image brightness of the denoised image;
[0121] The enhancement unit can be used to enhance the denoised image according to the enhancement coefficient to obtain an enhanced image corresponding to the target frequency.
[0122] In one embodiment, the determination unit may be further configured to determine an initial coefficient value corresponding to the image brightness of the denoised image; and calculate an enhancement coefficient corresponding to the denoised image based on the image brightness and the initial coefficient value.
[0123] In one embodiment, the filtering module 510 may include: an extraction unit and a filtering unit.
[0124] An extraction unit, which can be used to extract the brightness components of pixels in the image to be processed to obtain a brightness image corresponding to the image to be processed;
[0125] The filtering unit can be used to filter the brightness image through at least two filters to obtain filtered images output by the at least two filters respectively.
[0126] The aforementioned fusion module 540 may also be used to fuse the enhanced images corresponding to at least two filtering frequencies and the brightness image to obtain a processed sharpened image.
[0127] As can be seen, the aforementioned image processing device can filter the image to be processed using filters corresponding to different filtering frequencies, thereby obtaining filtered images corresponding to the different filtering frequencies. De-noising is then performed on each filtered image using a preset threshold to suppress noise amplification. Furthermore, when performing image enhancement on each denoised image obtained after denoising, adaptive enhancement is performed based on the image brightness of each denoised image, resulting in a sharpened image with higher quality and a more natural effect.
[0128] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the structure of an electronic device disclosed in an embodiment. Figure 6 As shown, the electronic device 600 may include:
[0129] A memory 610 storing executable program code;
[0130] a processor 620 coupled to the memory 610;
[0131] The processor 620 calls the executable program code stored in the memory 610 to execute any image processing method disclosed in the embodiments of the present application.
[0132] It should be noted that Figure 6 The electronic device shown may also include components not shown, such as a power supply, input buttons, a camera, a speaker, a screen, an RF circuit, a Wi-Fi module, a Bluetooth module, and sensors, which are not described in detail in this embodiment.
[0133] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements any one of the image processing methods disclosed in the embodiment of the present application.
[0134] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute any one of the image processing methods disclosed in the embodiments of the present application.
[0135] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.
[0136] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0137] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of these units may be selected based on actual needs to achieve the objectives of this embodiment.
[0138] In addition, the functional units in the embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0139] 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 can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a memory and includes several requests for a computer device (which can be a personal computer, server or network device, etc., specifically a processor in a computer device) to execute some or all of the steps of the above-mentioned methods of various embodiments of the present application.
[0140] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0141] The above describes in detail the image processing method, device, electronic device, and storage medium disclosed in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. At the same time, for those skilled in the art, based on the concept of the present application, there may be changes in the specific implementation methods and application scope. In summary, the contents of this specification should not be understood as limiting the present application.
Claims
1. An image processing method, characterized in that: The method comprises: Performing filtering processing on the image to be processed by at least two filters to obtain filtered images outputted by the at least two filters respectively; the filtering frequencies of the at least two filters are different; extracting a mask image from a filtered image output by a target filter in combination with the image to be processed, wherein the target filter is any one of the at least two filters; Comparing pixel values of pixels in the mask image with a first threshold, and retaining pixels in the mask image whose pixel values are greater than the first threshold, to obtain a denoised image corresponding to a target frequency; and / or, Comparing pixel values of pixels in the mask image with a second threshold, and retaining pixels in the mask image whose pixel values are less than the second threshold, to obtain a denoised image corresponding to a target frequency, where the first threshold is a positive value, the second threshold is a negative value, and the target frequency is the filtering frequency of the target filter; performing image enhancement processing on the denoised image according to the image brightness of the denoised image to obtain an enhanced image corresponding to the target frequency; The enhanced images corresponding to the at least two filtering frequencies and the image to be processed are fused to obtain a processed sharpened image.
2. The method according to claim 1, characterized in that The performing image enhancement processing on the denoised image according to the image brightness of the denoised image to obtain an enhanced image corresponding to the target frequency includes: determining an enhancement coefficient corresponding to the denoised image according to the image brightness of the denoised image; The denoised image is enhanced according to the enhancement coefficient to obtain an enhanced image corresponding to the target frequency.
3. The method according to claim 2, characterized in that The step of determining an enhancement coefficient corresponding to the denoised image according to the image brightness of the denoised image includes: determining an initial value of a coefficient corresponding to image brightness of the denoised image; An enhancement coefficient corresponding to the denoised image is calculated according to the image brightness and the initial value of the coefficient.
4. The method according to claim 1, wherein The filtering process of the image to be processed by at least two filters to obtain filtered images outputted by the at least two filters respectively includes: Extracting the brightness components of pixels in the image to be processed to obtain a brightness image corresponding to the image to be processed; Performing filtering processing on the brightness image through at least two filters to obtain filtered images outputted by the at least two filters respectively; Furthermore, fusing the enhanced images corresponding to the at least two filtering frequencies and the image to be processed to obtain a processed sharpened image includes: The enhanced images corresponding to the at least two filtering frequencies and the brightness image are fused to obtain a processed sharpened image.
5. The method according to any one of claims 1 to 4, characterized in that The at least two filters include: a high frequency filter, an intermediate frequency filter, and a low frequency filter; the filtering frequency of the high frequency filter is higher than the filtering frequency of the intermediate frequency filter, and the filtering frequency of the intermediate frequency filter is higher than the filtering frequency of the low frequency filter.
6. An image processing device, characterized in that include: a filtering module, configured to filter the image to be processed using at least two filters to obtain filtered images outputted by the at least two filters respectively; the at least two filters have different filtering frequencies; a denoising module, configured to extract a mask image from a filtered image output by a target filter in combination with an image to be processed, wherein the target filter is any one of the at least two filters; compare pixel values of pixels in the mask image with a first threshold, retain pixels in the mask image having pixel values greater than the first threshold, to obtain a denoised image corresponding to a target frequency; and / or compare pixel values of pixels in the mask image with a second threshold, retain pixels in the mask image having pixel values less than the second threshold, to obtain a denoised image corresponding to a target frequency, wherein the first threshold is a positive value, the second threshold is a negative value, and the target frequency is the filtering frequency of the target filter; an enhancement module, configured to perform image enhancement processing on the denoised image according to the image brightness of the denoised image to obtain an enhanced image corresponding to the target frequency; The fusion module is used to fuse the enhanced images corresponding to at least two filtering frequencies and the image to be processed to obtain a processed sharpened image.
7. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Image sharpening device and method
CN101197910A
Image processing method, device, storage medium, and electronic device
CN109146814A