Image enhancement method and device, electronic equipment and storage medium
By performing multi-channel decomposition and filtering on images, the hardware cost and power consumption issues caused by relying on high-performance SoC platforms in existing technologies are solved, achieving efficient and low-cost image enhancement effects and meeting real-time processing requirements.
Patent Information
- Application Number
- CN202210946348.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-08
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-08-08
AI Technical Summary
In existing technologies, image enhancement processing relies on high-performance SoC platforms, which increases hardware costs and power consumption, and makes it difficult to meet the application requirements for real-time processing.
By performing multi-channel decomposition on the image to be processed, the luminance component image in the YUV color space is obtained. The luminance component image is then filtered to obtain a mask image. Finally, image enhancement is performed based on the mask image, including luminance adjustment and color component image processing, thus achieving image enhancement.
It achieves high-definition, high-contrast image enhancement while reducing hardware costs and power consumption, meeting the needs of real-time processing.
Smart Images

Figure CN115330614B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more particularly to image enhancement methods, apparatus, electronic devices, and storage media. Background Technology
[0002] Image enhancement refers to highlighting useful information in an image while removing or weakening useless information according to specific needs. The purpose of image enhancement is to make the processed image more visually appealing to the human eye or easier for machines to recognize. Image enhancement technology has wide applications in aerospace, target detection, intelligent navigation, medical imaging, remote sensing imaging, and portrait photography.
[0003] In existing technologies, image enhancement is often performed using the following method: first, the image to be processed is subjected to brightness restoration processing; then, the brightness-restored image is enhanced based on an optimized MSR (MultiScale Retinex) algorithm. This method can restore the brightness of the image scene and achieve a better balance between the image's grayscale dynamic range and edge enhancement.
[0004] However, image enhancement using the MSR algorithm requires a high-performance SoC (System on Chip) platform, which not only increases the hardware cost and power consumption of image enhancement but also makes it difficult to meet the requirements of real-time processing applications. Summary of the Invention
[0005] To address the technical issues mentioned above, where image enhancement processing relies on high-performance SoC platforms, thereby increasing hardware costs and power consumption, and making it difficult to meet the requirements of real-time processing applications, embodiments of the present invention provide an image enhancement method, apparatus, electronic device, and storage medium.
[0006] In a first aspect, embodiments of the present invention provide an image enhancement method, the method comprising:
[0007] The image to be processed is decomposed into multiple channels to obtain the luminance component image of the image in the YUV color space.
[0008] The brightness component image is filtered to obtain a mask image;
[0009] Image enhancement is performed on the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed.
[0010] In one possible implementation, filtering the luminance component image to obtain a mask image includes:
[0011] The brightness component image is subjected to bilateral filtering to obtain a mask image.
[0012] In one possible implementation, image enhancement is performed on the image to be processed based on the mask image to obtain an enhanced image corresponding to the image to be processed, including:
[0013] The brightness of the mask image is adjusted to obtain a brightness-enhanced image corresponding to the mask image;
[0014] The image to be processed is enhanced based on the brightness-enhanced image to obtain the enhanced image corresponding to the image to be processed.
[0015] In one possible implementation, the brightness of the mask image is adjusted to obtain a brightness-enhanced image corresponding to the mask image;
[0016] The following processing is performed on each pixel in the mask image to obtain the brightness-enhanced image corresponding to the mask image;
[0017] If the pixel value of the pixel is less than a first set value, increase the pixel value of the pixel.
[0018] If the pixel value of a pixel is greater than the first set value, the pixel value of the pixel is reduced.
[0019] In one possible implementation, image enhancement is performed on the image to be processed based on the brightness enhancement image to obtain an enhanced image corresponding to the image to be processed, including:
[0020] The image to be processed is decomposed into multiple channels to obtain multiple color component images of the image in the RGB color space.
[0021] For each pixel in each of the color component images, the following processing is performed:
[0022] If the brightness value of the pixel is determined to be a second set value based on the brightness component image, the pixel value of the pixel is set to the second set value;
[0023] If the brightness value of the pixel is determined to be not the second set value based on the brightness component image, the pixel value of the pixel is adjusted based on the brightness enhancement image;
[0024] Multi-color channel fusion is performed on the multiple color component images after the above processing to obtain the enhanced image corresponding to the image to be processed.
[0025] In one possible implementation, the adjustment of the pixel value based on the brightness enhancement image is achieved by the following formula:
[0026]
[0027] In the above formula, dst(i,j) represents the adjusted pixel value, outY(i,j) represents the pixel value of the pixel in the brightness-enhanced image, and src_img(i,j) represents the pixel value of the pixel in the color component image.
[0028] In a second aspect, embodiments of the present invention provide an image enhancement apparatus, the apparatus comprising:
[0029] The channel decomposition module is used to perform multi-channel decomposition on the image to be processed to obtain the brightness component image of the image to be processed in the YUV color space.
[0030] The filtering module is used to filter the brightness component image to obtain a mask image;
[0031] An image enhancement module is used to enhance the image to be processed based on the mask image to obtain an enhanced image corresponding to the image to be processed.
[0032] In one possible implementation, the filtering module is specifically used for:
[0033] The brightness component image is subjected to bilateral filtering to obtain a mask image.
[0034] In one possible implementation, the image enhancement module includes:
[0035] A brightness adjustment submodule is used to adjust the brightness of the mask image to obtain a brightness-enhanced image corresponding to the mask image;
[0036] An enhancement submodule is used to perform image enhancement on the image to be processed based on the brightness enhancement image, so as to obtain an enhanced image corresponding to the image to be processed.
[0037] In one possible implementation, the brightness adjustment submodule is specifically used for:
[0038] The following processing is performed on each pixel in the mask image to obtain the brightness-enhanced image corresponding to the mask image;
[0039] If the pixel value of the pixel is less than a first set value, increase the pixel value of the pixel.
[0040] If the pixel value of a pixel is greater than the first set value, the pixel value of the pixel is reduced.
[0041] In one possible implementation, the enhancement submodule includes:
[0042] The channel decomposition unit is used to perform multi-channel decomposition on the image to be processed, so as to obtain multiple color component images of the image to be processed in the RGB color space.
[0043] The setting unit is used to set the pixel value of each pixel in each color component image to the second set value when the brightness value of the pixel is determined to be the second set value according to the brightness component image.
[0044] An adjustment unit is configured to adjust the pixel value of each pixel in each color component image based on the brightness enhancement image when the brightness value of the pixel is determined to be not the second set value according to the brightness component image.
[0045] The channel fusion unit is used to perform multi-color channel fusion on the multiple color component images after the above processing to obtain the enhanced image corresponding to the image to be processed.
[0046] In one possible implementation, the adjustment unit is specifically used for:
[0047] The adjustment of pixel values based on the brightness-enhanced image is achieved using the following formula:
[0048]
[0049] In the above formula, dst(i,j) represents the adjusted pixel value, outY(i,j) represents the pixel value of the pixel in the brightness-enhanced image, and src_img(i,j) represents the pixel value of the pixel in the color component image.
[0050] Thirdly, embodiments of the present invention provide an electronic device, including: a processor and a memory; the processor is configured to execute an image enhancement program stored in the memory to implement the image enhancement method described in any one of the first aspects.
[0051] Fourthly, a storage medium storing one or more programs that can be executed by one or more processors to implement the image enhancement method described in any one aspect.
[0052] The technical solution provided in this invention involves multi-channel decomposition of the image to be processed to obtain a luminance component image of the image in the YUV color space; filtering the luminance component image to obtain a mask image; and performing image enhancement on the image to be processed based on the mask image to obtain an enhanced image corresponding to the image to be processed. This achieves a high-clarity, high-contrast enhanced image. Furthermore, the implementation of this technical solution does not involve complex algorithms, resulting in low overall implementation complexity. This not only eliminates the need for a high-performance SoC platform, reducing hardware costs and power consumption during image enhancement, but also meets the application requirements for real-time processing. Attached Figure Description
[0053] Figure 1 A flowchart illustrating an embodiment of an image enhancement method provided by this invention;
[0054] Figure 2 This is an example of an image to be processed provided in an embodiment of the present invention;
[0055] Figure 3 for Figure 2 The image shown is an example of a brightness component image corresponding to the image to be processed.
[0056] Figure 4 for Figure 2 An example of the chromaticity component image of the image to be processed in the Cb channel is shown;
[0057] Figure 5 for Figure 2 An example of the chromaticity component image of the image to be processed in the Cr channel is shown;
[0058] Figure 6 for Figure 2 An example of an enhanced image corresponding to the image to be processed shown;
[0059] Figure 7 A flowchart illustrating another image enhancement method provided by an embodiment of the present invention;
[0060] Figure 8 A flowchart illustrating another embodiment of the image enhancement method provided by this invention;
[0061] Figure 9 A flowchart illustrating another embodiment of the image enhancement method provided by this invention;
[0062] Figure 10 A block diagram illustrating an embodiment of an image enhancement device provided by this invention;
[0063] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0065] The image enhancement method provided by the present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments. The embodiments do not constitute a limitation on the embodiments of the present invention.
[0066] See Figure 1 This is a flowchart illustrating an embodiment of an image enhancement method provided by the present invention. Figure 1 As shown, the process may include the following steps:
[0067] Step 101: Perform multi-channel decomposition on the image to be processed to obtain the luminance component image of the image in the YUV color space.
[0068] The image to be processed can be in formats such as bmp, jpg, png, etc.; there are no restrictions on the format of the image to be processed. For example, see... Figure 2 Here is an example of an image to be processed.
[0069] In this embodiment of the invention, the image to be processed can first be decomposed into multiple channels in the YUV color space to obtain the luminance component image of the image to be processed in the YUV color space, that is, the Y component image. For example, see... Figure 3 ,for Figure 2 The image shown is an example of the brightness component image corresponding to the image to be processed.
[0070] In practical applications, the image information of the image to be processed can be read through preset computer language functions. Then, based on the image information and using preset format conversion functions, the color space of the image to be processed is converted to obtain the YUV format image (i.e., YCbCr space image) of the image to be processed in the YUV color space. After that, the YUV format image is decomposed into multiple channels to obtain the luminance component image of the image to be processed in the YUV color space.
[0071] The aforementioned computer language function can be the `imread` function. The aforementioned format conversion function can be the `cvtColor` function; no specific limitation is made here.
[0072] Furthermore, by performing multi-channel decomposition on the image to be processed in the YUV color space, the chromaticity component images of the image in the Cb channel and the chromaticity component images in the Cr channel can also be obtained. For example, see... Figure 4 ,for Figure 2 An example of the chroma component image of the image to be processed in the Cb channel is shown below. Figure 5 ,for Figure 2 The image shown is an example of the chromaticity component image of the image to be processed in the Cr channel.
[0073] Step 102: Filter the luminance component image to obtain the mask image.
[0074] In one embodiment, a bilateral filtering process is performed on the luminance component image to obtain a mask image. Bilateral filtering is a non-linear filtering method that utilizes both color similarity and spatial distance similarity. That is, during the filtering process, bilateral filtering considers not only the difference between the image pixel value and the center point pixel value, but also the spatial distance between the image pixel and the center point, thereby determining the influence factor of the image pixel on the center point. This effectively removes noise while maintaining clear boundaries.
[0075] Specifically, the luminance component image can be bilaterally filtered using the filtering function f(i,j) shown in Formula (I) to obtain the mask image:
[0076]
[0077] In the above formula (i), W(i,j,k,l) represents the template weight of the bilateral filter, which can be calculated by the following formula (ii), and I(k,l) represents the pixel value of pixel (k,l) in the image to be processed.
[0078]
[0079] In formula (ii) above, W(i,j,k,l) represents the template weights of the bilateral filter. r (i,j,k,l) represents the range kernel weights of the bilateral filter, W d (i,j,k,l) represents the spatial domain kernel weights of the bilateral filter, I(i,j) represents the pixel value of pixel (i,j) in the image to be processed, and σ d σ is the standard deviation of the kernel Gaussian function in the spatial domain of the image pixels. r The standard deviation of the kernel Gaussian function represents the range of image pixel values.
[0080] Among them, the spatial domain core weight W d(i,j,k,l) is determined by the Euclidean distance between the image pixel position and the center position. Therefore, the spatial distance is also considered in the process of bilateral filtering, and the influence factor of pixel (i,j) on center point (k,l) is determined so as to effectively remove noise while maintaining clear boundaries.
[0081] Step 103: Perform image enhancement on the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed.
[0082] See Figure 6 ,for Figure 2 An example of an enhanced image corresponding to the image to be processed is shown.
[0083] Here, since the mask image is obtained by filtering the brightness component image corresponding to the image to be processed, and the filtering process can effectively maintain the clear boundaries and remove noise, the image enhancement based on the mask image can make the enhanced image have high clarity and obvious contrast.
[0084] The specific method of enhancing the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed will be explained in the following specific embodiments, and will not be described in detail here.
[0085] The technical solution of this invention decomposes the image to be processed into a multi-channel image to obtain the luminance component image of the image in the YUV color space, filters the luminance component image to obtain a mask image, and then enhances the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed. This achieves the result of an enhanced image with high clarity and obvious contrast. Moreover, the implementation of the above technical solution does not involve complex algorithms, so the overall implementation complexity of the technical solution is low. This not only eliminates the need to rely on a high-performance SoC platform, reducing hardware costs and power consumption during image enhancement, but also meets the application requirements of real-time processing.
[0086] See Figure 7 This is a flowchart of another image enhancement method provided by the present invention. Figure 7 The process shown above Figure 1 Based on the illustrated process, this section describes how to perform image enhancement on the image to be processed using a mask image, resulting in an enhanced image corresponding to the original image. For example... Figure 7 As shown, the process may include the following steps:
[0087] Step 701: Adjust the brightness of the mask image to obtain the brightness-enhanced image corresponding to the mask image.
[0088] Step 702: Perform image enhancement on the image to be processed based on the brightness enhancement image to obtain the enhanced image corresponding to the image to be processed.
[0089] The following is a unified explanation of steps 701 and 702:
[0090] As can be seen from the descriptions of steps 701 and 702 above, in one embodiment, the image to be processed can be enhanced in terms of both brightness and chroma based on the mask image to obtain an enhanced image corresponding to the image to be processed. This processing can produce an enhanced image with high clarity and obvious contrast.
[0091] The specific implementation of adjusting the brightness of the mask image to obtain a corresponding brightness-enhanced image can include: for each pixel in the mask image, increasing the pixel value if its value is less than a first preset value, decreasing the pixel value if its value is greater than the first preset value, and keeping the pixel value unchanged if it is equal to the first preset value. This processing can produce a brightness-enhanced image with significant contrast.
[0092] Optionally, the first setting value mentioned above can be 128.
[0093] Assuming the first set value is 128, the following formula (iii) can be used to achieve the above-described behavior: when the pixel value of a pixel in the mask image is less than the first set value, the pixel value of that pixel is increased; and when the pixel value of a pixel is greater than the first set value, the pixel value of that pixel is decreased.
[0094]
[0095] Where maskImage(i,j) is the mask image, and Y(i,j) is the brightness value of the pixel.
[0096] For a detailed implementation of image enhancement based on brightness enhancement images to obtain the enhanced image corresponding to the image to be processed, please refer to [link to relevant documentation]. Figure 8 ,like Figure 8 The process shown includes the following steps:
[0097] Step 801: Perform multi-channel decomposition on the image to be processed to obtain multiple color component images of the image in the RGB color space.
[0098] The image to be processed may include multiple color component images in the RGB color space, such as the R channel color component image, the G channel color component image, and the B channel color component image.
[0099] In implementation, the image to be processed can first be converted into an RGB format image through an encoding standard protocol. Then, the RGB format image is decomposed into multiple channels to obtain the R channel color component image, G channel color component image and B channel color component image of the image to be processed in the RGB color space.
[0100] Step 802: For each pixel in each color component image, if the brightness value of the pixel is determined to be a second set value based on the brightness component image, proceed to step 803; if the brightness value of the pixel is determined to be a second set value based on the brightness component image, proceed to step 804.
[0101] Step 803: Set the pixel value of the pixel to the second set value.
[0102] Step 804: Adjust the pixel values of the pixels based on the brightness enhancement image.
[0103] Step 805: Perform multi-color channel fusion on the multiple color component images after the above processing to obtain the enhanced image corresponding to the image to be processed.
[0104] The following is a unified explanation of steps 802 to 805:
[0105] First, it should be noted that the brightness value of a pixel refers to the pixel value of the corresponding pixel in the brightness component image.
[0106] In one embodiment, for any one of the R-channel, G-channel, and B-channel color component images, if the brightness value of a pixel in that color component image is a second preset value, the pixel value of that pixel in the color component image is also set to the second preset value. If the brightness value of a pixel in that color component image is not the second preset value, the pixel value of that pixel in the color component image is adjusted based on the brightness enhancement image. This process enhances the image to be processed from both brightness and chromaticity perspectives, ultimately resulting in an enhanced image with high clarity and significant contrast.
[0107] Optionally, the second setting mentioned above can be 0.
[0108] Optionally, the pixel values of pixels in the color component image can be adjusted based on the brightness enhancement image using the following formula (iv):
[0109]
[0110] In the above formula (iv), dst(i,j) represents the adjusted pixel value of the pixel in the color component image, outY(i,j) represents the pixel value (i.e., brightness value) of the pixel in the brightness enhancement image, and src_img(i,j) represents the original pixel value (i.e., the pixel value before adjustment) of the pixel in the color component image.
[0111] It is understandable that when adjusting the pixel values of pixels in the R channel color component image, the above src_img(i,j) represents the original pixel values of the pixels in the R channel color component image; when adjusting the pixel values of pixels in the G channel color component image, the above src_img(i,j) represents the original pixel values of the pixels in the G channel color component image; and when adjusting the pixel values of pixels in the B channel color component image, the above src_img(i,j) represents the original pixel values of the pixels in the B channel color component image.
[0112] pass Figure 7 The illustrated process implements image enhancement of the image to be processed based on a mask image, resulting in an enhanced image corresponding to the image to be processed. Furthermore, because the mask image enhances the image to be processed from both brightness and chroma aspects, resulting in an enhanced image with high clarity and significant contrast, this process yields an enhanced image.
[0113] See Figure 9 This is a flowchart illustrating another embodiment of the image enhancement method provided by this invention. Figure 9 As shown, the process may include the following steps:
[0114] First, a frame of the image to be processed is read. Then, it is converted to RGB format using a preset encoding protocol. Next, a preset format conversion function is used to convert the RGB image to YCbCr space, i.e., YUV format. Afterward, the YUV format image is separated into its Y, Cb, and Cr channels to obtain the Y component image.
[0115] Next, bilateral filtering is performed on the Y component, and then the filtered mask image maskImage is calculated. The brightness of the mask image maskImage is enhanced, and the brightness-enhanced image OutY(i,j) is output. Then, the image pixel values (color component images) of the three channels B, G, and R are calculated based on the brightness-enhanced image. Then, the image pixel values of the three channels are fused into multiple color channels, and the enhanced image is output, ending the process.
[0116] Figure 9The illustrated process involves reading a frame of the image to be processed, converting it to RGB format, then converting the RGB image to YCbCr color space, separating the Y, Cb, and Cr channels, performing bilateral filtering on the Y component of the Y channel, calculating the filtered mask image, enhancing this mask image to output a brightness-enhanced image, calculating the pixel values of each channel based on this brightness-enhanced image, and performing multi-color channel fusion to output the enhanced image. This technical solution has low complexity, does not rely on a high-performance SoC platform for image enhancement, achieves real-time processing enhancement requirements, and reduces hardware costs and power consumption during image enhancement.
[0117] See Figure 10 This is a block diagram illustrating an embodiment of an image enhancement device provided by an embodiment of the present invention. Figure 10 As shown, the device includes:
[0118] The channel decomposition module 1001 is used to perform multi-channel decomposition on the image to be processed to obtain the brightness component image of the image to be processed in the YUV color space.
[0119] Filtering module 1002 is used to filter the brightness component image to obtain a mask image;
[0120] The image enhancement module 1003 is used to enhance the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed.
[0121] In one possible implementation, the filtering module 1002 is specifically used for:
[0122] The brightness component image is subjected to bilateral filtering to obtain a mask image.
[0123] In one possible implementation, the image enhancement module 1003 includes (not shown in the figures):
[0124] A brightness adjustment submodule is used to adjust the brightness of the mask image to obtain a brightness-enhanced image corresponding to the mask image;
[0125] An enhancement submodule is used to perform image enhancement on the image to be processed based on the brightness enhancement image, so as to obtain an enhanced image corresponding to the image to be processed.
[0126] In one possible implementation, the brightness adjustment submodule is specifically used for:
[0127] The following processing is performed on each pixel in the mask image to obtain the brightness-enhanced image corresponding to the mask image;
[0128] If the pixel value of the pixel is less than a first set value, increase the pixel value of the pixel.
[0129] If the pixel value of a pixel is greater than the first set value, the pixel value of the pixel is reduced.
[0130] In one possible implementation, the enhancement submodule includes (not shown in the figures):
[0131] The channel decomposition unit is used to perform multi-channel decomposition on the image to be processed, so as to obtain multiple color component images of the image to be processed in the RGB color space.
[0132] The setting unit is used to set the pixel value of each pixel in each color component image to the second set value when the brightness value of the pixel is determined to be the second set value according to the brightness component image.
[0133] An adjustment unit is configured to adjust the pixel value of each pixel in each color component image based on the brightness enhancement image when the brightness value of the pixel is determined to be not the second set value according to the brightness component image.
[0134] The channel fusion unit is used to perform multi-color channel fusion on the multiple color component images after the above processing to obtain the enhanced image corresponding to the image to be processed.
[0135] In one possible implementation, the adjustment unit is specifically used for:
[0136] The adjustment of pixel values based on the brightness-enhanced image is achieved using the following formula:
[0137]
[0138] In the above formula, dst(i,j) represents the adjusted pixel value, outY(i,j) represents the pixel value of the pixel in the brightness-enhanced image, and src_img(i,j) represents the pixel value of the pixel in the color component image.
[0139] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 11The illustrated electronic device 1100 includes at least one processor 1101, a memory 1102, at least one network interface 1104, and a user interface 1103. The various components in the electronic device 1100 are coupled together via a bus system 1105. It is understood that the bus system 1105 is used to implement communication between these components. In addition to a data bus, the bus system 1105 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 11 The general labeled all buses as Bus System 1105.
[0140] The user interface 1103 may include a display, keyboard or clicking device (e.g., mouse, trackball), touchpad or touch screen, etc.
[0141] It is understood that the memory 1102 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1102 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0142] In some implementations, memory 1102 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 11021 and application program 11022.
[0143] The operating system 11021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 11022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 11022.
[0144] In this embodiment of the invention, by calling the program or instructions stored in memory 1102, specifically the program or instructions stored in application program 11022, processor 1101 executes the method steps provided in each method embodiment, including, for example:
[0145] The image to be processed is decomposed into multiple channels to obtain the luminance component image of the image in the YUV color space.
[0146] The brightness component image is filtered to obtain a mask image;
[0147] Image enhancement is performed on the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed.
[0148] The methods provided in the above embodiments of the present invention can be applied to processor 1101, or implemented by processor 1101. Processor 1101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 1101 or by instructions in the form of software. The processor 1101 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1102. Processor 1101 reads the information in memory 1102 and, in conjunction with its hardware, completes the steps of the above method.
[0149] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0150] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0151] The electronic device provided in this embodiment can perform the following: Figure 1 , Figures 7-9 All steps of the image enhancement method in the process are then implemented. Figure 1 , Figures 7-9 For details on the technical effects of the image enhancement methods described, please refer to [link / reference]. Figure 1 , Figures 7-9 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0152] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.
[0153] One or more programs in the storage medium can be executed by one or more processors to implement the image enhancement method described above that is executed on the electronic device side.
[0154] The processor is used to execute an image enhancement program stored in memory to implement the following steps of an image enhancement method executed on the electronic device side:
[0155] The image to be processed is decomposed into multiple channels to obtain the luminance component image of the image in the YUV color space.
[0156] The brightness component image is filtered to obtain a mask image;
[0157] Image enhancement is performed on the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed.
[0158] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0159] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0160] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An image enhancement method, characterized in that, The method includes: The image to be processed is decomposed into multiple channels to obtain the luminance component image of the image in the YUV color space. The brightness component image is filtered to obtain a mask image; Based on the mask image, image enhancement is performed on the image to be processed to obtain the enhanced image corresponding to the image to be processed; The process of enhancing the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed includes: The brightness of the mask image is adjusted to obtain a brightness-enhanced image corresponding to the mask image; Based on the brightness-enhanced image, the image to be processed is enhanced to obtain the enhanced image corresponding to the image to be processed; The process of enhancing the image to be processed based on the brightness-enhanced image to obtain the enhanced image corresponding to the image to be processed includes: The image to be processed is decomposed into multiple channels to obtain multiple color component images of the image in the RGB color space. For each pixel in each of the color component images, the following processing is performed: If the brightness value of the pixel is determined to be a second set value based on the brightness component image, the pixel value of the pixel is set to the second set value; If the brightness value of the pixel is determined to be not the second set value based on the brightness component image, the pixel value of the pixel is adjusted based on the brightness enhancement image; Multi-color channel fusion is performed on the multiple color component images after the above processing to obtain the enhanced image corresponding to the image to be processed.
2. The method according to claim 1, characterized in that, The brightness component image is filtered to obtain a mask image, including: The brightness component image is subjected to bilateral filtering to obtain a mask image.
3. The method according to claim 1, characterized in that, The brightness of the mask image is adjusted to obtain a brightness-enhanced image corresponding to the mask image; The following processing is performed on each pixel in the mask image to obtain the brightness-enhanced image corresponding to the mask image; If the pixel value of the pixel is less than a first set value, increase the pixel value of the pixel. If the pixel value of a pixel is greater than the first set value, the pixel value of the pixel is reduced.
4. The method according to claim 1, characterized in that, The adjustment of pixel values based on the brightness-enhanced image is achieved using the following formula: ; In the above formula, This indicates the adjusted pixel value. This represents the pixel value of a pixel in a brightened image. This represents the pixel value of a pixel in a color component image.
5. An image enhancement device, characterized in that, The device includes: The channel decomposition module is used to perform multi-channel decomposition on the image to be processed to obtain the brightness component image of the image to be processed in the YUV color space. The filtering module is used to filter the brightness component image to obtain a mask image; An image enhancement module is used to enhance the image to be processed based on the mask image to obtain an enhanced image corresponding to the image to be processed. The process of enhancing the image to be processed based on the mask image to obtain the enhanced image corresponding to the image to be processed includes: The brightness of the mask image is adjusted to obtain a brightness-enhanced image corresponding to the mask image; Based on the brightness-enhanced image, the image to be processed is enhanced to obtain the enhanced image corresponding to the image to be processed; The process of enhancing the image to be processed based on the brightness-enhanced image to obtain the enhanced image corresponding to the image to be processed includes: The image to be processed is decomposed into multiple channels to obtain multiple color component images of the image in the RGB color space. For each pixel in each of the color component images, the following processing is performed: If the brightness value of the pixel is determined to be a second set value based on the brightness component image, the pixel value of the pixel is set to the second set value; If the brightness value of the pixel is determined to be not the second set value based on the brightness component image, the pixel value of the pixel is adjusted based on the brightness enhancement image; Multi-color channel fusion is performed on the multiple color component images after the above processing to obtain the enhanced image corresponding to the image to be processed.
6. The apparatus according to claim 5, characterized in that, The filtering module is specifically used for: The brightness component image is subjected to bilateral filtering to obtain a mask image.
7. An electronic device, characterized in that, include: Processor and memory; The processor is used to execute the image enhancement program stored in the memory to implement the image enhancement method according to any one of claims 1 to 4.
8. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the image enhancement method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Self-adaptive panoramic image enhancement method and device
CN114037615A