Image processing method and device, equipment and storage medium
By performing brightness component and gamma correction processing on the electronic endoscope image, the dark area overdarkness and overexposure caused by uneven lighting are solved, and the image quality is improved. It is suitable for medical electronic endoscope systems.
Patent Information
- Application Number
- CN202510715854.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-08-29
AI Technical Summary
During the electronic endoscope imaging, due to the uneven distribution of the illumination light source field, some areas of the image space are too dark and some areas are overexposed, which reduces the image quality.
By acquiring the brightness component, hue component and saturation component images of the image, the brightness adjustment of the illumination component image is performed, and combined with segmented gamma correction, the brightness of the dark area is improved and the overexposure area is suppressed.
It improves the overall quality of the image, especially the brightness of the dark area, enhances the visual effect of the image, and facilitates doctors' diagnosis.
Smart Images

Figure CN120568211A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method, apparatus, device and storage medium. Background Art
[0002] Medical electronic endoscope systems integrate advanced technologies such as optics and computers, enabling doctors to directly observe internal tissues and organs, facilitating diagnostics. However, because electronic endoscopes use active illumination to generate images, uneven distribution of the illumination source can occur, resulting in areas of the image being too dark or overexposed, leading to reduced image quality. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide an image processing method, device, equipment and storage medium that can prevent dark areas from being too dark and suppress overexposed areas of the image, thereby improving image quality. The specific solution is as follows:
[0004] In a first aspect, the present application discloses an image processing method, comprising:
[0005] Obtaining a brightness component image, a hue component image, and a saturation component image of an image to be processed;
[0006] performing brightness adjustment on the illumination component image of the brightness component image according to brightness values of pixels in the brightness component image to obtain an adjusted brightness component image;
[0007] obtaining an initial adjusted image based on the adjusted brightness component image, the hue component image, and the saturation component image;
[0008] Performing segmented gamma correction on the initially adjusted image, and obtaining a processed image corresponding to the image to be processed according to the correction result.
[0009] Optionally, performing brightness adjustment on the illumination component image of the brightness component image according to the brightness values of pixels in the brightness component image to obtain an adjusted brightness component image includes:
[0010] Splitting the brightness component image into an illumination component image and a reflection component image;
[0011] Performing brightness adjustment on the illumination component image according to the brightness values of pixels in the brightness component image to obtain an adjusted illumination component image;
[0012] An adjusted brightness component image is obtained based on the adjusted illumination component image and the reflection component image.
[0013] Optionally, the initially adjusted image is an RGB image, and performing segmented gamma correction on the initially adjusted image includes:
[0014] Performing normalization processing on the initially adjusted image to obtain a normalized image;
[0015] Performing segmented gamma correction on the normalized image.
[0016] Optionally, performing segmented gamma correction on the normalized image includes:
[0017] comparing a maximum color component of a target pixel in the normalized image with a target threshold;
[0018] If the maximum color component of the target pixel is less than the target threshold, correcting the maximum color component using the gamma value;
[0019] If the maximum color component of the target pixel is not less than the target threshold, no correction is performed.
[0020] Optionally, the target threshold is the minimum grayscale value among the average grayscale values corresponding to the three color components of the normalized image.
[0021] Optionally, the performing brightness adjustment on the illumination component image of the brightness component image according to the brightness values of pixels in the brightness component image includes:
[0022] The brightness of the pixels in the illumination component image is adjusted using a preset brightness adjustment formula; the preset brightness adjustment formula is constructed based on the brightness value of the pixels in the brightness component image and correction parameters, and the correction parameters are determined based on the illumination value and grayscale median value of the pixels in the illumination component image.
[0023] Optionally, the preset brightness adjustment formula is:
[0024] ;
[0025] in, is the adjusted illumination component of pixel (x, y), b is the coefficient, V(x, y) is the brightness value of pixel (x, y) in the brightness component image, is the correction parameter.
[0026] In a second aspect, the present application discloses an image processing device, comprising:
[0027] An image acquisition module is used to acquire a brightness component image, a hue component image, and a saturation component image of an image to be processed;
[0028] a brightness adjustment module, configured to perform brightness adjustment on the illumination component image of the brightness component image according to the brightness values of the pixels in the brightness component image, to obtain an adjusted brightness component image;
[0029] an initial adjusted image determining module, configured to obtain an initial adjusted image based on the adjusted brightness component image, the hue component image, and the saturation component image;
[0030] The second brightness adjustment module is used to perform segmented gamma correction on the initially adjusted image, and obtain a processed image corresponding to the image to be processed according to the correction result.
[0031] In a third aspect, the present application discloses an electronic device, comprising:
[0032] Memory, used to store computer programs;
[0033] The processor is used to execute the computer program to implement the aforementioned image processing method.
[0034] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program implements the aforementioned image processing method when executed by a processor.
[0035] In the present application, a brightness component image, a hue component image, and a saturation component image of an image to be processed are obtained; based on the brightness values of the pixels in the brightness component image, brightness adjustment is performed on the illumination component image of the brightness component image to obtain an adjusted brightness component image; based on the adjusted brightness component image, the hue component image, and the saturation component image, an initial adjusted image is obtained; segmented gamma correction is performed on the initial adjusted image, and a processed image corresponding to the image to be processed is obtained based on the correction result. It can be seen that adjusting the brightness of the dark areas of the illumination component image based on the brightness values of the pixels in the brightness component image can improve the brightness of the dark areas, avoid the dark areas being too dark, and suppress overexposed areas of the image; however, the dark areas are still darker based on the dark area brightness adjustment of the illumination component image. By performing segmented gamma correction on the initial adjusted image, the brightness of the dark areas is further improved and overexposed areas of the image brightness areas are avoided, thereby improving image quality, thereby facilitating doctors to make diagnoses based on the processed images. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0037] Figure 1 A flow chart of an image processing method provided in this application;
[0038] Figure 2 A flowchart of a specific image processing method provided in this application;
[0039] Figure 3 A schematic diagram of the structure of an image processing device provided in this application;
[0040] Figure 4 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION
[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0042] In related technologies, because electronic endoscopes use active illumination to generate images, there may be an uneven distribution of the illumination source field, which can cause some image regions to be too dark and others to be overexposed, resulting in reduced image quality. To overcome these technical issues, this application proposes an image processing method that can prevent dark areas from being too dark and suppress image overexposure, thereby improving image quality.
[0043] The present application discloses an image processing method. Figure 1 As shown, the method may include the following steps:
[0044] Step S11: Acquire a brightness component image, a hue component image, and a saturation component image of the image to be processed.
[0045] First, obtain the luminance, hue, and saturation components of the image to be processed. Specifically, the image to be processed is a standard RGB (Red, Green, Blue) image, which has undergone image demosaicing, black level correction, white balance correction, and color correction using an Image Signal Processor (ISP). The input RGB image is converted to the HSV (Hue, Saturation, Value) color space, generating its luminance component image V, hue component image H, and saturation component image S.
[0046] Step S12: performing brightness adjustment on the illumination component image of the brightness component image according to the brightness values of the pixels in the brightness component image to obtain an adjusted brightness component image.
[0047] After determining the luminance component image, it can be further divided into an illumination component image I and a reflection component image F. The illumination component image is then adjusted based on the brightness values of the pixels in the luminance component image. Brightness adjustment specifically adjusts the image's average brightness to a neutral level, such as an average grayscale value of 128. This adjustment increases the brightness of dark areas and reduces the brightness of overexposed areas, resulting in the adjusted luminance component image.
[0048] This application performs brightness adjustment from the dimension of the illumination component image to achieve more fine-grained adjustment and improve the brightness adjustment effect. The illumination component image usually reflects the overall illumination distribution in the scene and is a relatively smooth low-frequency signal. By adjusting the illumination component, direct manipulation of high-frequency details in the image (such as textures and edges) can be avoided. In contrast, the brightness component image contains mixed information of illumination and reflection. Directly adjusting the brightness component may affect both the illumination and reflection components, resulting in loss or distortion of details. In addition, the human visual system perceives illumination changes relatively smoothly, but is more sensitive to the reflective characteristics of the object itself. By adjusting the illumination component, the brightness of the image can be changed more naturally, in line with the perception habits of human vision. It has higher robustness to illumination changes and adapts to different lighting conditions. Independent control of illumination and reflection components enables more flexible brightness adjustment.
[0049] In some embodiments, the brightness adjustment of the illumination component image of the brightness component image according to the brightness values of the pixels in the brightness component image to obtain the adjusted brightness component image includes: splitting the brightness component image to obtain the illumination component image and the reflection component image; performing brightness adjustment on the illumination component image according to the brightness values of the pixels in the brightness component image to obtain the adjusted illumination component image; and obtaining the adjusted brightness component image based on the adjusted illumination component image and the reflection component image. Specifically, the above splitting of the brightness component image to obtain the illumination component image and the reflection component image includes: filtering the brightness component image to obtain the illumination component image and the reflection component image of the brightness component image. Specifically, guided filtering, Gaussian filtering, etc. can be used, which is not limited in this application. Taking guided filtering as an example, guided filtering is performed on the brightness component image to obtain a filtered image, i.e., the illumination component image, and the brightness component image is subtracted from the filtered image to obtain the reflection component image.
[0050] In some embodiments, adjusting the brightness of the illumination component image of the luminance component image based on the luminance values of the pixels in the luminance component image includes: adjusting the brightness of the pixels in the illumination component image using a preset brightness adjustment formula; the preset brightness adjustment formula is constructed based on the luminance values of the pixels in the luminance component image and correction parameters, and the correction parameters are determined based on the illumination values and grayscale median values of the pixels in the illumination component image. The grayscale median value belongs to the human eye comfort zone, and to make the image brightness more comfortable for the human eye, the correction parameters are constructed using the grayscale median value.
[0051] Preferably, the above preset brightness adjustment formula is:
[0052] ;
[0053] in, is the adjusted illumination component of pixel (x, y), b is the coefficient, V(x, y) is the brightness value of pixel (x, y) in the brightness component image, is the correction parameter. The preferred value of b is 255.
[0054] ;
[0055] in, is an adjustable setting value ranging from 0 to 1; m is the grayscale median value, preferably 128; and I(x,y) is the value of the illumination component image I at pixel coordinates (x,y). Of course, in addition to the brightness adjustment formula and correction parameters described above, other brightness adjustment formulas and correction parameters can also be used to adjust the brightness of the illumination component image based on the brightness values of the pixels in the brightness component image.
[0056] Finally, the adjusted illumination component image is added to the reflectance component image to obtain the adjusted brightness component image. In this embodiment, the reflectance component image does not need to be adjusted. However, it can also be adaptively adjusted to enhance image detail and texture information based on actual needs. The reflectance component image contains high-frequency information. Adjusting this information can enhance image detail, making textures, edges, and small details more prominent, thereby improving image visual quality. In medical images, enhancing the reflectance component can help doctors more clearly see tissue texture and lesions.
[0057] Step S13: obtaining an initial adjusted image based on the adjusted brightness component image, the hue component image, and the saturation component image.
[0058] The initial adjusted image is obtained by merging the adjusted brightness component image with the hue component image and the saturation component image of the image to be processed. The initial adjusted image is an HSV image and needs to be converted to an RGB image.
[0059] Step S14: performing segmented gamma correction on the initially adjusted image, and obtaining a processed image corresponding to the image to be processed according to the correction result.
[0060] Although step S12 can achieve a certain effect of improving the brightness of dark areas, the dark areas of the image after the initial adjustment will still be somewhat dark. In order to further improve the brightness of the dark areas without increasing the brightness of the bright areas, this embodiment performs segmented gamma correction on the image after the initial adjustment, and finally obtains the processed image corresponding to the image to be processed based on the correction result. While maintaining the image contrast, the present application increases the brightness of the dark area image and suppresses the overexposed image area, thereby achieving adaptive brightness adjustment of the image. It is suitable for automatic brightness adjustment of medical electronic endoscopes and can enhance the visual effect of electronic endoscope images. Gamma correction is a nonlinear operation used to adjust the brightness and contrast of an image to improve the visual effect of the image or adapt to different display devices, so that it is more in line with the human eye's perception characteristics of brightness, or meets the requirements of a specific display device.
[0061] In some embodiments, performing segmented gamma correction on the initially adjusted image may include: performing segmented normalization on the initially adjusted image to obtain a normalized image; and performing segmented gamma correction on the normalized image. The normalization process unifies pixel values of all images into a standard range to facilitate subsequent processing.
[0062] The stepwise gamma correction of the normalized image includes comparing the maximum color component of a target pixel in the normalized image with a target threshold; if the maximum color component of the target pixel is less than the target threshold, correcting the maximum color component using a gamma value; and if the maximum color component of the target pixel is not less than the target threshold, not correcting the maximum color component. The target threshold is the minimum grayscale value among the average grayscale values corresponding to the three color components of the normalized image.
[0063] The segmented gamma correction formula is as follows:
[0064] ;
[0065] in, for The maximum value of the three color components R, G, and B at the pixel coordinate (x, y), is the gamma value for gamma correction, preferably The value can be 1 / 1.8; avg is The minimum value among the average grayscale values of the three color components R, G, and B of the image.
[0066] It can be understood that the maximum color component can be used to detect highlight areas in an image. Highlight areas are usually caused by excessive lighting or reflection, and at least one of the R, G, and B components will have a very high value. If the maximum color component value of a pixel is less than the minimum value of the image's average grayscale value, this indicates that the brightness of the pixel is lower than the average brightness of certain areas in the image, that is, the pixel is located in a low-brightness area of the image; for such pixels, gamma value correction is used to increase the brightness of the pixel, thereby increasing the brightness of the dark area. However, for pixels whose maximum color component value is greater than or equal to the minimum value of the image's average grayscale value, it indicates that the brightness of the pixel belongs to a highlight or normal area. At this time, no brightness adjustment is required to avoid overexposure of the bright area.
[0067] As can be seen from the above, in this embodiment, the brightness component image, hue component image, and saturation component image of the image to be processed are obtained; based on the brightness values of the pixels in the brightness component image, the illumination component image of the brightness component image is brightness-adjusted to obtain an adjusted brightness component image; based on the adjusted brightness component image, the hue component image, and the saturation component image, an initial adjusted image is obtained; segmented gamma correction is performed on the initial adjusted image, and a processed image corresponding to the image to be processed is obtained based on the correction result. It can be seen that, based on the brightness values of the pixels in the brightness component image, the dark area brightness adjustment of the illumination component image can improve the dark area brightness, avoid the dark area being too dark, and suppress the overexposed area of the image; however, the dark area is still dark based on the dark area brightness adjustment of the illumination component image. By performing segmented gamma correction on the initial adjusted image, the dark area brightness is further improved and the overexposed area of the image brightness area is avoided, thereby improving the image quality, thereby facilitating the doctor's diagnosis based on the processed image.
[0068] A specific image processing method, such as Figure 2 As shown, the following steps are included:
[0069] Step S21: Obtain an input standard RGB (Red, Green, Blue) image, which is the output after ISP processing such as demosaicing, black level correction, white balance correction, and color correction.
[0070] Step S22: Convert the input RGB image to the HSV (Hue, Saturation, Value) color space and obtain its brightness component V, hue component H, and saturation component S.
[0071] Step S23 , subjecting the V component in the HSV image obtained in step S22 to guided filtering to obtain an illumination component image I and a reflection component image F of the V component image.
[0072] Step S24: Dynamically adjust the brightness of the illumination component image I obtained in step S23 to obtain an adjusted illumination component image Iout.
[0073] Step S25 : Add the brightness component image Iout obtained in step S24 and the reflection component image F obtained in step S23 to obtain an adjusted brightness component image Vout.
[0074] Step S26: The brightness component image Vout obtained in step S25 is combined with the hue component H and the saturation component S obtained in step S22 and converted into an RGB color space to obtain an RGBtmp image.
[0075] Step S27: Perform segmented gamma correction on the RGBtmp image obtained in step S26 to obtain an output image RGBout after brightness correction.
[0076] Specifically, first normalize RGBtmp to get ; After normalization Perform segmented gamma correction. The specific calculation method is as follows:
[0077] ;
[0078] in, for The maximum value of the three color components R, G, and B at the pixel coordinate (x, y), is the gamma value of gamma correction, avg is The minimum value among the average grayscale values of the three color components R, G, and B of the image.
[0079] Accordingly, the present application also discloses an image processing device, see Figure 3 As shown, the device includes:
[0080] The image acquisition module 11 is used to acquire a brightness component image, a hue component image, and a saturation component image of an image to be processed;
[0081] A first brightness adjustment module 12 is configured to perform brightness adjustment on the illumination component image of the brightness component image according to the brightness values of the pixels in the brightness component image to obtain an adjusted brightness component image;
[0082] an initial adjusted image determining module 13, configured to obtain an initial adjusted image based on the adjusted brightness component image, the hue component image, and the saturation component image;
[0083] The second brightness adjustment module 14 is configured to perform segmented gamma correction on the initially adjusted image, and obtain a processed image corresponding to the image to be processed according to the correction result.
[0084] As can be seen from the above, in this embodiment, the brightness component image, hue component image, and saturation component image of the image to be processed are obtained; based on the brightness values of the pixels in the brightness component image, the illumination component image of the brightness component image is brightness-adjusted to obtain an adjusted brightness component image; based on the adjusted brightness component image, the hue component image, and the saturation component image, an initial adjusted image is obtained; segmented gamma correction is performed on the initial adjusted image, and a processed image corresponding to the image to be processed is obtained based on the correction result. It can be seen that, based on the brightness values of the pixels in the brightness component image, the dark area brightness adjustment of the illumination component image can improve the dark area brightness, avoid the dark area being too dark, and suppress the overexposed area of the image; however, the dark area is still dark based on the dark area brightness adjustment of the illumination component image. By performing segmented gamma correction on the initial adjusted image, the dark area brightness is further improved and the overexposed area of the image brightness area is avoided, thereby improving the image quality, thereby facilitating the doctor's diagnosis based on the processed image.
[0085] In some specific embodiments, the first brightness adjustment module 12 may specifically include:
[0086] a splitting unit, configured to split the brightness component image into an illumination component image and a reflection component image;
[0087] a brightness adjustment unit, configured to adjust the brightness of the illumination component image according to the brightness values of the pixels in the brightness component image to obtain an adjusted illumination component image;
[0088] The adjusted brightness component image determining unit is configured to obtain an adjusted brightness component image based on the adjusted illumination component image and the reflected component image.
[0089] In some specific embodiments, the initially adjusted image is an RGB image, and the second brightness adjustment module 14 may specifically include:
[0090] a normalization unit, configured to perform a normalization process on the initially adjusted image to obtain a normalized image;
[0091] A gamma correction unit is used to perform segmented gamma correction on the normalized image.
[0092] In some specific embodiments, the gamma correction unit may include:
[0093] a comparing unit, configured to compare a maximum color component of a target pixel in the normalized image with a target threshold;
[0094] A correction unit is configured to correct the maximum color component of the target pixel by using a gamma value if the maximum color component of the target pixel is less than the target threshold; and not perform correction if the maximum color component of the target pixel is not less than the target threshold.
[0095] In some specific embodiments, the target threshold is the minimum grayscale value among the average grayscale values corresponding to the three color components of the normalized image.
[0096] In some specific embodiments, the first brightness adjustment module 12 may specifically include:
[0097] A brightness adjustment unit is used to adjust the brightness of pixels in the illumination component image using a preset brightness adjustment formula; the preset brightness adjustment formula is constructed based on the brightness value of the pixels in the brightness component image and correction parameters, and the correction parameters are determined based on the illumination value and grayscale median value of the pixels in the illumination component image.
[0098] In some specific embodiments, the preset brightness adjustment formula is:
[0099] ;
[0100] in, is the adjusted illumination component of pixel (x, y), b is the coefficient, V(x, y) is the brightness value of pixel (x, y) in the brightness component image, is the correction parameter.
[0101] Furthermore, the present application also discloses an electronic device, see Figure 4 The contents in the drawings should not be considered as any limitation on the scope of use of the present application.
[0102] Figure 4 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the image processing method disclosed in any of the aforementioned embodiments.
[0103] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0104] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223 including images to be processed, etc. The storage method can be temporary storage or permanent storage.
[0105] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to enable the processor 21 to calculate and process the massive amount of data 223 in the memory 22. The operating system 221 can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of performing the image processing method disclosed in any of the aforementioned embodiments and executed by the electronic device 20, the computer programs 222 can further include computer programs capable of performing other specific tasks.
[0106] Furthermore, an embodiment of the present application also discloses a computer storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the steps of the image processing method disclosed in any of the aforementioned embodiments are implemented.
[0107] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program, which, when executed by a processor, implements the steps of the image processing method disclosed in any of the aforementioned embodiments.
[0108] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0109] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0110] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0111] The above is a detailed introduction to the image processing method, device, equipment and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. An image processing method, characterized in that: include: Obtaining a brightness component image, a hue component image, and a saturation component image of an image to be processed; performing brightness adjustment on the illumination component image of the brightness component image according to brightness values of pixels in the brightness component image to obtain an adjusted brightness component image; obtaining an initial adjusted image based on the adjusted brightness component image, the hue component image, and the saturation component image; Performing segmented gamma correction on the initially adjusted image, and obtaining a processed image corresponding to the image to be processed according to the correction result.
2. The image processing method according to claim 1, wherein: The step of performing brightness adjustment on the illumination component image of the brightness component image according to the brightness values of the pixels in the brightness component image to obtain the adjusted brightness component image includes: Splitting the brightness component image into an illumination component image and a reflection component image; Performing brightness adjustment on the illumination component image according to the brightness values of pixels in the brightness component image to obtain an adjusted illumination component image; An adjusted brightness component image is obtained based on the adjusted illumination component image and the reflected component image.
3. The image processing method according to claim 1, wherein: The initially adjusted image is an RGB image, and performing segmented gamma correction on the initially adjusted image includes: Performing normalization processing on the initially adjusted image to obtain a normalized image; Performing segmented gamma correction on the normalized image.
4. The image processing method according to claim 3, wherein: The performing segmented gamma correction on the normalized image includes: comparing a maximum color component of a target pixel in the normalized image with a target threshold; If the maximum color component of the target pixel is less than the target threshold, correcting the maximum color component using the gamma value; If the maximum color component of the target pixel is not less than the target threshold, no correction is performed.
5. The image processing method according to claim 4, characterized in that The target threshold is the minimum grayscale value among the average grayscale values corresponding to the three color components of the normalized image.
6. The image processing method according to any one of claims 1 to 5, characterized in that: The step of adjusting the brightness of the illumination component image of the brightness component image according to the brightness values of the pixels in the brightness component image comprises: The brightness of the pixels in the illumination component image is adjusted using a preset brightness adjustment formula; the preset brightness adjustment formula is constructed based on the brightness value of the pixels in the brightness component image and correction parameters, and the correction parameters are determined based on the illumination value and grayscale median value of the pixels in the illumination component image.
7. The image processing method according to claim 6, characterized in that: The preset brightness adjustment formula is: ; in, is the adjusted illumination component of pixel (x, y), b is the coefficient, V(x, y) is the brightness value of pixel (x, y) in the brightness component image, is the correction parameter.
8. An image processing device, characterized in that: include: An image acquisition module is used to acquire a brightness component image, a hue component image, and a saturation component image of an image to be processed; a first brightness adjustment module, configured to perform brightness adjustment on the illumination component image of the brightness component image according to brightness values of pixels in the brightness component image to obtain an adjusted brightness component image; an initial adjusted image determining module, configured to obtain an initial adjusted image based on the adjusted brightness component image, the hue component image, and the saturation component image; The second brightness adjustment module is used to perform segmented gamma correction on the initially adjusted image, and obtain a processed image corresponding to the image to be processed according to the correction result.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the image processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Used to store a computer program; wherein when the computer program is executed by a processor, the image processing method according to any one of claims 1 to 7 is implemented.