Image enhancement method and device, electronic equipment and medium
By determining the transmissivity expression based on the relationship between image brightness value and transmissivity under low illumination conditions and performing image enhancement, the problem of inaccurate transmissivity estimation is solved, achieving more accurate image enhancement results and reducing algorithm complexity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIVIEW TECH CO LTD
- Filing Date
- 2021-09-16
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies suffer from inaccurate transmittance estimation during image enhancement in low-light conditions, leading to image distortion or weak enhancement effects, and also have high algorithm complexity.
By determining the transmissivity expression of the inverted image based on the relationship between image brightness value and transmissivity, and enhancing the target image according to the transmissivity, including determining the relational parameters and constraints in the transmissivity expression, the transmissivity is accurately represented in a convenient way.
It improves image enhancement effects, avoids image distortion after enhancement, reduces algorithm complexity, and enhances the display of image details.
Smart Images

Figure CN115829845B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image enhancement method, apparatus, electronic device, and medium. Background Technology
[0002] When acquiring images in low-light conditions such as night vision and backlighting, the overall pixel value and contrast of the acquired images are very low, and a large amount of edge and texture details of objects in the image are lost. Therefore, in order to improve the display effect of physical edges and texture details in the image, image enhancement is generally required for images acquired under low-light conditions.
[0003] Current image enhancement methods often suffer from inaccurate transmittance estimation during the enhancement process, leading to image distortion or weak enhancement results, particularly in dark areas, resulting in poor overall enhancement. Furthermore, transmittance calculation requires edge-preserving filtering, which increases algorithm complexity. Summary of the Invention
[0004] This application provides an image enhancement method, apparatus, electronic device, and medium to conveniently and accurately determine transmittance, thereby improving the enhancement effect during the image enhancement process based on transmittance.
[0005] In one embodiment, this application provides an image enhancement method, the method comprising:
[0006] Based on the relationship between the brightness value and transmittance of an image, the transmittance expression of the inverted image is determined according to the brightness value of the inverted image of the target image.
[0007] Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, the relational parameters in the transmittance expression are determined; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance.
[0008] The transmittance of the inverted image is determined based on the relationship parameters and the transmittance expression, and the target image is enhanced based on the transmittance.
[0009] In another embodiment, this application also provides an image enhancement apparatus, the apparatus comprising:
[0010] An expression determination module is used to determine the transmittance expression of the inverted image based on the relationship between the brightness value and transmittance of the image and the brightness value of the inverted image of the target image.
[0011] The relational parameter determination module is used to determine the relational parameters in the transmittance expression based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance.
[0012] An enhancement processing module is used to determine the transmittance of the inverted image based on the relationship parameters and the transmittance expression, and to perform enhancement processing on the target image based on the transmittance.
[0013] In yet another embodiment, this application also provides an electronic device, including: one or more processors;
[0014] Memory, used to store one or more programs;
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the image enhancement method according to any one of the embodiments of this application.
[0016] In one embodiment, this application also provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the image enhancement method as described in any one of the embodiments of this application.
[0017] In this embodiment, based on the relationship between the brightness value and transmittance of an image, the transmittance expression of the inverted image is determined according to the brightness value of the inverted image of the target image; the relational parameters in the transmittance expression are determined according to the expression of the preliminary enhanced image of the target image and the pixel value range of the preliminary enhanced image; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance; the transmittance of the inverted image is determined according to the relational parameters and the transmittance expression, and the target image is enhanced according to the transmittance. The above scheme determines the transmittance expression based on the brightness value, thereby accurately representing the transmittance in a convenient way, and determines the relational coefficients in the transmittance expression, thereby further refining the transmittance under constraints. This solves the problem that in current image enhancement processes based on transmittance, ignoring the influence of the brightness value leads to inaccurate determined transmittance, resulting in image distortion or weak enhancement effect after enhancement. Determining the transmittance based on the brightness value improves the image enhancement effect. Attached Figure Description
[0018] Figure 1 A flowchart of an image enhancement method provided in one embodiment of this application;
[0019] Figure 2 A flowchart of an image enhancement method provided in another embodiment of this application;
[0020] Figure 3 This is a schematic diagram showing the relationship between luminance values and transmittance coordinates in another embodiment of this application;
[0021] Figure 4 A flowchart illustrating an image enhancement method provided in yet another embodiment of this application;
[0022] Figure 5 A flowchart illustrating an image enhancement method provided in yet another embodiment of this application;
[0023] Figure 6 This is a schematic diagram of the structure of an image enhancement device provided in one embodiment of this application;
[0024] Figure 7 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application.
[0025] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present application are shown in the drawings, not the entire structure. Detailed Implementation
[0026] Figure 1 This is a flowchart illustrating an image enhancement method according to an embodiment of this application. The image enhancement method provided in this embodiment is applicable to situations requiring image enhancement. Typically, this embodiment is applicable to enhancing images acquired under low-light conditions. Specifically, this method can be executed by an image enhancement device, which can be implemented in software and / or hardware, and can be integrated into an electronic device capable of implementing the image enhancement method. See also... Figure 1 The method in this application embodiment specifically includes:
[0027] S110. Based on the relationship between the brightness value and transmittance of the image, determine the transmittance expression of the inverted image according to the brightness value of the inverted image of the target image.
[0028] The relationship between the image's brightness value and transmittance is obtained based on statistical data of the brightness value and transmittance of the inverted image of the image in the application scenario of this application. Specifically, in a specific application scenario of this application, namely, in the scenario of image enhancement in a low-light environment, the relationship between the image's brightness value and transmittance is obtained based on statistical data of the brightness value and transmittance of the inverted image of the image in a low-light environment, that is, the relationship between the brightness value of the inverted image of the image in a low-light environment and the transmittance of the inverted image of the image in a low-light environment. In images acquired in low-light scenarios, there is a certain correspondence between their brightness value and transmittance. Based on this correspondence, one parameter can represent the other parameter; for example, based on the correspondence, the brightness value can represent the transmittance. The target image can be an image acquired by an image acquisition device under low-light conditions such as night vision or backlighting. Because the target image has low brightness and indistinct details under these conditions, it is necessary to enhance the target image to improve the display effect of the edges and texture details of objects in the target image. The process of generating the inverted image of the target image is as follows: the pixel value of the target image is subtracted from the upper limit of the pixel value range, and the result is used as the pixel value corresponding to that pixel in the inverted image.
[0029] In scenarios involving the enhancement of target images acquired under low-light conditions, conventional methods for determining transmittance fail to consider the impact of brightness intensity on transmittance, leading to inaccurate transmittance determinations and affecting the image enhancement effect. In this embodiment, the brightness value of the inverted image of the target image can be determined, and based on the relationship between the brightness value and transmittance, an expression for the transmittance of the inverted image is determined to represent the transmittance. The advantage of this approach is that it fully utilizes the relationship between the image's brightness value and transmittance, using the brightness value of the inverted image to represent the transmittance of the inverted image. This allows for a convenient determination of the transmittance expression while considering the influence of the brightness value on transmittance, thus accurately expressing the transmittance based on the brightness value and improving the accuracy of the determined transmittance.
[0030] S120. Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, determine the relational parameters in the transmittance expression; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance.
[0031] The preliminary enhanced image is the image obtained by performing preliminary enhancement processing on the target image. The expression for the preliminary enhanced image is related to the expression for transmittance; for example, the expression for the preliminary enhanced image can be represented by the transmittance expression. In this embodiment, a process for performing preliminary enhancement processing on a target image to obtain a preliminary enhanced image is described in detail below:
[0032] The target image acquired under low-light conditions is a low-light color image. The pixel values of the target image are normalized to [0,1], and the inverted image I of the target image is calculated. inv :
[0033]
[0034] Where I represents the target image, x represents a pixel, and c represents the R, G, and B channels. c (x) represents the pixel value of pixel x in a certain channel of the target image. This is to invert the pixel value of pixel x in a certain channel of the image.
[0035] Since the inverted image of the target image is similar to a foggy image, a method for enhancing the target image is based on dehazing techniques. The ambient light value and transmittance of the inverted image are calculated using a dehazing model. The calculation of the ambient light value is not limited in this embodiment; for example, the method for calculating atmospheric light values in dehazing algorithms can be used: first, the dark channel image I of the inverted image is obtained. dark (x):
[0036]
[0037] Where Ω(x) represents the neighborhood centered at pixel x, and the size of the neighborhood can be freely set, for example, 15*15. That is, among the pixel values of the three channels of the neighborhood pixels of each pixel in the inverted image, the smallest pixel value is selected as the pixel value of that pixel. N pixels with larger pixel values in the dark channel image are selected as ambient light selection points. In the inverted image, the pixel corresponding to the position of the ambient light selection point is selected as the target pixel of the inverted image. For each channel, the maximum pixel value among the target pixels in that channel is selected as the ambient light value A corresponding to that channel. In this embodiment, the transmittance expression is assumed to be t(x).
[0038] By combining the dehazing model with the obtained ambient light values and transmittance, the inverted image is dehazed to obtain the dehazed result. The specific method is as follows:
[0039] According to the formation model of foggy images, the fog-free image J of the inverted image is... inv It can be represented as:
[0040]
[0041] Where A is the ambient light value, t represents the transmittance, and I... inv (x) is the inverted image.
[0042] The dehazing result of the inverted image is inverted to perform inversion calculations, resulting in a preliminary enhancement result J. enh Right now:
[0043] J enh (x)=1-J inv (x).
[0044] In this embodiment, since the pixel value range of an unnormalized image is generally [0, 255], and the pixel values are normalized during the initial enhancement process, the pixel value range of the initially enhanced image should be [0, 1], i.e., J enh (x)≤1. Therefore, based on the expression of the preliminary enhanced image containing the transmittance expression, and the range of pixel values of the preliminary enhanced image, the relational parameters in the transmittance expression can be determined.
[0045] The beneficial effect of the above scheme is that by constraining the relational parameters in the transmittance expression, overflow of the enhancement result is avoided, that is, the brightness enhancement of the image J is guaranteed. enh The values of all three channels for each pixel are less than or equal to 1, which improves image enhancement and scene adaptability while ensuring that the image is not distorted.
[0046] S130. Determine the transmittance of the inverted image based on the relationship parameters and the transmittance expression, and perform enhancement processing on the target image based on the transmittance.
[0047] The transmittance of the inverted image is a specific numerical value of the transmittance of the target image. For example, by substituting the relational parameters into the transmittance expression, the transmittance of the inverted image is obtained. By substituting the transmittance of the inverted image into the preliminary enhanced image, a preliminary enhanced image can be obtained. Then, adaptive processing is performed on the preliminary enhanced image to achieve the enhancement of the target image.
[0048] In this embodiment, based on the relationship between the brightness value and transmittance of an image, the transmittance expression of the inverted image is determined according to the brightness value of the inverted image of the target image; the relational parameters in the transmittance expression are determined according to the expression of the preliminary enhanced image of the target image and the pixel value range of the preliminary enhanced image; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance; the transmittance of the inverted image is determined according to the relational parameters and the transmittance expression, and the target image is enhanced according to the transmittance. The above scheme determines the transmittance expression based on the brightness value, thereby accurately representing the transmittance in a convenient way, and determines the relational coefficients in the transmittance expression, thereby further refining the transmittance under constraints. This solves the problem that in current image enhancement processes based on transmittance, ignoring the influence of the brightness value leads to inaccurate determined transmittance, resulting in image distortion or weak enhancement effect after enhancement. Determining the transmittance based on the brightness value improves the image enhancement effect.
[0049] Figure 2 A flowchart illustrating an image enhancement method according to another embodiment of this application. This application embodiment is a further optimization of the above embodiments; details not described in detail in this application embodiment can be found in the above embodiments. See also... Figure 2 The image enhancement method provided in this application embodiment may include:
[0050] S210. Select a preset number of pixels from the inverted sample image of the sample image, and determine the brightness value and transmittance of each pixel.
[0051] The sample image can be at least one image randomly selected from images acquired by the image acquisition device. The inverted sample image is the reverse of the sample image. The inverted sample image is generated by subtracting the pixel value of the sample image from the upper limit of the pixel value range, resulting in the pixel value of the corresponding pixel in the inverted sample image. The preset number can be determined according to actual conditions; for example, the preset number can be 2000. The preset number of pixels can be randomly selected from at least one inverted sample image. For each selected pixel, the transmittance of the pixel is calculated according to the transmittance determination method of conventional dehazing methods. Then, the brightness value of the inverted sample image is calculated.
[0052] S220. Using the pixel number as the first dimension and the brightness value and transmittance as the second dimension, determine the coordinate relationship diagram of each pixel corresponding to the brightness value and transmittance.
[0053] In this embodiment, the first dimension can be the horizontal coordinate dimension in a two-dimensional coordinate system, and the second dimension can be the vertical coordinate dimension in a two-dimensional coordinate system. This specific solution is described in detail using this case. Alternatively, the first dimension can be the vertical coordinate dimension in a two-dimensional coordinate system, and the second dimension can be the horizontal coordinate dimension in a two-dimensional coordinate system.
[0054] For example, using the pixel number as the x-axis and the luminance value and transmittance as the y-axis, a coordinate relationship diagram is determined for each pixel corresponding to its luminance value and transmittance, such as... Figure 3 As shown.
[0055] S230. Based on the coordinate relationship diagram, determine the symmetrical relationship between the brightness value and transmittance of each pixel about the axis of symmetry.
[0056] For example, based on the coordinate relationship diagram, the symmetric relationship between the brightness value and transmittance of each pixel about the horizontal axis of symmetry can be determined. Assuming the horizontal axis is represented by x and the vertical axis by y, the horizontal axis of symmetry between the brightness value and transmittance is y = a, where a is a constant.
[0057] S240. Determine the transmittance expression of the inverted image based on the expression of the symmetry axis and the brightness value of the inverted image; wherein the expression of the symmetry axis is represented by the relational parameter.
[0058] The specific calculation method for the brightness value of the inverted image can be: Y inv (x)=0.299×R inv (x)+0.587×G inv (x)+0.114×B inv (x). Where Y inv R is used to invert the brightness values of the image. inv For the R channel component, G inv For the G channel component, B inv denoted as B channel component, and x represents the pixel.
[0059] Since the luminance and transmittance are symmetric about the axis of symmetry y = a, the transmittance of the inverted image can be expressed as: t(x) = -Y inv (x)+2a. Where a is the relational parameter in the transmittance expression.
[0060] S250. Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, determine the relational parameters in the transmittance expression; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance.
[0061] S260. Determine the transmittance of the inverted image based on the relationship parameters and the transmittance expression, and perform enhancement processing on the target image based on the transmittance.
[0062] The scheme in this application embodiment draws a coordinate relationship graph by inverting the brightness value and transmittance of selected pixels in the sample image, determining the symmetrical relationship between the brightness value and transmittance about the axis of symmetry, and then representing the transmittance based on the brightness value. Thus, the influence of the brightness value is taken into account in the process of determining the transmittance, and the transmittance is determined accurately in a convenient way, improving the enhancement effect in the image.
[0063] Figure 4 This is a flowchart illustrating an image enhancement method according to another embodiment of this application. This embodiment is a further optimization of the above embodiments; details not described in detail in this embodiment are provided in the above embodiments. See also... Figure 4 The image enhancement method provided in this application embodiment may include:
[0064] S310. Based on the relationship between the brightness value and transmittance of the image, determine the transmittance expression of the inverted image according to the brightness value of the inverted image of the target image.
[0065] S320. Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, determine the range of values for the relational parameters in the transmittance expression.
[0066] In this embodiment, since the expression of the preliminary enhanced image is related to the expression of transmittance, that is, the expression of the preliminary enhanced image is represented by the expression of transmittance, the range of values of the transmittance expression can be determined based on the range of pixel values of the preliminary enhanced image, and thus the range of values of the relational parameters in the transmittance expression can be determined.
[0067] For example, the expressions for the preliminary enhanced image and the transmittance in the above embodiments will be explained in detail. The expression for the preliminary enhanced image is J. enh (x)=1-J inv (x), The expression for transmittance is t(x) = -Y. inv Substituting the expression for transmittance into the expression for the initial enhanced image, we obtain (x)+2a. According to the formula, J enh By determining the range of values for (x), we can obtain the range of values for the relational parameter a in the transmittance expression.
[0068] For example, to avoid overflow of the enhancement result, that is, to ensure the brightness enhancement of image J... enhIn the image, the values of all three channels for each pixel are less than or equal to 1, i.e., J enh (x)≤1, that is
[0069]
[0070] This allows us to derive the range of values for the relational parameters:
[0071]
[0072] S330. Determine the relational parameter in the transmittance expression based on the minimum value in the range of the relational parameter.
[0073] From the formula It can be determined that the value of 'a' affects the enhancement effect on the target image. As shown in the formula above, when the value of 'a' is too small, the target image will be over-enhanced, leading to problems such as color cast and noise amplification; when the value of 'a' is too large, the image enhancement will be insufficient. Therefore, it is necessary to constrain the value of 'a' and determine its range. Within the range of 'a' values, the smaller 'a' is, the more significant the enhancement effect on the target image. Therefore, the relational parameter in the transmittance expression can be determined based on the minimum value within the range of relational parameter values.
[0074] Specifically, the minimum value within the range of the relational parameter can be used as the relational parameter in the transmittance expression, i.e. Among them, I dark (x) is the inverted image I inv Dark channel diagram of (x), A max It is the maximum value among the three channels of ambient light A.
[0075] In this embodiment of the application, determining the relational parameter in the transmittance expression based on the minimum value in the range of relational parameter values includes: if the minimum value in the range of relational parameter values is within a preset relational parameter interval, then the minimum value in the range of relational parameter values is used as the relational parameter in the transmittance expression; if the minimum value in the range of relational parameter values is outside the preset relational parameter interval, then the relational parameter in the transmittance expression is selected from the preset relational parameter interval.
[0076] For example, if the relation parameters obtained through the above scheme are too large, the enhancement effect will be insufficient; if the relation parameters are too small, the enhancement will be excessive. Therefore, a preset relation parameter range can be determined in advance based on the enhancement effect, and the relation parameters can be controlled to remain within the preset relation parameter range to ensure a more ideal enhancement effect. Assume the preset relation parameter range for relation parameter a is [a...]. min ,a max ], for example, a min =0.52,a max=0.6. If the minimum value of the relational parameter is within the preset relational parameter interval, then the minimum value of the relational parameter interval is used as the relational parameter in the transmittance expression. If the minimum value of the relational parameter is less than the lower limit of the preset relational parameter interval, then the lower limit of the preset relational parameter interval is used as the relational parameter in the transmittance expression. If the minimum value of the relational parameter is greater than the upper limit of the preset relational parameter interval, then the upper limit of the preset relational parameter interval is used as the relational parameter in the transmittance expression.
[0077] S340. Determine the transmittance of the inverted image based on the relationship parameters and the transmittance expression, and perform enhancement processing on the target image based on the transmittance.
[0078] The technical solution in this application determines the value range of the relational parameters from the perspective of avoiding overflow of enhancement results. It calculates the relational parameters using an adaptive method and adaptively determines the transmittance, thereby improving the enhancement effect on the target image and the scene adaptability of the solution. By setting a preset relational parameter range to limit the amplitude of the relational parameters, the image enhancement effect is further guaranteed, avoiding over-enhancement or under-enhancement.
[0079] Figure 5 This is a flowchart illustrating an image enhancement method provided in another embodiment of this application. This embodiment is a further optimization of the above embodiments; details not described in detail in this embodiment are provided in the above embodiments. See also... Figure 5 The image enhancement method provided in this application embodiment may include:
[0080] S410. Based on the relationship between the brightness value and transmittance of the image, determine the transmittance expression of the inverted image according to the brightness value of the inverted image of the target image.
[0081] S420. Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, determine the relational parameters in the transmittance expression; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance.
[0082] S430. Determine the transmittance of the inverted image based on the relationship parameters and the transmittance expression.
[0083] S440. Determine the preliminary enhanced image based on the expression for the transmittance and the preliminary enhanced image.
[0084] For example, the expression for the initial image enhancement The expression for transmittance is t(x) = -Y invIf the relational parameter a is determined, the specific value of the transmittance can be calculated by substituting it into the transmittance expression. Then, the specific value of the transmittance can be substituted into the preliminary enhancement image expression to obtain the preliminary enhancement image.
[0085] S450. Determine the edge information of the target image based on the target image and the smoothed filtered image of the target image.
[0086] The conventional method for enhancing the details of a target image is to directly extract details from the initial enhanced image before further enhancement. Since the initial enhanced image, after brightness enhancement, contains a significant amount of noise, this will result in the extracted details also containing considerable noise, leading to excessive noise in the final enhancement result. The target image, compared to the initial enhanced image, has much less noise. Therefore, in this embodiment, details are extracted from the target image, not the initial enhanced image, effectively reducing the introduction of noise during the enhancement process. Specifically, the target image I is smoothed using a smoothing filter to obtain a smoothed filtered image I′. The smoothing filter can be a mean filter, Gaussian filter, bilateral filter, guided filter, etc., and this embodiment is not limited to any particular type. In a specific embodiment, a Gaussian filter can be used as the smoothing filter. The parameters of the Gaussian filter can be freely set; the default parameters are a filter window size of 7*7 and a Gaussian variance of 3.
[0087] Edge information E is obtained by subtracting the target image I from its smoothed filtered image I′.
[0088] E = II'
[0089] S460. Based on the edge information and the preliminary enhanced image, determine the final enhanced image of the target image.
[0090] For example, the initial enhanced image can be added to the edge information to obtain the final enhanced image of the target image.
[0091] In this embodiment of the application, determining the final enhanced image of the target image based on the edge information and the preliminary enhanced image includes: adding the preliminary enhanced image to the edge information to obtain a sharpened enhanced image; determining an adjustment coefficient based on the endpoint values of a preset relational parameter range and the relational parameters of the transmittance expression; and adjusting the sharpened enhanced image based on the adjustment coefficient to obtain the final enhanced image of the target image.
[0092] In this embodiment of the application, to further improve the image enhancement effect, the enhancement result can be adjusted. Specifically, the edge information E and the preliminary enhancement result image J are compared. enh Adding them together yields the sharpened and enhanced image J′:
[0093] J′=Jenh +E.
[0094] Since the value of the relational parameter affects the enhancement effect, the sharpened and enhanced image can also be adjusted based on the relational parameter. For example, when the relational parameter is large, the enhancement effect is weak and the image brightness is too dark, so the brightness of the sharpened and enhanced image J′ needs to be adaptively increased to strengthen the enhancement. When the relational parameter is small, the enhancement effect is strong and the image brightness is too bright, so the brightness of the sharpened and enhanced image J′ needs to be adaptively decreased to weaken the enhancement.
[0095] In this embodiment of the application, an adjustment coefficient is determined based on the endpoint values of a preset relational parameter range and the relational parameters of the transmittance expression. This coefficient is then used to adjust the sharpened and enhanced image to obtain the final enhanced image of the target image, including:
[0096] The sharpened and enhanced image is adjusted based on the following formula to obtain the final enhanced image of the target image:
[0097]
[0098] Where J(x) is the final enhanced image of the target image, J′(x) is the sharpened enhanced image, x is the number of pixels, and a max a is the maximum value of the preset relation parameter range. min 'a' represents the minimum value of the preset relational parameter range, and 'a' represents the relational parameter in the transmittance expression.
[0099] For example, suppose a min =0.52,a max =0.6, if a = 0.53, the value of a is smaller, |1+a max +a min -2a|=1.06, Thus J′ (x) Decrease the value of a to reduce the brightness of the sharpened image, thus weakening the enhancement. If a = 0.58, the value of a is relatively large, |1+a max +a min -2a|=0.96, Thus J′ (x) Increase the brightness of the image to enhance sharpness.
[0100] The technical solution described in this application enhances details by extracting details from the target image, thus avoiding the problem of excessive noise extraction caused by extracting details from the initial enhanced image. This reduces noise in detail extraction and improves the enhancement effect. By adjusting the enhancement result based on the relational parameters, the insufficient enhancement caused by excessively large relational parameters or the excessive enhancement caused by excessively small relational parameters is neutralized, thereby improving the enhancement effect.
[0101] Figure 6 This is a schematic diagram of an image enhancement device provided in one embodiment of this application. The device is applicable to situations requiring image enhancement. Typically, embodiments of this application are applicable to image enhancement of images acquired under low-light conditions. The device can be implemented in software and / or hardware and can be integrated into an electronic device. See also... Figure 6 The device specifically includes:
[0102] The expression determination module 510 is used to determine the transmittance expression of the inverted image based on the relationship between the brightness value and transmittance of the image and the brightness value of the inverted image of the target image.
[0103] The relational parameter determination module 520 is used to determine the relational parameters in the transmittance expression based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance.
[0104] The enhancement processing module 530 is used to determine the transmittance of the inverted image based on the relationship parameters and the transmittance expression, and to perform enhancement processing on the target image based on the transmittance.
[0105] In this embodiment of the application, the device further includes:
[0106] The data determination module is used to select a preset number of pixels from the inverted sample image of the sample image and determine the brightness value and transmittance of each pixel.
[0107] The coordinate relationship diagram determination module is used to determine the coordinate relationship diagram of each pixel corresponding to its brightness value and transmittance, with the pixel number as the first dimension and the brightness value and transmittance as the second dimension.
[0108] The relationship determination module is used to determine the symmetrical relationship between the brightness value and transmittance of each pixel about the axis of symmetry based on the coordinate relationship diagram.
[0109] In this embodiment of the application, the expression determination module 510 is specifically used for:
[0110] Based on the expression for the axis of symmetry and the brightness value of the inverted image, the transmissivity expression for the inverted image is determined; wherein the expression for the axis of symmetry is represented by the relational parameter.
[0111] In this embodiment of the application, the relationship parameter determination module 520 includes:
[0112] The value range determination unit is used to determine the value range of the relational parameter in the transmittance expression based on the expression of the preliminary enhanced image of the target image and the value range of the pixel values of the preliminary enhanced image.
[0113] The parameter determination unit is used to determine the relational parameters in the transmittance expression based on the minimum value in the range of relational parameter values.
[0114] In this embodiment of the application, the parameter determination unit includes:
[0115] The first determining sub-unit is used to take the minimum value in the range of the relational parameter as the relational parameter in the transmittance expression if the minimum value in the range of the relational parameter is within the preset relational parameter interval.
[0116] The second determining subunit is used to select the relational parameter of the transmittance expression from the preset relational parameter range if the minimum value of the relational parameter range is outside the preset relational parameter range.
[0117] In this embodiment of the application, the enhanced processing module 530 includes:
[0118] A preliminary enhancement unit is used to determine a preliminary enhancement image based on the expression for the transmittance and the preliminary enhancement image.
[0119] An edge information determination unit is used to determine the edge information of the target image based on the target image and a smoothed filtered image of the target image.
[0120] The final enhanced image determination unit is used to determine the final enhanced image of the target image based on the edge information and the preliminary enhanced image.
[0121] In this embodiment of the application, the final enhanced image determination unit includes:
[0122] The sharpening and enhancement image determination subunit is used to add the preliminary enhancement image to the edge information to obtain the sharpening and enhancement image.
[0123] The adjustment coefficient subunit is used to determine the adjustment coefficient based on the endpoint values of the preset relational parameter range and the relational parameters of the transmittance expression.
[0124] The adjustment subunit is used to adjust the sharpened and enhanced image according to the adjustment coefficient to obtain the final enhanced image of the target image.
[0125] In this embodiment of the application, the adjustment subunit is specifically used for:
[0126] The sharpened and enhanced image is adjusted based on the following formula to obtain the final enhanced image of the target image:
[0127]
[0128] Where J(x) is the final enhanced image of the target image, J′(x) is the sharpened enhanced image, x is the number of pixels, and a max a is the maximum value of the preset relation parameter range. min 'a' represents the minimum value of the preset relational parameter range, and 'a' represents the relational parameter in the transmittance expression.
[0129] The image enhancement apparatus provided in the application embodiments can execute the image enhancement method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the method.
[0130] Figure 7 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Figure 7 A block diagram is shown that is suitable for implementing an exemplary electronic device 612 according to embodiments of this application. Figure 7 The electronic device 612 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0131] like Figure 7 As shown, the electronic device 612 may include: one or more processors 616; and a memory 628 for storing one or more programs, which, when executed by the one or more processors 616, cause the one or more processors 616 to implement the image enhancement method provided in the embodiments of this application, including:
[0132] Based on the relationship between the brightness value and transmittance of an image, the transmittance expression of the inverted image is determined according to the brightness value of the inverted image of the target image.
[0133] Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, the relational parameters in the transmittance expression are determined; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance.
[0134] The transmittance of the inverted image is determined based on the relationship parameters and the transmittance expression, and the target image is enhanced based on the transmittance.
[0135] The components of the electronic device 612 may include, but are not limited to: one or more processors 616, memory 628, and bus 618 connecting different device components (including memory 628 and processor 616).
[0136] Bus 618 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Processor ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0137] Electronic device 612 typically includes a variety of computer-readable storage media. These storage media can be any available storage media that can be accessed by electronic device 612, including volatile and non-volatile storage media, removable and non-removable storage media.
[0138] Memory 628 may include computer device readable storage media in the form of volatile memory, such as random access memory (RAM) 630 and / or cache memory 632. Electronic device 612 may further include other removable / non-removable, volatile / non-volatile computer device storage media. By way of example only, storage system 634 may be used to read and write non-removable, non-volatile magnetic storage media (… Figure 7 Not shown; usually referred to as a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical storage medium) may be provided. In these cases, each drive may be connected to bus 618 via one or more data storage medium interfaces. Memory 628 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.
[0139] A program / utility 640 having a set (at least one) of program modules 642 may be stored, for example, in memory 628. Such program modules 642 include, but are not limited to, operating devices, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 642 typically perform the functions and / or methods described in the embodiments of this application.
[0140] Electronic device 612 can also communicate with one or more external devices 614 and / or display 624, and with one or more devices that enable a user to interact with the electronic device 612, and / or with any device that enables the electronic device 612 to communicate with one or more other computing devices (e.g., network interface card, modem, etc.). This communication can be performed via input / output (I / O) interface 622. Furthermore, electronic device 612 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 620. Figure 7 As shown, network adapter 620 communicates with other modules of electronic device 612 via bus 618. It should be understood that, although... Figure 7 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 612, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID devices, tape drives, and data backup storage devices.
[0141] One or more processors 616 execute various functional applications and data processing by running at least one of the other programs among a plurality of programs stored in memory 628, such as implementing an image enhancement method provided in the embodiments of this application.
[0142] One embodiment of this application provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform an image enhancement method, including:
[0143] Based on the relationship between the brightness value and transmittance of an image, the transmittance expression of the inverted image is determined according to the brightness value of the inverted image of the target image.
[0144] Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, the relational parameters in the transmittance expression are determined; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance.
[0145] The transmittance of the inverted image is determined based on the relationship parameters and the transmittance expression, and the target image is enhanced based on the transmittance.
[0146] The computer storage medium in this application embodiment can be any combination of one or more computer-readable storage media. The computer-readable storage medium can be a computer-readable signal storage medium or a computer-readable storage medium in general. For example, a computer-readable storage medium can be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application embodiment, the computer-readable storage medium can be any tangible storage medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or device.
[0147] Computer-readable signal storage media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal storage media may also be any computer-readable storage medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution device, apparatus, or apparatus.
[0148] Program code contained on a computer-readable storage medium may be transmitted using any suitable storage medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0149] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or device. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0150] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.
Claims
1. An image enhancement method, characterized in that, The method includes: Based on the relationship between the brightness value and transmittance of an image, the transmittance expression of the inverted image is determined according to the brightness value of the inverted image of the target image. Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, the relational parameters in the transmittance expression are determined; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance. The transmittance of the inverted image is determined based on the relationship parameters and the transmittance expression, and the target image is enhanced based on the transmittance. The target image is enhanced based on the transmittance, including: The preliminary enhanced image is determined based on the expression for the transmittance and the preliminary enhanced image; Based on the target image and the smoothed filtered image of the target image, determine the edge information of the target image; Based on the edge information and the preliminary enhanced image, the final enhanced image of the target image is determined; Based on the edge information and the preliminary enhanced image, the final enhanced image of the target image is determined, including: The preliminary enhanced image is added to the edge information to obtain the sharpened enhanced image; The adjustment coefficient is determined based on the endpoint values of the preset relational parameter range and the relational parameters of the transmittance expression; The sharpened and enhanced image is adjusted according to the adjustment coefficient to obtain the final enhanced image of the target image; The sharpened and enhanced image is adjusted according to the adjustment coefficient to obtain the final enhanced image of the target image, including: The sharpened and enhanced image is adjusted based on the following formula to obtain the final enhanced image of the target image: ; in, The final enhanced image of the target image. To sharpen and enhance the image, For pixels, The maximum value of the preset relation parameter range. The minimum value within the preset range of relational parameters. The parameter is the relational parameter in the transmittance expression.
2. The method according to claim 1, characterized in that, Based on the relationship between the brightness value and transmittance of an image, before determining the transmittance expression of the inverted image according to the brightness value of the inverted image of the target image, the method further includes: Select a preset number of pixels from the inverted sample image of the sample image, and determine the brightness value and transmittance of each pixel; Using the pixel number as the first dimension and the brightness value and transmittance as the second dimension, a coordinate relationship diagram of each pixel corresponding to the brightness value and transmittance is determined. Based on the coordinate relationship diagram, the luminance value and transmittance of each pixel are determined to be symmetrical about the axis of symmetry.
3. The method according to claim 2, characterized in that, Based on the relationship between the brightness value and transmittance of an image, the transmittance expression of the inverted image is determined according to the brightness value of the inverted image of the target image, including: Based on the expression for the axis of symmetry and the brightness value of the inverted image, the transmissivity expression for the inverted image is determined; wherein the expression for the axis of symmetry is represented by the relational parameter.
4. The method according to claim 1, characterized in that, Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, the relational parameters in the transmittance expression are determined, including: Based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image, determine the range of values for the relational parameters in the transmittance expression; The relationship parameter in the transmittance expression is determined based on the minimum value within the range of the relationship parameter.
5. The method according to claim 4, characterized in that, Based on the minimum value within the range of the relational parameters, determine the relational parameters in the transmittance expression, including: If the minimum value in the range of the relational parameter is within the preset relational parameter interval, then the minimum value in the range of the relational parameter will be used as the relational parameter in the transmittance expression. If the minimum value of the relational parameter is outside the preset relational parameter range, then the relational parameter of the transmittance expression is selected from the preset relational parameter range.
6. An image enhancement device, characterized in that, The device includes: An expression determination module is used to determine the transmittance expression of the inverted image based on the relationship between the brightness value and transmittance of the image and the brightness value of the inverted image of the target image. The relational parameter determination module is used to determine the relational parameters in the transmittance expression based on the expression of the preliminary enhanced image of the target image and the range of pixel values of the preliminary enhanced image; wherein, the expression of the preliminary enhanced image is related to the expression of transmittance. An enhancement processing module is used to determine the transmittance of the inverted image based on the relationship parameters and the transmittance expression, and to perform enhancement processing on the target image based on the transmittance; Enhanced processing module, including: A preliminary enhancement unit is used to determine a preliminary enhancement image based on the expression for the transmittance and the preliminary enhancement image; An edge information determination unit is used to determine the edge information of the target image based on the target image and a smoothed filtered image of the target image; The final enhanced image determination unit is used to determine the final enhanced image of the target image based on the edge information and the preliminary enhanced image; The final image enhancement determination unit includes: The sharpening and enhancement image determination subunit is used to add the preliminary enhancement image to the edge information to obtain the sharpening and enhancement image; The adjustment coefficient subunit is used to determine the adjustment coefficient based on the endpoint values of the preset relational parameter range and the relational parameters of the transmittance expression. An adjustment subunit is used to adjust the sharpened and enhanced image according to the adjustment coefficient to obtain the final enhanced image of the target image; Adjusting subunits, specifically for: The sharpened and enhanced image is adjusted based on the following formula to obtain the final enhanced image of the target image: ; in, The final enhanced image of the target image. To sharpen and enhance the image, For pixels, The maximum value of the preset relation parameter range. The minimum value of the preset relation parameter range. The parameter is the relational parameter in the transmittance expression.
7. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the image enhancement method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the image enhancement method as described in any one of claims 1-5.