Image processing method and device, electronic device, and storage medium

By separating the image with high frequency and low frequency, the low frequency image is first color correction, and then fused with the high frequency image, the problem of details loss after color correction is solved and the image quality is improved.

CN119784596APending Publication Date: 2025-04-08BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311288060.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-07
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The prior art after image color correction is made, pixel values ​​are easily overflowed or uneven corrections, resulting in loss of image details and affecting image quality.

Method used

By separating the image to be processed into a high-frequency image and a low-frequency image, the low-frequency image is first color correction and then fused with the high-frequency image to determine the final processed image.

Benefits of technology

This method reduces the impact of color correction on high-frequency details, taking into account color correction and high-frequency details retention, thereby improving image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784596A_ABST
    Figure CN119784596A_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method and device, an electronic device, and a storage medium. The method comprises: determining a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed; performing color correction on the low-frequency image to obtain a color-corrected low-frequency image; and performing fusion processing based on the color-corrected low-frequency image and the high-frequency image to determine a processed image. By using this method, the quality of the color-corrected image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method and device, electronic equipment, and storage medium. Background Art

[0002] With the rapid development of electronic devices such as mobile phones, cameras, tablets, and wearable devices, higher quality requirements have been put forward for images obtained by electronic devices. From the initial raw image to the final image, the image will be processed by various modules, one of which is the color correction module. The color correction module is used to correct the image so that the image color is closer to the color perceived by the human eye.

[0003] However, after color correction, some details in the image are lost due to the overflow of pixel values ​​in the corrected image or the inconsistent degree of pixel value correction. How to improve the quality of color-corrected images is an urgent problem to be solved. Summary of the invention

[0004] The present disclosure provides an image processing method and device, an electronic device, and a storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, including:

[0006] Determine a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed;

[0007] Performing color correction on the low-frequency image to obtain a color-corrected low-frequency image;

[0008] A fusion process is performed based on the color-corrected low-frequency image and the high-frequency image to determine a processed image.

[0009] In some embodiments, the image to be processed is an image in RGB space, and the high-frequency image and the low-frequency image are both images in HSV space; and determining the high-frequency image and the low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed includes:

[0010] Performing spatial conversion on the image to be processed in the RGB space to obtain the image to be processed in the HSV space;

[0011] Performing filtering processing on the value of the V channel in the image to be processed in the HSV space to obtain a low-frequency image in the HSV space;

[0012] The difference between the image to be processed in the HSV space and the low-frequency image in the HSV space is determined as the high-frequency image in the HSV space.

[0013] In some embodiments, filtering the value of the V channel in the image to be processed in the HSV space to obtain the low-frequency image in the HSV space includes:

[0014] The preset bilateral filtering function is used to filter the value of the V channel in the image to be processed in the HSV space to obtain the low-frequency image.

[0015] In some embodiments, the image to be processed is an image in RGB space, and the low-frequency image is an image in HSV space; the method further includes:

[0016] Get the color correction matrix;

[0017] The step of performing color correction on the low-frequency image to obtain a color-corrected low-frequency image includes:

[0018] Performing spatial transformation on the low-frequency image in the HSV space to obtain a low-frequency image in the RGB space;

[0019] Processing pixel values ​​of pixel points in the low-frequency image in the RGB space by using the color correction matrix to obtain a low-frequency image after color correction in the RGB space;

[0020] The color-corrected low-frequency image in the RGB space is spatially transformed to obtain the color-corrected low-frequency image in the HSV space.

[0021] In some embodiments, obtaining a color correction matrix includes:

[0022] Collect sample images under different light sources;

[0023] The color correction matrix is ​​determined by fitting based on the mapping between the sample images collected under each light source and the preset standard images corresponding to each light source.

[0024] In some embodiments, the color-corrected low-frequency image and the high-frequency image are both images in the HSV space; and the fusion processing based on the color-corrected low-frequency image and the high-frequency image to determine the processed image includes:

[0025] Performing weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain a value of the V channel after weighted fusion;

[0026] Based on the H channel value, the S channel value respectively corresponding to the color-corrected low-frequency image and / or the high-frequency image, and the V channel value after weighted fusion, spatial conversion is performed to obtain an image processed in RGB space.

[0027] In some embodiments, performing weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain the value of the V channel after weighted fusion includes:

[0028] Using a first preset weight to weight the value of the V channel in the color-corrected low-frequency image to obtain a first component value;

[0029] Using a second preset weight to weight the value of the V channel in the high-frequency image to obtain a second component value; wherein the sum of the first preset weight and the second preset weight is a preset value;

[0030] The sum of the first component value and the second component value is determined as the value of the V channel after the weighted fusion.

[0031] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:

[0032] A determination module, used to determine a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed;

[0033] An obtaining module, used for performing color correction on the low-frequency image to obtain a color-corrected low-frequency image;

[0034] The processing module is used to perform fusion processing based on the low-frequency image after color correction and the high-frequency image to determine a processed image.

[0035] In some embodiments, the image to be processed is an image in RGB space, and the high-frequency image and the low-frequency image are both images in HSV space; the determination module is used to perform spatial conversion on the image to be processed in RGB space to obtain the image to be processed in HSV space; filter the value of the V channel in the image to be processed in HSV space to obtain the low-frequency image in HSV space; and determine the difference between the image to be processed in HSV space and the low-frequency image in HSV space as the high-frequency image in HSV space.

[0036] In some embodiments, the determination module is used to filter the value of the V channel in the image to be processed in the HSV space using a preset bilateral filtering function to obtain the low-frequency image.

[0037] In some embodiments, the image to be processed is an image in RGB space, and the low-frequency image is an image in HSV space; the device further comprises:

[0038] An acquisition module, used for acquiring a color correction matrix;

[0039] The obtaining module is used to perform spatial conversion on the low-frequency image in the HSV space to obtain a low-frequency image in the RGB space; use the color correction matrix to process the pixel values ​​of the pixel points in the low-frequency image in the RGB space to obtain a color-corrected low-frequency image in the RGB space; and perform spatial conversion on the color-corrected low-frequency image in the RGB space to obtain the color-corrected low-frequency image in the HSV space.

[0040] In some embodiments, the acquisition module is used to respectively collect sample images under different light sources; and determine the color correction matrix by fitting based on the mapping between the sample images collected under each light source and the preset standard images corresponding to each light source.

[0041] In some embodiments, the color-corrected low-frequency image and the high-frequency image are both images in the HSV space; the processing module is used to perform weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain the value of the weighted fused V channel; based on the value of the H channel, the value of the S channel corresponding to the color-corrected low-frequency image and / or the high-frequency image, and the value of the weighted fused V channel, perform spatial conversion to obtain the image processed in the RGB space.

[0042] In some embodiments, the processing module is used to weight the value of the V channel in the color-corrected low-frequency image using a first preset weight to obtain a first component value; weight the value of the V channel in the high-frequency image using a second preset weight to obtain a second component value; wherein the sum of the first preset weight and the second preset weight is a preset value; and the sum of the first component value and the second component value is determined as the value of the V channel after weighted fusion.

[0043] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0044] A processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method as described in the first aspect above.

[0045] According to a fourth aspect of an embodiment of the present disclosure, there is provided a storage medium, including:

[0046] When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as described in the first aspect above.

[0047] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0048] The image processing device of the disclosed embodiment separates the high-frequency image corresponding to the image to be processed and performs color correction on the low-frequency image corresponding to the image to be processed before color correction is performed on the image to be processed, thereby reducing the influence of color correction on high-frequency details; and determines the processed image based on the fusion processing of the low-frequency image after color correction and the high-frequency image, so that the processed image realizes color correction while taking into account high-frequency details such as edge contours in the image, thereby improving the image quality after color correction

[0049] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0051] Figure 1 This is an example of an image processing method flow shown in the embodiment of the present disclosure Figure 1 .

[0052] Figure 2 This is an example diagram of comparison of an image before and after processing provided by an embodiment of the present disclosure.

[0053] Figure 3 This is an example of an image processing method flow shown in the embodiment of the present disclosure Figure 2 .

[0054] Figure 4 is a diagram of an image processing device shown in an embodiment of the present disclosure.

[0055] Figure 5 It is a block diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0056] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0057] Taking the use of a color correction matrix (CCM) to correct the color of an image as an example, the values ​​of R (red channel), G (green channel), and B (blue channel) in the corrected image can be expressed by the following formula (1):

[0058]

[0059] in, Represents the value of the RGB channel in the image to be corrected, Represents the value of the RGB channel in the color-corrected image. Corresponding to the aforementioned color correction matrix.

[0060] However, the color correction methods including the aforementioned methods using CCM matrix and the like simply perform color correction without considering the impact on the details in the image. In practical applications, there will be loss of details after color correction, and after the details are lost, it is difficult for the subsequent image processing module to restore the details, resulting in poor image quality. For example, a high-saturation CCM matrix, after color correction, the pixel values ​​of some pixels will overflow, such as the part with a pixel value exceeding 255, which will be truncated by the data, resulting in the inability to accurately express the details of the part, which is reflected in the image as loss of details; in addition, after the CCM matrix conversion, due to the inconsistent degree of correction of the pixel value, there is a situation where the difference between the pixel values ​​of the pixel points becomes smaller, which is reflected in the image as blurred image contours and loss of details.

[0061] In this regard, an embodiment of the present disclosure provides an image processing method, the execution subject of which may be an image processing device. For example, the image processing method may be executed by a terminal device or a server or other electronic device including an image acquisition component, wherein the terminal device may be a mobile phone, a camera, a tablet computer, a vehicle-mounted device, a wearable device, etc. If the execution subject is a server or other electronic device, after the terminal device including the image acquisition component acquires the image, it sends it to the server or other electronic device, so that the server or other electronic device processes the image, and may also feed back the processed image to the terminal device. In some possible implementations, the image processing method may be implemented by a processor calling computer-readable instructions stored in a memory.

[0062] Figure 1 This is an example of an image processing method flow shown in the embodiment of the present disclosure Figure 1 ,Depend on Figure 1 It can be seen that the following steps are included:

[0063] S101, determining a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed;

[0064] S102, performing color correction on the low-frequency image to obtain a color-corrected low-frequency image;

[0065] S103: Perform fusion processing on the low-frequency image after color correction and the high-frequency image to determine a processed image.

[0066] The image to be processed in the embodiment of the present disclosure may be an image captured by an image acquisition component (such as a camera), a previewed image, an image frame in a video, etc., and the present disclosure does not limit this.

[0067] In step S101, the image processing device determines a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel in the image to be processed; in some embodiments, if the image to be processed is a grayscale image, the image processing device processes the grayscale values ​​of the pixels in the grayscale image using a low-pass filter to obtain a low-frequency image corresponding to the grayscale image; the image processing device processes the grayscale values ​​of the pixels in the grayscale image using a high-pass filter to obtain a high-frequency image corresponding to the grayscale image.

[0068] In some embodiments, if the image to be processed is a color image, the image processing device performs spatial conversion on the color image to obtain a spatially converted image; wherein the spatially converted image is an image in the H (hue) S (saturation) V (brightness) space, an image in the Y (brightness) U (blue channel) V (red channel) space, etc. The image processing device processes the brightness values ​​of the pixels in the spatially converted image using a low-pass filter to obtain a low-frequency image corresponding to the color image; the image processing device processes the brightness values ​​of the pixels in the spatially converted image using a high-pass filter to obtain a high-frequency image corresponding to the color image.

[0069] In addition, after determining the low-frequency image corresponding to the image to be processed, the embodiment of the present disclosure can also obtain the high-frequency image corresponding to the image to be processed according to the pixel difference between the image to be processed and the low-frequency image.

[0070] It can be understood that the low-frequency image corresponding to the image to be processed in the embodiment of the present disclosure includes low-frequency information that characterizes a smooth change in the intensity (such as brightness, grayscale, etc.) of the image to be processed, such as large color blocks in the image to be processed; the high-frequency image corresponding to the image to be processed in the embodiment of the present disclosure includes high-frequency information that characterizes a large change in the intensity of the image to be processed, such as details such as edge contours in the image to be processed.

[0071] In step S102, the image processing device performs color correction on the low-frequency image to obtain a color-corrected low-frequency image; for example, the image processing device uses a CCM matrix to process the low-frequency image based on the above formula (1) to obtain a color-corrected low-frequency image. If the low-frequency image is an image in the RGB space, the image processing device can directly use the CCM matrix to process the values ​​of the RGB channels in the low-frequency image to obtain a color-corrected low-frequency image; if the low-frequency image is not an image in the RGB space, the image processing device converts the low-frequency image to the RGB space based on a preset space conversion formula, such as a conversion formula between the HSV space and the RGB space, a conversion formula between the RGB space and the YUV space, etc., and then uses the CCM matrix to process the low-frequency image converted to the RGB space to obtain a color-corrected low-frequency image.

[0072] In addition, the image processing device of the embodiment of the present disclosure may also process the low-frequency image using algorithms such as histogram equalization, color balance, and color mapping to obtain a color-corrected low-frequency image, which is not limited in the embodiment of the present disclosure.

[0073] In step S103, the image processing device performs fusion processing based on the color-corrected low-frequency image and the high-frequency image to determine a processed image. In some embodiments, the image processing device performs operations on the pixel value of the pixel point in the color-corrected low-frequency image and the pixel value of the pixel point in the high-frequency image based on a preset fusion equation for each pixel point, and uses the pixel value of the pixel point after the operation as the pixel value of the pixel point in the processed image.

[0074] In some embodiments, the image processing device processes the color-corrected low-frequency image and the high-frequency image using a preset image fusion model to obtain a processed image. The image fusion model may be trained based on a deep learning network; for example, based on a training sample image set (including a low-frequency sample image and a high-frequency sample image) and a preset standard image corresponding to the training sample image set, a network such as a convolutional neural network (CNN) or a deep learning network (DNN) is trained, and the parameters of the network are adjusted according to the difference between the model standard images to obtain the image fusion model.

[0075] Figure 2 This is an example diagram of a comparison of images before and after processing provided by an embodiment of the present disclosure. Figure 2 In FIG. 1 , L1 indicates the image to be processed, L2 indicates the image after color correction is performed on the entire image to be processed, and L3 indicates the processed image obtained by the image processing method of the embodiment of the present disclosure. Figure 2It can be seen that compared with the image marked with L2, details such as edge contours in the processed image marked with L3 are well preserved, and the image quality is better.

[0076] It can be understood that, before performing color correction on the image to be processed, the image processing device of the embodiment of the present disclosure separates the high-frequency image corresponding to the image to be processed and performs color correction on the low-frequency image corresponding to the image to be processed, so as to reduce the influence of color correction on high-frequency details; and determines the processed image based on the fusion processing of the low-frequency image and the high-frequency image after color correction, so that the processed image realizes color correction while taking into account high-frequency details such as edge contours in the image, thereby improving the quality of the image after color correction.

[0077] In some embodiments, the image to be processed is an image in RGB space, and the high-frequency image and the low-frequency image are both images in HSV space; and determining the high-frequency image and the low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed includes:

[0078] Performing spatial conversion on the image to be processed in the RGB space to obtain the image to be processed in the HSV space;

[0079] Performing filtering processing on the value of the V channel in the image to be processed in the HSV space to obtain a low-frequency image in the HSV space;

[0080] The difference between the image to be processed in the HSV space and the low-frequency image in the HSV space is determined as the high-frequency image in the HSV space.

[0081] The image to be processed in the embodiment of the present disclosure is an image in the RGB space, corresponding to the pixel values ​​of the three color channels of R, G, and B; the high-frequency image and the low-frequency image in the embodiment of the present disclosure are both images in the HSV space, corresponding to the values ​​of the H, S, and V channels.

[0082] The image processing device of the embodiment of the present disclosure uses the existing conversion formula or other reasonable conversion formula to perform spatial conversion on the image to be processed in the RGB space to obtain the image to be processed in the HSV space, and performs low-pass filtering, Gaussian filtering, etc. on the value of the V channel in the image to be processed in the HSV space to obtain a low-frequency image in the HSV space, which can be expressed by the following formula (2):

[0083] LF_Img_V=f(x,y)*Ori_Img_V; (2)

[0084] Among them, LF_Img_V represents the value of the V channel in the low-frequency image of the HSV space, f(x, y) represents the filter function, and Ori_Img_V represents the value of the V channel in the image to be processed in the HSV space.

[0085] It should be noted that the value of the S channel in the low-frequency image of the HSV space can be consistent with the value of the S channel in the image to be processed in the HSV space (Ori_Img_S), and the value of the H channel in the low-frequency image of the HSV space can be consistent with the value of the H channel in the image to be processed in the HSV space (Ori_Img_H).

[0086] After obtaining the low-frequency image in the HSV space, the image processing apparatus of the embodiment of the present disclosure determines the difference between the image to be processed in the HSV space and the low-frequency image in the HSV space as the high-frequency image in the HSV space, which can be expressed by the following formula (3):

[0087] HF_Img_V=Ori_Img_V-LF_Img_V; (3)

[0088] Among them, HF_Img_V represents the value of the V channel in the high-frequency image of the HSV space.

[0089] It can be understood that, on the one hand, the brightness signal of the image can well characterize the intensity of the image to be processed. The embodiment of the present disclosure converts the image to be processed in the RGB space into the image to be processed in the HSV space. The accuracy of determining the low-frequency image and the high-frequency image can be improved through the value of the image to be processed in the HSV space in the V channel. On the other hand, after determining the low-frequency image in the HSV space, the difference between the image to be processed in the HSV space and the low-frequency image in the HSV space is determined as the high-frequency image in the HSV space, which can improve the convenience of determining the high-frequency image.

[0090] In some embodiments, filtering the value of the V channel in the image to be processed in the HSV space to obtain the low-frequency image in the HSV space includes:

[0091] The preset bilateral filtering function is used to filter the value of the V channel in the image to be processed in the HSV space to obtain the low-frequency image.

[0092] In the embodiment of the present disclosure, the image processing device uses a preset bilateral filter function to filter the value of each pixel in the V channel of the image to be processed in the HSV space to obtain a low-frequency image; wherein the preset bilateral filter function f(x, y) can be expressed by the following formula (4):

[0093]

[0094] Among them, S x,yrepresents the (2N+1)*(2N+1) size neighborhood of the center point (x, y), (i, j) represents the coordinates of the pixel point, g(i, j) represents the value of the V channel in the image to be processed in the HSV space, ω(i, j) is the filter factor; ω(i, j) can be expressed by the following formula (5):

[0095] ω(i, j) = ω s (i, j)*ω r (i, j); (5)

[0096] Among them, ω s (i, j) represents the spatial neighborhood factor, which can be expressed by the following formula (6): ω r (i, j) represents the brightness similarity factor, which can be expressed by the following formula (7):

[0097]

[0098]

[0099] Among them, σ s , σ r is the preset coefficient.

[0100] Based on the above formulas (4) to (7), it can be seen that by adjusting the width N and the spatial neighborhood factor coefficient σ in the bilateral filter function s and the brightness similarity factor coefficient σ r , you can control the strength of the bilateral filtering.

[0101] It can be understood that, since bilateral filtering can achieve image smoothing processing, the image processing device of the embodiment of the present disclosure uses a preset bilateral filtering function to filter the value of the V channel in the image to be processed in the HSV space to obtain a low-frequency image, which can improve the accuracy of the low-frequency image in the HSV space; in addition, by adjusting the width, spatial neighborhood factor coefficient and / or brightness similarity factor coefficient in the bilateral filtering function, the flexibility of adjusting the low-frequency image in the HSV space can be improved.

[0102] In some embodiments, the image to be processed is an image in RGB space, and the low-frequency image is an image in HSV space; the method further includes:

[0103] Get the color correction matrix;

[0104] The step of performing color correction on the low-frequency image to obtain a color-corrected low-frequency image includes:

[0105] Performing spatial transformation on the low-frequency image in the HSV space to obtain a low-frequency image in the RGB space;

[0106] Processing pixel values ​​of pixel points in the low-frequency image in the RGB space by using the color correction matrix to obtain a low-frequency image after color correction in the RGB space;

[0107] The color-corrected low-frequency image in the RGB space is spatially transformed to obtain the color-corrected low-frequency image in the HSV space.

[0108] In the embodiment of the present disclosure, the image to be processed is an image in the RGB space, and the low-frequency image is an image in the HSV space. The embodiment of the present disclosure performs spatial conversion on the low-frequency image in the HSV space to obtain the low-frequency image in the RGB space. For example, using the conversion formula between the HSV space and the RGB space, spatial conversion is performed according to the value of the V channel, the value of the S channel, and the value of the H channel in the low-frequency image in the HSV space to obtain the low-frequency image in the RGB space. The low-frequency image in the RGB space is suitable as a basis for color correction.

[0109] The embodiment of the present disclosure uses the acquired color correction matrix to process the pixel values ​​of the pixel points in the low-frequency image in the RGB space to obtain the low-frequency image LF_Img_rgb_correct after color correction in the RGB space, which can be expressed by the following formula (8):

[0110] LF_Img_rgb_correct=LF_Img_rgb*CCM; (8)

[0111] Among them, CCM represents the color correction matrix, and LF_Img_rgb represents the low-frequency image in the RGB space.

[0112] After obtaining the color-corrected low-frequency image in the RGB space, the image processing device of the embodiment of the present disclosure converts the color-corrected low-frequency image in the RGB space into the HSV space to obtain the color-corrected low-frequency image in the HSV space.

[0113] It can be understood that the image processing device of the embodiment of the present disclosure converts the low-frequency image in the HSV space into the RGB space, thereby improving the convenience of color correction of the low-frequency image in the RGB space based on the color correction matrix.

[0114] In some embodiments, obtaining a color correction matrix includes:

[0115] Collect sample images under different light sources;

[0116] The color correction matrix is ​​determined by fitting based on the mapping between the sample images collected under each light source and the preset standard images corresponding to each light source.

[0117] In the embodiments of the present disclosure, different light sources may be light sources of different color temperatures, light sources of different brightness, etc., which is not limited in the embodiments of the present disclosure.

[0118] After obtaining sample images collected under different light sources, the disclosed embodiment fits the mapping between the sample images collected under each light source and the preset standard images corresponding to each light source based on the least squares method, Monte Carlo algorithm, etc., and uses the fitted mapping as the color correction matrix. The preset standard image corresponding to the light source can be an image selected by humans to meet the visual experience, or an image generated based on the standard RGB value corresponding to the light source parameters (color temperature, brightness, etc.).

[0119] It can be understood that the embodiment of the present disclosure can improve the generalization capability of color correction of images under different light sources based on the color correction matrix obtained after fitting based on the color matrix.

[0120] Since the brightness and color temperature of the light source have standard RGB colors, and each light sensor has different characteristics, the color correction matrix under different light sources will also be different. In this regard, the embodiment of the present disclosure can also determine the mapping between the sample image collected under each light source and the preset standard image corresponding to each light source based on each light source, and the mapping can also be represented by a matrix; thus, when the image processing device of the embodiment of the present disclosure performs color correction on the low-frequency image, it can select the matrix corresponding to the light source based on the light source used to collect the low-frequency image, and use the matrix to perform color correction on the low-frequency image to obtain a color-corrected low-frequency image.

[0121] In some embodiments, the color-corrected low-frequency image and the high-frequency image are both images in the HSV space; and the fusion processing based on the color-corrected low-frequency image and the high-frequency image to determine the processed image includes:

[0122] Performing weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain a value of the V channel after weighted fusion;

[0123] Based on the H channel value, the S channel value respectively corresponding to the color-corrected low-frequency image and / or the high-frequency image, and the V channel value after weighted fusion, spatial conversion is performed to obtain an image processed in RGB space.

[0124] In the disclosed embodiment, both the low-frequency image and the high-frequency image after color correction are images in the HSV space, corresponding to the value of the H channel, the value of the S channel, and the value of the V channel, respectively.

[0125] The image processing device of the embodiment of the present disclosure performs weighted fusion processing on the value of the V channel in the low-frequency image after color correction and the value of the V channel in the high-frequency image, such as directly linearly summing the value of the V channel in the low-frequency image and the value of the V channel in the high-frequency image, or processing the value of the V channel in the low-frequency image and the value of the V channel in the high-frequency image based on a preset nonlinear function to obtain the value of the V channel after weighted fusion.

[0126] After obtaining the value of the V channel after weighted fusion, the image processing device of the embodiment of the present disclosure performs spatial conversion based on the value of the H channel, the value of the S channel of the low-frequency image after color correction, and the value of the V channel after weighted fusion to obtain an image processed in RGB space.

[0127] Alternatively, the image processing device performs space conversion based on the value of the H channel, the value of the S channel, and the value of the V channel after weighted fusion of the high-frequency image to obtain an image processed in the RGB space.

[0128] Alternatively, the image processing device averages the value of the H channel of the color-corrected low-frequency image and the value of the H channel of the high-frequency image, as the value of the H channel to be converted; averages the value of the S channel of the color-corrected low-frequency image and the value of the S channel of the high-frequency image, as the value of the S channel to be converted; and performs spatial conversion based on the value of the H channel to be converted, the value of the S channel to be converted, and the value of the V channel after weighted fusion to obtain an image processed in RGB space.

[0129] It can be understood that the value of the V channel in the low-frequency image of the embodiment of the present disclosure includes brightness information such as large color blocks after color correction, and the value of the V channel in the high-frequency image includes brightness information of details such as edge contours, so that the value of the V channel after weighted fusion includes low-frequency information and high-frequency information, so that the image processed by the converted RGB space can achieve color correction of the low-frequency information while retaining the high-frequency information, that is, the high-frequency details are superimposed on the low-frequency image after color correction, thereby improving the color effect of the processed image.

[0130] In some embodiments, performing weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain the value of the V channel after weighted fusion includes:

[0131] Using a first preset weight to weight the value of the V channel in the color-corrected low-frequency image to obtain a first component value;

[0132] Using a second preset weight to weight the value of the V channel in the high-frequency image to obtain a second component value; wherein the sum of the first preset weight and the second preset weight is a preset value;

[0133] The sum of the first component value and the second component value is determined as the value of the V channel after the weighted fusion.

[0134] In an embodiment of the present disclosure, the image processing device uses a first preset weight and a second preset weight to weight the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image, respectively, to obtain a first component value and a second component value; wherein the sum of the first preset weight and the second preset weight is a preset value, such as 1.

[0135] The image processing device of the embodiment of the present disclosure determines the sum of the first component value and the second component value as the value Out_Img_rgb_correct_V of the V channel after weighted fusion, which can be expressed by the following formula (9):

[0136] Out_Img_rgb_correct_V=(1-a)*LF_Img_rgb_correct_V+a*HF_Img_V; (9)

[0137] Among them, (1-a) represents the first preset weight, a represents the second preset weight, (1-a)*LF_Img_rgb_correct_V corresponds to the aforementioned first component value, and a*HF_Img_V corresponds to the aforementioned second component value.

[0138] It can be understood that the embodiment of the present disclosure can control the influence of the brightness information of the low-frequency image after color correction and the brightness information of the high-frequency image on the value of the weighted fused V channel through the first preset weight and the second preset weight, thereby improving the flexibility of the degree of fusion of the low-frequency information after color correction and the high-frequency information in the final processed image.

[0139] Figure 3 This is an example of an image processing method flow shown in the embodiment of the present disclosure Figure 2 ,Depend on Figure 3 It can be seen that the following steps are included:

[0140] S301, obtaining an image to be processed;

[0141] In the embodiment of the present disclosure, the image processing device obtains an image to be processed, which may be an image captured by an image acquisition component (such as a camera), a previewed image, an image frame in a video, etc., and the present disclosure does not limit this.

[0142] S302, performing detail processing on the image to be processed;

[0143] In the disclosed embodiment, the image processing device performs detail processing on the image to be processed, and determines a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed.

[0144] S303, obtaining a low-frequency image;

[0145] In the embodiment of the present disclosure, after performing detail processing on the image to be processed in step S302, a low-frequency image is obtained. For example, the image to be processed is an image in RGB space, and both the high-frequency image and the low-frequency image are images in HSV space; the embodiment of the present disclosure can perform spatial conversion on the image to be processed in RGB space to obtain the image to be processed in HSV space, and filter the value of the V channel in the image to be processed in HSV space to obtain the low-frequency image in HSV space.

[0146] S304, performing color correction on the low-frequency image;

[0147] In the embodiment of the present disclosure, the image processing device performs spatial transformation on the low-frequency image in the HSV space to obtain the low-frequency image in the RGB space, and uses the color correction matrix to process the pixel values ​​of the pixel points in the low-frequency image in the RGB space to obtain the low-frequency image after color correction in the RGB space; and performs spatial transformation on the low-frequency image after color correction in the RGB space to obtain the low-frequency image after color correction in the HSV space.

[0148] S305, obtaining a high-frequency image;

[0149] In the disclosed embodiment, after performing detail processing on the image to be processed in step S302, a high-frequency image is obtained. For example, the difference between the image to be processed in the HSV space and the low-frequency image in the HSV space is determined as the high-frequency image in the HSV space.

[0150] S306: Image fusion.

[0151] In the embodiment of the present disclosure, the image processing device performs weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain the value of the weighted fused V channel; and performs spatial conversion based on the value of the H channel and the value of the S channel corresponding to the color-corrected low-frequency image and / or high-frequency image, and the value of the weighted fused V channel to obtain the image after RGB space processing.

[0152] Figure 4 is a diagram of an image processing device shown in an embodiment of the present disclosure, comprising Figure 4 It is known that, including:

[0153] A determination module 401 is used to determine a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed;

[0154] An obtaining module 402 is used to perform color correction on the low-frequency image to obtain a color-corrected low-frequency image;

[0155] The processing module 403 is used to perform fusion processing based on the low-frequency image after color correction and the high-frequency image to determine a processed image.

[0156] In some embodiments, the image to be processed is an image in RGB space, and both the high-frequency image and the low-frequency image are images in HSV space; the determination module 401 is used to perform spatial conversion on the image to be processed in RGB space to obtain the image to be processed in HSV space; filter the value of the V channel in the image to be processed in HSV space to obtain the low-frequency image in HSV space; and determine the difference between the image to be processed in HSV space and the low-frequency image in HSV space as the high-frequency image in HSV space.

[0157] In some embodiments, the determination module 401 is used to filter the value of the V channel in the image to be processed in the HSV space using a preset bilateral filtering function to obtain the low-frequency image.

[0158] In some embodiments, the image to be processed is an image in RGB space, and the low-frequency image is an image in HSV space; the device further comprises:

[0159] An acquisition module 404 is used to acquire a color correction matrix;

[0160] The obtaining module 402 is used to perform spatial transformation on the low-frequency image in the HSV space to obtain a low-frequency image in the RGB space; use the color correction matrix to process the pixel values ​​of the pixel points in the low-frequency image in the RGB space to obtain a color-corrected low-frequency image in the RGB space; and perform spatial transformation on the color-corrected low-frequency image in the RGB space to obtain the color-corrected low-frequency image in the HSV space.

[0161] In some embodiments, the acquisition module 404 is used to respectively collect sample images under different light sources; and determine the color correction matrix by fitting based on the mapping between the sample images collected under each light source and the preset standard images corresponding to each light source.

[0162] In some embodiments, the color-corrected low-frequency image and the high-frequency image are both images in the HSV space; the processing module 403 is used to perform weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain the value of the weighted fused V channel; based on the value of the H channel, the value of the S channel corresponding to the color-corrected low-frequency image and / or the high-frequency image, and the value of the weighted fused V channel, perform spatial conversion to obtain the image processed in the RGB space.

[0163] In some embodiments, the processing module 403 is used to weight the value of the V channel in the color-corrected low-frequency image using a first preset weight to obtain a first component value; weight the value of the V channel in the high-frequency image using a second preset weight to obtain a second component value; wherein the sum of the first preset weight and the second preset weight is a preset value; and the sum of the first component value and the second component value is determined as the value of the V channel after weighted fusion.

[0164] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0165] Figure 5 8 is a block diagram of an electronic device 800 shown in an embodiment of the present disclosure. For example, the electronic device 800 may be a mobile phone, a mobile computer, etc.

[0166] Reference Figure 5 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0167] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0168] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0169] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0170] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0171] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0172] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0173] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0174] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as Wi-Fi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0175] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0176] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0177] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the aforementioned image processing method.

[0178] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims above.

[0179] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: The method comprises: Determine a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed; Performing color correction on the low-frequency image to obtain a color-corrected low-frequency image; A fusion process is performed based on the color-corrected low-frequency image and the high-frequency image to determine a processed image.

2. The method according to claim 1, characterized in that The image to be processed is an image in RGB space, and the high-frequency image and the low-frequency image are both images in HSV space; and determining the high-frequency image and the low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed includes: Performing spatial conversion on the image to be processed in the RGB space to obtain the image to be processed in the HSV space; Performing filtering processing on the value of the V channel in the image to be processed in the HSV space to obtain a low-frequency image in the HSV space; The difference between the image to be processed in the HSV space and the low-frequency image in the HSV space is determined as the high-frequency image in the HSV space.

3. The method according to claim 2, characterized in that The filtering process is performed on the value of the V channel in the image to be processed in the HSV space to obtain the low-frequency image in the HSV space, including: The preset bilateral filtering function is used to filter the value of the V channel in the image to be processed in the HSV space to obtain the low-frequency image.

4. The method according to claim 1, characterized in that: The image to be processed is an image in RGB space, and the low-frequency image is an image in HSV space; the method further includes: Get the color correction matrix; The step of performing color correction on the low-frequency image to obtain a color-corrected low-frequency image includes: Performing spatial transformation on the low-frequency image in the HSV space to obtain a low-frequency image in the RGB space; Processing pixel values ​​of pixel points in the low-frequency image in the RGB space by using the color correction matrix to obtain a low-frequency image after color correction in the RGB space; The color-corrected low-frequency image in the RGB space is spatially transformed to obtain the color-corrected low-frequency image in the HSV space.

5. The method according to claim 4, characterized in that The obtaining of the color correction matrix comprises: Collect sample images under different light sources; The color correction matrix is ​​determined by fitting based on the mapping between the sample images collected under each light source and the preset standard images corresponding to each light source.

6. The method according to claim 1, characterized in that The color-corrected low-frequency image and the high-frequency image are both images in the HSV space; and the fusion processing based on the color-corrected low-frequency image and the high-frequency image to determine the processed image includes: Performing weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain a value of the V channel after weighted fusion; Based on the H channel value, the S channel value respectively corresponding to the color-corrected low-frequency image and / or the high-frequency image, and the V channel value after weighted fusion, spatial conversion is performed to obtain an image processed in RGB space.

7. The method according to claim 6, characterized in that The step of performing weighted fusion processing on the value of the V channel in the color-corrected low-frequency image and the value of the V channel in the high-frequency image to obtain the value of the V channel after weighted fusion includes: Using a first preset weight to weight the value of the V channel in the color-corrected low-frequency image to obtain a first component value; Using a second preset weight to weight the value of the V channel in the high-frequency image to obtain a second component value; wherein the sum of the first preset weight and the second preset weight is a preset value; The sum of the first component value and the second component value is determined as the value of the V channel after the weighted fusion.

8. An image processing device, characterized in that: The device comprises: A determination module, used to determine a high-frequency image and a low-frequency image corresponding to the image to be processed according to the pixel value of each pixel point in the image to be processed; An obtaining module, used for performing color correction on the low-frequency image to obtain a color-corrected low-frequency image; The processing module is used to perform fusion processing based on the low-frequency image after color correction and the high-frequency image to determine a processed image.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 7.