WO2022127174A1 - Image processing method and electronic device - Google Patents

Image processing method and electronic device Download PDF

Info

Publication number
WO2022127174A1
WO2022127174A1 PCT/CN2021/114109 CN2021114109W WO2022127174A1 WO 2022127174 A1 WO2022127174 A1 WO 2022127174A1 CN 2021114109 W CN2021114109 W CN 2021114109W WO 2022127174 A1 WO2022127174 A1 WO 2022127174A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
weight
image
value
original
Prior art date
Application number
PCT/CN2021/114109
Other languages
French (fr)
Chinese (zh)
Inventor
杨烨
鹿镇
Original Assignee
北京达佳互联信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京达佳互联信息技术有限公司 filed Critical 北京达佳互联信息技术有限公司
Publication of WO2022127174A1 publication Critical patent/WO2022127174A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • the present disclosure relates to the field of computer technology, and in particular, to an image processing method and an electronic device.
  • an image processing method comprising:
  • weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
  • a second image is generated.
  • an image processing apparatus comprising:
  • an image acquisition module configured to acquire the original image
  • a brightness enhancement module configured to enhance the brightness of the original image to obtain a first image
  • a weight determination module configured to determine a first weight of a first pixel in the first image and an original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original The sum of the weight and the first weight is 1, and the first weight has a negative correlation with the pixel value of the original pixel point;
  • the first fusion module is configured to perform weighted fusion on the pixel value of the original pixel point and the pixel value of the first pixel point based on the original weight and the first weight to obtain the pixel value of the second pixel point value;
  • the image generation module is configured to generate a second image based on the pixel values of the second pixel points.
  • an electronic device comprising:
  • a memory for storing the processor-executable instructions
  • processor is configured to execute the instructions to implement the following steps:
  • weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
  • a second image is generated.
  • a computer-readable storage medium wherein instructions in the computer-readable storage medium are executed by a processor of an electronic device, so that the electronic device can perform the following steps:
  • weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
  • a second image is generated.
  • a computer program product comprising a computer program, the computer program being executed by a processor of an electronic device to implement the following steps:
  • weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
  • a second image is generated.
  • the technical solution of the present disclosure obtains the first image by brightening the original image, and then performs weighted fusion of the original image and the first image. Since the first weight of the first image has a negative correlation with the pixel value of the original pixel, there are Targetedly brightens the dark areas of the original image, while preventing overexposure in highlights, improving image quality, and making the final fill light effect meet the needs of human visual perception.
  • Fig. 1 is a flowchart of an image processing method according to an exemplary embodiment.
  • Fig. 2 is a flow chart of a texture enhancement method according to an exemplary embodiment.
  • Fig. 3 is a flow chart of a color enhancement method according to an exemplary embodiment.
  • Fig. 4 is a flow chart of a method for illumination compensation according to an exemplary embodiment.
  • FIG. 5 is a comparison diagram of an original image and a second image according to an exemplary embodiment.
  • Fig. 6 is a structural block diagram of an image processing apparatus according to an exemplary embodiment.
  • Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment.
  • Fig. 8 is a block diagram of an electronic device according to an exemplary embodiment.
  • Fig. 1 is a flowchart of an image processing method according to an exemplary embodiment. As shown in Fig. 1 , the method includes the following steps.
  • step S11 the original image is acquired.
  • the execution body of the embodiment of the present disclosure is an electronic device such as a terminal.
  • the original image is an image stored by the terminal or a preview image captured by the terminal, or the like.
  • step S12 the brightness of the original image is enhanced to obtain a first image.
  • Step S12 is to enhance the overall brightness of the original image, that is, to enhance the brightness of each pixel in the original image to obtain a brightened first image. For example, by performing Gamma curve enhancement on the overall brightness of the original image, a brightened first image is obtained.
  • the Gamma curve is a special tone curve, and the brightness of the image can be adjusted by adjusting the Gamma value.
  • a Gamma value equal to 1 means that the input and output brightness are the same; a Gamma value higher than 1 will cause the output to be darkened, and a Gamma value below 1 will cause the output to be brighter. In practical applications, the Gamma value can be adjusted according to requirements.
  • step S13 the first weight of the first pixel in the first image and the original weight of the original pixel are determined based on the pixel value of the original pixel in the original image, wherein the sum of the original weight and the first weight is 1 , the first weight has a negative correlation with the pixel value of the original pixel point.
  • the original pixel is any pixel in the original image
  • the first pixel is the pixel in the first image corresponding to the position of the original pixel, that is, the position of the first pixel in the first image is the same as the original pixel.
  • the pixel value of the pixel point is the brightness value or gray value of the pixel point.
  • step S13 includes: determining the first weight of the first pixel point based on the first adjustment parameter and the pixel value of the original pixel point, wherein the first adjustment parameter is used to adjust the intensity of the brightness enhancement of the original image , the first adjustment parameter is positively correlated with the first weight.
  • the first adjustment parameter affects the brightness enhancement effect of the image by affecting the size of the first weight, so that the brightness enhancement effect can be flexibly adjusted by flexibly adjusting the first adjustment parameter.
  • x represents the y-channel value of the original pixel in the image yuv space, that is, the luminance value;
  • ⁇ 1 and ⁇ are parameters that are flexibly set according to actual needs, and determine the steepness of the curve.
  • ⁇ 1 and ⁇ determine the steepness of the curve, that is, ⁇ 1 and ⁇ affect the slope of the curve.
  • the first adjustment parameter ⁇ 1 is used to adjust the fusion strength between the original image and the first image, and the first adjustment parameter ⁇ 1 is input by the user, machine input or automatically generated, for example, the size of ⁇ 1 can be determined by the user on the terminal interface Self-adjusting. Since the first weight is related to the first adjustment parameter, the first adjustment parameter can affect the brightness enhancement effect by affecting the size of the first weight, and the first adjustment parameter can be flexibly adjusted as needed, and accordingly, the brightness enhancement effect will also follow the first adjustment. A flexible adjustment is achieved by adjusting the adjustment parameters.
  • the first weight and the second weight perform weighted fusion of the original image and the first image, which can achieve targeted highlighting of the dark areas of the original image, and at the same time effectively suppress overexposure in the highlights.
  • the first weight Alpha 1 of the first pixel is only related to the pixel value of the corresponding original pixel, and has nothing to do with the pixel values of other pixels. Therefore, the first weight of each first pixel can be calculated independently, and there is no need to perform a full Calculation of graph information, thereby improving computational efficiency.
  • step S14 based on the original weight and the first weight, the pixel value of the original pixel point and the pixel value of the first pixel point are weighted and fused to obtain the pixel value of the second pixel point.
  • the pixel value S0 of the original pixel point and the pixel value S1 of the first pixel point can be weighted and fused once.
  • the process of weighted fusion includes: determining the first product of the pixel value of the original pixel point and the original weight, and determining the second product of the pixel value of the first pixel point and the first weight; The sum value is determined as the pixel value of the second pixel point.
  • the pixel value S2 of the pixel point is closer to the pixel value S1 of the first pixel point in the first image; on the contrary, the higher the brightness of the original pixel point (the larger the x), the smaller the first weight Alpha 1 value of the first pixel point, the weighted
  • the pixel value S2 of the second pixel point obtained after fusion is closer to the pixel value S0 of the original pixel point in the original image.
  • FIG. 5 shows a comparison diagram of the original image and the second image. It can be seen from the comparison diagram that, compared with the original image, the dark areas of the second image are highlighted, and the highlights are not overexposed.
  • step S15 a second image is generated based on the pixel values of the second pixel points.
  • a second pixel corresponds to an original pixel, and the second pixel and the original pixel have the same position in the image.
  • the second pixel corresponding to each original pixel can be obtained.
  • the pixel value of the pixel point, and the pixel value of each second pixel point is arranged according to the position to form the second image.
  • the second image is output as the final image.
  • at least one of texture enhancement, color enhancement, and dehazing is also performed on the second image to obtain a final image. For example, performing texture enhancement on the second image to obtain a final image; or performing color enhancement on the second image to obtain a final image; or performing dehazing on the second image to obtain a final image; or performing texture on the second image enhancement and color enhancement to obtain a final image; or, performing texture enhancement and dehazing on the second image to obtain a final image; or, performing color enhancement and dehazing on the second image to obtain a final image; or, performing Texture enhancement, color enhancement, and dehazing to get the final image.
  • the order of performing various processing on the second image can be set flexibly.
  • the second image is further processed by texture enhancement, color enhancement, and dehazing in sequence to obtain a final image.
  • a first image is obtained by brightening the original image, and then weighted fusion is performed on the original image and the first image. Since the first weight of the first image is equal to the pixel value of the original pixel point Therefore, the dark parts of the original image are brightened in a targeted manner, and at the same time, the overexposure of the highlights is prevented, and the image quality is improved, so that the final fill light effect meets the needs of human visual perception.
  • the image processing method provided by the embodiment of the present disclosure performs independent processing on each pixel, without the need to calculate the whole image information, and each pixel can be processed in parallel, which improves the image processing efficiency, so that the original image can be processed in real time, Real-time preview.
  • texture enhancement is also performed on the second image, that is, after step S15, the following steps are further included:
  • Step S16 Based on the pixel values of the second pixels in the second image, texture enhancement is performed on the second image to obtain a third image.
  • the original texture details of the original image may be suppressed, resulting in blurred texture on the naked eye effect. Improve the clarity of the image, thereby enhancing the visual effect of the image.
  • step S16 includes: when the pixel value of the second pixel is less than or equal to the first threshold, reducing the pixel value of the second pixel to obtain the pixel value of the third pixel in the third image ; When the pixel value of the second pixel point is greater than the second threshold, increase the pixel value of the second pixel point to obtain the pixel value of the third pixel point. That is, for the dark parts with strong brightness enhancement, reduce the brightness appropriately, and for the bright parts with weak brightness enhancement, increase the brightness appropriately, so that the texture of the dark and bright parts of the image is more distinct, so that the dark and bright parts of the image are more prominent.
  • the texture details of the parts make the structure of the image texture more distinct and the details richer, realize the texture enhancement of the image, and improve the clarity of the image.
  • the first threshold is less than or equal to 0.5.
  • the second threshold is greater than or equal to 0.5.
  • the first threshold and the second threshold can be flexibly set as required.
  • the first threshold and the second threshold are the same, and both the first threshold and the second threshold are 0.5. In some embodiments, the first threshold is different from the second threshold, eg, the first threshold is a value less than 0.5, and the second threshold is 0.5.
  • the above technical solution can enhance the texture of the second image, and make the texture details of the dark and bright parts of the image stand out, so as to ensure that the structure level of the image texture is more distinct and the details are more abundant.
  • step S16 after the third image is obtained, weighted fusion is performed on the third image and the second image, so as to prevent the texture enhancement effect from offsetting the brightening effect, and improve the texture details of the image while maintaining the brightening effect of the image sense of hierarchy. That is, referring to FIG. 2, the following steps are included after step S16:
  • Step S21 based on the pixel value of the original pixel point, determine the second weight of the second pixel point and the third weight of the third pixel point in the third image, wherein the sum of the second weight and the third weight is 1, and the first weight is 1.
  • the relationship between the two weights changing with the pixel value of the original pixel point is a downward convex function relationship.
  • the third pixel is a pixel corresponding to the position of the second pixel in the third image, and the third pixel and the second pixel have the same position in the image.
  • the functional relationship in which the second weight changes with the pixel value of the original pixel point can be set according to actual needs, for example, the functional relationship is a downward convex quadratic functional relationship or an exponential functional relationship.
  • the above step of determining the second weight of the second pixel point based on the pixel value of the original pixel point includes: determining the second weight of the second pixel point based on the second adjustment parameter and the pixel value of the original pixel point , wherein the second adjustment parameter is used to adjust the intensity of texture enhancement on the second image, and the second adjustment parameter is positively correlated with the second weight.
  • the second adjustment parameter affects the texture enhancement effect of the image by affecting the size of the second weight, so that flexible adjustment of the texture enhancement effect can be achieved by flexibly adjusting the second adjustment parameter.
  • x represents the y channel value of the original pixel in the image yuv space, that is, the luminance value;
  • ⁇ 2 is a parameter flexibly set according to actual requirements, which determines the steepness of the curve.
  • ⁇ 2 determines the steepness of the curve, that is, ⁇ 2 affects the slope of the curve.
  • the second adjustment parameter ⁇ 2 is used to adjust the fusion strength between the second image and the third image, and the second adjustment parameter ⁇ 2 is input by the user, machine input or automatically generated, for example, the size of ⁇ 2 can be determined by the user on the terminal interface self-adjustment. Since the second weight is related to the second adjustment parameter, the second adjustment parameter can affect the texture enhancement effect by affecting the size of the second weight, and the second adjustment parameter can be flexibly adjusted as needed, and accordingly, the texture enhancement effect will also follow the first adjustment. A flexible adjustment is achieved by adjusting the adjustment parameters.
  • the relationship between the second weight and the pixel value of the original pixel point is a downward convex function relationship.
  • the original When the brightness value of the pixel is extreme (too bright or too dark), the second weight Alpha 2 value of the second pixel is larger, and then the second image and the third image are processed based on the second weight and the third weight.
  • Weighted fusion the weaker the effect of texture enhancement on the brightening of the dark parts of the image and the suppression of highlights, thus not only maintaining the brightening of the dark parts without overexposure in the highlights, but also improving the layering of image texture details.
  • the second weight of the second pixel point is only related to the pixel value of the corresponding original pixel point, and has nothing to do with the pixel value of other pixel points, so the second weight of each second pixel point can be calculated independently, without the need for full-image information , so as to improve the computational efficiency.
  • Step S22 based on the second weight and the third weight, weighted fusion is performed on the pixel value of the second pixel point and the pixel value of the third pixel point to obtain the pixel value of the fourth pixel point.
  • S4 is the pixel value of the fourth pixel point
  • Alpha 2 represents the second weight of the second pixel point
  • 1-Alpha 2 is the third weight of the third pixel point.
  • the second weight Alpha 2 value of the second pixel point is higher. is larger, the pixel value S4 of the fourth pixel point obtained by fusion will be closer to the pixel value S2 of the second pixel point. In this way, the effect of texture enhancement on the brightening of dark parts and the suppression of highlights in the image is reduced, and the layering of image texture details is also improved.
  • Step S23 generating a fourth image based on the pixel value of the fourth pixel point.
  • a fourth pixel corresponds to a second pixel, and the fourth pixel and the second pixel have the same position in the image.
  • the pixel value of the fourth pixel point of , and the pixel value of each fourth pixel point is arranged according to the position to form a fourth image.
  • the above technical solution prevents the texture enhancement operation in step S16 from offsetting the brightening effect of the second image by performing a weighted fusion of the third image and the second image, so that the brightening effect of the image is not greatly damaged, while improving The layering of image texture details.
  • color enhancement is also performed on the fourth image, that is, after step S23, the following steps are further included:
  • Step S31 acquiring the red channel value, the blue channel value and the green channel value of the fourth pixel in the fourth image.
  • the fourth pixel is any pixel in the fourth image.
  • the above step S31 includes: acquiring RGB color information of the fourth pixel in the fourth image in the RGB space, where the RGB color information includes a red channel value, a blue channel value and a green channel value.
  • Step S32 based on the color lookup table, correct the red channel value, blue channel value and green channel value of the fourth pixel to obtain the red channel value, blue channel value and green channel value of the fifth pixel in the fifth image value.
  • the RGB color information of the fourth pixel is corrected to obtain the RGB color information of the fifth pixel.
  • the color lookup table includes relationship data between the first color information and the second color information, the first color information is the color information that needs to be corrected, the second color information is the corrected color information, the relationship The data is used to represent the correspondence between the first color information and the second color information.
  • the above-mentioned steps of correcting the RGB color information of the fourth pixel point based on the color lookup table, and obtaining the RGB color information of the fifth pixel point include: From the color lookup table, query the relationship data corresponding to the RGB color information of the fourth pixel; from the relationship data, obtain the RGB color information of the fifth pixel.
  • the RGB color information of the fourth pixel is corrected to obtain the RGB color information of the fifth pixel, that is, the RGB color information of the fourth pixel is corrected according to the following formula, and the fifth pixel is obtained.
  • S4' represents the RGB color information of the fourth pixel
  • S5' represents the RGB color information of the fifth pixel
  • LUT represents the query from the color lookup table
  • the RGB color information of the fifth pixel point corresponding to the RGB color information of the fourth pixel point.
  • the color look-up table can be designed by users in different styles according to actual needs.
  • Step S33 generating a fifth image based on the red channel value, the blue channel value and the green channel value of the fifth pixel.
  • a fifth pixel corresponds to a fourth pixel, and the fifth pixel and the fourth pixel have the same position in the image.
  • the red channel value, blue channel value, and green channel value of the fifth pixel point based on the red channel value, blue channel value and green channel value of each fifth pixel point, determine the pixel value of each fifth pixel ;
  • the pixel value of each fifth pixel point is arranged according to the position to form the fifth image.
  • the above technical solution further improves the image quality and improves the visual effect of the image by enhancing the color of the texture-enhanced image.
  • weighted fusion is also performed on the fifth image and the fourth image, so as to balance the color enhancement effect and the brightening effect, and enhance the color of the image while maintaining the brightening effect of the image Richness, that is, referring to FIG. 3 , after step S33, the following steps are further included:
  • step S34 a third adjustment parameter is obtained, and the third adjustment parameter is used to adjust the intensity of color enhancement of the fourth image.
  • Step S35 based on the third adjustment parameter, determine the fourth weight of the fourth pixel point and the fifth weight of the fifth pixel point, wherein the sum of the fourth weight and the fifth weight is 1.
  • the fifth pixel is a pixel corresponding to the position of the fourth pixel in the fifth image, and the fifth pixel and the fourth pixel have the same position in the image.
  • Step S36 based on the fourth weight and the fifth weight, weighted fusion is performed on the pixel value of the fourth pixel point and the pixel value of the fifth pixel point to obtain the pixel value of the sixth pixel point.
  • the process of weighted fusion includes: determining the fifth product of the pixel value of the fourth pixel point and the fourth weight, and determining the sixth product of the pixel value of the fifth pixel point and the fifth weight; The sum value of the six products is determined as the pixel value of the sixth pixel point.
  • the third adjustment parameter Alpha 3 is input by the user, input by the machine or automatically generated, for example, the size of the third adjustment parameter can be adjusted by the user on the terminal interface. Since the fifth weight of the fifth pixel point and the fourth weight of the fourth pixel point are both determined by Alpha 3 , the intensity of color enhancement can be adjusted according to needs, which improves the flexibility of adjustment.
  • the pixel value of the sixth pixel point is only related to the pixel value of the fourth pixel point and the fifth pixel point corresponding to the position, and has nothing to do with the pixel value of other pixel points, so the pixel value of each sixth pixel point can be calculated independently , there is no need to calculate the whole image information, so as to improve the calculation efficiency and realize the real-time processing of the image.
  • Step S37 generating a sixth image based on the pixel value of the sixth pixel.
  • a sixth pixel corresponds to a fourth pixel, and the sixth pixel and the fourth pixel have the same position in the image.
  • the above embodiments describe the process of performing color enhancement on the fourth image after the fourth image is generated.
  • the generated second image or third image may also be Do color enhancement.
  • the process of performing color enhancement processing on any generated image is the same as the above-mentioned steps 31 to 37, and will not be repeated here.
  • the sixth image is further dehazed to improve the clarity of the image, that is, the following steps are included after step S37:
  • Step S41 acquiring high-frequency information of the sixth pixel in the sixth image.
  • the sixth pixel is any pixel in the sixth image.
  • the high-frequency information indicates the sharpness of the pixel value change between the sixth pixel and its surrounding pixels.
  • High-frequency information also refers to high-frequency components. The larger the high-frequency component is, the more severe the pixel value of the sixth pixel is compared to its surrounding pixels, and the pixel value of the sixth pixel is used to represent the sixth image. Edge details; the smaller the high-frequency component, the smoother the pixel value change of the sixth pixel is compared with its surrounding pixels.
  • Step S42 determining the target blur radius of the sixth pixel based on the high frequency information of the sixth pixel.
  • the process of dehazing the sixth image is similar to the multi-scale retina enhancement algorithm with color recovery (MSRCR).
  • MSRCR multi-scale retina enhancement algorithm with color recovery
  • the target blur radius is determined according to the size of the high frequency component, and the high frequency component has a negative correlation with the target blur radius.
  • the larger the high-frequency component is the smaller the target blur radius is to apply a smaller dehazing intensity, which not only achieves dehazing, but also avoids the loss of edge details of the image; on the contrary, the smaller the high-frequency component is, the larger the target is selected.
  • Step S43 based on the corresponding relationship between the blur radius and the ambient light illumination component, determine the target ambient light illumination component corresponding to the target blur radius of the sixth pixel point.
  • different blur radii such as 3*3, 5*5, 7*7, 9*9, 11*11 are used in advance to perform Gaussian blurring on the sixth image respectively, to obtain the corresponding ambient light illumination components such as L3*3, L5*5, L7*7, L9*9, L11*11, establish the corresponding relationship between the blur radius and the ambient light illumination component.
  • the target ambient light illumination component corresponding to the target blur radius needs to be determined, the target ambient light illumination component corresponding to the target blur radius is determined based on the established correspondence.
  • Gaussian blur is performed on the sixth image based on the target blur radius to obtain the target ambient light illumination component.
  • Step S44 determining the pixel value of the seventh pixel point based on the pixel value of the sixth pixel point and the target ambient light illumination component.
  • the pixel value of the seventh pixel is only related to the pixel value of the corresponding sixth pixel and the target ambient light illumination component, and has nothing to do with other pixels, the pixel value of each seventh pixel can be calculated independently, without the need for full Calculation of image information, thereby improving computing efficiency and realizing real-time processing of images.
  • Step S45 generating a seventh image based on the pixel value of the seventh pixel.
  • a seventh pixel corresponds to a sixth pixel, and the seventh pixel and the sixth pixel have the same position in the image.
  • the part may show a uniform brightening effect, and the image will have a foggy visual effect when observed with the naked eye.
  • the above embodiments describe the process of dehazing the sixth image after the sixth image is generated.
  • the generated second image and third image may also be dehazed.
  • the fourth image, or the fifth image for dehazing may also be dehazed.
  • the process of defogging any generated image is the same as the above steps 41 to 45, and will not be repeated here.
  • At least one of processing such as sharpening and denoising is further performed on the generated image.
  • the generated image is also sharpened; or the generated image is also denoised; or the generated image is also sharpened and denoised.
  • the Laplacian filtering method is used to sharpen the generated image to obtain the eighth image, which realizes the enhancement of high-frequency details.
  • the process of brightening dark areas further enhances the color noise in the device, impairing the visual effect of the resulting image to the naked eye. Therefore, in some embodiments, in order to eliminate the influence of noise, the red channel value, blue channel value and green channel value of each pixel in the generated image are further obtained; The red channel value, blue channel value and green channel value are denoised separately to obtain the final image.
  • the three RGB channels of each pixel in the generated image are denoised respectively to improve image quality.
  • Any suitable method can be used for denoising, such as NL-means, three-dimensional block matching algorithm (BM3D), and so on.
  • the image processing method provided by the embodiments of the present disclosure can effectively brighten the dark parts while suppressing overexposure of highlights, and at the same time, it can enhance the texture and color of the image, improve the layering of the image structure and the visual effect of the final imaging, and improve the image quality ; And can achieve real-time processing, improve the efficiency of image processing, and achieve real-time preview in the shooting window.
  • Fig. 6 is a block diagram of an image processing apparatus according to an exemplary embodiment. 6, the image processing apparatus includes:
  • an image acquisition module 61 configured to acquire an original image
  • the brightness enhancement module 62 is configured to enhance the brightness of the original image to obtain the first image
  • the weight determination module 63 is configured to determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the sum of the original weight and the first weight The value is 1, and the first weight is negatively correlated with the pixel value of the original pixel;
  • the first fusion module 64 is configured to perform weighted fusion on the pixel value of the original pixel point and the pixel value of the first pixel point based on the original weight and the first weight to obtain the pixel value of the second pixel point;
  • the image generation module 65 is configured to generate a second image based on the pixel values of the second pixel points.
  • the weight determination module 63 is configured to: determine the first weight of the first pixel point based on the first adjustment parameter and the pixel value of the original pixel point, where the first adjustment parameter is used to adjust the brightness enhancement of the original image The strength of the first adjustment parameter is positively correlated with the first weight.
  • weight determination module 63 is configured to:
  • the image processing apparatus further includes:
  • the texture enhancement module is configured to perform texture enhancement on the second image based on the pixel value of the second pixel in the second image to obtain a third image.
  • the texture enhancement module is configured to:
  • the pixel value of the second pixel point is greater than the second threshold, the pixel value of the second pixel point is increased to obtain the pixel value of the third pixel point.
  • the second threshold is greater than or equal to 0.5
  • the image processing apparatus further includes:
  • the second fusion module configured as:
  • the second weight of the second pixel point and the third weight of the third pixel point in the third image are determined, wherein the sum of the second weight and the third weight is 1, and the second weight varies with
  • the relationship between the changes of the pixel values of the original pixel points is a downward convex function relationship
  • weighted fusion is performed on the pixel value of the second pixel point and the pixel value of the third pixel point to obtain the pixel value of the fourth pixel point;
  • a fourth image is generated.
  • the second fusion module is configured to determine the second weight of the second pixel point based on the second adjustment parameter and the pixel value of the original pixel point, the second adjustment parameter is used to adjust the texture enhancement of the second image The strength of the second adjustment parameter is positively correlated with the second weight.
  • the second fusion module is configured to:
  • the image processing apparatus further includes:
  • Color enhancement module configured as:
  • the red channel value, the blue channel value and the green channel value of the fourth pixel are respectively corrected to obtain the red channel value, the blue channel value and the green channel value of the fifth pixel;
  • a fifth image is generated based on the red channel value, the blue channel value and the green channel value of the fifth pixel.
  • the image processing apparatus further includes:
  • the third fusion module configured as:
  • the third adjustment parameter is used to adjust the intensity of color enhancement of the generated image
  • weighted fusion is performed on the pixel value of the fourth pixel point and the pixel value of the fifth pixel point to obtain the pixel value of the sixth pixel point;
  • a sixth image is generated.
  • the image processing apparatus further includes:
  • Light compensation module configured as:
  • a seventh image is generated.
  • the illumination compensation module is configured to:
  • FIG. 7 is a block diagram of an electronic device 700 shown in the present disclosure.
  • electronic device 700 is a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, or personal digital assistant, among others.
  • an electronic device 700 includes one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and communication component 716 .
  • the processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 702 includes an OR processor 720 to execute instructions to perform all or part of the steps of the image processing method of any embodiment.
  • processing component 702 also includes one or a module that facilitates interaction between processing component 702 and other components.
  • processing component 702 includes a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.
  • Memory 704 is configured to store various types of data to support operation at device 700 . Examples of such data include instructions for any application or method operating on electronic device 700, contact data, phonebook data, messages, pictures, videos, and the like. Memory 704 is implemented by any type of volatile or nonvolatile storage device or combination thereof, such as static random access memory (SRAM), erasable programmable read only memory (EPROM), programmable read only memory ( PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
  • SRAM static random access memory
  • EPROM erasable programmable read only memory
  • PROM programmable read only memory
  • ROM read only memory
  • magnetic memory flash memory
  • flash memory magnetic disk or optical disk.
  • Power supply component 706 provides power to various components of electronic device 700 .
  • Power component 706 includes a power management system, an or power source, and other components associated with generating, managing, and distributing power to electronic device 700 .
  • Multimedia component 708 includes a screen that provides an output interface between electronic device 700 and the user.
  • the screen includes a liquid crystal display (LCD) and a touch panel (TP).
  • the screen is a touch screen to receive input signals from a user.
  • the touch panel includes an or touch sensor to sense touch, swipe, and gestures on the touch panel.
  • a touch sensor not only senses the boundaries of a touch or swipe action, but also detects the duration and pressure associated with the touch or swipe action.
  • multimedia component 708 includes a front-facing camera and/or a rear-facing camera. When the device 700 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera receive external multimedia data.
  • Each front and rear camera is a fixed optical lens system or has focal length and optical zoom capability.
  • Audio component 710 is configured to output and/or input audio signals.
  • audio component 710 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 700 is in operating modes, such as calling mode, recording mode, and voice recognition mode. The received audio signal is further stored in memory 704 or transmitted via communication component 716 .
  • audio component 710 also includes a speaker for outputting audio signals.
  • the I/O interface 712 provides an interface between the processing component 702 and a peripheral interface module, such as a keyboard, a click wheel or a button, and the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
  • Sensor assembly 714 includes one or a sensor for providing status assessment of various aspects of electronic device 700 .
  • the sensor assembly 714 detects the open/closed state of the device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, the sensor assembly 714 also detects a change in the position of the electronic device 700 or a component of the electronic device 700, The presence or absence of user contact with the electronic device 700 , the orientation or acceleration/deceleration of the electronic device 700 and the temperature change of the electronic device 700 .
  • Sensor assembly 714 includes a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 714 also includes a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor assembly 714 also includes an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices.
  • the electronic device 700 accesses a wireless network based on a communication standard, such as WiFi, a carrier network (eg, 2G, 3G, 4G, or 5G), or a combination thereof.
  • the communication component 716 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • electronic device 700 is implemented by one or an application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components implemented for performing the image processing method of any of the embodiments.
  • ASIC application specific integrated circuit
  • DSP digital signal processor
  • DSPD digital signal processing device
  • PLD programmable logic device
  • FPGA field programmable gate array
  • controller a microcontroller, a microprocessor or other electronic components implemented for performing the image processing method of any of the embodiments.
  • Embodiments of the present disclosure also provide an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the above instructions to achieve the following operations: acquiring an original image; The brightness of the original image is enhanced to obtain the first image; based on the pixel value of the original pixel in the original image, the first weight of the first pixel in the first image and the original weight of the original pixel are determined, wherein the original weight is the same as the first weight.
  • the sum value of a weight is 1, and the first weight has a negative correlation with the pixel value of the original pixel point; based on the original weight and the first weight, the pixel value of the original pixel point and the pixel value of the first pixel point are weighted and fused, The pixel value of the second pixel point is obtained; based on the pixel value of the second pixel point, a second image is generated.
  • the processor is further configured to execute the above-mentioned instructions, so as to implement the image processing methods provided by other embodiments of the above-mentioned method embodiments.
  • non-transitory computer-readable storage medium including instructions, such as memory 704 including instructions, executable by the processor 720 of the electronic device 700 to complete the image of any of the embodiments Approach.
  • the non-transitory computer-readable storage medium is ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
  • Embodiments of the present disclosure also provide a storage medium, where the instructions in the computer-readable storage medium are executed by a processor of an electronic device, so that the electronic device can perform the following steps: acquiring an original image; enhancing the brightness of the original image to obtain the first An image; based on the pixel value of the original pixel in the original image, determine the first weight of the first pixel in the first image and the original weight of the original pixel, wherein the sum of the original weight and the first weight is 1, and the first weight is 1.
  • a weight is negatively correlated with the pixel value of the original pixel point; based on the original weight and the first weight, the pixel value of the original pixel point and the pixel value of the first pixel point are weighted and fused to obtain the pixel value of the second pixel point; Based on the pixel values of the second pixel points, a second image is generated.
  • the instructions in the computer-readable storage medium are executed by the processor of the electronic device, so that the electronic device can execute the image processing methods provided in other embodiments of the foregoing method embodiments.
  • a computer program product includes a computer program, and the computer program can be executed by the processor 720 of the electronic device 700 to complete the image processing method of any one of the embodiments.
  • the computer program is stored in a storage medium of electronic device 700, the computer readable storage medium being ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage devices, and the like.
  • Embodiments of the present disclosure also provide a computer program product, including a computer program, the computer program being executed by a processor to implement the following steps: acquiring an original image; enhancing the brightness of the original image to obtain a first image; based on the original pixels in the original image The pixel value of the point, to determine the first weight of the first pixel in the first image and the original weight of the original pixel, where the sum of the original weight and the first weight is 1, and the first weight and the pixel value of the original pixel A negative correlation; based on the original weight and the first weight, the pixel value of the original pixel point and the pixel value of the first pixel point are weighted and fused to obtain the pixel value of the second pixel point; based on the pixel value of the second pixel point, Generate a second image.
  • the computer program is executed by the processor, so that the processor can execute the image processing methods provided by other embodiments of the above method embodiments.
  • FIG. 8 is a block diagram of an electronic device 800 shown in the present disclosure.
  • the electronic device 800 is provided as a server.
  • electronic device 800 includes processing component 822, which further includes an OR processor, and a memory resource represented by memory 832 for storing instructions executable by processing component 822, such as applications.
  • the application program stored in memory 832 includes one or more modules, each corresponding to a set of instructions.
  • the processing component 822 is configured to execute instructions to perform the image processing method of any of the embodiments.
  • the electronic device 800 also includes a power supply assembly 826 configured to perform power management of the electronic device 800, a wired or wireless network interface 850 configured to connect the electronic device 800 to a network, and an input output (I/O) interface 858.
  • Electronic device 800 operates based on an operating system stored in memory 832, such as WindowsServerTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

An image processing method and an electronic device. The method comprises: acquiring a raw image (S11), and enhancing the brightness of the raw image to obtain a first image (S12); on the basis of pixel values of raw pixel points in the raw image, determining a first weight of first pixel points in the first image and a raw weight of the raw pixel points (S13); on the basis of the raw weight and the first weight, performing weighted fusing on the pixel values of the raw pixel points and pixel values of the first pixel points, so as to obtain pixel values of second pixel points (S14); and generating a second image on the basis of the pixel values of the second pixel points (S15).

Description

图像处理方法及电子设备Image processing method and electronic device
本公开基于申请号为202011507495.9、申请日为2020年12月18日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。The present disclosure is based on a Chinese patent application with application number 202011507495.9 and an application date of December 18, 2020, and claims the priority of the Chinese patent application, the entire contents of which are incorporated herein by reference.
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种图像处理方法及电子设备。The present disclosure relates to the field of computer technology, and in particular, to an image processing method and an electronic device.
背景技术Background technique
随着智能手机的拍照能力不断提高,越来越多的人使用智能手机拍摄照片、视频,以记录自己生活中的精彩瞬间。然而,使用智能手机在夜间或其它背光、弱光等场景下拍摄照片时,获得的图像中光线较暗的部分难以观察,高光部分又过于突兀,图像质量较差,无法满足人眼需求。With the continuous improvement of the camera capability of smartphones, more and more people use smartphones to take photos and videos to record the wonderful moments in their lives. However, when using a smartphone to take photos at night or in other backlight and low-light scenarios, the darker parts of the obtained images are difficult to observe, and the highlighted parts are too obtrusive, resulting in poor image quality, which cannot meet the needs of the human eye.
发明内容SUMMARY OF THE INVENTION
根据本公开的一方面,提供一种图像处理方法,所述方法包括:According to an aspect of the present disclosure, there is provided an image processing method, the method comprising:
获取原始图像;get the original image;
对所述原始图像的亮度进行增强,得到第一图像;enhancing the brightness of the original image to obtain a first image;
基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;Determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original weight and the first weight The sum value is 1, and the first weight is negatively correlated with the pixel value of the original pixel point;
基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;Based on the original weight and the first weight, weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
基于所述第二像素点的像素值,生成第二图像。Based on the pixel values of the second pixel points, a second image is generated.
根据本公开的一方面,提供一种图像处理装置,所述图像处理装置包括:According to an aspect of the present disclosure, there is provided an image processing apparatus, the image processing apparatus comprising:
图像获取模块,被配置为获取原始图像;an image acquisition module, configured to acquire the original image;
亮度增强模块,被配置为对所述原始图像的亮度进行增强,得到第一图像;a brightness enhancement module, configured to enhance the brightness of the original image to obtain a first image;
权重确定模块,被配置为基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;A weight determination module configured to determine a first weight of a first pixel in the first image and an original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original The sum of the weight and the first weight is 1, and the first weight has a negative correlation with the pixel value of the original pixel point;
第一融合模块,被配置为基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;The first fusion module is configured to perform weighted fusion on the pixel value of the original pixel point and the pixel value of the first pixel point based on the original weight and the first weight to obtain the pixel value of the second pixel point value;
图像生成模块,被配置为基于所述第二像素点的像素值,生成第二图像。The image generation module is configured to generate a second image based on the pixel values of the second pixel points.
根据本公开的一方面,提供一种电子设备,所述电子设备包括:According to an aspect of the present disclosure, there is provided an electronic device, the electronic device comprising:
处理器;processor;
用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
其中,所述处理器被配置为执行所述指令,实现以下步骤:Wherein, the processor is configured to execute the instructions to implement the following steps:
获取原始图像;get the original image;
对所述原始图像的亮度进行增强,得到第一图像;enhancing the brightness of the original image to obtain a first image;
基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;Determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original weight and the first weight The sum value is 1, and the first weight is negatively correlated with the pixel value of the original pixel point;
基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;Based on the original weight and the first weight, weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
基于所述第二像素点的像素值,生成第二图像。Based on the pixel values of the second pixel points, a second image is generated.
根据本公开的一方面,提供一种计算机可读存储介质,所述计算机可读存储介质中的指令由电子设备的处理器执行,使得所述电子设备能够执行以下步骤:According to an aspect of the present disclosure, a computer-readable storage medium is provided, wherein instructions in the computer-readable storage medium are executed by a processor of an electronic device, so that the electronic device can perform the following steps:
获取原始图像;get the original image;
对所述原始图像的亮度进行增强,得到第一图像;enhancing the brightness of the original image to obtain a first image;
基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;Determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original weight and the first weight The sum value is 1, and the first weight is negatively correlated with the pixel value of the original pixel point;
基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;Based on the original weight and the first weight, weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
基于所述第二像素点的像素值,生成第二图像。Based on the pixel values of the second pixel points, a second image is generated.
根据本公开的一方面,提供一种计算机程序产品,包括计算机程序,所述计算机程序由电子设备的处理器执行实现以下步骤:According to an aspect of the present disclosure, there is provided a computer program product, comprising a computer program, the computer program being executed by a processor of an electronic device to implement the following steps:
获取原始图像;get the original image;
对所述原始图像的亮度进行增强,得到第一图像;enhancing the brightness of the original image to obtain a first image;
基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;Determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original weight and the first weight The sum value is 1, and the first weight is negatively correlated with the pixel value of the original pixel point;
基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;Based on the original weight and the first weight, weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
基于所述第二像素点的像素值,生成第二图像。Based on the pixel values of the second pixel points, a second image is generated.
本公开技术方案通过对原始图像进行提亮得到第一图像,再对原始图像和第一图像进行加权融合,由于第一图像的第一权重与原始像素点的像素值成负相关关系,因此有针对性地对原始图像的暗处进行了提亮,同时防止了高光处过曝,提高了图像质量,使得最终的补光效果符合人眼视觉感知需求。The technical solution of the present disclosure obtains the first image by brightening the original image, and then performs weighted fusion of the original image and the first image. Since the first weight of the first image has a negative correlation with the pixel value of the original pixel, there are Targetedly brightens the dark areas of the original image, while preventing overexposure in highlights, improving image quality, and making the final fill light effect meet the needs of human visual perception.
附图说明Description of drawings
图1是根据一示例性实施例示出的一种图像处理方法的流程图。Fig. 1 is a flowchart of an image processing method according to an exemplary embodiment.
图2是根据一示例性实施例示出的一种纹理增强方法的流程图。Fig. 2 is a flow chart of a texture enhancement method according to an exemplary embodiment.
图3是根据一示例性实施例示出的一种色彩增强方法的流程图。Fig. 3 is a flow chart of a color enhancement method according to an exemplary embodiment.
图4是根据一示例性实施例示出的一种光照补偿方法的流程图。Fig. 4 is a flow chart of a method for illumination compensation according to an exemplary embodiment.
图5是根据一示例性实施例示出的原始图像与第二图像对比图。FIG. 5 is a comparison diagram of an original image and a second image according to an exemplary embodiment.
图6是根据一示例性实施例示出的一种图像处理装置的结构框图。Fig. 6 is a structural block diagram of an image processing apparatus according to an exemplary embodiment.
图7是根据一示例性实施例示出的一种电子设备的框图。Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment.
图8是根据一示例性实施例示出的一种电子设备的框图。Fig. 8 is a block diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
图1是根据一示例性实施例示出的一种图像处理方法的流程图,如图1所示,该方法包括以下步骤。Fig. 1 is a flowchart of an image processing method according to an exemplary embodiment. As shown in Fig. 1 , the method includes the following steps.
在步骤S11中,获取原始图像。In step S11, the original image is acquired.
本公开实施例的执行主体为终端等电子设备。The execution body of the embodiment of the present disclosure is an electronic device such as a terminal.
其中,原始图像为终端存储的图像或者终端拍摄的预览图像等。The original image is an image stored by the terminal or a preview image captured by the terminal, or the like.
在步骤S12中,对原始图像的亮度进行增强,得到第一图像。In step S12, the brightness of the original image is enhanced to obtain a first image.
步骤S12是对原始图像整体的亮度进行增强,也就是对原始图像中的各像素点的亮度都进行增强,得到提亮后的第一图像。例如,通过对原始图像的整体亮度进行Gamma曲线增强,得到提亮后的第一图像。Step S12 is to enhance the overall brightness of the original image, that is, to enhance the brightness of each pixel in the original image to obtain a brightened first image. For example, by performing Gamma curve enhancement on the overall brightness of the original image, a brightened first image is obtained.
其中,Gamma曲线是一种特殊的色调曲线,通过调节Gamma值能够调节图像亮度。Gamma值等于1,表示输入和输出亮度相同;Gamma值高于1会造成输出暗化,Gamma值低于1会造成输出亮化。在实际应用中,可以根据需求对Gamma值进行调整。Among them, the Gamma curve is a special tone curve, and the brightness of the image can be adjusted by adjusting the Gamma value. A Gamma value equal to 1 means that the input and output brightness are the same; a Gamma value higher than 1 will cause the output to be darkened, and a Gamma value below 1 will cause the output to be brighter. In practical applications, the Gamma value can be adjusted according to requirements.
在步骤S13中,基于原始图像中原始像素点的像素值,确定第一图像中第一像素点的第一权重以及原始像素点的原始权重,其中,原始权重与第一权重的和值为1,第一权重与原始像素点的像素值成负相关关系。In step S13, the first weight of the first pixel in the first image and the original weight of the original pixel are determined based on the pixel value of the original pixel in the original image, wherein the sum of the original weight and the first weight is 1 , the first weight has a negative correlation with the pixel value of the original pixel point.
其中,原始像素点为原始图像中的任意一个像素点,第一像素点为第一图像中与原始像素点位置对应的像素点,即第一像素点在第一图像中的位置与原始像素点在原始图像中的位置相同。像素点的像素值为该像素点的亮度值或灰度值等。The original pixel is any pixel in the original image, and the first pixel is the pixel in the first image corresponding to the position of the original pixel, that is, the position of the first pixel in the first image is the same as the original pixel. The same position in the original image. The pixel value of the pixel point is the brightness value or gray value of the pixel point.
在一些实施例中,步骤S13包括:基于第一调节参数和原始像素点的像素值,确定第一像素点的第一权重,其中,第一调节参数用于调节对原始图像进行亮度增强的强度,第一调节参数与第一权重呈正相关关系。其中,第一调节参数通过影响第一权重的大小,影响图像的亮度增强效果,从而能够通过对第一调节参数的灵活调整,实现亮度增强效果的灵活调整。In some embodiments, step S13 includes: determining the first weight of the first pixel point based on the first adjustment parameter and the pixel value of the original pixel point, wherein the first adjustment parameter is used to adjust the intensity of the brightness enhancement of the original image , the first adjustment parameter is positively correlated with the first weight. The first adjustment parameter affects the brightness enhancement effect of the image by affecting the size of the first weight, so that the brightness enhancement effect can be flexibly adjusted by flexibly adjusting the first adjustment parameter.
在一些实施例中,根据以下公式确定第一像素点的第一权重,Alpha 1=α 1(1-β 1*(x γ-x γ+1)),其中,Alpha 1表示第一像素点的第一权重,α 1表示第一调节参数,第一调节参数用于调节对原始图像进行亮度增强的强度,x表示原始像素点的像素值,β 1表示第一常量,γ表示第二常量。 In some embodiments, the first weight of the first pixel is determined according to the following formula, Alpha 11 (1-β 1 *(x γ -x γ+1 )), where Alpha 1 represents the first pixel , α 1 represents the first adjustment parameter, the first adjustment parameter is used to adjust the intensity of the brightness enhancement of the original image, x represents the pixel value of the original pixel point, β 1 represents the first constant, γ represents the second constant .
在一些实施例中,x表示原始像素点在图像yuv空间中的y通道值,也即是亮度值;β 1与γ均为根据实际需求灵活设置的参数,决定曲线的陡度。其中,上述曲线是以x为自变量,Alpha 1为因变量,为函数Alpha 1=α 1(1-β 1*(x γ-x γ+1))绘制的曲线。β 1与γ决定曲线的陡度,也即是,β 1与γ影响着该曲线的斜率。 In some embodiments, x represents the y-channel value of the original pixel in the image yuv space, that is, the luminance value; β 1 and γ are parameters that are flexibly set according to actual needs, and determine the steepness of the curve. The above curve is a curve drawn by a function Alpha 11 (1-β 1 *(x γ -x γ+1 )) with x as an independent variable and Alpha 1 as a dependent variable. β 1 and γ determine the steepness of the curve, that is, β 1 and γ affect the slope of the curve.
第一调节参数α 1用于调节原始图像与第一图像之间的融合强度,第一调节参数α 1是由用户输入、机器输入或自动生成的,例如α 1的大小可由用户在终端界面上自行调节。由于第一权重与第一调节参数有关,第一调节参数通过影响第一权重的大小,能够影响亮度增强效果,第一调节参数能够根据需要灵活调整,相应的,亮度增强效果也会随着第一调节参数的调整而实现灵活调整。 The first adjustment parameter α 1 is used to adjust the fusion strength between the original image and the first image, and the first adjustment parameter α 1 is input by the user, machine input or automatically generated, for example, the size of α 1 can be determined by the user on the terminal interface Self-adjusting. Since the first weight is related to the first adjustment parameter, the first adjustment parameter can affect the brightness enhancement effect by affecting the size of the first weight, and the first adjustment parameter can be flexibly adjusted as needed, and accordingly, the brightness enhancement effect will also follow the first adjustment. A flexible adjustment is achieved by adjusting the adjustment parameters.
根据第一权重Alpha 1的计算公式可知,原始像素点的像素值x越大,第一权重Alpha 1的值越小,即第一权重与原始像素点的像素值成负相关关系,进而基于第一权重和第二权重对原始图像和第一图像进行加权融合,能够实现对原始图像的暗处进行有针对性地重点提亮,同时对高光处的过曝进行有效抑制。另外,第一像素点的第一权重Alpha 1仅与对应原始像素点的像素值有关,与其它像素点的像素值无关,因此能够独立计算得到各第一像素点的第一权重,无需进行全图信息的计算,从而提高计算效率。 According to the calculation formula of the first weight Alpha 1 , the larger the pixel value x of the original pixel point, the smaller the value of the first weight Alpha 1 , that is, the first weight has a negative correlation with the pixel value of the original pixel point, and then based on the first weight The first weight and the second weight perform weighted fusion of the original image and the first image, which can achieve targeted highlighting of the dark areas of the original image, and at the same time effectively suppress overexposure in the highlights. In addition, the first weight Alpha 1 of the first pixel is only related to the pixel value of the corresponding original pixel, and has nothing to do with the pixel values of other pixels. Therefore, the first weight of each first pixel can be calculated independently, and there is no need to perform a full Calculation of graph information, thereby improving computational efficiency.
在步骤S14中,基于原始权重以及第一权重,对原始像素点的像素值和第一像素点的像素值进行加权融合,得到第二像素点的像素值。In step S14, based on the original weight and the first weight, the pixel value of the original pixel point and the pixel value of the first pixel point are weighted and fused to obtain the pixel value of the second pixel point.
为了使暗处重点提亮的同时防止高光过曝,能够将原始像素点的像素值S0和第一像素点的像素值S1进行一次加权融合。其中,加权融合的过程包括:确定原始像素点的像素值与原始权重的第一乘积,以及,确定第一像素点的像素值与第一权重的第二乘积;将第一乘积与第二乘积的和值确定为第二像素点的像素值。也即是,根据以下加权融合的公式确定第二像素点的像素值:S2=S1*Alpha 1+S0*(1-Alpha 1),其中,S0为原始图 像中原始像素点的像素值,S1为第一图像中第一像素点的像素值,S2为第二像素点的像素值,Alpha 1表示第一像素点的第一权重,1-Alpha 1表示原始像素点的原始权重。 In order to highlight highlights in the dark and prevent overexposure of highlights, the pixel value S0 of the original pixel point and the pixel value S1 of the first pixel point can be weighted and fused once. Wherein, the process of weighted fusion includes: determining the first product of the pixel value of the original pixel point and the original weight, and determining the second product of the pixel value of the first pixel point and the first weight; The sum value is determined as the pixel value of the second pixel point. That is, the pixel value of the second pixel is determined according to the following weighted fusion formula: S2=S1*Alpha 1 +S0*(1-Alpha 1 ), where S0 is the pixel value of the original pixel in the original image, S1 is the pixel value of the first pixel in the first image, S2 is the pixel value of the second pixel, Alpha 1 represents the first weight of the first pixel, and 1-Alpha 1 represents the original weight of the original pixel.
根据第一像素点的第一权重Alpha 1的计算公式可知,原始像素点的亮度越低(x越小),第一像素点的第一权重Alpha 1值越大,加权融合后得到的第二像素点的像素值S2越接近第一图像中第一像素点的像素值S1;反之原始像素点的亮度越高(x越大),第一像素点的第一权重Alpha 1值越小,加权融合后得到的第二像素点的像素值S2越接近原始图像中原始像素点的像素值S0。这样,通过对原始图像和提亮后的第一图像进行加权融合,能够使原始图像的暗处被重点提亮,同时确保高光处的过曝得到有效抑制。参照图5,图5示出了原始图像与第二图像的对比图,由该对比图可知,第二图像与原始图像相比,暗处被重点提亮,且高光处未发生过曝。 According to the calculation formula of the first weight Alpha 1 of the first pixel point, the lower the brightness of the original pixel point (the smaller the x), the greater the value of the first weight Alpha 1 of the first pixel point, and the second weight obtained after weighted fusion. The pixel value S2 of the pixel point is closer to the pixel value S1 of the first pixel point in the first image; on the contrary, the higher the brightness of the original pixel point (the larger the x), the smaller the first weight Alpha 1 value of the first pixel point, the weighted The pixel value S2 of the second pixel point obtained after fusion is closer to the pixel value S0 of the original pixel point in the original image. In this way, by performing weighted fusion of the original image and the brightened first image, the dark parts of the original image can be highlighted, and at the same time, the overexposure in the highlights can be effectively suppressed. Referring to FIG. 5 , FIG. 5 shows a comparison diagram of the original image and the second image. It can be seen from the comparison diagram that, compared with the original image, the dark areas of the second image are highlighted, and the highlights are not overexposed.
在步骤S15中,基于第二像素点的像素值,生成第二图像。In step S15, a second image is generated based on the pixel values of the second pixel points.
其中,一个第二像素点对应一个原始像素点,该第二像素点与该原始像素点在图像中的位置相同,通过执行上述步骤S13至步骤S14,能够得到每个原始像素点对应的第二像素点的像素值,每个第二像素点的像素值按照位置排列,构成第二图像。Wherein, a second pixel corresponds to an original pixel, and the second pixel and the original pixel have the same position in the image. By performing the above steps S13 to S14, the second pixel corresponding to each original pixel can be obtained. The pixel value of the pixel point, and the pixel value of each second pixel point is arranged according to the position to form the second image.
在一些实施例中,将第二图像作为最终图像进行输出。在一些实施例中,还对第二图像进行纹理增强、色彩增强以及去雾等处理中的至少一种,得到最终图像。例如,对第二图像进行纹理增强,得到最终图像;或者,对第二图像进行色彩增强,得到最终图像;或者,对第二图像进行去雾,得到最终图像;或者,对第二图像进行纹理增强和色彩增强,得到最终图像;或者,对第二图像进行纹理增强和去雾,得到最终图像;或者,对第二图像进行色彩增强和去雾,得到最终图像;或者,对第二图像进行纹理增强、色彩增强以及去雾,得到最终图像。其中,对第二图像进行多种处理的顺序可灵活设置,例如,还进一步对第二图像依次进行纹理增强、色彩增强以及去雾等处理,得到最终图像。In some embodiments, the second image is output as the final image. In some embodiments, at least one of texture enhancement, color enhancement, and dehazing is also performed on the second image to obtain a final image. For example, performing texture enhancement on the second image to obtain a final image; or performing color enhancement on the second image to obtain a final image; or performing dehazing on the second image to obtain a final image; or performing texture on the second image enhancement and color enhancement to obtain a final image; or, performing texture enhancement and dehazing on the second image to obtain a final image; or, performing color enhancement and dehazing on the second image to obtain a final image; or, performing Texture enhancement, color enhancement, and dehazing to get the final image. The order of performing various processing on the second image can be set flexibly. For example, the second image is further processed by texture enhancement, color enhancement, and dehazing in sequence to obtain a final image.
本公开实施例提供的图像处理方法,通过对原始图像进行提亮得到第一图像,再对原始图像和第一图像进行加权融合,由于第一图像的第一权重与原始像素点的像素值成负相关关系,因此有针对性地对原始图像的暗处进行了提亮,同时防止了高光处过曝,提高了图像质量,使得最终的补光效果符合人眼视觉感知需求。另外,本公开实施例提供的图像处理方法对每个像素点进行独立处理,无需进行全图信息的计算,每个像素点均可并行处理,提高了图像处理效率,因此能够实时处理原始图像,实现实时预览。In the image processing method provided by the embodiment of the present disclosure, a first image is obtained by brightening the original image, and then weighted fusion is performed on the original image and the first image. Since the first weight of the first image is equal to the pixel value of the original pixel point Therefore, the dark parts of the original image are brightened in a targeted manner, and at the same time, the overexposure of the highlights is prevented, and the image quality is improved, so that the final fill light effect meets the needs of human visual perception. In addition, the image processing method provided by the embodiment of the present disclosure performs independent processing on each pixel, without the need to calculate the whole image information, and each pixel can be processed in parallel, which improves the image processing efficiency, so that the original image can be processed in real time, Real-time preview.
在一些实施例中,在生成第二图像后,还对第二图像进行纹理增强,也即是,步骤S15之后还包括以下步骤:In some embodiments, after the second image is generated, texture enhancement is also performed on the second image, that is, after step S15, the following steps are further included:
步骤S16:基于第二图像中第二像素点的像素值,对第二图像进行纹理增强,得到第三图像。Step S16: Based on the pixel values of the second pixels in the second image, texture enhancement is performed on the second image to obtain a third image.
在对原始图像进行亮度增强的过程中,原始图像的原始纹理细节可能会被抑制,导致肉眼效果上的纹理模糊,因此,通过对第二图像进行纹理增强,使图像的纹理细节更清楚明显,提高图像的清晰度,从而提升图像的视觉效果。In the process of enhancing the brightness of the original image, the original texture details of the original image may be suppressed, resulting in blurred texture on the naked eye effect. Improve the clarity of the image, thereby enhancing the visual effect of the image.
在一些实施例中,步骤S16包括:在第二像素点的像素值小于或等于第一阈值的情况下,减小第二像素点的像素值,得到第三图像中第三像素点的像素值;在第二像素点的像素值大于第二阈值的情况下,增大第二像素点的像素值,得到第三像素点的像素值。也即是,对于亮度增强程度较强的暗部,适当降低亮度,对于亮度增强程度较弱的亮部,适当提高亮度,使图像的暗部和亮部纹理更分明,从而更凸显图像的暗部和亮部的纹理细节,使图像纹理的结构层次更加分明,细节更加丰富,实现图像的纹理增强,提高图像的清晰度。In some embodiments, step S16 includes: when the pixel value of the second pixel is less than or equal to the first threshold, reducing the pixel value of the second pixel to obtain the pixel value of the third pixel in the third image ; When the pixel value of the second pixel point is greater than the second threshold, increase the pixel value of the second pixel point to obtain the pixel value of the third pixel point. That is, for the dark parts with strong brightness enhancement, reduce the brightness appropriately, and for the bright parts with weak brightness enhancement, increase the brightness appropriately, so that the texture of the dark and bright parts of the image is more distinct, so that the dark and bright parts of the image are more prominent. The texture details of the parts make the structure of the image texture more distinct and the details richer, realize the texture enhancement of the image, and improve the clarity of the image.
在一些实施例中,在第二像素点的像素值小于或等于第一阈值的情况下,根据以下公式确定第三像素点的像素值:S3=2*S2*S2;在第二像素点的像素值大于第二阈值的 情况下,根据以下公式确定第三像素点的像素值:S3=1-2*(1-S2)*(1-S2);其中,S2表示第二像素点的像素值,S3表示第三像素点的像素值。其中,第一阈值小于或等于0.5。第二阈值大于或等于0.5。第一阈值和第二阈值可根据需要灵活设置,在一些实施例中,第一阈值与第二阈值相同,第一阈值与第二阈值均为0.5。在一些实施例中,第一阈值与第二阈值不相同,例如,第一阈值为小于0.5的数值,第二阈值为0.5。In some embodiments, when the pixel value of the second pixel is less than or equal to the first threshold, the pixel value of the third pixel is determined according to the following formula: S3=2*S2*S2; When the pixel value is greater than the second threshold, the pixel value of the third pixel is determined according to the following formula: S3=1-2*(1-S2)*(1-S2); wherein, S2 represents the pixel of the second pixel value, S3 represents the pixel value of the third pixel point. Wherein, the first threshold is less than or equal to 0.5. The second threshold is greater than or equal to 0.5. The first threshold and the second threshold can be flexibly set as required. In some embodiments, the first threshold and the second threshold are the same, and both the first threshold and the second threshold are 0.5. In some embodiments, the first threshold is different from the second threshold, eg, the first threshold is a value less than 0.5, and the second threshold is 0.5.
上述技术方案能够实现第二图像的纹理增强,并且使图像的暗部和亮部纹理细节凸显出来,保证图像纹理的结构层次更加分明,细节更加丰富。The above technical solution can enhance the texture of the second image, and make the texture details of the dark and bright parts of the image stand out, so as to ensure that the structure level of the image texture is more distinct and the details are more abundant.
在一些实施例中,在得到第三图像之后,还对第三图像和第二图像进行加权融合,以避免纹理增强效果抵消提亮效果,在保持图像的提亮效果的同时,提升图像纹理细节的层次感。也即是,参照图2,步骤S16之后还包括以下步骤:In some embodiments, after the third image is obtained, weighted fusion is performed on the third image and the second image, so as to prevent the texture enhancement effect from offsetting the brightening effect, and improve the texture details of the image while maintaining the brightening effect of the image sense of hierarchy. That is, referring to FIG. 2, the following steps are included after step S16:
步骤S21,基于原始像素点的像素值,确定第二像素点的第二权重以及第三图像中第三像素点的第三权重,其中,第二权重与第三权重的和值为1,第二权重随原始像素点的像素值发生变化的关系呈下凸函数关系。Step S21, based on the pixel value of the original pixel point, determine the second weight of the second pixel point and the third weight of the third pixel point in the third image, wherein the sum of the second weight and the third weight is 1, and the first weight is 1. The relationship between the two weights changing with the pixel value of the original pixel point is a downward convex function relationship.
其中,第三像素点为第三图像中与第二像素点位置对应的像素点,上述第三像素点和上述第二像素点在图像中的位置相同。The third pixel is a pixel corresponding to the position of the second pixel in the third image, and the third pixel and the second pixel have the same position in the image.
第二权重随原始像素点的像素值发生变化的函数关系可以根据实际需要进行设置,例如,该函数关系为下凸的二次函数关系或指数函数关系。The functional relationship in which the second weight changes with the pixel value of the original pixel point can be set according to actual needs, for example, the functional relationship is a downward convex quadratic functional relationship or an exponential functional relationship.
在一些实施例中,上述基于原始像素点的像素值,确定第二像素点的第二权重的步骤包括:基于第二调节参数和原始像素点的像素值,确定第二像素点的第二权重,其中,第二调节参数用于调节对第二图像进行纹理增强的强度,第二调节参数与第二权重呈正相关关系。其中,第二调节参数通过影响第二权重的大小,影响图像的纹理增强效果,从而能够通过对第二调节参数的灵活调整,实现纹理增强效果的灵活调整。In some embodiments, the above step of determining the second weight of the second pixel point based on the pixel value of the original pixel point includes: determining the second weight of the second pixel point based on the second adjustment parameter and the pixel value of the original pixel point , wherein the second adjustment parameter is used to adjust the intensity of texture enhancement on the second image, and the second adjustment parameter is positively correlated with the second weight. The second adjustment parameter affects the texture enhancement effect of the image by affecting the size of the second weight, so that flexible adjustment of the texture enhancement effect can be achieved by flexibly adjusting the second adjustment parameter.
在一些实施例中,根据以下公式确定第二像素点的第二权重,Alpha 2=α 2(1-β 2*x*(1-x)),Alpha 2表示第二像素点的第二权重,α 2表示第二调节参数,第二调节参数用于调节对第二图像进行纹理增强的强度,x表示原始像素点的像素值,β 2表示第三预设常量。 In some embodiments, the second weight of the second pixel is determined according to the following formula, Alpha 22 (1-β 2 *x*(1-x)), and Alpha 2 represents the second weight of the second pixel , α 2 represents the second adjustment parameter, the second adjustment parameter is used to adjust the intensity of texture enhancement on the second image, x represents the pixel value of the original pixel point, and β 2 represents the third preset constant.
在一些实施例中,x表示原始像素点在图像yuv空间中的y通道值,也即是亮度值;β 2为根据实际需求灵活设置的参数,决定曲线的陡度。其中,上述曲线是以x为自变量,Alpha 2为因变量,为函数Alpha 2=α 2(1-β 2*x*(1-x))绘制的曲线。β 2决定曲线的陡度,也即是,β 2影响着该曲线的斜率。 In some embodiments, x represents the y channel value of the original pixel in the image yuv space, that is, the luminance value; β 2 is a parameter flexibly set according to actual requirements, which determines the steepness of the curve. Wherein, the above curve takes x as an independent variable, Alpha 2 as a dependent variable, and is a curve drawn by a function Alpha 22 (1-β 2 *x*(1-x)). β 2 determines the steepness of the curve, that is, β 2 affects the slope of the curve.
第二调节参数α 2用于调节第二图像与第三图像之间的融合强度,第二调节参数α 2是由用户输入、机器输入或自动生成的,例如α 2的大小可由用户在终端界面上自行调节。由于第二权重与第二调节参数有关,第二调节参数通过影响第二权重的大小,能够影响纹理增强效果,第二调节参数能够根据需要灵活调整,相应的,纹理增强效果也会随着第一调节参数的调整而实现灵活调整。 The second adjustment parameter α 2 is used to adjust the fusion strength between the second image and the third image, and the second adjustment parameter α 2 is input by the user, machine input or automatically generated, for example, the size of α 2 can be determined by the user on the terminal interface self-adjustment. Since the second weight is related to the second adjustment parameter, the second adjustment parameter can affect the texture enhancement effect by affecting the size of the second weight, and the second adjustment parameter can be flexibly adjusted as needed, and accordingly, the texture enhancement effect will also follow the first adjustment. A flexible adjustment is achieved by adjusting the adjustment parameters.
根据第二权重Alpha 2的计算公式可知,第二权重随原始像素点的像素值发生变化的关系呈下凸函数关系,在原始像素点的像素值x较大或较小的情况下,即原始像素点的亮度值较为极端(过亮或过暗)的情况下,第二像素点的第二权重Alpha 2值越大,进而基于第二权重和第三权重对第二图像和第三图像进行加权融合,纹理增强对图像暗部提亮和高光抑制效果的抵消越弱,从而既保持了暗部提亮且高光处不会过曝,同时也提升了图像纹理细节的层次感。另外,第二像素点的第二权重仅与对应原始像素点的像素值有关,与其它像素点的像素值无关,因此能够独立计算得到各第二像素点的第二权重,无需进行全图信息的计算,从而提高计算效率。 According to the calculation formula of the second weight Alpha 2 , the relationship between the second weight and the pixel value of the original pixel point is a downward convex function relationship. When the pixel value x of the original pixel point is large or small, the original When the brightness value of the pixel is extreme (too bright or too dark), the second weight Alpha 2 value of the second pixel is larger, and then the second image and the third image are processed based on the second weight and the third weight. Weighted fusion, the weaker the effect of texture enhancement on the brightening of the dark parts of the image and the suppression of highlights, thus not only maintaining the brightening of the dark parts without overexposure in the highlights, but also improving the layering of image texture details. In addition, the second weight of the second pixel point is only related to the pixel value of the corresponding original pixel point, and has nothing to do with the pixel value of other pixel points, so the second weight of each second pixel point can be calculated independently, without the need for full-image information , so as to improve the computational efficiency.
步骤S22,基于第二权重以及第三权重,对第二像素点的像素值和第三像素点的像素 值进行加权融合,得到第四像素点的像素值。Step S22, based on the second weight and the third weight, weighted fusion is performed on the pixel value of the second pixel point and the pixel value of the third pixel point to obtain the pixel value of the fourth pixel point.
其中,加权融合的过程包括:确定第二像素点的像素值与第二权重的第三乘积,以及,确定第三像素点的像素值与第三权重的第四乘积;将第三乘积与第四乘积的和值确定为第四像素点的像素值。也即是,根据以下加权融合的公式确定第四像素点的像素值:S4=S2*Alpha 2+S3*(1-Alpha 2),其中,S2为第二像素点的像素值,S3为第三像素点的像素值,S4为第四像素点的像素值,Alpha 2表示第二像素点的第二权重,1-Alpha 2为第三像素点的第三权重。 Wherein, the process of weighted fusion includes: determining the third product of the pixel value of the second pixel point and the second weight, and determining the fourth product of the pixel value of the third pixel point and the third weight; The sum of the four products is determined as the pixel value of the fourth pixel point. That is, the pixel value of the fourth pixel is determined according to the following weighted fusion formula: S4=S2*Alpha 2 +S3*(1-Alpha 2 ), wherein S2 is the pixel value of the second pixel, and S3 is the first pixel value. The pixel value of the three pixel points, S4 is the pixel value of the fourth pixel point, Alpha 2 represents the second weight of the second pixel point, and 1-Alpha 2 is the third weight of the third pixel point.
根据第二权重Alpha 2的计算公式可知,原始像素点的亮度值较为极端(过亮或过暗,即x过大或过小)的情况下,第二像素点的第二权重Alpha 2值越大,融合得到的第四像素点的像素值S4会更接近第二像素点的像素值S2。这样,减小了纹理增强对图像暗部提亮和高光抑制效果的抵消,同时也提升了图像纹理细节的层次感。 According to the calculation formula of the second weight Alpha 2 , when the brightness value of the original pixel point is relatively extreme (too bright or too dark, that is, x is too large or too small), the second weight Alpha 2 value of the second pixel point is higher. is larger, the pixel value S4 of the fourth pixel point obtained by fusion will be closer to the pixel value S2 of the second pixel point. In this way, the effect of texture enhancement on the brightening of dark parts and the suppression of highlights in the image is reduced, and the layering of image texture details is also improved.
步骤S23,基于第四像素点的像素值,生成第四图像。Step S23, generating a fourth image based on the pixel value of the fourth pixel point.
其中,一个第四像素点对应一个第二像素点,该第四像素点与该第二像素点在图像中的位置相同,通过执行上述步骤S21至步骤S22,能够得到每个第二像素点对应的第四像素点的像素值,每个第四像素点的像素值按照位置排列,构成第四图像。Wherein, a fourth pixel corresponds to a second pixel, and the fourth pixel and the second pixel have the same position in the image. By performing the above steps S21 to S22, it is possible to obtain the correspondence of each second pixel. The pixel value of the fourth pixel point of , and the pixel value of each fourth pixel point is arranged according to the position to form a fourth image.
上述技术方案通过将第三图像与第二图像进行一次加权融合,避免了步骤S16中的纹理增强操作抵消掉第二图像的提亮效果,使图像的提亮效果不受太大损害,同时提升了图像纹理细节的层次感。The above technical solution prevents the texture enhancement operation in step S16 from offsetting the brightening effect of the second image by performing a weighted fusion of the third image and the second image, so that the brightening effect of the image is not greatly damaged, while improving The layering of image texture details.
在一些实施例中,参照图3,在生成第四图像后,还对第四图像进行色彩增强,也即是,步骤S23之后还包括以下步骤:In some embodiments, referring to FIG. 3 , after the fourth image is generated, color enhancement is also performed on the fourth image, that is, after step S23, the following steps are further included:
步骤S31,获取第四图像中第四像素点的红色通道值、蓝色通道值以及绿色通道值。Step S31, acquiring the red channel value, the blue channel value and the green channel value of the fourth pixel in the fourth image.
其中,第四像素点为第四图像中的任意一个像素点。The fourth pixel is any pixel in the fourth image.
在一些实施例中,上述步骤S31包括:在RGB空间中获取第四图像中第四像素点的RGB颜色信息,RGB颜色信息包括红色通道值、蓝色通道值以及绿色通道值。In some embodiments, the above step S31 includes: acquiring RGB color information of the fourth pixel in the fourth image in the RGB space, where the RGB color information includes a red channel value, a blue channel value and a green channel value.
步骤S32,基于色彩查找表,对第四像素点的红色通道值、蓝色通道值以及绿色通道值进行校正,得到第五图像中第五像素点的红色通道值、蓝色通道值以及绿色通道值。Step S32, based on the color lookup table, correct the red channel value, blue channel value and green channel value of the fourth pixel to obtain the red channel value, blue channel value and green channel value of the fifth pixel in the fifth image value.
在一些实施例中,基于色彩查找表LUT,对第四像素点的RGB颜色信息进行校正,得到第五像素点的RGB颜色信息。在一些实施例中,色彩查找表包括第一颜色信息与第二颜色信息之间的关系数据,第一颜色信息为需要进行校正的颜色信息,第二颜色信息为校正后的颜色信息,该关系数据用于表示第一颜色信息和第二颜色信息之间的对应关系,上述基于色彩查找表,对第四像素点的RGB颜色信息进行校正,得到第五像素点的RGB颜色信息的步骤包括:从色彩查找表中,查询第四像素点的RGB颜色信息对应的关系数据;从该关系数据中,获取第五像素点的RGB颜色信息。In some embodiments, based on the color lookup table LUT, the RGB color information of the fourth pixel is corrected to obtain the RGB color information of the fifth pixel. In some embodiments, the color lookup table includes relationship data between the first color information and the second color information, the first color information is the color information that needs to be corrected, the second color information is the corrected color information, the relationship The data is used to represent the correspondence between the first color information and the second color information. The above-mentioned steps of correcting the RGB color information of the fourth pixel point based on the color lookup table, and obtaining the RGB color information of the fifth pixel point include: From the color lookup table, query the relationship data corresponding to the RGB color information of the fourth pixel; from the relationship data, obtain the RGB color information of the fifth pixel.
基于色彩查找表,对第四像素点的RGB颜色信息进行校正,得到第五像素点的RGB颜色信息,也即是,根据以下公式,对第四像素点的RGB颜色信息进行校正,得到第五像素点的RGB颜色信息:S5′=LUT(S4′),其中,S4′表示第四像素点的RGB颜色信息,S5′表示第五像素点的RGB颜色信息,LUT表示从色彩查找表中查询第四像素点的RGB颜色信息对应的第五像素点的RGB颜色信息。色彩查找表可由用户根据实际需要进行不同风格的设计。Based on the color lookup table, the RGB color information of the fourth pixel is corrected to obtain the RGB color information of the fifth pixel, that is, the RGB color information of the fourth pixel is corrected according to the following formula, and the fifth pixel is obtained. RGB color information of the pixel: S5'=LUT(S4'), where S4' represents the RGB color information of the fourth pixel, S5' represents the RGB color information of the fifth pixel, and LUT represents the query from the color lookup table The RGB color information of the fifth pixel point corresponding to the RGB color information of the fourth pixel point. The color look-up table can be designed by users in different styles according to actual needs.
步骤S33,基于第五像素点的红色通道值、蓝色通道值以及绿色通道值,生成第五图像。Step S33 , generating a fifth image based on the red channel value, the blue channel value and the green channel value of the fifth pixel.
其中,一个第五像素点对应一个第四像素点,该第五像素点与该第四像素点在图像中的位置相同,通过执行上述步骤S31至步骤S32,能够得到每个第四像素点对应的第五像素点的红色通道值、蓝色通道值以及绿色通道值;基于每个第五像素点的红色通道值、蓝 色通道值以及绿色通道值,确定每个第五像素点的像素值;每个第五像素点的像素值按照位置排列,构成第五图像。Wherein, a fifth pixel corresponds to a fourth pixel, and the fifth pixel and the fourth pixel have the same position in the image. By executing the above steps S31 to S32, it is possible to obtain the correspondence of each fourth pixel. The red channel value, blue channel value, and green channel value of the fifth pixel point; based on the red channel value, blue channel value and green channel value of each fifth pixel point, determine the pixel value of each fifth pixel ; The pixel value of each fifth pixel point is arranged according to the position to form the fifth image.
上述技术方案通过对纹理增强后的图像进行色彩增强,进一步提高了图像质量,提升了图像的视觉效果。The above technical solution further improves the image quality and improves the visual effect of the image by enhancing the color of the texture-enhanced image.
在一些实施例中,在得到第五图像之后,还对第五图像和第四图像进行加权融合,以平衡色彩增强效果和提亮效果,在保持图像的提亮效果的同时,增强图像的色彩丰富度,也即是,参照图3,步骤S33之后还包括以下步骤:In some embodiments, after the fifth image is obtained, weighted fusion is also performed on the fifth image and the fourth image, so as to balance the color enhancement effect and the brightening effect, and enhance the color of the image while maintaining the brightening effect of the image Richness, that is, referring to FIG. 3 , after step S33, the following steps are further included:
步骤S34,获取第三调节参数,第三调节参数用于调节对第四图像进行色彩增强的强度。In step S34, a third adjustment parameter is obtained, and the third adjustment parameter is used to adjust the intensity of color enhancement of the fourth image.
步骤S35,基于第三调节参数,确定第四像素点的第四权重以及第五像素点的第五权重,其中,第四权重与第五权重的和值为1。Step S35 , based on the third adjustment parameter, determine the fourth weight of the fourth pixel point and the fifth weight of the fifth pixel point, wherein the sum of the fourth weight and the fifth weight is 1.
其中,第五像素点为第五图像中与第四像素点位置对应的像素点,上述第五像素点和上述第四像素点在图像中的位置相同。The fifth pixel is a pixel corresponding to the position of the fourth pixel in the fifth image, and the fifth pixel and the fourth pixel have the same position in the image.
步骤S36,基于第四权重以及第五权重,对第四像素点的像素值和第五像素点的像素值进行加权融合,得到第六像素点的像素值。Step S36, based on the fourth weight and the fifth weight, weighted fusion is performed on the pixel value of the fourth pixel point and the pixel value of the fifth pixel point to obtain the pixel value of the sixth pixel point.
其中,加权融合的过程包括:确定第四像素点的像素值与第四权重的第五乘积,以及,确定第五像素点的像素值与第五权重的第六乘积;将第五乘积与第六乘积的和值确定为第六像素点的像素值。也即是,采用以下融合公式确定第六像素点的像素值:S6=S5*Alpha 3+S4*(1-Alpha 3),其中,Alpha 3表示第五像素点的第五权重,即第三调节参数,1-Alpha 3表示第四像素点的第四权重,S4表示第四像素点的像素值,S5表示第五像素点的像素值,S6表示第六像素点的像素值。 Wherein, the process of weighted fusion includes: determining the fifth product of the pixel value of the fourth pixel point and the fourth weight, and determining the sixth product of the pixel value of the fifth pixel point and the fifth weight; The sum value of the six products is determined as the pixel value of the sixth pixel point. That is, the following fusion formula is used to determine the pixel value of the sixth pixel: S6=S5*Alpha 3 +S4*(1-Alpha 3 ), wherein Alpha 3 represents the fifth weight of the fifth pixel, that is, the third Adjustment parameter, 1-Alpha 3 represents the fourth weight of the fourth pixel, S4 represents the pixel value of the fourth pixel, S5 represents the pixel value of the fifth pixel, and S6 represents the pixel value of the sixth pixel.
其中,第三调节参数Alpha 3是由用户输入、机器输入或自动生成的,例如第三调节参数的大小可由用户在终端界面上自行调节。由于第五像素点的第五权重以及第四像素点的第四权重均由Alpha 3确定,因此色彩增强的强度可以根据需要自行调节,提高调节灵活度。另外,第六像素点的像素值仅与位置对应的第四像素点和第五像素点的像素值有关,与其它像素点的像素值无关,因此能够独立计算得到各第六像素点的像素值,无需进行全图信息的计算,从而提高计算效率,实现对图像的实时处理。 Wherein, the third adjustment parameter Alpha 3 is input by the user, input by the machine or automatically generated, for example, the size of the third adjustment parameter can be adjusted by the user on the terminal interface. Since the fifth weight of the fifth pixel point and the fourth weight of the fourth pixel point are both determined by Alpha 3 , the intensity of color enhancement can be adjusted according to needs, which improves the flexibility of adjustment. In addition, the pixel value of the sixth pixel point is only related to the pixel value of the fourth pixel point and the fifth pixel point corresponding to the position, and has nothing to do with the pixel value of other pixel points, so the pixel value of each sixth pixel point can be calculated independently , there is no need to calculate the whole image information, so as to improve the calculation efficiency and realize the real-time processing of the image.
步骤S37,基于第六像素点的像素值,生成第六图像。Step S37, generating a sixth image based on the pixel value of the sixth pixel.
其中,一个第六像素点对应一个第四像素点,该第六像素点与该第四像素点在图像中的位置相同,通过执行上述步骤S34至步骤S36,能够得到每个第四像素点对应的第六像素点的像素值,每个第六像素点的像素值按照位置排列,构成第六图像。Wherein, a sixth pixel corresponds to a fourth pixel, and the sixth pixel and the fourth pixel have the same position in the image. By performing the above steps S34 to S36, it can be obtained that each fourth pixel corresponds to The pixel value of the sixth pixel point, the pixel value of each sixth pixel point is arranged according to the position, and constitutes a sixth image.
需要说明的是,上述实施例描述了在生成第四图像后,对第四图像进行色彩增强的过程,同理,在另一些实施例中,也可以对已生成的第二图像或第三图像进行色彩增强。其中,对任一已生成的图像进行色彩增强处理的过程与上述步骤31至步骤37同理,在此不再赘述。It should be noted that the above embodiments describe the process of performing color enhancement on the fourth image after the fourth image is generated. Similarly, in other embodiments, the generated second image or third image may also be Do color enhancement. The process of performing color enhancement processing on any generated image is the same as the above-mentioned steps 31 to 37, and will not be repeated here.
在一些实施例中,参照图4,在生成第六图像后,还对第六图像进行去雾,以提高图像的清晰度,也即是,步骤S37之后还包括以下步骤:In some embodiments, referring to FIG. 4 , after the sixth image is generated, the sixth image is further dehazed to improve the clarity of the image, that is, the following steps are included after step S37:
步骤S41,获取第六图像中第六像素点的高频信息。Step S41, acquiring high-frequency information of the sixth pixel in the sixth image.
其中,第六像素点为第六图像中的任意一个像素点。高频信息表示第六像素点与其周围的像素点相比,像素值变化的剧烈程度。高频信息也即是指高频分量,高频分量越大,表示第六像素点与其周围的像素点相比,像素值变化越剧烈,第六像素点的像素值用于表示第六图像的边缘细节;高频分量越小,表示第六像素点与其周围的像素点相比,像素值变化越平缓。Wherein, the sixth pixel is any pixel in the sixth image. The high-frequency information indicates the sharpness of the pixel value change between the sixth pixel and its surrounding pixels. High-frequency information also refers to high-frequency components. The larger the high-frequency component is, the more severe the pixel value of the sixth pixel is compared to its surrounding pixels, and the pixel value of the sixth pixel is used to represent the sixth image. Edge details; the smaller the high-frequency component, the smoother the pixel value change of the sixth pixel is compared with its surrounding pixels.
步骤S42,基于第六像素点的高频信息,确定第六像素点的目标模糊半径。Step S42, determining the target blur radius of the sixth pixel based on the high frequency information of the sixth pixel.
在本公开实施例中,对第六图像进行去雾的过程类似于带色彩恢复的多尺度视网膜增强算法(MSRCR),本公开实施例与MSRCR最大的不同在于,所选用的模糊半径并非固定值,而是基于第六像素点的高频信息选取不同的模糊半径。In the embodiment of the present disclosure, the process of dehazing the sixth image is similar to the multi-scale retina enhancement algorithm with color recovery (MSRCR). The biggest difference between the embodiment of the present disclosure and MSRCR is that the selected blur radius is not a fixed value , but select different blur radii based on the high-frequency information of the sixth pixel.
在一些实施例中,根据高频分量的大小来确定目标模糊半径,高频分量与目标模糊半径呈负相关关系。例如,高频分量越大则选取较小的目标模糊半径,以应用较小的去雾强度,既实现去雾,又避免图像的边缘细节丢失;反之高频分量越小则选取较大的目标模糊半径,以应用较大的去雾强度,提高图像的清晰度。In some embodiments, the target blur radius is determined according to the size of the high frequency component, and the high frequency component has a negative correlation with the target blur radius. For example, the larger the high-frequency component is, the smaller the target blur radius is to apply a smaller dehazing intensity, which not only achieves dehazing, but also avoids the loss of edge details of the image; on the contrary, the smaller the high-frequency component is, the larger the target is selected. Blur Radius to apply a larger dehazing strength, improving the clarity of the image.
步骤S43,基于模糊半径与环境光照射分量的对应关系,确定与第六像素点的目标模糊半径对应的目标环境光照射分量。Step S43 , based on the corresponding relationship between the blur radius and the ambient light illumination component, determine the target ambient light illumination component corresponding to the target blur radius of the sixth pixel point.
在一些实施例中,预先采用不同的模糊半径如3*3、5*5、7*7、9*9、11*11,分别对第六图像进行高斯模糊,得到对应的环境光照射分量如L3*3、L5*5、L7*7、L9*9、L11*11,建立模糊半径与环境光照射分量的对应关系。在需要确定目标模糊半径对应的目标环境光照射分量时,基于已建立的该对应关系,确定与目标模糊半径对应的目标环境光照射分量。In some embodiments, different blur radii such as 3*3, 5*5, 7*7, 9*9, 11*11 are used in advance to perform Gaussian blurring on the sixth image respectively, to obtain the corresponding ambient light illumination components such as L3*3, L5*5, L7*7, L9*9, L11*11, establish the corresponding relationship between the blur radius and the ambient light illumination component. When the target ambient light illumination component corresponding to the target blur radius needs to be determined, the target ambient light illumination component corresponding to the target blur radius is determined based on the established correspondence.
在一些实施例中,在确定目标模糊半径后,基于该目标模糊半径,对第六图像进行高斯模糊,得到目标环境光照射分量。In some embodiments, after the target blur radius is determined, Gaussian blur is performed on the sixth image based on the target blur radius to obtain the target ambient light illumination component.
步骤S44,基于第六像素点的像素值以及目标环境光照射分量,确定第七像素点的像素值。Step S44 , determining the pixel value of the seventh pixel point based on the pixel value of the sixth pixel point and the target ambient light illumination component.
在一些实施例中,根据以下公式计算第七像素点的像素值,log(S7)=log(S6)-log(L w*w),S7表示第七像素点的像素值,S6表示第六像素点的像素值,L w*w表示第六像素点的目标环境光照射分量。 In some embodiments, the pixel value of the seventh pixel is calculated according to the following formula, log(S7)=log(S6)-log(L w*w ), S7 represents the pixel value of the seventh pixel, and S6 represents the sixth pixel The pixel value of the pixel point, L w*w represents the target ambient light illumination component of the sixth pixel point.
由于第七像素点的像素值仅与对应的第六像素点的像素值以及目标环境光照射分量有关,与其它像素点无关,因此能够独立计算得到各第七像素点的像素值,无需进行全图信息的计算,从而提高计算效率,实现对图像的实时处理。Since the pixel value of the seventh pixel is only related to the pixel value of the corresponding sixth pixel and the target ambient light illumination component, and has nothing to do with other pixels, the pixel value of each seventh pixel can be calculated independently, without the need for full Calculation of image information, thereby improving computing efficiency and realizing real-time processing of images.
步骤S45,基于第七像素点的像素值,生成第七图像。Step S45 , generating a seventh image based on the pixel value of the seventh pixel.
其中,一个第七像素点对应一个第六像素点,该第七像素点与该第六像素点在图像中的位置相同,通过执行上述步骤S41至步骤S44,能够得到每个第六像素点对应的第七像素点的像素值,每个第七像素点的像素值按照位置排列,构成第七图像。Wherein, a seventh pixel corresponds to a sixth pixel, and the seventh pixel and the sixth pixel have the same position in the image. By performing the above steps S41 to S44, it is possible to obtain the correspondence of each sixth pixel The pixel value of the seventh pixel point of , and the pixel value of each seventh pixel point is arranged according to the position to form a seventh image.
在色彩增强后的图像的某局部亮度值过于集中在中部段的情况下,该局部可能会呈现均匀提亮的效果,肉眼观察图像有雾化的视觉效果。通过对色彩增强后的图像进行光照补偿,实现去雾,从而进一步提高图像的清晰度,提升图像的视觉效果。If the brightness value of a certain part of the color-enhanced image is too concentrated in the middle section, the part may show a uniform brightening effect, and the image will have a foggy visual effect when observed with the naked eye. By performing illumination compensation on the color-enhanced image to achieve dehazing, the clarity of the image is further improved and the visual effect of the image is improved.
需要说明的是,上述实施例描述了在生成第六图像后,对第六图像进行去雾的过程,同理,在另一些实施例中,也可以对已生成的第二图像、第三图像、第四图像或第五图像进行去雾。其中,对任一已生成的图像进行去雾的过程与上述步骤41至步骤45同理,在此不再赘述。It should be noted that the above embodiments describe the process of dehazing the sixth image after the sixth image is generated. Similarly, in other embodiments, the generated second image and third image may also be dehazed. , the fourth image, or the fifth image for dehazing. Wherein, the process of defogging any generated image is the same as the above steps 41 to 45, and will not be repeated here.
在一些实施例中,还进一步对已生成的图像进行锐化和去噪等处理中的至少一种。例如,还对已生成的图像进行锐化;或者,还对已生成的图像进行去噪;或者,还对已生成的图像进行锐化和去噪。例如,采用Laplacian滤波方法,对已生成的图像进行锐化,得到第八图像,实现高频细节的增强。In some embodiments, at least one of processing such as sharpening and denoising is further performed on the generated image. For example, the generated image is also sharpened; or the generated image is also denoised; or the generated image is also sharpened and denoised. For example, the Laplacian filtering method is used to sharpen the generated image to obtain the eighth image, which realizes the enhancement of high-frequency details.
在对暗处进行提亮的过程中,会将设备中的彩色噪声进一步增强,损害生成图像的肉眼视觉效果。因此,在一些实施例中,为了消除噪声的影响,还进一步获取已生成的图像中各像素点的红色通道值、蓝色通道值以及绿色通道值;再对已生成的图像中各像素点的红色通道值、蓝色通道值以及绿色通道值分别进行去噪,得到最终图像。The process of brightening dark areas further enhances the color noise in the device, impairing the visual effect of the resulting image to the naked eye. Therefore, in some embodiments, in order to eliminate the influence of noise, the red channel value, blue channel value and green channel value of each pixel in the generated image are further obtained; The red channel value, blue channel value and green channel value are denoised separately to obtain the final image.
在一些实施例中,对已生成的图像中各像素点的RGB三通道分别进行去噪,提高图像质量。去噪可采用任意合适方法,比如NL-means、三维块匹配算法(BM3D)等。In some embodiments, the three RGB channels of each pixel in the generated image are denoised respectively to improve image quality. Any suitable method can be used for denoising, such as NL-means, three-dimensional block matching algorithm (BM3D), and so on.
本公开实施例提供的图像处理方法,在有效提亮暗部的同时抑制高光过曝,同时还能实现图像的纹理和色彩增强,提升图像结构的层次感和最终成像的视觉效果,提高了图像质量;并且能够做到实时处理,提高了图像处理效率,实现在拍摄窗口中实时预览。The image processing method provided by the embodiments of the present disclosure can effectively brighten the dark parts while suppressing overexposure of highlights, and at the same time, it can enhance the texture and color of the image, improve the layering of the image structure and the visual effect of the final imaging, and improve the image quality ; And can achieve real-time processing, improve the efficiency of image processing, and achieve real-time preview in the shooting window.
图6是根据一示例性实施例示出的一种图像处理装置框图。参照图6,该图像处理装置包括:Fig. 6 is a block diagram of an image processing apparatus according to an exemplary embodiment. 6, the image processing apparatus includes:
图像获取模块61,被配置为获取原始图像;an image acquisition module 61, configured to acquire an original image;
亮度增强模块62,被配置为对原始图像的亮度进行增强,得到第一图像;The brightness enhancement module 62 is configured to enhance the brightness of the original image to obtain the first image;
权重确定模块63,被配置为基于原始图像中原始像素点的像素值,确定第一图像中第一像素点的第一权重以及原始像素点的原始权重,其中,原始权重与第一权重的和值为1,第一权重与原始像素点的像素值呈负相关关系;The weight determination module 63 is configured to determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the sum of the original weight and the first weight The value is 1, and the first weight is negatively correlated with the pixel value of the original pixel;
第一融合模块64,被配置为基于原始权重以及第一权重,对原始像素点的像素值和第一像素点的像素值进行加权融合,得到第二像素点的像素值;The first fusion module 64 is configured to perform weighted fusion on the pixel value of the original pixel point and the pixel value of the first pixel point based on the original weight and the first weight to obtain the pixel value of the second pixel point;
图像生成模块65,被配置为基于第二像素点的像素值,生成第二图像。The image generation module 65 is configured to generate a second image based on the pixel values of the second pixel points.
在一些实施例中,权重确定模块63被配置为:基于第一调节参数和原始像素点的像素值,确定第一像素点的第一权重,第一调节参数用于调节对原始图像进行亮度增强的强度,第一调节参数与第一权重呈正相关关系。In some embodiments, the weight determination module 63 is configured to: determine the first weight of the first pixel point based on the first adjustment parameter and the pixel value of the original pixel point, where the first adjustment parameter is used to adjust the brightness enhancement of the original image The strength of the first adjustment parameter is positively correlated with the first weight.
在一些实施例中,权重确定模块63被配置为:In some embodiments, weight determination module 63 is configured to:
根据以下公式确定第一像素点的第一权重,Alpha 1=α 1(1-β 1*(x γ-x γ+1)),其中,Alpha 1表示第一像素点的第一权重,α 1表示第一调节参数,x表示原始像素点的像素值,β 1表示第一常量,γ表示第二常量。 The first weight of the first pixel is determined according to the following formula, Alpha 11 (1-β 1 *(x γ -x γ+1 )), where Alpha 1 represents the first weight of the first pixel, α 1 represents the first adjustment parameter, x represents the pixel value of the original pixel point, β 1 represents the first constant, and γ represents the second constant.
在一些实施例中,该图像处理装置还包括:In some embodiments, the image processing apparatus further includes:
纹理增强模块,被配置为基于第二图像中第二像素点的像素值,对第二图像进行纹理增强,得到第三图像。The texture enhancement module is configured to perform texture enhancement on the second image based on the pixel value of the second pixel in the second image to obtain a third image.
在一些实施例中,纹理增强模块被配置为:In some embodiments, the texture enhancement module is configured to:
在第二像素点的像素值小于或等于第一阈值的情况下,减小第二像素点的像素值,得到第三图像中第三像素点的像素值;When the pixel value of the second pixel is less than or equal to the first threshold, reducing the pixel value of the second pixel to obtain the pixel value of the third pixel in the third image;
在第二像素点的像素值大于第二阈值的情况下,增大第二像素点的像素值,得到第三像素点的像素值。When the pixel value of the second pixel point is greater than the second threshold, the pixel value of the second pixel point is increased to obtain the pixel value of the third pixel point.
在一些实施例中,第一阈值小于或等于0.5,纹理增强模块被配置为:根据以下公式确定第三像素点的像素值:S3=2*S2*S2;其中,S2表示第二像素点的像素值,S3表示第三像素点的像素值。In some embodiments, the first threshold value is less than or equal to 0.5, and the texture enhancement module is configured to: determine the pixel value of the third pixel point according to the following formula: S3=2*S2*S2; wherein, S2 represents the second pixel point pixel value, S3 represents the pixel value of the third pixel point.
在一些实施例中,第二阈值大于或等于0.5,纹理增强模块被配置为:根据以下公式确定第三像素点的像素值:S3=1-2*(1-S2)*(1-S2);其中,S2表示第二像素点的像素值,S3表示第三像素点的像素值。In some embodiments, the second threshold is greater than or equal to 0.5, and the texture enhancement module is configured to: determine the pixel value of the third pixel point according to the following formula: S3=1-2*(1-S2)*(1-S2) ; wherein, S2 represents the pixel value of the second pixel point, and S3 represents the pixel value of the third pixel point.
在一些实施例中,该图像处理装置还包括:In some embodiments, the image processing apparatus further includes:
第二融合模块,被配置为:The second fusion module, configured as:
基于原始像素点的像素值,确定第二像素点的第二权重以及第三图像中第三像素点的第三权重,其中,第二权重与第三权重的和值为1,第二权重随原始像素点的像素值发生变化的关系呈下凸函数关系;Based on the pixel value of the original pixel point, the second weight of the second pixel point and the third weight of the third pixel point in the third image are determined, wherein the sum of the second weight and the third weight is 1, and the second weight varies with The relationship between the changes of the pixel values of the original pixel points is a downward convex function relationship;
基于第二权重以及第三权重,对第二像素点的像素值和第三像素点的像素值进行加权融合,得到第四像素点的像素值;Based on the second weight and the third weight, weighted fusion is performed on the pixel value of the second pixel point and the pixel value of the third pixel point to obtain the pixel value of the fourth pixel point;
基于第四像素点的像素值,生成第四图像。Based on the pixel value of the fourth pixel point, a fourth image is generated.
在一些实施例中,第二融合模块被配置为基于第二调节参数和原始像素点的像素值,确定第二像素点的第二权重,第二调节参数用于调节对第二图像进行纹理增强的强度,第 二调节参数与第二权重呈正相关关系。In some embodiments, the second fusion module is configured to determine the second weight of the second pixel point based on the second adjustment parameter and the pixel value of the original pixel point, the second adjustment parameter is used to adjust the texture enhancement of the second image The strength of the second adjustment parameter is positively correlated with the second weight.
在一些实施例中,第二融合模块被配置为:In some embodiments, the second fusion module is configured to:
根据以下公式确定第二像素点的第二权重,Alpha 2=α 2(1-β 2*x*(1-x)),Alpha 2表示第二像素点的第二权重,α 2表示第二调节参数,x表示原始像素点的像素值,β 2表示第三常量。 The second weight of the second pixel is determined according to the following formula, Alpha 22 (1-β 2 *x*(1-x)), Alpha 2 represents the second weight of the second pixel, and α 2 represents the second weight Adjustment parameters, x represents the pixel value of the original pixel point, β 2 represents the third constant.
在一些实施例中,该图像处理装置还包括:In some embodiments, the image processing apparatus further includes:
色彩增强模块,被配置为:Color enhancement module, configured as:
获取第四像素点的红色通道值、蓝色通道值以及绿色通道值;Get the red channel value, blue channel value and green channel value of the fourth pixel;
基于色彩查找表,对第四像素点的红色通道值、蓝色通道值以及绿色通道值分别进行校正,得到第五像素点的红色通道值、蓝色通道值以及绿色通道值;Based on the color lookup table, the red channel value, the blue channel value and the green channel value of the fourth pixel are respectively corrected to obtain the red channel value, the blue channel value and the green channel value of the fifth pixel;
基于第五像素点的红色通道值、蓝色通道值以及绿色通道值,生成第五图像。A fifth image is generated based on the red channel value, the blue channel value and the green channel value of the fifth pixel.
在一些实施例中,该图像处理装置还包括:In some embodiments, the image processing apparatus further includes:
第三融合模块,被配置为:The third fusion module, configured as:
获取第三调节参数,第三调节参数用于调节对已生成的图像进行色彩增强的强度;obtaining a third adjustment parameter, where the third adjustment parameter is used to adjust the intensity of color enhancement of the generated image;
基于第三调节参数,确定第四像素点的第四权重以及第五像素点的第五权重,其中,第四权重与第五权重的和值为1;determining the fourth weight of the fourth pixel point and the fifth weight of the fifth pixel point based on the third adjustment parameter, wherein the sum of the fourth weight and the fifth weight is 1;
基于第四权重以及第五权重,对第四像素点的像素值和第五像素点的像素值进行加权融合,得到第六像素点的像素值;Based on the fourth weight and the fifth weight, weighted fusion is performed on the pixel value of the fourth pixel point and the pixel value of the fifth pixel point to obtain the pixel value of the sixth pixel point;
基于第六像素点的像素值,生成第六图像。Based on the pixel value of the sixth pixel point, a sixth image is generated.
在一些实施例中,该图像处理装置还包括:In some embodiments, the image processing apparatus further includes:
光照补偿模块,被配置为:Light compensation module, configured as:
获取第六图像中第六像素点的高频信息;obtaining high-frequency information of the sixth pixel in the sixth image;
基于第六像素点的高频信息,确定第六像素点的目标模糊半径;Determine the target blur radius of the sixth pixel based on the high-frequency information of the sixth pixel;
基于模糊半径与环境光照射分量的对应关系,确定与目标模糊半径对应的目标环境光照射分量;Based on the correspondence between the blur radius and the ambient light illumination component, determine the target ambient light illumination component corresponding to the target blur radius;
基于第六像素点的像素值以及目标环境光照射分量,确定第七像素点的像素值;Determine the pixel value of the seventh pixel point based on the pixel value of the sixth pixel point and the target ambient light illumination component;
基于第七像素点的像素值,生成第七图像。Based on the pixel value of the seventh pixel point, a seventh image is generated.
在一些实施例中,光照补偿模块被配置为:In some embodiments, the illumination compensation module is configured to:
根据以下公式确定第七像素点的像素值,log(S7)=log(S6)-log(L w*w),S7表示第七像素点的像素值,S6表示第六像素点的像素值,L w*w表示目标环境光照射分量。 Determine the pixel value of the seventh pixel point according to the following formula, log(S7)=log(S6)-log(L w*w ), S7 represents the pixel value of the seventh pixel point, S6 represents the pixel value of the sixth pixel point, L w*w represents the target ambient light illumination component.
关于上述实施例中的装置,其中各个模块执行操作的方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiments, the manner in which each module performs operations has been described in detail in the embodiments of the method, and will not be described in detail here.
图7是本公开示出的一种电子设备700的框图。例如,电子设备700是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备或者个人数字助理等。FIG. 7 is a block diagram of an electronic device 700 shown in the present disclosure. For example, electronic device 700 is a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, or personal digital assistant, among others.
参照图7,电子设备700包括以下一个或多个组件:处理组件702,存储器704,电力组件706,多媒体组件708,音频组件710,输入/输出(I/O)的接口712,传感器组件714,以及通信组件716。7, an electronic device 700 includes one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and communication component 716 .
处理组件702通常控制电子设备700的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件702包括一个或处理器720来执行指令,以完成任一实施例的图像处理方法的全部或部分步骤。在一些实施例中,处理组件702还包括一个或模块,便于处理组件702和其他组件之间的交互。例如,处理组件702包括多媒体模块,以方便多媒体组件708和处理组件702之间的交互。The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 includes an OR processor 720 to execute instructions to perform all or part of the steps of the image processing method of any embodiment. In some embodiments, processing component 702 also includes one or a module that facilitates interaction between processing component 702 and other components. For example, processing component 702 includes a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.
存储器704被配置为存储各种类型的数据以支持在设备700的操作。这些数据的示 例包括用于在电子设备700上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器704由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 704 is configured to store various types of data to support operation at device 700 . Examples of such data include instructions for any application or method operating on electronic device 700, contact data, phonebook data, messages, pictures, videos, and the like. Memory 704 is implemented by any type of volatile or nonvolatile storage device or combination thereof, such as static random access memory (SRAM), erasable programmable read only memory (EPROM), programmable read only memory ( PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
电源组件706为电子设备700的各种组件提供电力。电源组件706包括电源管理系统,一个或电源,及其他与为电子设备700生成、管理和分配电力相关联的组件。 Power supply component 706 provides power to various components of electronic device 700 . Power component 706 includes a power management system, an or power source, and other components associated with generating, managing, and distributing power to electronic device 700 .
多媒体组件708包括在电子设备700和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕包括液晶显示器(LCD)和触摸面板(TP)。在屏幕包括触摸面板的情况下,屏幕为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件708包括一个前置摄像头和/或后置摄像头。在设备700处于操作模式,如拍摄模式或视频模式的情况下,前置摄像头和/或后置摄像头接收外部的多媒体数据。每个前置摄像头和后置摄像头是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 708 includes a screen that provides an output interface between electronic device 700 and the user. In some embodiments, the screen includes a liquid crystal display (LCD) and a touch panel (TP). In the case where the screen includes a touch panel, the screen is a touch screen to receive input signals from a user. The touch panel includes an or touch sensor to sense touch, swipe, and gestures on the touch panel. A touch sensor not only senses the boundaries of a touch or swipe action, but also detects the duration and pressure associated with the touch or swipe action. In some embodiments, multimedia component 708 includes a front-facing camera and/or a rear-facing camera. When the device 700 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera receive external multimedia data. Each front and rear camera is a fixed optical lens system or has focal length and optical zoom capability.
音频组件710被配置为输出和/或输入音频信号。例如,音频组件710包括一个麦克风(MIC),在电子设备700处于操作模式,如呼叫模式、记录模式和语音识别模式的情况下,麦克风被配置为接收外部音频信号。所接收的音频信号被进一步存储在存储器704或经由通信组件716发送。在一些实施例中,音频组件710还包括一个扬声器,用于输出音频信号。 Audio component 710 is configured to output and/or input audio signals. For example, audio component 710 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 700 is in operating modes, such as calling mode, recording mode, and voice recognition mode. The received audio signal is further stored in memory 704 or transmitted via communication component 716 . In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
I/O接口712为处理组件702和外围接口模块之间提供接口,上述外围接口模块是键盘,点击轮或者按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 712 provides an interface between the processing component 702 and a peripheral interface module, such as a keyboard, a click wheel or a button, and the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
传感器组件714包括一个或传感器,用于为电子设备700提供各个方面的状态评估。例如,传感器组件714检测到设备700的打开/关闭状态,组件的相对定位,例如组件为电子设备700的显示器和小键盘,传感器组件714还检测电子设备700或电子设备700一个组件的位置改变,用户与电子设备700接触的存在或不存在,电子设备700方位或加速/减速和电子设备700的温度变化。传感器组件714包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件714还包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件714还包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 714 includes one or a sensor for providing status assessment of various aspects of electronic device 700 . For example, the sensor assembly 714 detects the open/closed state of the device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, the sensor assembly 714 also detects a change in the position of the electronic device 700 or a component of the electronic device 700, The presence or absence of user contact with the electronic device 700 , the orientation or acceleration/deceleration of the electronic device 700 and the temperature change of the electronic device 700 . Sensor assembly 714 includes a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 714 also includes a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 also includes an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件716被配置为便于电子设备700和其他设备之间有线或无线方式的通信。电子设备700接入基于通信标准的无线网络,如WiFi,运营商网络(如2G、3G、4G或5G),或它们的组合。在一个示例性实施例中,通信组件716经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件716还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices. The electronic device 700 accesses a wireless network based on a communication standard, such as WiFi, a carrier network (eg, 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 716 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备700被一个或应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行任一实施例的图像处理方法。In the exemplary embodiment, electronic device 700 is implemented by one or an application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components implemented for performing the image processing method of any of the embodiments.
本公开的实施例还提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,处理器被配置为执行上述指令,以实现如下操作:获取原始图像;对原始图像的亮度进行增强,得到第一图像;基于原始图像中原始像素点的像素值,确定第一 图像中第一像素点的第一权重以及原始像素点的原始权重,其中,原始权重与第一权重的和值为1,第一权重与原始像素点的像素值呈负相关关系;基于原始权重以及第一权重,对原始像素点的像素值和第一像素点的像素值进行加权融合,得到第二像素点的像素值;基于第二像素点的像素值,生成第二图像。Embodiments of the present disclosure also provide an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the above instructions to achieve the following operations: acquiring an original image; The brightness of the original image is enhanced to obtain the first image; based on the pixel value of the original pixel in the original image, the first weight of the first pixel in the first image and the original weight of the original pixel are determined, wherein the original weight is the same as the first weight. The sum value of a weight is 1, and the first weight has a negative correlation with the pixel value of the original pixel point; based on the original weight and the first weight, the pixel value of the original pixel point and the pixel value of the first pixel point are weighted and fused, The pixel value of the second pixel point is obtained; based on the pixel value of the second pixel point, a second image is generated.
在一些实施例中,处理器还被配置为执行上述指令,以实现上述方法实施例中的其他实施例提供的图像处理方法。In some embodiments, the processor is further configured to execute the above-mentioned instructions, so as to implement the image processing methods provided by other embodiments of the above-mentioned method embodiments.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器704,上述指令可由电子设备700的处理器720执行以完成任一实施例的图像处理方法。例如,非临时性计算机可读存储介质是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as memory 704 including instructions, executable by the processor 720 of the electronic device 700 to complete the image of any of the embodiments Approach. For example, the non-transitory computer-readable storage medium is ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
本公开实施例还提供了一种存储介质,计算机可读存储介质中的指令由电子设备的处理器执行,使得电子设备能够执行以下步骤:获取原始图像;对原始图像的亮度进行增强,得到第一图像;基于原始图像中原始像素点的像素值,确定第一图像中第一像素点的第一权重以及原始像素点的原始权重,其中,原始权重与第一权重的和值为1,第一权重与原始像素点的像素值呈负相关关系;基于原始权重以及第一权重,对原始像素点的像素值和第一像素点的像素值进行加权融合,得到第二像素点的像素值;基于第二像素点的像素值,生成第二图像。Embodiments of the present disclosure also provide a storage medium, where the instructions in the computer-readable storage medium are executed by a processor of an electronic device, so that the electronic device can perform the following steps: acquiring an original image; enhancing the brightness of the original image to obtain the first An image; based on the pixel value of the original pixel in the original image, determine the first weight of the first pixel in the first image and the original weight of the original pixel, wherein the sum of the original weight and the first weight is 1, and the first weight is 1. A weight is negatively correlated with the pixel value of the original pixel point; based on the original weight and the first weight, the pixel value of the original pixel point and the pixel value of the first pixel point are weighted and fused to obtain the pixel value of the second pixel point; Based on the pixel values of the second pixel points, a second image is generated.
在一些实施例中,计算机可读存储介质中的指令由电子设备的处理器执行,使得电子设备能够执行上述方法实施例中的其他实施例提供的图像处理方法。In some embodiments, the instructions in the computer-readable storage medium are executed by the processor of the electronic device, so that the electronic device can execute the image processing methods provided in other embodiments of the foregoing method embodiments.
在示例性实施例中,还提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序可由电子设备700的处理器720执行以完成任一实施例的图像处理方法。在一些实施例中,该计算机程序存储在电子设备700的存储介质中,计算机可读存储介质是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a computer program product is also provided, the computer program product includes a computer program, and the computer program can be executed by the processor 720 of the electronic device 700 to complete the image processing method of any one of the embodiments. In some embodiments, the computer program is stored in a storage medium of electronic device 700, the computer readable storage medium being ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage devices, and the like.
本公开实施例还提供了一种计算机程序产品,包括计算机程序,计算机程序被处理器执行实现以下步骤:获取原始图像;对原始图像的亮度进行增强,得到第一图像;基于原始图像中原始像素点的像素值,确定第一图像中第一像素点的第一权重以及原始像素点的原始权重,其中,原始权重与第一权重的和值为1,第一权重与原始像素点的像素值呈负相关关系;基于原始权重以及第一权重,对原始像素点的像素值和第一像素点的像素值进行加权融合,得到第二像素点的像素值;基于第二像素点的像素值,生成第二图像。Embodiments of the present disclosure also provide a computer program product, including a computer program, the computer program being executed by a processor to implement the following steps: acquiring an original image; enhancing the brightness of the original image to obtain a first image; based on the original pixels in the original image The pixel value of the point, to determine the first weight of the first pixel in the first image and the original weight of the original pixel, where the sum of the original weight and the first weight is 1, and the first weight and the pixel value of the original pixel A negative correlation; based on the original weight and the first weight, the pixel value of the original pixel point and the pixel value of the first pixel point are weighted and fused to obtain the pixel value of the second pixel point; based on the pixel value of the second pixel point, Generate a second image.
在一些实施例中,计算机程序被处理器执行,使得处理器能够执行上述方法实施例中的其他实施例提供的图像处理方法。In some embodiments, the computer program is executed by the processor, so that the processor can execute the image processing methods provided by other embodiments of the above method embodiments.
图8是本公开示出的一种电子设备800的框图。例如,电子设备800被提供为一服务器。FIG. 8 is a block diagram of an electronic device 800 shown in the present disclosure. For example, the electronic device 800 is provided as a server.
参照图8,电子设备800包括处理组件822,其进一步包括一个或处理器,以及由存储器832所代表的存储器资源,用于存储可由处理组件822的执行的指令,例如应用程序。存储器832中存储的应用程序包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件822被配置为执行指令,以执行任一实施例的图像处理方法。8, electronic device 800 includes processing component 822, which further includes an OR processor, and a memory resource represented by memory 832 for storing instructions executable by processing component 822, such as applications. The application program stored in memory 832 includes one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 822 is configured to execute instructions to perform the image processing method of any of the embodiments.
电子设备800还包括一个电源组件826被配置为执行电子设备800的电源管理,一个有线或无线网络接口850被配置为将电子设备800连接到网络,和一个输入输出(I/O)接口858。电子设备800操作基于存储在存储器832的操作系统,例如WindowsServerTM,MacOSXTM,UnixTM,LinuxTM,FreeBSDTM或类似。The electronic device 800 also includes a power supply assembly 826 configured to perform power management of the electronic device 800, a wired or wireless network interface 850 configured to connect the electronic device 800 to a network, and an input output (I/O) interface 858. Electronic device 800 operates based on an operating system stored in memory 832, such as WindowsServerTM, MacOSXTM, UnixTM, LinuxTM, FreeBSDTM or the like.
本公开所有实施例均可以单独被执行,也可以与其他实施例相结合被执行,均视为本公开要求的保护范围。All the embodiments of the present disclosure can be implemented independently or in combination with other embodiments, which are all regarded as the protection scope required by the present disclosure.

Claims (31)

  1. 一种图像处理方法,所述方法包括:An image processing method, the method comprising:
    获取原始图像;get the original image;
    对所述原始图像的亮度进行增强,得到第一图像;enhancing the brightness of the original image to obtain a first image;
    基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;Determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original weight and the first weight The sum value is 1, and the first weight is negatively correlated with the pixel value of the original pixel point;
    基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;Based on the original weight and the first weight, weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
    基于所述第二像素点的像素值,生成第二图像。Based on the pixel values of the second pixel points, a second image is generated.
  2. 根据权利要求1所述的图像处理方法,其中,所述基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重的步骤,包括:The image processing method according to claim 1, wherein the step of determining the first weight of the first pixel in the first image based on the pixel value of the original pixel in the original image comprises:
    基于第一调节参数和所述原始像素点的像素值,确定所述第一像素点的第一权重,所述第一调节参数用于调节对所述原始图像进行亮度增强的强度,所述第一调节参数与所述第一权重呈正相关关系。A first weight of the first pixel is determined based on a first adjustment parameter and the pixel value of the original pixel, the first adjustment parameter is used to adjust the intensity of brightness enhancement for the original image, and the first weight is used to adjust the intensity of the original image. An adjustment parameter is positively correlated with the first weight.
  3. 根据权利要求2所述的图像处理方法,其中,所述基于第一调节参数和所述原始像素点的像素值,确定所述第一像素点的第一权重的步骤,包括:The image processing method according to claim 2, wherein the step of determining the first weight of the first pixel point based on the first adjustment parameter and the pixel value of the original pixel point comprises:
    根据以下公式确定所述第一像素点的第一权重,Alpha 1=α 1(1-β 1*(x γ-x γ+1)),其中,所述Alpha 1表示所述第一像素点的第一权重,所述α 1表示所述第一调节参数,所述x表示所述原始像素点的像素值,所述β 1表示第一常量,所述γ表示第二常量。 The first weight of the first pixel is determined according to the following formula, Alpha 11 (1-β 1 *(x γ -x γ+1 )), where the Alpha 1 represents the first pixel The first weight of , the α 1 represents the first adjustment parameter, the x represents the pixel value of the original pixel point, the β 1 represents the first constant, and the γ represents the second constant.
  4. 根据权利要求1-3任一项所述的图像处理方法,其中,所述图像处理方法还包括:The image processing method according to any one of claims 1-3, wherein the image processing method further comprises:
    基于所述第二图像中所述第二像素点的像素值,对所述第二图像进行纹理增强,得到第三图像。Based on the pixel values of the second pixel points in the second image, texture enhancement is performed on the second image to obtain a third image.
  5. 根据权利要求4所述的图像处理方法,其中,所述基于所述第二图像中所述第二像素点的像素值,对所述第二图像进行纹理增强,得到第三图像的步骤,包括:The image processing method according to claim 4, wherein the step of performing texture enhancement on the second image based on the pixel values of the second pixels in the second image to obtain the third image comprises the following steps: :
    在所述第二像素点的像素值小于或等于第一阈值的情况下,减小所述第二像素点的像素值,得到所述第三图像中第三像素点的像素值;In the case that the pixel value of the second pixel point is less than or equal to the first threshold, reducing the pixel value of the second pixel point to obtain the pixel value of the third pixel point in the third image;
    在所述第二像素点的像素值大于第二阈值的情况下,增大所述第二像素点的像素值,得到所述第三像素点的像素值。When the pixel value of the second pixel point is greater than the second threshold, the pixel value of the second pixel point is increased to obtain the pixel value of the third pixel point.
  6. 根据权利要求5所述的方法,其中,所述第一阈值小于或等于0.5,所述减小所述第二像素点的像素值,得到所述第三图像中第三像素点的像素值的步骤,包括:The method according to claim 5, wherein the first threshold value is less than or equal to 0.5, and the reduction of the pixel value of the second pixel point obtains the difference between the pixel value of the third pixel point in the third image steps, including:
    根据以下公式确定所述第三像素点的像素值:S3=2*S2*S2;Determine the pixel value of the third pixel point according to the following formula: S3=2*S2*S2;
    其中,所述S2表示所述第二像素点的像素值,所述S3表示所述第三像素点的像素值。Wherein, the S2 represents the pixel value of the second pixel point, and the S3 represents the pixel value of the third pixel point.
  7. 根据权利要求5所述的方法,其中,所述第二阈值大于或等于0.5,所述增大所述第二像素点的像素值,得到所述第三像素点的像素值的步骤,包括:The method according to claim 5, wherein the second threshold value is greater than or equal to 0.5, and the step of increasing the pixel value of the second pixel point to obtain the pixel value of the third pixel point comprises:
    根据以下公式确定所述第三像素点的像素值:S3=1-2*(1-S2)*(1-S2);Determine the pixel value of the third pixel point according to the following formula: S3=1-2*(1-S2)*(1-S2);
    其中,所述S2表示所述第二像素点的像素值,所述S3表示所述第三像素点的像素值。Wherein, the S2 represents the pixel value of the second pixel point, and the S3 represents the pixel value of the third pixel point.
  8. 根据权利要求4所述的图像处理方法,其中,所述图像处理方法还包括:The image processing method according to claim 4, wherein the image processing method further comprises:
    基于所述原始像素点的像素值,确定所述第二像素点的第二权重以及所述第三图像中第三像素点的第三权重,其中,所述第二权重与所述第三权重的和值为1,所述第二权 重随所述原始像素点的像素值发生变化的关系呈下凸函数关系;Based on the pixel value of the original pixel point, a second weight of the second pixel point and a third weight of the third pixel point in the third image are determined, wherein the second weight and the third weight The sum value is 1, and the relationship between the second weight and the pixel value of the original pixel point is a downward convex function relationship;
    基于所述第二权重以及所述第三权重,对所述第二像素点的像素值和所述第三像素点的像素值进行加权融合,得到第四像素点的像素值;Based on the second weight and the third weight, weighted fusion is performed on the pixel value of the second pixel point and the pixel value of the third pixel point to obtain the pixel value of the fourth pixel point;
    基于所述第四像素点的像素值,生成第四图像。Based on the pixel values of the fourth pixel points, a fourth image is generated.
  9. 根据权利要求8所述的图像处理方法,其中,所述基于所述原始像素点的像素值,确定所述第二像素点的第二权重的步骤,包括:The image processing method according to claim 8, wherein the step of determining the second weight of the second pixel point based on the pixel value of the original pixel point comprises:
    基于第二调节参数和所述原始像素点的像素值,确定所述第二像素点的第二权重,所述第二调节参数用于调节对所述第二图像进行纹理增强的强度,所述第二调节参数与所述第二权重呈正相关关系。A second weight of the second pixel is determined based on a second adjustment parameter and the pixel value of the original pixel, the second adjustment parameter is used to adjust the intensity of texture enhancement for the second image, the The second adjustment parameter has a positive correlation with the second weight.
  10. 根据权利要求9所述的图像处理方法,其中,所述基于第二调节参数和所述原始像素点的像素值,确定所述第二像素点的第二权重的步骤,包括:The image processing method according to claim 9, wherein the step of determining the second weight of the second pixel point based on the second adjustment parameter and the pixel value of the original pixel point comprises:
    根据以下公式确定所述第二像素点的第二权重,Alpha 2=α 2(1-β 2*x*(1-x)),所述Alpha 2表示所述第二像素点的第二权重,所述α 2表示所述第二调节参数,所述x表示所述原始像素点的像素值,所述β 2表示第三常量。 The second weight of the second pixel is determined according to the following formula, Alpha 22 (1-β 2 *x*(1-x)), and the Alpha 2 represents the second weight of the second pixel , the α 2 represents the second adjustment parameter, the x represents the pixel value of the original pixel point, and the β 2 represents the third constant.
  11. 根据权利要求8-10任一项所述的图像处理方法,其中,所述图像处理方法还包括:The image processing method according to any one of claims 8-10, wherein the image processing method further comprises:
    获取所述第四像素点的红色通道值、蓝色通道值以及绿色通道值;acquiring the red channel value, the blue channel value and the green channel value of the fourth pixel;
    基于色彩查找表,对所述第四像素点的红色通道值、蓝色通道值以及绿色通道值分别进行校正,得到第五像素点的红色通道值、蓝色通道值以及绿色通道值;Based on the color lookup table, the red channel value, the blue channel value and the green channel value of the fourth pixel are respectively corrected to obtain the red channel value, the blue channel value and the green channel value of the fifth pixel;
    基于所述第五像素点的红色通道值、蓝色通道值以及绿色通道值,生成第五图像。A fifth image is generated based on the red channel value, the blue channel value and the green channel value of the fifth pixel point.
  12. 根据权利要求11所述的图像处理方法,其中,所述图像处理方法还包括:The image processing method according to claim 11, wherein the image processing method further comprises:
    获取第三调节参数,所述第三调节参数用于调节对所述第四图像进行色彩增强的强度;acquiring a third adjustment parameter, where the third adjustment parameter is used to adjust the intensity of color enhancement performed on the fourth image;
    基于所述第三调节参数,确定所述第四像素点的第四权重以及所述第五像素点的第五权重,其中,所述第四权重与所述第五权重的和值为1;determining a fourth weight of the fourth pixel point and a fifth weight of the fifth pixel point based on the third adjustment parameter, wherein the sum of the fourth weight and the fifth weight is 1;
    基于所述第四权重以及所述第五权重,对所述第四像素点的像素值和所述第五像素点的像素值进行加权融合,得到第六像素点的像素值;Based on the fourth weight and the fifth weight, weighted fusion is performed on the pixel value of the fourth pixel point and the pixel value of the fifth pixel point to obtain the pixel value of the sixth pixel point;
    基于所述第六像素点的像素值,生成所述第六图像。The sixth image is generated based on the pixel values of the sixth pixel points.
  13. 根据权利要求12所述的图像处理方法,其中,所述图像处理方法还包括:The image processing method according to claim 12, wherein the image processing method further comprises:
    获取所述第六图像中第六像素点的高频信息;acquiring high-frequency information of the sixth pixel in the sixth image;
    基于所述第六像素点的高频信息,确定所述第六像素点的目标模糊半径;Determine the target blur radius of the sixth pixel based on the high-frequency information of the sixth pixel;
    基于模糊半径与环境光照射分量的对应关系,确定与所述目标模糊半径对应的目标环境光照射分量;Determine the target ambient light illumination component corresponding to the target blur radius based on the correspondence between the blur radius and the ambient light illumination component;
    基于所述第六像素点的像素值以及所述目标环境光照射分量,确定第七像素点的像素值;determining the pixel value of the seventh pixel point based on the pixel value of the sixth pixel point and the target ambient light illumination component;
    基于所述第七像素点的像素值,生成第七图像。Based on the pixel values of the seventh pixel points, a seventh image is generated.
  14. 根据权利要求13所述的图像处理方法,其中,所述基于所述第六像素点的像素值以及所述目标环境光照射分量,确定第七像素点的像素值的步骤,包括:The image processing method according to claim 13, wherein the step of determining the pixel value of the seventh pixel point based on the pixel value of the sixth pixel point and the target ambient light illumination component comprises:
    根据以下公式确定所述第七像素点的像素值,log(S7)=log(S6)-log(L w*w),所述S7表示所述第七像素点的像素值,所述S6表示所述第六像素点的像素值,所述L w*w表示所述目标环境光照射分量。 The pixel value of the seventh pixel is determined according to the following formula, log(S7)=log(S6)-log(L w*w ), the S7 represents the pixel value of the seventh pixel, and the S6 represents The pixel value of the sixth pixel point, and the L w*w represents the illumination component of the target ambient light.
  15. 一种图像处理装置,所述图像处理装置包括:An image processing device, the image processing device comprising:
    图像获取模块,被配置为获取原始图像;an image acquisition module, configured to acquire the original image;
    亮度增强模块,被配置为对所述原始图像的亮度进行增强,得到第一图像;a brightness enhancement module, configured to enhance the brightness of the original image to obtain a first image;
    权重确定模块,被配置为基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述 第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;A weight determination module, configured to determine a first weight of a first pixel in the first image and an original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original The sum of the weight and the first weight is 1, and the first weight has a negative correlation with the pixel value of the original pixel point;
    第一融合模块,被配置为基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;The first fusion module is configured to perform weighted fusion on the pixel value of the original pixel point and the pixel value of the first pixel point based on the original weight and the first weight to obtain the pixel value of the second pixel point value;
    图像生成模块,被配置为基于所述第二像素点的像素值,生成第二图像。The image generation module is configured to generate a second image based on the pixel values of the second pixel points.
  16. 一种电子设备,所述电子设备包括:An electronic device comprising:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
    其中,所述处理器被配置为执行所述指令,以实现如下操作:Wherein, the processor is configured to execute the instructions to achieve the following operations:
    获取原始图像;get the original image;
    对所述原始图像的亮度进行增强,得到第一图像;enhancing the brightness of the original image to obtain a first image;
    基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;Determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original weight and the first weight The sum value is 1, and the first weight is negatively correlated with the pixel value of the original pixel point;
    基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;Based on the original weight and the first weight, weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
    基于所述第二像素点的像素值,生成第二图像。Based on the pixel values of the second pixel points, a second image is generated.
  17. 根据权利要求16所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:17. The electronic device of claim 16, wherein the processor is configured to execute the instructions to:
    基于第一调节参数和所述原始像素点的像素值,确定所述第一像素点的第一权重,所述第一调节参数用于调节对所述原始图像进行亮度增强的强度,所述第一调节参数与所述第一权重呈正相关关系。A first weight of the first pixel is determined based on a first adjustment parameter and the pixel value of the original pixel, the first adjustment parameter is used to adjust the intensity of brightness enhancement for the original image, and the first weight is used to adjust the intensity of the original image. An adjustment parameter is positively correlated with the first weight.
  18. 根据权利要求17所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:18. The electronic device of claim 17, wherein the processor is configured to execute the instructions to:
    根据以下公式确定所述第一像素点的第一权重,Alpha 1=α 1(1-β 1*(x γ-x γ+1)),其中,所述Alpha 1表示所述第一像素点的第一权重,所述α 1表示所述第一调节参数,所述x表示所述原始像素点的像素值,所述β 1表示第一常量,所述γ表示第二常量。 The first weight of the first pixel is determined according to the following formula, Alpha 11 (1-β 1 *(x γ -x γ+1 )), where the Alpha 1 represents the first pixel The first weight of , the α 1 represents the first adjustment parameter, the x represents the pixel value of the original pixel point, the β 1 represents the first constant, and the γ represents the second constant.
  19. 根据权利要求16-18任一项所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:The electronic device of any one of claims 16-18, wherein the processor is configured to execute the instructions to:
    基于所述第二图像中所述第二像素点的像素值,对所述第二图像进行纹理增强,得到第三图像。Based on the pixel values of the second pixel points in the second image, texture enhancement is performed on the second image to obtain a third image.
  20. 根据权利要求19所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:19. The electronic device of claim 19, wherein the processor is configured to execute the instructions to:
    在所述第二像素点的像素值小于或等于第一阈值的情况下,减小所述第二像素点的像素值,得到所述第三图像中第三像素点的像素值;In the case that the pixel value of the second pixel point is less than or equal to the first threshold, reducing the pixel value of the second pixel point to obtain the pixel value of the third pixel point in the third image;
    在所述第二像素点的像素值大于第二阈值的情况下,增大所述第二像素点的像素值,得到所述第三像素点的像素值。When the pixel value of the second pixel point is greater than the second threshold, the pixel value of the second pixel point is increased to obtain the pixel value of the third pixel point.
  21. 根据权利要求20所述的电子设备,其中,所述第一阈值小于或等于0.5,所述处理器被配置为执行所述指令,实现以下步骤:21. The electronic device of claim 20, wherein the first threshold is less than or equal to 0.5, and the processor is configured to execute the instructions to:
    根据以下公式确定所述第三像素点的像素值:S3=2*S2*S2;Determine the pixel value of the third pixel point according to the following formula: S3=2*S2*S2;
    其中,所述S2表示所述第二像素点的像素值,所述S3表示所述第三像素点的像素值。Wherein, the S2 represents the pixel value of the second pixel point, and the S3 represents the pixel value of the third pixel point.
  22. 根据权利要求20所述的电子设备,其中,所述第二阈值大于或等于0.5,所述处理器被配置为执行所述指令,实现以下步骤:21. The electronic device of claim 20, wherein the second threshold is greater than or equal to 0.5, and the processor is configured to execute the instructions to:
    根据以下公式确定所述第三像素点的像素值:S3=1-2*(1-S2)*(1-S2);Determine the pixel value of the third pixel point according to the following formula: S3=1-2*(1-S2)*(1-S2);
    其中,所述S2表示所述第二像素点的像素值,所述S3表示所述第三像素点的像素 值。Wherein, the S2 represents the pixel value of the second pixel point, and the S3 represents the pixel value of the third pixel point.
  23. 根据权利要求19所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:19. The electronic device of claim 19, wherein the processor is configured to execute the instructions to:
    基于所述原始像素点的像素值,确定所述第二像素点的第二权重以及所述第三图像中第三像素点的第三权重,其中,所述第二权重与所述第三权重的和值为1,所述第二权重随所述原始像素点的像素值发生变化的关系呈下凸函数关系;Based on the pixel value of the original pixel point, a second weight of the second pixel point and a third weight of the third pixel point in the third image are determined, wherein the second weight and the third weight The sum value is 1, and the relationship between the second weight and the pixel value of the original pixel point is a downward convex function relationship;
    基于所述第二权重以及所述第三权重,对所述第二像素点的像素值和所述第三像素点的像素值进行加权融合,得到第四像素点的像素值;Based on the second weight and the third weight, weighted fusion is performed on the pixel value of the second pixel point and the pixel value of the third pixel point to obtain the pixel value of the fourth pixel point;
    基于所述第四像素点的像素值,生成第四图像。Based on the pixel values of the fourth pixel points, a fourth image is generated.
  24. 根据权利要求23所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:23. The electronic device of claim 23, wherein the processor is configured to execute the instructions to:
    基于第二调节参数和所述原始像素点的像素值,确定所述第二像素点的第二权重,所述第二调节参数用于调节对所述第二图像进行纹理增强的强度,所述第二调节参数与所述第二权重呈正相关关系。A second weight of the second pixel is determined based on a second adjustment parameter and the pixel value of the original pixel, the second adjustment parameter is used to adjust the intensity of texture enhancement for the second image, the The second adjustment parameter has a positive correlation with the second weight.
  25. 根据权利要求24所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:24. The electronic device of claim 24, wherein the processor is configured to execute the instructions to:
    根据以下公式确定所述第二像素点的第二权重,Alpha 2=α 2(1-β 2*x*(1-x)),所述Alpha 2表示所述第二像素点的第二权重,所述α 2表示所述第二调节参数,所述x表示所述原始像素点的像素值,所述β 2表示第三常量。 The second weight of the second pixel is determined according to the following formula, Alpha 22 (1-β 2 *x*(1-x)), and the Alpha 2 represents the second weight of the second pixel , the α 2 represents the second adjustment parameter, the x represents the pixel value of the original pixel point, and the β 2 represents the third constant.
  26. 根据权利要求23-25任一项所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:The electronic device of any one of claims 23-25, wherein the processor is configured to execute the instructions to:
    获取第四像素点的红色通道值、蓝色通道值以及绿色通道值;Get the red channel value, blue channel value and green channel value of the fourth pixel;
    基于色彩查找表,对所述第四像素点的红色通道值、蓝色通道值以及绿色通道值分别进行校正,得到第五像素点的红色通道值、蓝色通道值以及绿色通道值;Based on the color lookup table, the red channel value, the blue channel value and the green channel value of the fourth pixel are respectively corrected to obtain the red channel value, the blue channel value and the green channel value of the fifth pixel;
    基于所述第五像素点的红色通道值、蓝色通道值以及绿色通道值,生成第五图像。A fifth image is generated based on the red channel value, the blue channel value and the green channel value of the fifth pixel point.
  27. 根据权利要求26所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:27. The electronic device of claim 26, wherein the processor is configured to execute the instructions to:
    获取第三调节参数,所述第三调节参数用于调节对所述已生成的图像进行色彩增强的强度;acquiring a third adjustment parameter, where the third adjustment parameter is used to adjust the intensity of color enhancement on the generated image;
    基于所述第三调节参数,确定所述第四像素点的第四权重以及所述第五像素点的第五权重,其中,所述第四权重与所述第五权重的和值为1;determining a fourth weight of the fourth pixel point and a fifth weight of the fifth pixel point based on the third adjustment parameter, wherein the sum of the fourth weight and the fifth weight is 1;
    基于所述第四权重以及所述第五权重,对所述第四像素点的像素值和所述第五像素点的像素值进行加权融合,得到第六像素点的像素值;Based on the fourth weight and the fifth weight, weighted fusion is performed on the pixel value of the fourth pixel point and the pixel value of the fifth pixel point to obtain the pixel value of the sixth pixel point;
    基于所述第六像素点的像素值,生成所述第六图像。The sixth image is generated based on the pixel values of the sixth pixel points.
  28. 根据权利要求27所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:28. The electronic device of claim 27, wherein the processor is configured to execute the instructions to:
    获取第六图像中第六像素点的高频信息;obtaining high-frequency information of the sixth pixel in the sixth image;
    基于所述第六像素点的高频信息,确定所述第六像素点的目标模糊半径;Determine the target blur radius of the sixth pixel based on the high-frequency information of the sixth pixel;
    基于模糊半径与环境光照射分量的对应关系,确定与所述目标模糊半径对应的目标环境光照射分量;Determine the target ambient light illumination component corresponding to the target blur radius based on the correspondence between the blur radius and the ambient light illumination component;
    基于所述第六像素点的像素值以及所述目标环境光照射分量,确定第七像素点的像素值;determining the pixel value of the seventh pixel point based on the pixel value of the sixth pixel point and the target ambient light illumination component;
    基于所述第七像素点的像素值,生成第七图像。Based on the pixel values of the seventh pixel points, a seventh image is generated.
  29. 根据权利要求28所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:29. The electronic device of claim 28, wherein the processor is configured to execute the instructions to:
    根据以下公式确定所述第七像素点的像素值,log(S7)=log(S6)-log(L w*w),所述S7表示所述第七像素点的像素值,所述S6表示所述第六像素点的像素值,所述L w*w表示所述目标环境光照射分量。 The pixel value of the seventh pixel is determined according to the following formula, log(S7)=log(S6)-log(L w*w ), the S7 represents the pixel value of the seventh pixel, and the S6 represents The pixel value of the sixth pixel point, and the L w*w represents the illumination component of the target ambient light.
  30. 一种计算机可读存储介质,所述计算机可读存储介质中的指令由电子设备的处理器执行,使得所述电子设备能够执行以下步骤:A computer-readable storage medium, the instructions in the computer-readable storage medium are executed by a processor of an electronic device, so that the electronic device can perform the following steps:
    获取原始图像;get the original image;
    对所述原始图像的亮度进行增强,得到第一图像;enhancing the brightness of the original image to obtain a first image;
    基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;Determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original weight and the first weight The sum value is 1, and the first weight is negatively correlated with the pixel value of the original pixel;
    基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;Based on the original weight and the first weight, weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
    基于所述第二像素点的像素值,生成第二图像。Based on the pixel values of the second pixel points, a second image is generated.
  31. 一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行实现以下步骤:A computer program product comprising a computer program executed by a processor to achieve the following steps:
    获取原始图像;get the original image;
    对所述原始图像的亮度进行增强,得到第一图像;enhancing the brightness of the original image to obtain a first image;
    基于所述原始图像中原始像素点的像素值,确定所述第一图像中第一像素点的第一权重以及所述原始像素点的原始权重,其中,所述原始权重与所述第一权重的和值为1,所述第一权重与所述原始像素点的像素值呈负相关关系;Determine the first weight of the first pixel in the first image and the original weight of the original pixel based on the pixel value of the original pixel in the original image, wherein the original weight and the first weight The sum value is 1, and the first weight is negatively correlated with the pixel value of the original pixel point;
    基于所述原始权重以及所述第一权重,对所述原始像素点的像素值和所述第一像素点的像素值进行加权融合,得到第二像素点的像素值;Based on the original weight and the first weight, weighted fusion is performed on the pixel value of the original pixel point and the pixel value of the first pixel point to obtain the pixel value of the second pixel point;
    基于所述第二像素点的像素值,生成第二图像。Based on the pixel values of the second pixel points, a second image is generated.
PCT/CN2021/114109 2020-12-18 2021-08-23 Image processing method and electronic device WO2022127174A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011507495.9 2020-12-18
CN202011507495.9A CN112614064B (en) 2020-12-18 2020-12-18 Image processing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022127174A1 true WO2022127174A1 (en) 2022-06-23

Family

ID=75240691

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/114109 WO2022127174A1 (en) 2020-12-18 2021-08-23 Image processing method and electronic device

Country Status (2)

Country Link
CN (1) CN112614064B (en)
WO (1) WO2022127174A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112614064B (en) * 2020-12-18 2023-04-25 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN113781370A (en) * 2021-08-19 2021-12-10 北京旷视科技有限公司 Image enhancement method and device and electronic equipment
CN114240813A (en) * 2021-12-14 2022-03-25 成都微光集电科技有限公司 Image processing method, apparatus, device and storage medium thereof
CN115115554B (en) * 2022-08-30 2022-11-04 腾讯科技(深圳)有限公司 Image processing method and device based on enhanced image and computer equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040136603A1 (en) * 2002-07-18 2004-07-15 Vitsnudel Iiia Enhanced wide dynamic range in imaging
US20100232726A1 (en) * 2009-03-13 2010-09-16 Liu Yung-Chiu Method for simulating dark-part exposure compensation of high dynamic range images using a single image and image processing device for use with the method
CN109829864A (en) * 2019-01-30 2019-05-31 北京达佳互联信息技术有限公司 Image processing method, device, equipment and storage medium
CN110619610A (en) * 2019-09-12 2019-12-27 紫光展讯通信(惠州)有限公司 Image processing method and device
CN110766621A (en) * 2019-10-09 2020-02-07 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN111145114A (en) * 2019-12-19 2020-05-12 腾讯科技(深圳)有限公司 Image enhancement method and device and computer readable storage medium
CN111311532A (en) * 2020-03-26 2020-06-19 深圳市商汤科技有限公司 Image processing method and device, electronic device and storage medium
CN111325680A (en) * 2020-01-08 2020-06-23 深圳深知未来智能有限公司 Image brightening method capable of inhibiting local overexposure
CN112614064A (en) * 2020-12-18 2021-04-06 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530848A (en) * 2013-09-27 2014-01-22 中国人民解放军空军工程大学 Double exposure implementation method for inhomogeneous illumination image
CN105046663B (en) * 2015-07-10 2017-08-04 西南科技大学 A kind of adaptive enhancement method of low-illumination image for simulating human visual perception
US9881364B2 (en) * 2015-08-10 2018-01-30 Fuji Xerox Co., Ltd. Image processing apparatus, image processing method and computer readable medium for image enhancement
CN109272459B (en) * 2018-08-20 2020-12-01 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040136603A1 (en) * 2002-07-18 2004-07-15 Vitsnudel Iiia Enhanced wide dynamic range in imaging
US20100232726A1 (en) * 2009-03-13 2010-09-16 Liu Yung-Chiu Method for simulating dark-part exposure compensation of high dynamic range images using a single image and image processing device for use with the method
CN109829864A (en) * 2019-01-30 2019-05-31 北京达佳互联信息技术有限公司 Image processing method, device, equipment and storage medium
CN110619610A (en) * 2019-09-12 2019-12-27 紫光展讯通信(惠州)有限公司 Image processing method and device
CN110766621A (en) * 2019-10-09 2020-02-07 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN111145114A (en) * 2019-12-19 2020-05-12 腾讯科技(深圳)有限公司 Image enhancement method and device and computer readable storage medium
CN111325680A (en) * 2020-01-08 2020-06-23 深圳深知未来智能有限公司 Image brightening method capable of inhibiting local overexposure
CN111311532A (en) * 2020-03-26 2020-06-19 深圳市商汤科技有限公司 Image processing method and device, electronic device and storage medium
CN112614064A (en) * 2020-12-18 2021-04-06 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112614064B (en) 2023-04-25
CN112614064A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
WO2022127174A1 (en) Image processing method and electronic device
CN109345485B (en) Image enhancement method and device, electronic equipment and storage medium
CN108898546B (en) Face image processing method, device and equipment and readable storage medium
TWI549106B (en) Image display method and electronic device
CN111709890B (en) Training method and device for image enhancement model and storage medium
JP7166171B2 (en) INTERFACE IMAGE DISPLAY METHOD, APPARATUS AND PROGRAM
CN108986053B (en) Screen display method and device
CN112950499B (en) Image processing method, device, electronic equipment and storage medium
CN110958401A (en) Super night scene image color correction method and device and electronic equipment
CN113450713B (en) Screen display method and device and gray scale mapping information generation method and device
CN111625213A (en) Picture display method, device and storage medium
CN106803920B (en) Image processing method and device and intelligent conference terminal
CN113674718B (en) Display brightness adjusting method, device and storage medium
CN105472228B (en) Image processing method and device and terminal
CN107563957B (en) Eye image processing method and device
CN115239570A (en) Image processing method, image processing apparatus, and storage medium
CN111901519B (en) Screen light supplement method and device and electronic equipment
CN109102779B (en) Backlight adjusting method and device
CN108156381B (en) Photographing method and device
CN116866495A (en) Image acquisition method, device, terminal equipment and storage medium
WO2022226963A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN112785537A (en) Image processing method, device and storage medium
US20160292825A1 (en) System and method to refine image data
CN112019680A (en) Screen brightness adjusting method and device
CN113191994B (en) Image processing method, device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21905107

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02.10.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21905107

Country of ref document: EP

Kind code of ref document: A1