Image processing method, device, equipment, readable storage medium and program product

By acquiring dark channel images and fogging processing and brightness enhancement, the problem of insufficient image brightness in low-illumination environments is solved, image brightness improvement and contrast retention are achieved, and image quality is improved.

CN118735831BActive Publication Date: 2024-11-26CHINA OPTICS (HANGZHOU) INTELLIGENT OPTOELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411224483.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-11-26
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

In fog, haze or low illumination environments, the dark areas in the image are low, resulting in invisible image details. The image needs to be brightened to retain local contrast and details, avoid excessive blurring, and improve overall image quality.

Method used

By acquiring the dark channel image of the original image, fog processing is performed according to the brightness value of the dark channel image, the brightness adjustment is determined, the brightness enhancement process is performed on the original image, and the fog image is obtained, and the original image is then adjusted according to the brightness value of the fog image. Brightness enhancement is performed, weighted proportions are dynamically adjusted to adapt to different image content and brightness distribution, maintain the original information at the brightness, and improve overall brightness balance and contrast.

Benefits of technology

Effectively improve image brightness, preserve local contrast and details of the image, avoid excessive blurring, improve overall image quality, achieve the purpose of improving image brightness, and maintain original information at bright spots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735831B_ABST
    Figure CN118735831B_ABST
Patent Text Reader

Abstract

The present application relates to an image processing method, device, equipment, readable storage medium and program product. The method comprises: obtaining an original image, determining a dark channel image of the original image; performing fogging processing on the original image according to the brightness value of the dark channel image to obtain a fogged image; performing brightness enhancement processing on the original image according to the brightness value of the fogged image to obtain a target image. The method can improve the brightness of an image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, apparatus, device, readable storage medium and program product. Background Art

[0002] Image technology is widely used in various fields. For example, image technology can be used in security monitoring to help identify and analyze activities or events in the scene. In medical image analysis, it can accurately identify diseases and formulate treatment plans. In autonomous driving, it can obtain road information through sensors such as cameras, analyze road conditions, identify traffic signs and pedestrians, etc., to ensure safe driving of vehicles, etc. However, factors such as fog, haze or low-light environments may cause low brightness in dark areas of the image.

[0003] However, insufficient image brightness will make the dark details in the image invisible, resulting in loss of image details. Therefore, the image needs to be brightened. Summary of the invention

[0004] Based on this, it is necessary to provide an image processing method, apparatus, computer device, computer-readable storage medium and computer program product that can improve image brightness in response to the above technical problems.

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

[0006] Acquire an original image, and determine a dark channel image of the original image;

[0007] According to the brightness value of the dark channel image, fogging the original image to obtain a fogged image;

[0008] The original image is subjected to brightness enhancement processing according to the brightness value of the fogged image to obtain a target image.

[0009] In one embodiment, the fogging process is performed on the original image according to the brightness value of the dark channel image to obtain the fogged image, including:

[0010] Determining a brightness adjustment degree of the original image according to a brightness value of the dark channel image;

[0011] The brightness of the original image is enhanced according to the brightness adjustment degree to obtain a fogged image.

[0012] In one embodiment, determining the brightness adjustment degree of the original image according to the brightness value of the dark channel image includes:

[0013] For each original pixel point of the original image, the brightness value of a first pixel point corresponding to each original pixel point is determined as a brightness enhancement value; the first pixel point is a pixel point on the dark channel image corresponding to the original pixel point.

[0014] In one embodiment, the brightness value includes a brightness value, the dark channel image includes at least two color channels, and the brightness of the original image is enhanced according to the brightness adjustment degree to obtain a fogged image, including:

[0015] Determine all target pixels whose brightness values ​​of the dark channel image are greater than a brightness threshold;

[0016] Performing mean processing on the brightness values ​​corresponding to all the target pixels to obtain the atmospheric light value of each color channel;

[0017] According to the atmospheric light value of each color channel and the brightness adjustment degree, the brightness of each original pixel in the original image is enhanced to obtain a fogged image.

[0018] In one embodiment, determining all target pixels whose brightness values ​​of the dark channel image are greater than a brightness threshold comprises:

[0019] Performing brightness recognition on the dark channel image to obtain a brightness recognition result;

[0020] Extracting a target area that meets a preset brightness condition from the dark channel image according to the brightness recognition result;

[0021] Determine all target pixels in the target area whose brightness values ​​are greater than a brightness threshold.

[0022] In one of the embodiments, the step of enhancing the brightness of each original pixel in the original image according to the atmospheric light value of each color channel and the brightness adjustment degree to obtain a fogged image includes:

[0023] For each original pixel in the original image, determine the brightness difference of each original pixel in each color channel according to the atmospheric light value; the brightness difference is used to characterize the net amount of light reflected by the surface of the object;

[0024] Multiplying each of the brightness difference values ​​and the corresponding brightness adjustment degree to obtain the brightness value of the original pixel after fogging;

[0025] The atmospheric light value is used to compensate the brightness value of the fogged channels in the respective corresponding channels to obtain a fogged image.

[0026] In one embodiment, the step of performing brightness enhancement processing on the original image according to the brightness value of the fogged image to obtain a target image includes:

[0027] For each original pixel point of the original image, determining a second pixel point corresponding to the original pixel point in the fogged image;

[0028] Determine a first weighted weight and a second weighted weight according to the brightness value of the second pixel point; wherein the first weighted weight is used to characterize the weight of a dark portion of the original image whose brightness value is less than a preset brightness threshold, and the second weighted weight is used to characterize the weight of a bright portion of the original image whose brightness value is greater than the preset brightness threshold;

[0029] According to the first weighted weight, the second weighted weight and the brightness value of the original pixel, the original image is subjected to brightness enhancement processing to obtain a target image.

[0030] In one embodiment, determining the first weighted weight and the second weighted weight according to the brightness value of the second pixel point includes:

[0031] The brightness value of the second pixel is determined as the first weighted weight, and the difference between the brightness value of the second pixel and the preset color channel value is determined as the second weighted weight.

[0032] In one embodiment, performing brightness enhancement processing on the original image according to the first weighted weight, the second weighted weight and the brightness value of the original pixel to obtain the target image includes:

[0033] Determine a first product of the first weighted weight and the brightness value of the second pixel, and determine a second product of the second weighted weight and the brightness value of the original pixel;

[0034] The first product and the second product are weighted to obtain a weighted brightness value; the weighted brightness value is normalized to complete brightness enhancement processing of the original image to obtain a target image.

[0035] In a second aspect, the present application further provides an image processing device, comprising:

[0036] An image acquisition module, used to acquire an original image and determine a dark channel image of the original image;

[0037] A fog processing module, used for performing fog processing on the original image according to the brightness value of the dark channel image to obtain a fogged image;

[0038] The brightness processing module is used to perform brightness enhancement processing on the original image according to the brightness value of the fogged image to obtain a target image.

[0039] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0040] Acquire an original image, and determine a dark channel image of the original image;

[0041] According to the brightness value of the dark channel image, fogging the original image to obtain a fogged image;

[0042] The original image is subjected to brightness enhancement processing according to the brightness value of the fogged image to obtain a target image.

[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0044] Acquire an original image, and determine a dark channel image of the original image;

[0045] According to the brightness value of the dark channel image, fogging the original image to obtain a fogged image;

[0046] The original image is subjected to brightness enhancement processing according to the brightness value of the fogged image to obtain a target image.

[0047] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0048] Acquire an original image, and determine a dark channel image of the original image;

[0049] According to the brightness value of the dark channel image, fogging the original image to obtain a fogged image;

[0050] The original image is subjected to brightness enhancement processing according to the brightness value of the fogged image to obtain a target image.

[0051] The above-mentioned image processing method, device, computer equipment, computer-readable storage medium and computer program product determine the dark channel image of the original image, fog the original image according to the brightness value of the dark channel image, and obtain a fogged image. The brightness value of the dark channel image is used as the basis for fogging, and the enhancement intensity of the fogging can be adaptively determined for different brightness values, so that the obtained fogged image can retain the local contrast and details of the image, avoid excessive blurring, and improve the overall image quality. On this basis, the original image is brightness enhanced according to the brightness value of the fogged image to obtain a target image. The weighting ratio can be dynamically adjusted according to different image contents and brightness distributions, and can adapt to different images and application scenarios, that is, the original information of the bright area can be maintained while the brightness of the dark area is enhanced, thereby improving the brightness balance and contrast of the overall image, thereby achieving the purpose of improving the image brightness. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0053] Figure 1 A diagram showing an application environment of an image processing method in an embodiment;

[0054] Figure 2 is a schematic flow chart of an image processing method in one embodiment;

[0055] Figure 3 is a schematic flow chart of step 202 in one embodiment;

[0056] Figure 4 A schematic diagram of a process flow of an image fogging processing method in one embodiment;

[0057] Figure 5 is a schematic diagram of a flow chart of an image weighted processing method in one embodiment;

[0058] Figure 6 is a structural block diagram of an image processing device in one embodiment;

[0059] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] The image processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal obtains the original image and determines the dark channel image of the original image; according to the brightness value of the dark channel image, the original image is fogged to obtain the fogged image; according to the brightness value of the fogged image, the original image is brightness enhanced to obtain the target image. Among them, the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0062] In an exemplary embodiment, Figure 2 As shown, an image processing method is provided, which is applied to Figure 1 The terminal in is taken as an example to illustrate, including the following steps 202 to 206. Among them:

[0063] Step 202: Acquire an original image and determine a dark channel image of the original image.

[0064] Among them, the original image can be understood as an image directly captured by an image acquisition device. The image acquisition device can be set at different terminals. The terminals can be mobile carriers and stationary carriers. The mobile carriers can be but are not limited to mobile vehicles, robots, airplanes, and ships. For example, the image acquisition device is set on a vehicle to capture images of the vehicle in different driving environments. The type of driving environment is not limited here. The image acquisition device can also be different types of image acquisition devices, such as cameras. In this embodiment, the original image can be an image including a dark area with a brightness less than a preset brightness. The brightness of the dark area can be the brightness of those areas in the image that lack sufficient lighting due to insufficient ambient light or the characteristics of the scene itself. In the image taken by the camera, these areas may appear darker in color, with unclear or lost details, and low overall contrast.

[0065] The dark channel image can be understood as calculating the minimum value of the three RGB color channels for each pixel of the image, and then generating a new grayscale image. The grayscale image highlights the dark areas in the original image. Further, when determining the dark channel image of the original image, the image type of the original image can be determined; the determination method of the dark channel image is determined according to the image type, and the dark channel image of the original image is determined according to the determination method. Among them, the image type can include any one of a grayscale image and a color image. When determining the dark channel image based on the image type, the original image can be determined as a dark channel image when the image type is a grayscale image, which can be expressed as: dark channel image dark_img = grayscale image img.

[0066] In the case where the image type is a color image, the dark channel image is determined according to the brightness value of each original pixel in the original image. Optionally, the dark channel image is determined according to the brightness value of each original pixel in the original image, and the minimum value of each pixel in the preset color channel is determined for each original pixel in the original image; the minimum value is determined as the brightness value of the corresponding original pixel, and the dark channel image of the original image is obtained, which can be expressed as:

[0067] Original image img, dark channel image , where 1, 2, and 3 represent the three color channels of RGB respectively. , Represents the image width, Represents the image height.

[0068] Exemplarily, an original image captured by an image acquisition device is obtained, and the image type of the original image is determined. When the image type is a grayscale image, the original image is determined to be a dark channel image. When the image type is a color image, the minimum value of the three RGB color channels is calculated for each original pixel of the original image to obtain a new image, and the new image is used as the dark channel image.

[0069] Furthermore, when the original image is acquired, the brightness of the original image can be detected to determine whether the original image needs to be processed for brightness enhancement, and when it is detected that the preset conditions for brightness enhancement are met, the dark channel image of the original image is determined. The detection of whether the original image needs to be processed for brightness enhancement can be, but is not limited to, determined by a trained image detection model, which will not be elaborated here.

[0070] Step 204, fogging the original image according to the brightness value of the dark channel image to obtain a fogged image.

[0071] Among them, fogging can be understood as simulating the effect of fog on an image to enhance the visual effect of the image or provide data enhancement for a specific application scenario, that is, fogging includes brightness enhancement. For the same original image, the original image includes multiple pixels. When the brightness of the original image is enhanced, the corresponding brightness adjustment degree can be determined according to the brightness value of the dark channel image corresponding to the original image, and the brightness of the original image is enhanced with the brightness adjustment degree to obtain a fogged image.

[0072] It is understandable that the brightness adjustment degree can be determined based on the corresponding relationship between the brightness value and the brightness adjustment degree, or the brightness adjustment degree matching the brightness value can be determined based on the brightness value of the dark channel image. For a dark channel image, the brightness value of each pixel of the dark channel image may be different, so adaptive adjustment can be performed for different brightnesses.

[0073] Step 206, performing brightness enhancement processing on the original image according to the brightness value of the fogged image to obtain a target image.

[0074] The brightness enhancement process may be performed by determining a weight according to the brightness value of the fogged image, and performing weighted processing on the fogged image and the original image according to the weight to obtain a target image with enhanced brightness.

[0075] It should be noted that the specific relationship between the weighted processing of the fogged image and the original image can be that the weights of the dark part and the bright part can be dynamically adjusted so that the sum of the weights of the two parts is a preset value, so that after the brightness of the original image is enhanced, the brightness of the first area in the original image is less than the preset brightness, close to the brightness of the fogged image in the corresponding position area, and the brightness of the second area in the original image is greater than the preset brightness, close to the original brightness of the second area in the original image before the brightness enhancement processing, that is, the original brightness of the second area in the original image is retained. It can be understood that closeness can be that the brightness difference is within the preset difference range, and the preset difference range can be determined according to the actual application scenario.

[0076] In the above image processing method, by determining the dark channel image of the original image, fogging the original image according to the brightness value of the dark channel image to obtain a fogged image, taking the brightness value of the dark channel image as the basis for fogging, and adaptively determining the enhancement intensity of fogging for different brightness values, so that the obtained fogged image can retain the local contrast and details of the image, avoid excessive blurring, and improve the overall image quality. On this basis, brightness enhancement processing is performed on the original image according to the brightness value of the fogged image to obtain a target image, and the weighting ratio can be dynamically adjusted according to different image contents and brightness distributions, and can adapt to different images and application scenarios, that is, the original information of the bright areas can be maintained while the details of the dark areas are enhanced, thereby improving the brightness balance and contrast of the overall image, thereby achieving the purpose of improving the image brightness.

[0077] The premise of image brightness enhancement processing is to determine the fogged image corresponding to the original image. In an exemplary embodiment, Figure 3 As shown, step 202 includes steps 302 to 304, wherein:

[0078] Step 302: Determine the brightness adjustment degree of the original image according to the brightness value of the dark channel image.

[0079] It should be noted that due to the influence of environmental factors and other factors, the brightness of each pixel in the same captured image is also different. In order to ensure the overall brightness improvement effect of the original image, different proportions of enhancement are required for different brightness values ​​to determine the corresponding fogged image.

[0080] Exemplarily, the brightness adjustment degree of the original image is determined according to the brightness value of the dark channel image. Furthermore, the original image includes a plurality of pixels, and for each original pixel of the original image, the brightness value of the first pixel corresponding to each original pixel is determined as the brightness enhancement value; the first pixel is the pixel corresponding to the original pixel on the dark channel image. If the original image is a color image, then for each first pixel of the dark channel image, the brightness value corresponding to the first pixel may be the brightness value of any color channel in the RGB channel. If the original image is a grayscale image, the grayscale image is a single-channel image, and the brightness value corresponding to the first pixel is the brightness value on the single channel.

[0081] Step 304: enhance the brightness of the original image according to the brightness adjustment degree to obtain a fogged image.

[0082] The enhancement process of the brightness of the original image according to the brightness adjustment degree may be to directly multiply the brightness adjustment degree by the brightness value of the corresponding original image to achieve the enhancement process. The enhancement process may also be to determine the atmospheric light value according to the brightness of the dark channel image, and enhance the brightness of the original image according to the atmospheric light value and the brightness adjustment degree.

[0083] In the above embodiment, different proportions of enhancement are performed according to brightness, and the brightness can be enhanced in dark areas to help restore lost details, and to help expand the dynamic range of the image and retain more bright and dark details.

[0084] Optionally, in an exemplary embodiment, as Figure 4 As shown, a method for image fogging is provided, comprising steps 402 to 406. Among them:

[0085] Step 402: determine all target pixels in the dark channel image whose brightness values ​​are greater than a brightness threshold.

[0086] The brightness threshold is preset, and the brightness threshold may be, but is not limited to, 200.

[0087] Exemplarily, all first pixel points in the dark channel image are determined, and each first pixel point is polled in turn to determine whether the brightness value is greater than the brightness threshold. If it is greater, it is determined as the target pixel point. In this way, all target pixel points in the dark channel image whose brightness value is greater than the brightness threshold can be obtained.

[0088] Optionally, the target area can be determined from the dark channel image according to the distribution of brightness in the dark channel image, and the first pixel in the target area is determined as the target pixel. In an exemplary embodiment, the method of determining the target pixel also includes: performing brightness recognition on the dark channel image to obtain a brightness recognition result; extracting the target area that meets the preset brightness condition from the dark channel image according to the brightness recognition result; and determining all target pixels in the target area whose brightness value is greater than a brightness threshold.

[0089] The preset brightness condition may be a brightness range or a preset value, and the preset brightness value and the brightness threshold in the preset brightness condition may be the same or different. For example, the dark channel image includes a sky area and a non-sky area, and the brightness of the image corresponding to the sky area is greater than the brightness of the non-sky area. The pixel points corresponding to the sky area can be determined as target pixel points, and the target pixel points greater than the brightness threshold can be screened out from the pixel points corresponding to the sky area to obtain all target pixel points. This method does not require all pixel points to be judged, which can reduce the amount of data processing.

[0090] Step 404, performing mean processing on the brightness values ​​corresponding to all target pixels to obtain the atmospheric light value of each color channel.

[0091] Among them, the atmospheric light value can be expressed as ,in, Represents the brightness of the target pixel in the dark channel image, Represents the original pixel of the original image. k can be at least one of 1, 2, and 3, representing any color channel in the RGB color channels respectively. For example, 1 can be the R color channel, 2 can be the G color channel, and 3 can be the B color channel.

[0092] Exemplarily, for each color channel, original pixel points corresponding to all target pixel points are determined in the original image, and the average value of the pixel values ​​of the original pixel points corresponding to all target pixel points is calculated to obtain the atmospheric light value of the corresponding color channel.

[0093] Step 406 , according to the atmospheric light value and brightness adjustment degree of each color channel, the brightness of each original pixel in the original image is enhanced to obtain a fogged image.

[0094] Exemplarily, based on the bijection scattering model, the brightness of each original pixel in the original image is enhanced according to the atmospheric light value and brightness adjustment degree of each color channel to obtain a fogged image.

[0095] In an exemplary embodiment, the method for determining a fogged image includes: for each original pixel in the original image, determining the brightness difference of each original pixel in each color channel according to the atmospheric light value; the brightness difference is used to characterize the net amount of light reflected from the surface of the object; multiplying each brightness difference with the corresponding brightness adjustment degree to obtain the brightness value of the original pixel after fogging; and using the atmospheric light value to compensate for the brightness values ​​after fogging on each corresponding channel to obtain a fogged image.

[0096] Among them, the fogged image The calculation method can be as follows:

[0097] ;

[0098] In this embodiment, by determining the atmospheric light value of each color channel, the original image is enhanced in different proportions according to the atmospheric light value and the pixels of the dark channel image according to the brightness, and the details and contrast of the image are restored, which can achieve the effect of retaining more details of the bright and dark parts.

[0099] It should be noted that, after enhancing the image at different ratios according to the brightness, the enhanced image and the original image are weighted to obtain a better brightness enhancement effect. Therefore, in an exemplary embodiment, Figure 5 As shown, a method for image weighting processing is provided, comprising steps 502 to 506, wherein:

[0100] Step 502: for each original pixel point of the original image, determine a second pixel point corresponding to the original pixel point in the fogged image.

[0101] Step 504, determine the first weighted weight and the second weighted weight according to the brightness value of the second pixel point; wherein the first weighted weight is used to characterize the weight of the dark part in the original image whose brightness value is less than the preset brightness threshold, and the second weighted weight is used to characterize the weight of the bright part in the original image whose brightness value is greater than the preset brightness threshold.

[0102] The first weighted weight and the second weighted weight may be determined by determining the brightness value of the second pixel as the first weighted weight and determining the difference between the brightness value of the second pixel and the preset color channel value as the second weighted weight.

[0103] It should be noted that the first weighted weight and the second weighted weight mentioned here are the weights of each pixel in the K channel. For example, the first weighted weight can be expressed as , the second weighted weight can be expressed as ,in, Indicates the pixel value of the second pixel corresponding to the k channel ij in the fogged image.

[0104] Step 506, performing brightness enhancement processing on the original image according to the first weighted weight, the second weighted weight and the brightness value of the original pixel to obtain a target image.

[0105] Optionally, determining a first weighted weight and a fogged image The first product of the brightness value, and the determination of the second weighted weight and the original pixel point The second product of the brightness value of the image is obtained; the first product and the second product are weighted to obtain a weighted brightness value; the weighted brightness value is normalized to complete the brightness enhancement processing of the original image to obtain a target image, wherein the normalization processing can be divided by 255 to normalize the pixel value range of the result to 0 to 1, ensuring that the pixel value of the processed image is within the effective display range to avoid loss of details.

[0106] Specifically, it can be expressed as:

[0107] ;

[0108] Understandably, Can be used to enhance dark areas in an image. When the value of is large, it means that the pixel is in a dark area, and its square will further increase this weight, thereby enhancing the brightness of these dark areas in the final image. The value of is smaller (i.e. the pixel is brighter), then The value of will be larger, which means that the bright area The original pixel value has a larger weight in the final image, thus protecting the bright details. In this method, the two parts are weighted and summed, and then normalized by dividing by 255 to jointly determine the final pixel value. , which enhances the dark areas and protects the bright areas, achieving a balanced adjustment of the image brightness.

[0109] In the above embodiment, by performing weighted processing on the fogged image and the original image, the dark part is enhanced and the bright part is protected, thereby achieving balanced adjustment of the image brightness.

[0110] In an exemplary embodiment, an original image is acquired, a dark channel image of the original image is determined, and for each original pixel point of the original image, a brightness value of a first pixel point corresponding to each original pixel point is determined as a brightness enhancement value; the first pixel point is a pixel point on the dark channel image corresponding to the original pixel point, and all target pixel points in the dark channel image whose brightness values ​​are greater than a brightness threshold are determined;

[0111] The brightness values ​​corresponding to all target pixels are averaged to obtain the atmospheric light value of each color channel; for each original pixel in the original image, the brightness difference of each original pixel in each color channel is determined according to the atmospheric light value; the brightness difference is used to characterize the net amount of light reflected from the surface of the object; each brightness difference is multiplied by the corresponding brightness adjustment degree to obtain the brightness value of the original pixel after fogging; the atmospheric light value is used to compensate the brightness value of each corresponding channel after fogging to obtain a fogged image.

[0112] For each original pixel of the original image, a second pixel corresponding to the original pixel is determined in the fogged image; the brightness value of the second pixel is determined as the first weighted weight, and the difference between the brightness value of the second pixel and the preset color channel value is determined as the second weighted weight; wherein the first weighted weight is used to characterize the weight of the dark part of the original image whose brightness value is less than the preset brightness threshold, and the second weighted weight is used to characterize the weight of the bright part of the original image whose brightness value is greater than the preset brightness threshold; determine the first product of the first weighted weight and the brightness value of the second pixel, and determine the second product of the second weighted weight and the brightness value of the original pixel; perform weighted processing on the first product and the second product to obtain a weighted brightness value; perform normalization processing on the weighted brightness value to complete the brightness enhancement processing of the original image to obtain a target image.

[0113] In the above embodiment, after the image is enhanced at different ratios according to brightness, the enhanced fogged image and the original image are weighted, so that the dark part is enhanced and the bright part is protected, thereby achieving balanced adjustment of the image brightness.

[0114] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0115] Based on the same inventive concept, the embodiment of the present application also provides an image processing device for implementing the above-mentioned image processing method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image processing device embodiments provided below can refer to the limitations on the image processing method above, and will not be repeated here.

[0116] In an exemplary embodiment, Figure 6 As shown, an image processing device is provided, including: an image acquisition module 602, a fog processing module 604 and a brightness processing module 606, wherein:

[0117] The image acquisition module 602 is used to acquire an original image and determine a dark channel image of the original image.

[0118] The fog processing module 604 is used to perform fog processing on the original image according to the brightness value of the dark channel image to obtain a fogged image.

[0119] The brightness processing module 606 is used to perform brightness enhancement processing on the original image according to the brightness value of the fogged image to obtain a target image.

[0120] In the above embodiment, by determining the dark channel image of the original image, fogging the original image according to the brightness value of the dark channel image to obtain a fogged image, taking the brightness value of the dark channel image as the basis for fogging, and adaptively determining the enhancement intensity of the fogging for different brightness values, so that the obtained fogged image can retain the local contrast and details of the image, avoid excessive blurring, and improve the overall image quality. On this basis, brightness enhancement processing is performed on the original image according to the brightness value of the fogged image to obtain a target image. The weighting ratio can be dynamically adjusted according to different image contents and brightness distributions, and can adapt to different images and application scenarios, that is, the original information of the bright areas can be maintained while the brightness of the dark areas is enhanced, thereby improving the brightness balance and contrast of the overall image, thereby achieving the purpose of improving the image brightness.

[0121] In an exemplary embodiment, the fogging processing module 604 is further used to determine the brightness adjustment degree of the original image according to the brightness value of the dark channel image;

[0122] The brightness of the original image is enhanced according to the brightness adjustment degree to obtain a fogged image.

[0123] In an exemplary embodiment, the fog processing module 604 is also used to determine the brightness value of the first pixel corresponding to each original pixel of the original image as the brightness enhancement value; the first pixel is the pixel corresponding to the original pixel on the dark channel image.

[0124] In an exemplary embodiment, the fogging processing module 604 is further used to determine all target pixels in the dark channel image whose brightness values ​​are greater than a brightness threshold;

[0125] Perform mean processing on the brightness values ​​corresponding to all target pixels to obtain the atmospheric light value of each color channel;

[0126] According to the atmospheric light value and brightness adjustment degree of each color channel, the brightness of each original pixel in the original image is enhanced to obtain a fogged image.

[0127] In an exemplary embodiment, the image processing device further includes a brightness recognition module and an extraction module, wherein the brightness recognition module is used to perform brightness recognition on the dark channel image to obtain a brightness recognition result;

[0128] An extraction module, used to extract a target area that meets a preset brightness condition from a dark channel image according to a brightness recognition result;

[0129] Determine all target pixels in the target area whose brightness values ​​are greater than the brightness threshold.

[0130] In an exemplary embodiment, the fogging processing module 604 is further used to determine the brightness difference of each original pixel in each color channel according to the atmospheric light value for each original pixel in the original image; the brightness difference is used to characterize the net amount of light reflected by the surface of the object;

[0131] Multiply each brightness difference value and the corresponding brightness adjustment degree to obtain the brightness value of the original pixel after fogging;

[0132] The atmospheric light value is used to compensate the brightness value of the fogged channels to obtain a fogged image.

[0133] In an exemplary embodiment, the brightness processing module 606 is further configured to determine, for each original pixel of the original image, a second pixel corresponding to the original pixel in the fogged image;

[0134] Determine a first weighted weight and a second weighted weight according to the brightness value of the second pixel point; wherein the first weighted weight is used to characterize the weight of a dark portion in the original image whose brightness value is less than a preset brightness threshold, and the second weighted weight is used to characterize the weight of a bright portion in the original image whose brightness value is greater than the preset brightness threshold;

[0135] According to the first weighted weight, the second weighted weight and the brightness value of the original pixel, the original image is subjected to brightness enhancement processing to obtain a target image.

[0136] In an exemplary embodiment, the brightness processing module 606 is further configured to determine the brightness value of the second pixel as the first weighted weight, and determine the difference between the brightness value of the second pixel and the preset color channel value as the second weighted weight.

[0137] In an exemplary embodiment, the brightness processing module 606 is further used to determine a first product of the first weighted weight and the brightness value of the second pixel, and to determine a second product of the second weighted weight and the brightness value of the original pixel;

[0138] Performing weighted processing on the first product and the second product to obtain a weighted brightness value;

[0139] The weighted brightness values ​​are normalized to complete the brightness enhancement processing of the original image and obtain the target image.

[0140] Each module in the above image processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0141] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, an image processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0142] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0143] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0145] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0147] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0148] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0149] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire an original image, and determine a dark channel image of the original image; According to the brightness value of the dark channel image, fogging the original image to obtain a fogged image; Performing brightness enhancement processing on the original image according to the brightness value of the fogged image to obtain a target image; The fogging process is performed on the original image according to the brightness value of the dark channel image to obtain a fogged image, including: Determining a brightness adjustment degree of the original image according to a brightness value of the dark channel image; Performing brightness enhancement processing on the original image according to the brightness adjustment degree to obtain a fogged image; The step of enhancing the brightness of the original image according to the brightness adjustment degree to obtain a fogged image includes: Determine all target pixels in the dark channel image whose brightness values ​​are greater than a brightness threshold; Performing mean processing on the brightness values ​​corresponding to all the target pixels to obtain the atmospheric light value of each color channel; For each original pixel in the original image, determine the brightness difference of each original pixel in each color channel according to the atmospheric light value; the brightness difference is used to characterize the net amount of light reflected by the surface of the object; Multiplying each of the brightness difference values ​​and the corresponding brightness adjustment degree to obtain the brightness value of the original pixel after fogging; The atmospheric light value is used to compensate the brightness value of the fogged channels in the respective corresponding channels to obtain a fogged image.

2. The method according to claim 1, characterized in that The step of determining the brightness adjustment degree of the original image according to the brightness value of the dark channel image comprises: For each original pixel point of the original image, the brightness value of a first pixel point corresponding to each original pixel point is determined as a brightness enhancement value; the first pixel point is a pixel point on the dark channel image corresponding to the original pixel point.

3. The method according to claim 1, characterized in that The step of determining all target pixels whose brightness values ​​of the dark channel image are greater than a brightness threshold comprises: Performing brightness recognition on the dark channel image to obtain a brightness recognition result; Extracting a target area that meets a preset brightness condition from the dark channel image according to the brightness recognition result; Determine all target pixels in the target area whose brightness values ​​are greater than a brightness threshold.

4. The method according to any one of claims 1 to 3, characterized in that: The step of performing brightness enhancement processing on the original image according to the brightness value of the fogged image to obtain a target image includes: For each original pixel point of the original image, determining a second pixel point corresponding to the original pixel point in the fogged image; Determine a first weighted weight and a second weighted weight according to the brightness value of the second pixel point; wherein the first weighted weight is used to characterize the weight of a dark portion of the original image whose brightness value is less than a preset brightness threshold, and the second weighted weight is used to characterize the weight of a bright portion of the original image whose brightness value is greater than the preset brightness threshold; According to the first weighted weight, the second weighted weight and the brightness value of the original pixel, the original image is subjected to brightness enhancement processing to obtain a target image.

5. The method according to claim 4, characterized in that The determining the first weighted weight and the second weighted weight according to the brightness value of the second pixel point includes: The brightness value of the second pixel is determined as the first weighted weight, and the difference between the brightness value of the second pixel and the preset color channel value is determined as the second weighted weight.

6. The method according to claim 5, characterized in that The step of performing brightness enhancement processing on the original image according to the first weighted weight, the second weighted weight and the brightness value of the original pixel to obtain a target image includes: Determine a first product of the first weighted weight and the brightness value of the second pixel, and determine a second product of the second weighted weight and the brightness value of the original pixel; Performing weighted processing on the first product and the second product to obtain a weighted brightness value; The weighted brightness values ​​are normalized to complete the brightness enhancement process of the original image to obtain a target image.

7. An image processing device, characterized in that: The device comprises: An image acquisition module, used to acquire an original image and determine a dark channel image of the original image; A fog processing module, used for performing fog processing on the original image according to the brightness value of the dark channel image to obtain a fogged image; A brightness processing module, used for performing brightness enhancement processing on the original image according to the brightness value of the fogged image to obtain a target image; The fogging processing module is further used to determine the brightness adjustment degree of the original image according to the brightness value of the dark channel image; Performing brightness enhancement processing on the original image according to the brightness adjustment degree to obtain a fogged image; Determine all target pixels in the dark channel image whose brightness values ​​are greater than a brightness threshold; Performing mean processing on the brightness values ​​corresponding to all the target pixels to obtain the atmospheric light value of each color channel; For each original pixel in the original image, determine the brightness difference of each original pixel in each color channel according to the atmospheric light value; the brightness difference is used to characterize the net amount of light reflected by the surface of the object; Multiplying each of the brightness difference values ​​and the corresponding brightness adjustment degree to obtain the brightness value of the original pixel after fogging; The atmospheric light value is used to compensate the brightness value of the fogged channels in the respective corresponding channels to obtain a fogged image.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.