Image enhancement method and device, storage medium and computer program product

By performing color equalization, contrast optimization and grayscale adjustment on underwater images, the problem of unsatisfactory image enhancement effect in the prior art is solved, higher visual quality and color reproduction are achieved, and the clarity and brightness of the image are improved. .

CN119090977AActive Publication Date: 2024-12-06CHINA TELECOM CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411119519.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-12-06
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

The existing image enhancement methods have problems such as slow speed, unsatisfactory results, noise sensitivity, insufficient robustness and complex parameter adjustment when processing underwater images, resulting in poor visual quality and color reduction.

Method used

By acquiring the original image, color equalization processing, contrast optimization and grayscale adjustment are carried out, including enhancement and standardization of RGB color channel component values, and using sliding window and histogram equalization technology to gradually improve the color distribution, contrast and grayscale of the image Value range.

Benefits of technology

It significantly improves the visual quality and color reproduction of the image, makes the image clearer, visual impact, and improves the overall brightness and dynamic range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090977A_ABST
    Figure CN119090977A_ABST
Patent Text Reader

Abstract

The invention discloses an image enhancement method and device, a storage medium and a computer program product. Comprising the steps that an original image is acquired, and the original image comprises a plurality of pixel points whose pixel values are first pixel values; color equalization processing is carried out on the first pixel value of each pixel point in the original image to obtain a first intermediate image, the first intermediate image comprises a plurality of pixel points whose pixel values are second pixel values, and the second pixel values are obtained by carrying out color equalization processing on the first pixel values of the corresponding pixel points; contrast optimization is carried out on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, and the second intermediate image comprises a plurality of pixel points whose pixel values are third pixel values; and performing gray adjustment on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image. The technical problem that the visual quality and the color reducibility are poor after an image is enhanced through a related algorithm is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Underwater activities such as underwater archaeology, underwater environmental protection, underwater terrain scanning and underwater autonomous navigation are inseparable from the support of underwater visual technology. Therefore, obtaining clear underwater images plays a key role in ocean exploration. The imaging process of underwater images is quite different from that of outdoor images. Due to the selective attenuation of light of different wavelengths when propagating in water, light scattering in complex underwater environments, artificial light sources and other problems, underwater images show problems such as color cast, blur, and low visibility. Therefore, underwater image enhancement technology has become one of the key means to improve the quality and visualization of underwater images.

[0003] However, most existing image enhancement methods still have the following problems when processing underwater images: (1) There are problems with processing speed, and the speed of image processing is slow; (2) The effect is good for certain types of images, but the effect may not be ideal for other types of images; (3) They are sensitive to noise, resulting in noise or artifacts in the enhanced image; (4) They are not robust enough for complex lighting conditions or irregular lighting distribution; (5) When processing images, multiple parameters need to be adjusted or set, and this process may require users to perform some trial and error or optimization.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide an image enhancement method, device, storage medium and computer program product to at least solve the technical problem that the visual quality and color reproduction of images after enhancement by related algorithms are poor.

[0006] According to one aspect of an embodiment of the present application, an image enhancement method is provided, including: obtaining an original image to be processed, wherein the original image includes a plurality of pixel points whose pixel values ​​are first pixel values; performing color balancing processing on the first pixel value of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes a plurality of pixel points whose pixel values ​​are second pixel values, and the second pixel value is obtained by performing color balancing processing on the first pixel value of the corresponding pixel point; performing contrast optimization on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes a plurality of pixel points whose pixel values ​​are third pixel values; performing grayscale adjustment on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

[0007] Optionally, color balancing is performed on the first pixel value of each pixel in the original image to obtain a first intermediate image, including: determining the first pixel values ​​of multiple pixel points in the original image, wherein the first pixel value is an RGB color value; performing RGB color decomposition on the first pixel values ​​of multiple pixel points in the original image to obtain three first color component values ​​of each pixel point on the three RGB color channels; performing color balancing on the three first color component values ​​of each pixel point on the three RGB color channels to obtain three second color component values ​​of each pixel point on the three RGB color channels, wherein the color balancing processing at least includes: enhancement processing and standardization processing; determining the second pixel value of each pixel point based on the three second color component values ​​of each pixel point in the three RGB color channels, and obtaining the first intermediate image based on the second pixel value of each pixel point.

[0008] Optionally, the three first color component values ​​of each pixel point on the three RGB color channels are color-equalized to obtain the three second color component values ​​of each pixel point on the three RGB color channels, including: for each pixel point, the three first color component values ​​of the pixel point on the three RGB color channels are enhanced to obtain the corresponding three third color component values; the three third color component values ​​of the pixel point on the three RGB color channels are standardized to obtain the corresponding three second color component values.

[0009] Optionally, the three first color component values ​​of the pixel point on the three RGB color channels are enhanced respectively to obtain corresponding three third color component values, including: for the first color component value of the pixel point on each color channel, the first color component value is normalized; each pixel point is traversed by using a preset sliding window, and the third color component value of each pixel point is determined based on a preset enhancement ratio, a preset window step size, the position coordinates of the pixel point in the original image and the normalized first color component value.

[0010] Optionally, the three third color component values ​​of the pixel point on the three RGB color channels are respectively standardized to obtain the corresponding three second color component values, including: determining three first color histograms corresponding to the three RGB color channels based on the third color component values ​​of multiple pixels in the original image on each color channel; determining the maximum non-zero color component value and the minimum non-zero color component value in each first color histogram; for the third color component value of the pixel point on each color channel, adjusting the third color component value based on the maximum non-zero color component value and the minimum non-zero color component value in the first color histogram corresponding to the color channel to obtain the corresponding second color component value.

[0011] Optionally, contrast optimization is performed on the second pixel value of each pixel point in the first intermediate image to obtain the second intermediate image, including: dividing the first intermediate image into multiple non-overlapping sub-blocks, and determining the second pixel value of each pixel point in each sub-block, wherein the second pixel value is determined by three second color component values ​​of the pixel point in three RGB color channels; for each sub-block, determining three second color histograms of the sub-block in three RGB color channels based on the second pixel values ​​of each pixel point in the sub-block; determining the cumulative distribution function of the sub-block in three RGB color channels based on the three second color histograms, wherein the cumulative distribution function is used to characterize the color component value of each pixel point in the sub-block as the cumulative probability density of the second color component value; for the second color component value of the sub-block in each color channel, determining a mapping function according to the cumulative distribution function, and mapping the second color component value according to the mapping function to obtain a corresponding fourth color component value; determining the third pixel value of each pixel point based on the three fourth color component values ​​of each pixel point in three RGB color channels, and obtaining the second intermediate image based on the third pixel value of each pixel point.

[0012] Optionally, grayscale adjustment is performed on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image, including: determining the third pixel values ​​of multiple pixel points in the second intermediate image, wherein the third pixel value is a grayscale value, and the grayscale value is determined by three fourth color components of the pixel point in the RGB three color channels; determining a pixel histogram of the second intermediate image according to the third pixel value of each pixel point, and determining a maximum non-zero pixel value and a minimum non-zero pixel value based on the pixel histogram; for each third pixel value, adjusting the third pixel value based on the maximum non-zero pixel value, the minimum non-zero pixel value, and a preset control parameter to obtain a corresponding fourth pixel value, and using the fourth pixel value as the pixel value of the corresponding pixel point in the second intermediate image, wherein the control parameter is used to control the adjustment amplitude, and the larger the control parameter, the smaller the adjustment amplitude, and vice versa, the smaller the control parameter, the larger the adjustment amplitude; the enhanced target image is obtained according to the fourth pixel value of each pixel point.

[0013] According to another aspect of an embodiment of the present application, an image enhancement device is also provided, including: an acquisition module, used to acquire an original image to be processed, wherein the original image includes multiple pixel points whose pixel values ​​are first pixel values; a first processing module, used to perform color balancing processing on the first pixel values ​​of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes multiple pixel points whose pixel values ​​are second pixel values, and the second pixel value is obtained by performing color balancing processing on the first pixel values ​​of the corresponding pixel points; a second processing module, used to perform contrast optimization on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes multiple pixel points whose pixel values ​​are third pixel values; and a third processing module, used to perform grayscale adjustment on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

[0014] According to another aspect of an embodiment of the present application, a non-volatile storage medium is further provided, the non-volatile storage medium including a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-mentioned image enhancement method by running the computer program.

[0015] According to another aspect of an embodiment of the present application, a computer program product is further provided. The computer program product includes a stored computer program, wherein the computer program implements the above-mentioned image enhancement method when executed by a processor.

[0016] In an embodiment of the present application, an original image to be processed is obtained, wherein the original image includes a plurality of pixel points whose pixel values ​​are first pixel values; color equalization processing is performed on the first pixel values ​​of each pixel point in the original image to obtain a first intermediate image, wherein the color distribution of the first intermediate image is more uniform and closer to the real image color than the original image; contrast optimization is performed on the second pixel values ​​of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the image details and contrast of the second intermediate image are significantly enhanced compared to the first intermediate image, making the image clearer and more visually impactful; grayscale adjustment is performed on the third pixel values ​​of each pixel point in the second intermediate image to obtain an enhanced target image, wherein the grayscale value distribution range of the target image is wider than that of the second intermediate image, thereby improving the overall brightness and dynamic range of the image, thereby solving the technical problem of poor visual quality and color reproduction after image enhancement by related algorithms. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a hardware structure block diagram of an optional computer terminal (or mobile device) for implementing an image enhancement method according to an embodiment of the present application;

[0019] Figure 2 is a flow chart of an optional image enhancement method according to an embodiment of the present application;

[0020] Figure 3 is a visual analysis comparison diagram of an optional multi-class image enhancement method according to an embodiment of the present application;

[0021] Figure 4 is a schematic structural diagram of an optional image enhancement device according to an embodiment of the present application;

[0022] Figure 5 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] In addition, the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0026] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

[0027] Pixel: refers to the smallest controllable unit in a digital image, that is, the basic element that constitutes a digital image. Each pixel contains information about the color and brightness of the image. By combining pixels of different colors, rich image content can be presented. In digital image processing and computer graphics, pixels are the basic unit of image processing and display.

[0028] Pixel value: refers to the grayscale value or color component value of each pixel in a digital image. In digital image processing, pixel values ​​are usually used to represent information such as brightness and color in an image. The common pixel value range is 0 to 255, representing different grayscale levels from black to white. In a color image, each pixel is usually composed of pixel values ​​of three channels (red, green, and blue) to represent different colors.

[0029] Contrast: Refers to the degree of difference in brightness or color between adjacent pixels in a digital image. The higher the contrast, the more obvious the differences between different areas in the image, making the image clearer and more vivid.

[0030] Automatic Color Equalization (ACE) is an image processing technique that adjusts the color distribution of an image to make the color histogram of the image more uniform. Therefore, the algorithm can improve the visual effect of the image, especially when the color distribution is uneven or some color channels are too bright or too dark.

[0031] Fast Automatic Color Equalization (Fast ACE) is a technology used for image color equalization, which aims to improve the visual effect of the image and make the brightness and color distribution of the image more uniform. Its core idea is to make the brightness distribution of the image more uniform by adjusting the histogram of the image.

[0032] Adaptive Histogram Equalization (AHE) is a technique for enhancing image contrast, especially for contrast enhancement in local areas. Its basic idea is to divide the image into multiple small areas and perform histogram equalization on each small area.

[0033] Peak Signal-to-Noise Ratio (PSNR): refers to the level of distortion produced by the image enhancement operation compared to the original ideal illumination image, where an increase in the PSNR value indicates less distortion and represents an improvement in image quality.

[0034] Structural Similarity Index (SSIM): refers to the consistency between the structural characteristics of the enhanced image and the original image, and the increase in the SSIM value indicates that the structures of the two images are closer.

[0035] Tone Mapping Quality Index (TMQI): It is based on the principle of SSIM and is used to evaluate whether the color of the enhanced image remains consistent with the original image. The higher the TMQI value, the higher the image color consistency.

[0036] Natural Image Quality Evaluator (NIQE): It is built based on a model of the statistical characteristics of natural scenes and evaluates images through a set of quality-aware statistical characteristics. The lower the NIQE value, the closer the image quality is to the visual preference of the human eye.

[0037] Perceptual Contrast Quality Index (PCQI): used to evaluate the contrast of local areas. The higher the PCQI value, the better the contrast obtained during the image enhancement process.

[0038] Luminance Order Error (LOE): It determines the natural properties of an image based on the relative order of the luminance sequence. The lower the LOE value, the smaller the luminance error and the more natural the image appears.

[0039] Example 1

[0040] According to an embodiment of the present application, a method embodiment of an image enhancement method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0041] The method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The image enhancement method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the image enhancement method, etc., but is not limited to the above forms.

[0042] Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing an image enhancement method. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0043] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0044] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the image enhancement method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the image enhancement method of the above-mentioned application is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0045] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0046] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0047] In the above operating environment, Figure 2 is a flow chart of an optional image enhancement method according to an embodiment of the present application, such as Figure 2 As shown, the method at least includes steps S202-S208, wherein:

[0048] Step S202, obtaining the original image to be processed.

[0049] In the technical solution provided in step S202, the original image can be understood as an image to be enhanced, such as an underwater image. Due to the absorption and scattering characteristics of water, light will be greatly attenuated when propagating in water. Problems such as light attenuation, background light scattering, and light scattering by plankton and suspended particles in the underwater environment cause noise and distortion in the image, resulting in poor image quality. Therefore, the first pixel values ​​of multiple pixels in the original image are generally low.

[0050] Step S204: performing color equalization processing on the first pixel value of each pixel point in the original image to obtain a first intermediate image.

[0051] In the technical solution provided in step S204, the second pixel value of each pixel point is obtained by performing color balancing processing on the first pixel value of each pixel point in the original image, and the first intermediate image is composed of pixel points whose pixel values ​​are the second pixel values. Compared with the original image, the color distribution is more balanced and the color bars are more uniform, so the image quality is initially improved.

[0052] Step S206: performing contrast optimization on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image.

[0053] In the technical solution provided in step S206, the third pixel value of each pixel point is obtained by performing color contrast optimization on the second pixel value of each pixel point in the first intermediate image, and the second intermediate image is composed of pixel points whose pixel values ​​are the third pixel values. Compared with the first intermediate image, the visibility and clarity of local details of the image are improved, such as brighter or darker areas are equalized, making the image clearer and fuller, and the details more prominent, so that the image quality is further improved.

[0054] Step S208, grayscale adjustment is performed on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

[0055] In the technical solution provided in step S208, the grayscale of the third pixel value of each pixel point in the second intermediate image is adjusted to obtain the final enhanced target image. Compared with the second intermediate image, the grayscale difference between different areas within the image is more obvious, which enhances the contrast of the image and makes the visual effect of the image more outstanding.

[0056] The above method of this embodiment is further introduced below.

[0057] As an optional implementation, in the technical solution provided in the above step S202, the original image can be obtained in the following ways, including: obtaining the original image by a robot equipped with a high-definition camera, obtaining the original image by using a camera, etc.

[0058] As an optional implementation, in the technical solution provided in the above step S204, the original image may be color balanced by using an automatic color balance algorithm and in accordance with the following steps, including:

[0059] Step S2041, determining first pixel values ​​of a plurality of pixel points in the original image.

[0060] Among them, the pixel value of a pixel point usually refers to the RGB color value or grayscale value of the pixel point. Since step S204 is to balance the image color, only the RGB color value of the pixel point is considered in the entire processing process. Therefore, the above-mentioned first pixel value is an RGB color value (with a value range of 0 to 255).

[0061] Step S2042, performing RGB color decomposition on the first pixel values ​​of multiple pixel points in the original image to obtain three first color component values ​​of each pixel point on the three RGB color channels.

[0062] Specifically, the above step S2042 is to decompose the RGB color values ​​of multiple pixels in the original image according to the three RGB color channels, and use the three first color component values ​​of each pixel on the three RGB color channels, that is, for each pixel, it has a first color component value on the three RGB color channels, including: the first color component value corresponding to the red channel, the first color component value corresponding to the green channel, and the first color component value corresponding to the blue channel. Each color channel includes the color component values ​​of multiple pixels in the original image on the corresponding color.

[0063] For example, if the RGB color value of a pixel is (255, 0, 0), then the first color component value corresponding to its red channel is 255, and the first color component values ​​corresponding to the green channel and the blue channel are both 0.

[0064] Step S2043, color balancing is performed on the three first color component values ​​of each pixel point on the three RGB color channels to obtain the three second color component values ​​of each pixel point on the three RGB color channels.

[0065] Specifically, the above step S2043 performs color balancing processing on the first color component values ​​of each pixel point in the three RGB color channels respectively to obtain three second color component values ​​of each pixel point in the three RGB color channels, wherein the second color component value of each pixel point in each RGB color channel is more balanced in color component distribution than the first color component value of each pixel point in each RGB color channel.

[0066] Step S2044: determine the second pixel value of each pixel based on the three second color component values ​​of each pixel in the three RGB color channels, and obtain a first intermediate image based on the second pixel value of each pixel.

[0067] Specifically, the above step S2044 combines the second color component values ​​of each pixel in the image in the three RGB color channels to obtain the second pixel value of each pixel, that is, the RGB color value; then, the re-determined RGB color value is applied to each pixel to generate a first intermediate image.

[0068] Optionally, in the technical solution provided in the above step S2043, the color balancing process at least includes: enhancement process and standardization process. Therefore, for each pixel in the image, the color balancing process can be implemented according to the following method:

[0069] Step S1, respectively enhancing the three first color component values ​​of the pixel point on the three RGB color channels to obtain corresponding three third color component values.

[0070] Specifically, for the first color component value of the pixel point on the R, G, B color channels, it can be enhanced in the following manner:

[0071] Step 1: Normalize the value of the first color component.

[0072] The normalization process may be performed by dividing the first color component value corresponding to the pixel point in the corresponding color channel by 255, so as to limit the range of the first color component value to between 0 and 1.

[0073] Step 2: Use a preset sliding window to traverse each pixel point, and determine the third color component value of each pixel point based on a preset enhancement ratio, a preset window step size, the position coordinates of the pixel point in the original image, and the normalized first color component value.

[0074] First, the entire image is divided into multiple sub-blocks, and the local enhancement parameter matrix P corresponding to each sub-block is obtained by the following formula, which can be written as:

[0075]

[0076] Among them, (x, y) represents the pixel point with abscissa x and ordinate y in the sub-block, P x,y It represents the element in the local enhancement parameter matrix P corresponding to the sub-block. Therefore, when (x, y) = (0, 0), it means that the element is the center of the matrix.

[0077] Then, the local enhancement parameter matrix P is normalized according to the following formula so that the sum of all elements in the local enhancement parameter matrix P is 1:

[0078]

[0079] Among them, sum(P n,m ) represents all elements P in the local enhancement parameter matrix P corresponding to the sub-block x,y The sum of , and the value range of x is (-n,n), and the value range of y is (-m,m).

[0080] Finally, for each sub-block, all pixels in the sub-block are traversed in sequence according to a certain step size using a preset local sliding window, and the third color component value corresponding to each pixel is obtained by the following formula;

[0081]

[0082] Among them, r represents the radius of the local sliding window, C represents the enhancement ratio (also called magnification ratio), I x,y The second color component value of the pixel with the position coordinate (x, y), I x+i,y+j Indicates the first color component value (i.e., the color component value between 0 and 1) of the pixel point with the position coordinate (x+i, y+i) in the corresponding color channel, P i+r,j+r Represents the local enhancement parameters of the pixel with position coordinates (x+i, y+i).

[0083] Step 3: Obtain an enhanced color channel based on the third color component value of each pixel.

[0084] Step S2, respectively normalize the three third color component values ​​of the pixel point on the three RGB color channels to obtain the corresponding three second color component values.

[0085] Step 1: Determine three first color histograms corresponding to the three RGB color channels according to the third color component values ​​of multiple pixels in the original image on each color channel.

[0086] That is to say, the third color component values ​​of multiple pixels in the original image on the three color channels of R, G, and B are summarized respectively to obtain three first color histograms of the three RGB color channels respectively, wherein the first color histogram is used to intuitively display the distribution of the third color components of all pixels in the original image in each color channel.

[0087] Step 2: Determine the maximum non-zero color component value and the minimum non-zero color component value in each first color histogram.

[0088] The maximum non-zero color component value and the minimum non-zero color component value are the maximum and minimum non-zero color component values ​​in the color histogram.

[0089] Step 3: for the third color component value of the pixel point on each color channel, the third color component value is adjusted based on the maximum non-zero color component value and the minimum non-zero color component value in the first color histogram corresponding to the color channel to obtain the corresponding second color component value;

[0090] Specifically, the second color component can be obtained by the following formula:

[0091]

[0092] Among them, the above I x,y represents the second color component value of the pixel at the (x, y) position of the original image in the corresponding color channel, min(I) and max(I) represent the minimum non-zero color component value and the maximum non-zero color component value of the original image in the corresponding color channel, respectively. x,y Represents the second color component value of the pixel at position (x, y) of the original image, which is normalized to the range of [0, 1].

[0093] It should be noted that the second color component values ​​of each pixel in the three color channels of R, G, and B obtained by the above method are all in the decimal range of 0-1. Therefore, the second color component values ​​need to be converted into integers in the range of 0-255, which can be obtained by multiplying the second color component values ​​by 255.

[0094] Therefore, by performing color balancing processing on the first pixel value (ie, RGB color value) of each pixel point in the original image through the automatic color balancing algorithm provided in the above steps S2041-S2044, the following effects can be achieved:

[0095] (1) Enhance the color distribution of the image to achieve the purpose of improving the visual effect, making the image color more vivid and the contrast stronger;

[0096] (2) Eliminate color deviation in images caused by factors such as lighting conditions and camera equipment, so that each detail in the image has a consistent tone and visual effect;

[0097] (3) Enhance image details and contrast, reduce problems such as underexposure or overexposure, and make the image clearer and more vivid.

[0098] Furthermore, in order to make the detail contrast in the first intermediate image after color equalization more balanced, the embodiment of the present application also proposes to adjust and improve the contrast level of the image through an adaptive histogram equalization algorithm.

[0099] As an optional implementation, in the technical solution provided in the above step S206, the contrast of the first intermediate image may be optimized by using an adaptive histogram equalization algorithm and following the following steps, including:

[0100] Step S2061: divide the first intermediate image into a plurality of non-overlapping sub-blocks, and determine the second pixel value of each pixel in each sub-block.

[0101] The first intermediate image is divided into a plurality of non-overlapping sub-blocks of equal size, denoted as W(x, y), and the sub-block includes at least one pixel point (x, y), and the second pixel value of the pixel point is determined by the three second color component values ​​of the pixel point in the three RGB color channels.

[0102] Step S2062: for each sub-block, three second color histograms of the sub-block on three color channels of RGB are determined based on the second pixel values ​​of each pixel point in the sub-block.

[0103] That is to say, the three second color component values ​​of each pixel in the sub-block in the three color channels of R, G, and B are counted to obtain three second color histograms of the three RGB color channels, wherein each second color histogram is used to intuitively display the distribution of the second color components of all pixels in the sub-block in each color channel.

[0104] Step S2063: Determine the cumulative distribution functions of the sub-blocks in the three RGB color channels based on the three second color histograms, and determine the mapping function according to the cumulative distribution functions.

[0105] For each color channel, let P(x,y,z) represent the probability density that the second color component value of the pixel point (x,y) in the sub-block W(x,y) in the color channel is equal to z, then the cumulative distribution function CDF(x,y,z) of the sub-block in the color channel can be expressed as: Among them, CDF(x, y, z) represents the cumulative probability density of the pixel value in the area W(x, y) being less than or equal to z. Therefore, the cumulative distribution function is used to characterize the cumulative probability density of the color component value of each pixel point in the sub-block being the second color component value. Then, the mapping function is determined by the following formula: T(z) = CDF -1 (z), wherein the mapping function may map the second color component value to a new color component value.

[0106] Step S2064: for the second color component value of the sub-block in each color channel, the second color component value is mapped according to a mapping function to obtain a corresponding fourth color component value.

[0107] The mapping function of the sub-block on each color channel is applied to map the second color component value of each pixel point in the corresponding color channel to obtain the fourth color component value.

[0108] Step S2065, determining the third pixel value of each pixel based on the three fourth color component values ​​of each pixel in the three RGB color channels, and obtaining a second intermediate image based on the third pixel value of each pixel.

[0109] Specifically, the above step S2065 combines the fourth color component values ​​of each pixel in the image in the three RGB color channels to obtain the third pixel value of each pixel, that is, the RGB color value; then, the re-determined RGB color value is applied to each pixel to generate a second intermediate image.

[0110] Therefore, by optimizing the contrast of the second pixel value (ie, RGB color value) of each pixel point in the first intermediate image through the adaptive histogram equalization provided by the above steps S2061-S2065, the following effects can be achieved:

[0111] (1) By equalizing the histogram of the local area, the detail information in the image can be significantly enhanced, especially the darker or brighter areas will be equalized, making the details more obvious;

[0112] (2) Adjust the contrast of different areas in the image to make the light and dark parts of the image more clearly visible.

[0113] Furthermore, in order to make the contrast-optimized second intermediate image clearer, the embodiment of the present application also proposes adjusting and improving the grayscale of the image through a histogram stretching algorithm.

[0114] As an optional implementation, in the technical solution provided in the above step S208, the grayscale of the second intermediate image may be adjusted by a histogram stretching algorithm and in accordance with the following steps, including:

[0115] Step S2081, determine the third pixel values ​​of multiple pixel points in the second intermediate image.

[0116] Among them, since this step is to adjust the grayscale of the image, only the grayscale value of the pixel is considered in the entire processing process. Therefore, the above-mentioned third pixel value is a grayscale value (its range is 0-255, and 0 represents black, and 255 represents white), and the grayscale value of each pixel can be determined according to the three fourth color components of the pixel in the three RGB color channels through the following formula: Grayscale value = A1*the fourth color component value corresponding to the red channel+A2*the fourth color component value corresponding to the green channel+A3*the fourth color component value corresponding to the blue channel, wherein A1, A2, and A3 are all weights, which can be set according to the actual application scenario.

[0117] Step S2082, determining a pixel histogram of the second intermediate image according to the third pixel value of each pixel point, and determining a maximum zero pixel value and a minimum non-zero pixel value in the grayscale histogram.

[0118] That is to say, the third pixel (grayscale) value of each pixel point is counted to obtain a pixel (grayscale) histogram corresponding to the second intermediate image, and the pixel histogram is used to intuitively reflect the distribution of the third pixel value of each pixel point in the image.

[0119] Step S2083, for each third pixel value, adjust the third pixel value based on the maximum non-zero pixel value, the minimum non-zero pixel value, and the preset control parameters to obtain the corresponding fourth pixel value, and use the fourth pixel value as the pixel value of the corresponding pixel point in the second intermediate image.

[0120] The fourth pixel value can be obtained by the following method:

[0121]

[0122] Among them, the above max(g) represents the maximum non-zero pixel (grayscale) value, min(g) represents the minimum non-zero pixel (grayscale) value, g represents the third pixel (grayscale) value, g′ represents the fourth pixel (grayscale) value, C represents the control parameter, and the control parameter C is used to control the adjustment amplitude, and the larger the control parameter C is, the smaller the adjustment amplitude is, and vice versa. The smaller the control parameter C is, the larger the adjustment amplitude is.

[0123] It should be noted that the value of the control parameter C can be determined according to the balance between contrast enhancement and detail retention. Generally, a larger C value can be used to control detail retention during contrast enhancement, which may be more applicable to images with rich light and dark details; while a smaller C value can be used to obtain a stronger contrast enhancement effect, which may be more applicable to images that need to enhance the overall contrast. Generally, its value can be between 0.1 and 10.

[0124] Step S2084, obtaining an enhanced target image according to the fourth pixel value of each pixel point.

[0125] That is to say, the grayscale value of each pixel in the image is replaced with the fourth pixel (grayscale) value determined above to obtain an enhanced target image.

[0126] Therefore, by adjusting the third pixel value (i.e., grayscale value) of each pixel point in the second intermediate image through the histogram stretching algorithm provided in the above steps S2081-S2084, the following effects can be achieved:

[0127] (1) By linearly mapping the grayscale values ​​between the minimum non-zero grayscale value and the maximum non-zero grayscale value, the grayscale value range of the image is expanded. This can make the grayscale values ​​that are originally similar in the image have a larger difference after stretching, thereby enhancing the contrast of the image and making the boundaries between objects in the image clearer;

[0128] (2) The grayscale value range of the entire image is remapped to between 0 and 255, thereby expanding the grayscale range of the image. This means that the originally dark areas will become brighter, and the originally brighter areas will become darker, so that the image has richer information at different grayscale values.

[0129] Based on the scheme defined in the above steps S202 to S208, it can be known that in an embodiment, an original image to be processed is obtained, wherein the original image includes multiple pixel points whose pixel values ​​are first pixel values; the first pixel value of each pixel point in the original image is color-equalized to obtain a first intermediate image, wherein the color distribution of the first intermediate image is more uniform and closer to the real image color compared with the original image; the second pixel value of each pixel point in the first intermediate image is contrast-optimized to obtain a second intermediate image, wherein the image details and contrast of the second intermediate image are significantly enhanced compared with the first intermediate image, making the image clearer and more visually impactful; the third pixel value of each pixel point in the second intermediate image is gray-adjusted to obtain an enhanced target image, wherein the gray-scale value distribution range of the target image is wider than that of the second intermediate image, thereby improving the overall brightness and dynamic range of the image, thereby solving the technical problem of poor visual quality and color reproduction after the image is enhanced by the relevant algorithm.

[0130] Furthermore, in order to verify the effect of the above scheme, the present application uses underwater images in the underwater image processing classic picture data set as the original images to be processed, among which 6 images of underwater shooting types, namely people, fish schools, and corals, are selected for visual effect analysis, and the image enhancement enrichment of the present application is compared with the current mainstream machine learning image enhancement algorithms, including the MSR algorithm, the MSRCP algorithm, and the LIME algorithm, and the following is obtained: Figure 3The visual effect comparison diagram is shown.

[0131] It can be seen from the visual effect comparison chart that for underwater images with poor shooting effects and blurred image quality, various underwater image enhancement methods can improve image quality. Among them, the MSR (Minimum Set Ratio) algorithm greatly retains the color of the original image, but the image is still relatively blurred, and the enhancement effect is not good for images with foreground objects; the MSRCR (Minimum Set Ratio with Contrast Preservation) algorithm can highlight the front object and improve the enhancement effect, but it affects the color of the original image, resulting in color difference, and does not achieve the enhancement effect for static objects such as corals; the LIME (Locally Interpretable Model-agnostic Explanations) algorithm highlights the dynamic objects while retaining the original color of the image during image enhancement, and improves the contrast of the image to a certain extent, but the effect is not obvious and there is a slight halo phenomenon, and the contrast of the dark area of ​​the static image is not obvious and the brightness is low; the present application scheme performs specific enhancement on the foreground and dynamic objects on the basis of retaining the original color of the image, improves the contrast and brightness, and does not overexpose, achieving the effect of underwater image enhancement. In general, the image enhancement algorithm proposed in this application makes the enhanced underwater image look clearer and more natural to the human eye.

[0132] In addition, this application also evaluates each enhancement method from an objective perspective, that is, customer evaluation indicators, such as peak signal-to-noise ratio (PSNR), structural similarity index (SSIM), tone mapping image quality index (TMQI), no-reference image quality evaluation index (NIQE), block contrast quality index (PCQI), brightness sorting error (LOE), etc., and obtains the comparison results shown in Table 1 below.

[0133] Table 1

[0134] Evaluation indicators MSR algorithm MSRCR algorithm LIME algorithm This application plan PSNR 14.5147 14.9573 12.0149 15.0702 SSIM 0.8864 0.9129 0.7351 0.9803 PCQI 1.1248 1.1683 0.8319 1.2016 TMQI 0.8512 0.9209 0.6284 0.9674 NIQE 2.4012 2.4694 2.0843 2.5318 LOE 21.6384 16.0711 40.1502 12.0539

[0135] It is not difficult to see from the above Table 1 that the present application scheme has better performance in various indicators compared with other schemes. In addition, it should be noted that the present application scheme is not only applicable to underwater image capture, but also can be widely used in fields such as environmental monitoring and marine engineering.

[0136] Example 2

[0137] Based on Embodiment 1 of the present application, an embodiment of an image enhancement device is also provided, and the image enhancement method of the above embodiment is executed when the device is running. Figure 4 is a schematic structural diagram of an optional image enhancement device according to an embodiment of the present application, such as Figure 4 As shown, the image enhancement device at least includes an acquisition module 42, a first processing module 44, a second processing module 46 and a third processing module 48, wherein:

[0138] An acquisition module 42 is used to acquire an original image to be processed, wherein the original image includes a plurality of pixel points whose pixel values ​​are first pixel values;

[0139] A first processing module 44 is used to perform color balancing processing on the first pixel value of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes a plurality of pixel points whose pixel values ​​are second pixel values, and the second pixel values ​​are obtained by performing color balancing processing on the first pixel values ​​of the corresponding pixel points;

[0140] A second processing module 46 is used to optimize the contrast of the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes a plurality of pixel points whose pixel values ​​are the third pixel value;

[0141] The third processing module 48 is used to adjust the grayscale of the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

[0142] It should be noted that each module in the above-mentioned image enhancement device can be a program module (for example, a set of program instructions that implement a certain specific function) or a hardware module. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0143] Example 3

[0144] According to an embodiment of the present application, a non-volatile storage medium is further provided, in which a program is stored, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the image enhancement method in Example 1.

[0145] Optionally, the device where the non-volatile storage medium is located implements the following steps by running the program: obtaining an original image to be processed, wherein the original image includes multiple pixel points whose pixel values ​​are first pixel values; performing color balancing processing on the first pixel value of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes multiple pixel points whose pixel values ​​are second pixel values, and the second pixel value is obtained by performing color balancing processing on the first pixel value of the corresponding pixel point; performing contrast optimization on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes multiple pixel points whose pixel values ​​are third pixel values; and performing grayscale adjustment on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

[0146] According to an embodiment of the present application, a computer program product is also provided, which includes a stored computer program, wherein the image enhancement method in Embodiment 1 is implemented when the computer program is executed by a processor.

[0147] Optionally, the computer program executes the following steps: obtaining an original image to be processed, wherein the original image includes a plurality of pixel points whose pixel values ​​are first pixel values; performing color balancing on the first pixel value of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes a plurality of pixel points whose pixel values ​​are second pixel values, and the second pixel value is obtained by performing color balancing on the first pixel value of the corresponding pixel point; performing contrast optimization on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes a plurality of pixel points whose pixel values ​​are third pixel values; and performing grayscale adjustment on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

[0148] According to an embodiment of the present application, a processor is also provided, which is used to run a program, wherein the image enhancement method in Example 1 is executed when the program is running.

[0149] Optionally, when the program is running, the following steps are executed: obtaining an original image to be processed, wherein the original image includes a plurality of pixel points whose pixel values ​​are the first pixel value; performing color balancing on the first pixel value of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes a plurality of pixel points whose pixel values ​​are the second pixel value, and the second pixel value is obtained by performing color balancing on the first pixel value of the corresponding pixel point; performing contrast optimization on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes a plurality of pixel points whose pixel values ​​are the third pixel value; performing grayscale adjustment on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

[0150] According to an embodiment of the present application, an electronic device is also provided, wherein: Figure 5 is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application, such as Figure 5 As shown, the electronic device includes one or more processors; a memory for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the image enhancement method in the above-mentioned embodiment 1 when running.

[0151] Optionally, the processor is configured to execute the following steps through a computer program: obtaining an original image to be processed, wherein the original image includes multiple pixel points whose pixel values ​​are first pixel values; performing color balancing on the first pixel value of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes multiple pixel points whose pixel values ​​are second pixel values, and the second pixel value is obtained by performing color balancing on the first pixel value of the corresponding pixel point; performing contrast optimization on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes multiple pixel points whose pixel values ​​are third pixel values; and performing grayscale adjustment on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

[0152] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0153] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0154] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0155] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0156] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0157] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0158] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An image enhancement method, characterized in that: include: Acquire an original image to be processed, wherein the original image includes a plurality of pixel points whose pixel values ​​are first pixel values; Performing color balancing processing on the first pixel value of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes a plurality of pixel points whose pixel values ​​are second pixel values, and the second pixel values ​​are obtained by performing color balancing processing on the first pixel values ​​of the corresponding pixel points; performing contrast optimization on the second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes a plurality of pixel points whose pixel values ​​are third pixel values; Grayscale adjustment is performed on the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

2. The method according to claim 1, characterized in that: Performing color balancing processing on the first pixel value of each pixel point in the original image to obtain a first intermediate image includes: Determine first pixel values ​​of a plurality of pixel points in the original image, wherein the first pixel values ​​are RGB color values; Performing RGB color decomposition on the first pixel values ​​of the plurality of pixel points in the original image to obtain three first color component values ​​of each pixel point on three RGB color channels; Performing color balancing processing on the three first color component values ​​of each pixel point on the three RGB color channels respectively to obtain the three second color component values ​​of each pixel point on the three RGB color channels, wherein the color balancing processing at least includes: enhancement processing and standardization processing; The second pixel value of each pixel is determined based on the three second color component values ​​of each pixel in the three RGB color channels, and the first intermediate image is obtained based on the second pixel value of each pixel.

3. The method according to claim 2, characterized in that Performing color balancing processing on the three first color component values ​​of each pixel point on the three RGB color channels to obtain the three second color component values ​​of each pixel point on the three RGB color channels includes: For each of the pixel points, the three first color component values ​​of the pixel point on the three RGB color channels are enhanced respectively to obtain corresponding three third color component values; The three third color component values ​​of the pixel point on the three RGB color channels are respectively standardized to obtain the corresponding three second color component values.

4. The method according to claim 3, characterized in that The three first color component values ​​of the pixel point on the three RGB color channels are enhanced respectively to obtain the corresponding three third color component values, including: For the first color component value of the pixel point in each color channel, normalizing the first color component value; A preset sliding window is used to traverse each of the pixel points, and the third color component value of each of the pixel points is determined based on a preset enhancement ratio, a preset window step size, the position coordinates of the pixel point in the original image, and the normalized first color component value.

5. The method according to claim 3, characterized in that: The three third color component values ​​of the pixel point on the three RGB color channels are respectively normalized to obtain the corresponding three second color component values, including: Determine three first color histograms corresponding to the three RGB color channels according to the third color component values ​​of the plurality of pixels in the original image on each color channel; Determine the maximum non-zero color component value and the minimum non-zero color component value in each of the first color histograms; For the third color component value of the pixel point on each color channel, the third color component value is adjusted based on the maximum non-zero color component value and the minimum non-zero color component value in the first color histogram corresponding to the color channel to obtain the corresponding second color component value.

6. The method according to claim 1, characterized in that Optimizing the contrast of a second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image includes: Divide the first intermediate image into a plurality of non-overlapping sub-blocks, and determine a second pixel value of each pixel in each sub-block, wherein the second pixel value is determined by three second color component values ​​of the pixel in three RGB color channels; For each of the sub-blocks, determining three second color histograms of the sub-block on three color channels of RGB based on second pixel values ​​of each pixel point in the sub-block; Based on the three second color histograms, respectively determine the cumulative distribution function of the sub-block in the three color channels of RGB, wherein the cumulative distribution function is used to characterize the cumulative probability density of the color component value of each pixel point in the sub-block being the second color component value; For the second color component value of the sub-block in each color channel, determine a mapping function according to the cumulative distribution function, and map the second color component value according to the mapping function to obtain a corresponding fourth color component value; The third pixel value of each pixel is determined based on the three fourth color component values ​​of each pixel in the three RGB color channels, and the second intermediate image is obtained based on the third pixel value of each pixel.

7. The method according to claim 1, characterized in that The method of adjusting the grayscale of the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image includes: Determine third pixel values ​​of a plurality of pixel points in the second intermediate image, wherein the third pixel values ​​are grayscale values, and the grayscale values ​​are determined by three fourth color components of the pixel points in three RGB color channels; Determine a pixel histogram of the second intermediate image according to the third pixel value of each pixel point, and determine a maximum non-zero pixel value and a minimum non-zero pixel value based on the pixel histogram; For each of the third pixel values, adjusting the third pixel value based on the maximum non-zero pixel value, the minimum non-zero pixel value, and a preset control parameter to obtain a corresponding fourth pixel value, and using the fourth pixel value as the pixel value of the corresponding pixel point in the second intermediate image, wherein the control parameter is used to control the adjustment amplitude, and the larger the control parameter, the smaller the adjustment amplitude, and vice versa, the smaller the control parameter, the larger the adjustment amplitude; The enhanced target image is obtained according to the fourth pixel value of each pixel point.

8. An image enhancement device, characterized in that: include: An acquisition module, used for acquiring an original image to be processed, wherein the original image includes a plurality of pixel points whose pixel values ​​are the first pixel values; A first processing module is used to perform color balancing processing on a first pixel value of each pixel point in the original image to obtain a first intermediate image, wherein the first intermediate image includes a plurality of pixel points whose pixel values ​​are second pixel values, and the second pixel values ​​are obtained by performing color balancing processing on the first pixel values ​​of the corresponding pixel points; a second processing module, configured to perform contrast optimization on a second pixel value of each pixel point in the first intermediate image to obtain a second intermediate image, wherein the second intermediate image includes a plurality of pixel points whose pixel values ​​are third pixel values; The third processing module is used to adjust the grayscale of the third pixel value of each pixel point in the second intermediate image to obtain an enhanced target image.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, wherein the device where the non-volatile storage medium is located executes the image enhancement method described in any one of claims 1 to 7 by running the computer program.

10. A computer program product, characterized in that include: A computer program, wherein when the computer program is executed by a processor, the image enhancement method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Underwater image enhancement method based on low-rank decomposition and fusion

    CN113191992A

  • Underwater fish image enhancement method and system, computer equipment and storage medium

    CN114331876A

  • Processing method and device of image contrast

    WO2011127825A1