Image inpainting method and device, electronic equipment and storage medium

By extracting brightness parameters from the HSV color gamut and brightening dark areas, combined with image fusion technology, the problem of texture and color loss in underexposed color images was solved, achieving efficient image brightening and quality restoration.

CN116523771BActive Publication Date: 2025-12-16BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310328881.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2025-12-16
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

In existing technologies, underexposed color images are prone to loss of texture and color under low light conditions, resulting in a serious reduction in image quality. Furthermore, traditional brightening methods can lead to overly bright or color-shifted images.

Method used

Image brightness parameters are extracted using the HSV color gamut to identify and brighten dark areas. Image fusion is then performed using these brightness parameters, which solves the overexposure and color cast problems caused by overall brightening.

Benefits of technology

It improves image brightening, avoids overly bright overall images, enhances image details and color restoration, and improves image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116523771B_ABST
    Figure CN116523771B_ABST
Patent Text Reader

Abstract

The application relates to an image repairing method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring an image to be processed; extracting a brightness parameter of the image to be processed according to a preset color model; determining a dark area image corresponding to the image to be processed according to the brightness parameter; performing a brightening process on the dark area image according to the brightness parameter to obtain a brightened image; and performing a repairing process on the image to be processed based on the brightened image to obtain a repaired image corresponding to the image to be processed. Therefore, the image repairing method provided in the embodiment can solve the problem of poor image brightening effect of the existing brightening method, avoid overall image over-brightening, and improve the image brightening effect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, and in particular to an image repairing method and device, an electronic device, and a storage medium. BACKGROUND

[0002] When the light entering the camera is lower than the range that the camera sensor can capture, the acquired image will be underexposed, which is referred to as underexposure. Underexposure usually occurs at night or in a relatively low-light environment. The color underexposed image has extremely low brightness, and the texture and color in the underexposed area are easily lost, which seriously reduces the image quality. Therefore, underexposure should be avoided as much as possible when acquiring an image, and the image with underexposure needs to be repaired to maximize the improvement of the image quality and image information.

[0003] In the traditional image underexposure processing mode, the image histogram equalization in the RGB color space is mainly used for processing. This processing mode will enhance the brightness of the entire image, which often leads to over-brightening of the entire image, that is, the image brightening effect is poor. SUMMARY

[0004] To solve the above technical problems, the present application provides an image repairing method, device, electronic device, and storage medium.

[0005] In a first aspect, the present application provides an image repairing method, comprising:

[0006] acquiring a to-be-processed image;

[0007] extracting a brightness parameter of the to-be-processed image based on an HSV color domain;

[0008] determining a dark area corresponding to the to-be-processed image according to the brightness parameter;

[0009] performing brightening processing based on the dark area to obtain a brightened image;

[0010] performing repairing processing on the to-be-processed image based on the brightened image to obtain a repaired image corresponding to the to-be-processed image.

[0011] Optionally, the performing repairing processing on the to-be-processed image based on the brightened image to obtain a repaired image corresponding to the to-be-processed image comprises:

[0012] determining a first fusion weight of the to-be-processed image based on the brightness parameter;

[0013] determining a second fusion weight of the brightened image according to the first fusion weight;

[0014] According to the first fusion weight and the second fusion weight, the to-be-processed image and the brightened image are fused to obtain a repaired image corresponding to the to-be-processed image.

[0015] Optionally, the fusing the to-be-processed image and the brightened image according to the first fusion weight and the second fusion weight to obtain a repaired image corresponding to the to-be-processed image comprises:

[0016] The to-be-processed image is combined with the first fusion weight to obtain a first fusion image;

[0017] The brightened image is combined with the second fusion weight to obtain a second fusion image;

[0018] The first fusion image and the second fusion image are fused to obtain the repaired image corresponding to the to-be-processed image.

[0019] Optionally, the extracting the brightness parameter of the to-be-processed image based on the HSV color domain comprises:

[0020] Determining color domain information of the to-be-processed image;

[0021] In a case where the color domain information is an RGB color domain, converting the RGB color domain into an HSV color domain;

[0022] Extracting the brightness parameter of the to-be-processed image based on the HSV color domain.

[0023] Optionally, the brightening the to-be-processed image based on the dark area to obtain a brightened image comprises:

[0024] Filtering the brightness parameter based on the dark area to obtain a filtered brightness image;

[0025] Determining a brightness mapping image according to the filtered brightness image;

[0026] Performing image entropy processing on the brightness mapping image to obtain an exposure parameter;

[0027] Brightening the to-be-processed image according to the exposure parameter to obtain the brightened image.

[0028] Optionally, the determining the dark area corresponding to the to-be-processed image according to the brightness parameter comprises:

[0029] Determining area brightness information of each area of the to-be-processed image according to the brightness parameter;

[0030] In a case where the area brightness information meets a preset adjustment condition, determining that an area corresponding to the area brightness information is a dark area.

[0031] Optionally, the image entropy processing on the luminance mapping image is performed to obtain an exposure parameter, including:

[0032] The maximum entropy value of the luminance mapping image is obtained;

[0033] The exposure parameter is obtained by performing calculation according to the maximum entropy value and the luminance mapping image.

[0034] In a second aspect, the present application provides an image repairing device, including:

[0035] An acquisition module is configured to acquire a to-be-processed image;

[0036] An extraction module is configured to extract a luminance parameter of the to-be-processed image based on an HSV color domain;

[0037] A determination module is configured to determine a dark area corresponding to the to-be-processed image according to the luminance parameter;

[0038] A lightening module is configured to perform lightening processing based on the dark area to obtain a lightened image;

[0039] A repairing module is configured to perform repairing processing on the to-be-processed image based on the lightened image to obtain a repaired image corresponding to the to-be-processed image.

[0040] In a third aspect, an electronic device is provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;

[0041] The memory is configured to store a computer program;

[0042] The processor is configured to execute the program stored on the memory, and implement the steps of the image repairing method according to any one of the first aspect.

[0043] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the steps of the image repairing method according to any one of the first aspect.

[0044] Compared with the prior art, the above technical solution provided by the embodiments of the present application has the following advantages:

[0045] The method provided by the embodiment of the present application obtains a to-be-processed image, extracts a brightness parameter of the to-be-processed image according to a preset color model, determines a dark area image corresponding to the to-be-processed image according to the brightness parameter, performs a brightening process on the dark area image according to the brightness parameter to obtain a brightened image, performs a repairing process on the to-be-processed image based on the brightened image, and obtains a repaired image corresponding to the to-be-processed image. Therefore, the image repairing method provided by the embodiment solves the problem of poor image brightening effect of the existing brightening method, avoids the overall image being too bright, and improves the image brightening effect. BRIEF DESCRIPTION OF DRAWINGS

[0046] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

[0048] Figure 1 A flowchart of an image repairing method provided by the embodiment of the present application;

[0049] Figure 2 An application scenario diagram of an image repairing method provided by the embodiment of the present application;

[0050] Figure 3 A structure diagram of an image repairing device provided by the embodiment of the present application;

[0051] Figure 4 A structure diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without any creative effort fall within the scope of protection of the present application.

[0053] When the light entering the camera is lower than the range that the camera sensor can capture, the acquired image will be underexposed. Underexposure usually occurs at night or in low light conditions. Color underexposed images have extremely low brightness, and the texture and color in the underexposed area are easily lost, which seriously reduces the image quality. Therefore, the image should be acquired as much as possible to avoid underexposure, and the image with underexposure should be repaired to improve the image quality and image information to the maximum extent.

[0054] The traditional image underexposure processing method has two problems. On the one hand, the traditional image underexposure processing does not judge the region of the image, but enhances the whole image, which often leads to the whole image being brightened. The image brightness enhancement technology used is usually image histogram equalization, and the gray levels of the output image of the image histogram equalization will be merged, especially the low-frequency gray values, which will lead to the loss of image details. The existing histogram equalization and gamma transformation are to suppress the brightness of the whole image. The simplest gamma transformation is to perform the same operation on each pixel point of the whole image to suppress the brightness. Gamma transformation needs to manually specify parameters, and if the same parameters are used for each image, it will cause overexposure of many originally bright images.

[0055] On the other hand, the traditional image underexposure processing usually processes in the RGB domain, which will cause color deviation. The reason for color deviation is that different color spaces have different characteristics when processing color images, and the coupling between the components of the RGB color space is strong. The change between the components will change the color information of the image, and it is not easy to process separately. Therefore, the brightness enhancement based on the RGB domain is easy to cause color deviation.

[0056] Figure 1 A flowchart of an image repairing method provided by an embodiment of the present application is shown.

[0057] As shown in Figure 1 An embodiment of the present application provides an image repairing method, which comprises the following steps:

[0058] S110: Acquire a to-be-processed image.

[0059] Specifically, the image repairing method of the embodiment can be applied to a terminal or a server. The terminal can obtain a to-be-processed image based on a camera or based on user input. The server can obtain a to-be-processed image based on user instructions or based on a preset acquisition manner. The to-be-processed image is used to represent a photographed image or an input image. The photographed image can be an image obtained based on a camera. However, not every image needs to be subjected to brightening processing. Therefore, whether a current image is a to-be-processed image can be determined based on user settings or preset configuration information. For example, if a user starts a night shooting brightening mode, it is determined that the photographed image is a to-be-processed image. Based on preset configuration information, whether an input image needs to be subjected to brightening processing can be monitored, and then it is determined whether the input image is a to-be-processed image. Therefore, S110 can include the following steps.

[0060] S111: Obtain an input image.

[0061] S112: In a case where the input image satisfies a brightening condition, determine the input image as a to-be-processed image.

[0062] In the embodiment, the input image can be user input or active collection. After the input image is obtained, the brightness state of the image is judged. The brightness state includes a normal state, an over-dark state, and an over-bright state. The brightness state can be judged based on specific content information, time parameters, or overall brightness information of the image. The parameter interval corresponding to each brightness state can be preset. When the brightness state of the image is within the parameter interval of a brightness state, the input image is considered to be the brightness state. For example, when the brightness state of the input image is within the parameter interval of the over-dark state, the input image is considered to satisfy the brightening condition. At this time, the input image is determined as a to-be-processed image. In this way, the input image is screened, and the images that need to be subjected to brightening processing are subjected to brightening processing. The effect of the brightening processing is targeted and accurate.

[0063] S120: Extract a brightness parameter of the to-be-processed image based on an HSV color domain.

[0064] Specifically, the embodiment is to repair the to-be-processed image. Taking brightening processing as an example, the brightness parameter of the to-be-processed image needs to be determined in the brightening process. The brightness parameter can be extracted based on an HSV color model. HSV is hue, saturation, and value.

[0065] Hue H

[0066] With angular measurement, the value range is 0°-360°, starting from red and counting in the anticlockwise direction, red is 0°, green is 120°, and blue is 240°. Their complementary colors are: yellow is 60°, cyan is 180°, and purple is 300°;

[0067] Saturation S

[0068] Saturation S represents the degree of color approaching the spectral color. A color can be regarded as the result of mixing a spectral color with white. The greater the proportion of the spectral color, the higher the degree of color approaching the spectral color, and the higher the saturation of the color. The color is deep and bright with high saturation. The white light component of the spectral color is 0, and the saturation reaches the highest. Usually the value range is 0%-100%, and the greater the value, the more saturated the color.

[0069] Luminance V

[0070] Luminance represents the degree of color brightness. For light source color, the brightness value is related to the brightness of the light source; for object color, this value is related to the transmittance or reflectance of the object. Usually the value range is 0% (black) to 100% (white).

[0071] Therefore, the luminance parameter of the image to be processed is extracted, that is, the luminance V of the image to be processed is extracted according to the HSV color model. However, existing image information is generally stored in RGB color domain information. RGB produces different color effects by mixing three primary colors, and the three primary colors are defined by 8 bits. In hardware implementation, it is convenient to understand and process. Therefore, if the luminance parameter of the image to be processed needs to be extracted, the RGB color domain needs to be converted to the HSV color domain. Therefore, the luminance parameter of the image to be processed is extracted based on the HSV color domain in step S120, including:

[0072] S121: determining the color domain information of the image to be processed;

[0073] S122: in the case of RGB color domain, converting the RGB color domain to the HSV color domain;

[0074] S123: extracting the luminance parameter of the image to be processed based on the HSV color domain.

[0075] In this embodiment, because the luminance parameter of the image to be processed needs to be extracted based on the HSV color model, the HSV color domain of the image to be processed needs to be determined first. Therefore, the color domain information of the image to be processed is determined first. In the case of HSV color domain, the luminance parameter of the image to be processed can be directly extracted from the HSV color domain according to the preset color model. In the case of RGB color domain, the RGB color domain needs to be converted to the HSV color domain before the luminance parameter of the image to be processed is extracted based on the HSV color domain, so as to realize the extraction of the luminance parameter of the image to be processed.

[0076] S130: determining a dark region corresponding to the to-be-processed image according to the brightness parameter.

[0077] Specifically, after determining the brightness parameter of the to-be-processed image, a dark region corresponding to the to-be-processed image can be determined according to the brightness parameter. The dark region is used to represent a region of an underexposed part in the to-be-processed image. The dark region can be a region corresponding to brightness information lower than a preset exposure parameter, or the to-be-processed image can be divided into several regions, and each region can be determined one by one to be a dark region. Therefore, S130 can include:

[0078] S131: determining region brightness information of each region of the to-be-processed image according to the brightness parameter.

[0079] S132: determining a region corresponding to the region brightness information as a dark region in a case where the region brightness information satisfies a preset adjustment condition.

[0080] In this embodiment, first, region brightness information of each region of the to-be-processed image is determined according to the brightness parameter. Each region of the to-be-processed image can be divided based on a preset division manner or based on image content. For example, three parts of content, a pavilion, the sky, and the ground, are clearly identified in the image. At this time, the to-be-processed image can be divided into three regions, or other division manners are not specifically limited. After determining each region of the to-be-processed image, region brightness information of each region can be determined according to the image parameter. The region brightness information is used to represent the brightness state of the current region, such as the normal state, the over-dark state, and the over-bright state. According to the region brightness information, it is determined whether the dark region satisfies a preset adjustment condition. The preset adjustment condition can be to determine whether the region brightness information is in the over-dark state. If yes, it is considered that the region brightness information satisfies the preset adjustment condition. At this time, the region corresponding to the region brightness information is determined as a dark region. In this way, the effect of separately extracting the dark region is achieved.

[0081] S140: performing a brightening process based on the dark region to obtain a brightened image.

[0082] Specifically, after determining the dark region, a brightening process can be performed based on the dark region. In this way, the effect of not performing a brightening process on the whole to-be-processed image is achieved. Only the dark region is subjected to the brightening process. The problem that in the traditional method, for example, in the brightening process, the whole image is enhanced, resulting in poor overexposure brightening effect of many originally bright images is solved. The specific brightening process can be:

[0083] S141: performing a filter process on the brightness parameter based on the dark region to obtain a filtered brightness map.

[0084] S142: determining a brightness mapping image according to the filtered brightness map.

[0085] S143: image entropy processing is performed on the brightness mapping image to obtain an exposure parameter;

[0086] S144: the exposure parameter is used to perform brightening processing on the to-be-processed image to obtain a brightened image.

[0087] In this embodiment, the brightness parameter can be the brightness component V extracted from the HSV as described above in , and the filter processing can be Gaussian filtering performed on V in , which plays a role of blurring the pixel points to make the brightness of the pixel points consistent with the surrounding and remove the noise points in the dark area image. Specifically, the filter processing can be performed according to the following formula: L(x) = gaussianfilter(V in (x)), where x represents the position of a pixel point, and L(x) represents the filtered brightness map. It should be noted that S141-S144 are all performed under the HSV color model, and since only the brightness parameter is processed, that is, only the V channel in the HSV is processed, although the above formula L(x) only represents the matrix of V in the HSV, L(x) can also be used to represent the current image because H and S in the HSV are not processed. After the brightness parameter is filtered based on the dark area to obtain the filtered brightness image L, the brightness parameter in the dark area can be filtered to improve the processing effect. The brightness mapping image T is determined according to the filtered brightness map. From a physical point of view, T reflects the distribution of brightness in the "idealized" image. With this brightness distribution, the weight can be determined during subsequent image fusion. Specifically, the brightness mapping image T can be determined according to the following formula

[0088]

[0089] The first term of the formula is to make T close to L, and the second term is to keep T smooth. M is represented as: M = 1 / L, which represents the gradient of T, so that the brightness mapping image T retains the meaningful area of the filtered brightness image L and removes the edges with too much texture.

[0090] After the brightness mapping image T is determined, image entropy processing is performed on the brightness mapping image Y to obtain an exposure parameter. The essence of entropy is to represent the degree of internal disorder. In terms of an image, it represents the richness of image details. That is, the greater the entropy, the richer the image details. Therefore, in order to maximize the recovery of image texture and color during the repair process and improve the image quality, the entropy needs to be maximized. That is, the image entropy processing is performed on the brightness mapping image to obtain an exposure parameter, which can also include:

[0091] S1431: Obtain a maximum entropy value of the brightness mapping image.

[0092] S1432: Calculate according to the maximum entropy value and the brightness mapping image to obtain an exposure parameter.

[0093] In this embodiment, the determination of the entropy of the brightness mapping image is performed, and to maximize the recovery of image texture and color in the repair process, a maximum entropy value of the brightness mapping image is obtained, and calculation is performed according to the maximum entropy value and the brightness mapping image to obtain an exposure parameter.

[0094] The best exposure parameter is obtained by maximizing the image entropy H of the brightness mapping image T. The greater the image entropy, the richer the information represented by the image.

[0095]

[0096]

[0097] wherein, a and b are empirical coefficients, a = 1e-3, b = 2e-2, and the image entropy function is:

[0098]

[0099] Then, the exposure parameter is also needed to perform a brightening process on the to-be-processed image to obtain a brightened image, that is, to suppress the dark area to obtain the brightened image V. weaken The specific formula is as follows:

[0100]

[0101] S150: Perform repair processing on the to-be-processed image based on the brightened image to obtain a repair image corresponding to the to-be-processed image.

[0102] Specifically, after obtaining the brightened image, the to-be-processed image can be repaired based on the brightened image to obtain a repair image corresponding to the to-be-processed image. The repair processing process can be image fusion of the brightened image and the to-be-processed image. At this time, S150 can include:

[0103] S151: Determine a first fusion weight of the to-be-processed image based on the brightness parameter.

[0104] S152: Determine a second fusion weight of the brightened image according to the first fusion weight.

[0105] S153: Perform fusion processing on the to-be-processed image and the brightened image according to the first fusion weight and the second fusion weight to obtain a repair image corresponding to the to-be-processed image.

[0106] In this embodiment, first, the first fusion weight of the to-be-processed image is determined based on the luminance parameter, the first fusion weight is used to represent the weight of the to-be-processed image for image fusion, the second fusion weight of the brightened image is determined according to the first fusion weight, since the sum of the weights needs to be 1, the second fusion weight is used to represent (1-first fusion weight), and the to-be-processed image and the brightened image are fused according to the first fusion weight and the second fusion weight, to obtain the repaired image corresponding to the to-be-processed image. In specific implementation, the weight calculation formula of image fusion can be W=T μ , wherein μ is an empirical parameter, and T is a luminance mapping matrix.

[0107] In an embodiment, S153: the to-be-processed image and the brightened image are fused according to the first fusion weight and the second fusion weight, to obtain the repaired image corresponding to the to-be-processed image, including:

[0108] S1531: the to-be-processed image is combined with the first fusion weight to obtain a first fused image;

[0109] S1532: the brightened image is combined with the second fusion weight to obtain a second fused image;

[0110] S1533: the first fused image and the second fused image are fused to obtain the repaired image corresponding to the to-be-processed image.

[0111] This embodiment is used to represent the specific implementation process of fusion processing. After the first fusion weight is determined, the to-be-processed image can be combined with the first fusion weight to obtain a first fused image. Similarly, after the second fusion weight is determined, the brightened image can be combined with the second fusion weight to obtain a second fused image. Finally, the first fused image and the second fused image are fused to obtain the repaired image corresponding to the to-be-processed image, as shown in Figure 2 .

[0112]

[0113] Since the color gamut information of the to-be-processed image is converted from the RGB color gamut to the HSV color gamut, after the repaired image is obtained, the color gamut information of the repaired image needs to be converted from the HSV color gamut to the RGB color gamut to generate an output image for output out =H in

[0114] S out =S in

[0115] V out =V res

[0116] I res =HSV2RGB(Hout S out V out )

[0117] wherein, I res represents an output image.

[0118] Therefore, in the embodiment, the image repair is mainly performed through the determination of the dark area, the problem that the overall image is enhanced in the traditional method, resulting in overexposure of many originally bright images, the whole image is brightened, and the brightening effect is poor is solved, the image processing is performed through the HSV color domain, and only the brightness V channel needs to be operated, without involving the remaining channels, the problem that the color deviation is easily caused by the brightening processing based on the RGB domain in the traditional method is solved, and the image brightening effect and the processing efficiency are improved.

[0119] As Figure 3 shown, the application also discloses an embodiment, which provides an image repair device, comprising:

[0120] The acquisition module 310 is configured to acquire a to-be-processed image.

[0121] The extraction module 320 is configured to extract a brightness parameter of the to-be-processed image based on an HSV color domain.

[0122] The determination module 330 is configured to determine a dark area corresponding to the to-be-processed image according to the brightness parameter.

[0123] The brightening module 340 is configured to perform brightening processing based on the dark area to obtain a brightened image.

[0124] The repair module 350 is configured to perform repair processing on the to-be-processed image based on the brightened image to obtain a repaired image corresponding to the to-be-processed image.

[0125] In an embodiment, the repair module 350 can include:

[0126] The first determination unit is configured to determine a first fusion weight of the to-be-processed image based on the brightness parameter.

[0127] The second determination unit is configured to determine a second fusion weight of the brightened image according to the first fusion weight.

[0128] The fusion unit is configured to perform fusion processing on the to-be-processed image and the brightened image according to the first fusion weight and the second fusion weight to obtain the repaired image corresponding to the to-be-processed image.

[0129] In an embodiment, the fusion unit can include:

[0130] The first fusion subunit is configured to obtain a first fused image by combining the to-be-processed image with the first fusion weight.

[0131] The second fusion subunit is configured to brighten the image to obtain a second fusion image according to a second fusion weight.

[0132] The third fusion subunit is configured to fuse the first fusion image and the second fusion image to obtain a repair image corresponding to the to-be-processed image.

[0133] In an embodiment, the extraction module 320 can include:

[0134] The third unit is configured to determine gamut information of the to-be-processed image.

[0135] The conversion unit is configured to convert the RGB gamut into an HSV gamut in a case where the gamut information is the RGB gamut.

[0136] The extraction unit is configured to extract a brightness parameter of the to-be-processed image based on the HSV gamut.

[0137] In an embodiment, the brightening module 350 can include:

[0138] The filtering unit is configured to filter the brightness parameter based on the dark region to obtain a filtered brightness map.

[0139] The fourth determination unit is configured to determine a brightness mapping image according to the filtered brightness map.

[0140] The entropy value unit is configured to perform image entropy value processing on the brightness mapping image to obtain an exposure parameter.

[0141] The brightening unit is configured to perform brightening processing on the to-be-processed image according to the exposure parameter to obtain a brightened image.

[0142] In an embodiment, the determination module 330 can include:

[0143] The fifth determination unit is configured to determine region brightness information of each region of the to-be-processed image according to the brightness parameter.

[0144] The sixth determination unit is configured to determine that a region corresponding to the region brightness information is a dark region in a case where the region brightness information satisfies a preset adjustment condition.

[0145] In an embodiment, the entropy value unit can include:

[0146] The acquisition subunit is configured to acquire a maximum entropy value of the brightness mapping image.

[0147] The calculation subunit is configured to perform calculation according to the maximum entropy value and the brightness mapping image to obtain the exposure parameter.

[0148] The implementation process of the functions and roles of each module in the above device is specifically described in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0149] As Figure 4 shown in the drawings: the embodiments of the present application provide an electronic device, comprising a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 complete the communication among each other through the communication bus 440,

[0150] The memory 430 is used to store a computer program.

[0151] In an embodiment of the present application, the processor 410 is used to execute the program stored in the memory 430, and the image repairing method provided by any one of the foregoing method embodiments is realized.

[0152] The embodiments of the present application further provide a computer readable storage medium, which has a computer program stored thereon, and the computer program is executed by a processor to implement the steps of the image repairing method provided by any one of the foregoing method embodiments.

[0153] It should be noted that, in this document, relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the stated elements.

[0154] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still accomplish desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0155] The foregoing is considered as illustrative only of the principles of the application. Numerous modifications and changes will readily occur to those skilled in the art, and it is intended to embrace all such modifications and changes that fall within the scope of the application. Accordingly, the application is not to be restricted in scope to the specific embodiments disclosed herein but is to be accorded the full scope that the principles and novel features request appropriately granted.

Claims

1. An image restoration method, characterized in that, include: Obtain the image to be processed; The brightness parameters of the image to be processed are extracted based on the HSV color gamut. The dark areas corresponding to the image to be processed are determined based on the brightness parameters. Brightening the dark areas to obtain a brightened image includes: filtering the brightness parameters based on the dark areas to obtain a filtered brightness map; determining a brightness mapping image based on the filtered brightness map; processing the brightness mapping image for image entropy to obtain exposure parameters; and brightening the image to be processed based on the exposure parameters to obtain the brightened image. The image to be processed is repaired based on the brightened image to obtain a repaired image corresponding to the image to be processed. The repair process includes: fusing the image to be processed and the brightened image.

2. The method according to claim 1, characterized in that, The step of repairing the image to be processed based on the brightened image to obtain the repaired image corresponding to the image to be processed includes: The first fusion weight of the image to be processed is determined based on the brightness parameter; The second fusion weight of the brightened image is determined based on the first fusion weight; Based on the first fusion weight and the second fusion weight, the image to be processed and the brightened image are fused to obtain the repaired image corresponding to the image to be processed.

3. The method according to claim 2, characterized in that, The step of fusing the image to be processed and the brightened image according to the first fusion weight and the second fusion weight to obtain the repaired image corresponding to the image to be processed includes: The image to be processed is combined with the first fusion weight to obtain the first fused image; The brightened image is combined with the second fusion weight to obtain the second fused image; The first fused image and the second fused image are fused together to obtain the repaired image corresponding to the image to be processed.

4. The method according to claim 1, characterized in that, The extraction of brightness parameters from the image to be processed based on the HSV color gamut includes: Determine the color gamut information of the image to be processed; If the color gamut information is RGB, the RGB color gamut is converted to the HSV color gamut; The brightness parameters of the image to be processed are extracted based on the HSV color gamut.

5. The method according to claim 1, characterized in that, Determining the dark region corresponding to the image to be processed based on the brightness parameter includes: The regional brightness information of each region of the image to be processed is determined based on the brightness parameters. If the brightness information of the area meets the preset adjustment conditions, the area corresponding to the brightness information of the area is determined to be a dark area.

6. The method according to claim 4, characterized in that, The step of processing the brightness-mapped image for image entropy values ​​to obtain exposure parameters includes: Obtain the maximum entropy value of the brightness-mapped image; The exposure parameters are obtained by calculating based on the maximum entropy value and the brightness mapping image.

7. An image restoration device, characterized in that, include: The acquisition module is used to acquire the image to be processed; The extraction module is used to extract the brightness parameters of the image to be processed based on the HSV color gamut. The determination module is used to determine the dark area corresponding to the image to be processed based on the brightness parameters; A brightening module is used to perform brightening processing based on the dark area to obtain a brightened image, including: filtering the brightness parameters based on the dark area to obtain a filtered brightness map; determining a brightness mapping image based on the filtered brightness map; performing image entropy value processing on the brightness mapping image to obtain exposure parameters; and performing brightening processing on the image to be processed based on the exposure parameters to obtain a brightened image. The repair module is used to perform repair processing on the image to be processed based on the brightened image to obtain a repaired image corresponding to the image to be processed. The repair processing includes: fusing the image to be processed and the brightened image.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the steps of the image restoration method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the image restoration method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Exposure algorithm applied to multi-lens sensor

    CN107592470A

  • Brightness enhancement method for an image in dark light scene

    CN108830800A

  • Image processing method and device

    CN110619610A