Image saturation adjusting method and device, equipment, storage medium and program product

By performing HSV conversion on the RGB color space of the image and adjusting the saturation according to the brightness component and preset table, the problem that image saturation adjustment in the prior art is difficult to achieve high accuracy and adaptability, and the efficient adaptation of the image under different ambient brightness is achieved.

CN119520700APending Publication Date: 2025-02-25SHENZHEN XIHUA TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411498138.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art is difficult to achieve high-precision image saturation adjustment, especially adaptive adjustment under different ambient brightness, resulting in large differences in saturation and obvious sense of splitting.

Method used

By performing spatial transformation of the RGB color space of the image to be processed, the HSV color space is obtained, and the HSV color space is saturated according to the brightness component and the preset saturation adjustment table, the target HSV color space is obtained, and the target RGB color space is transformed to obtain the target RGB color space.

Benefits of technology

It realizes that the corresponding saturation adjustment is performed for pixels of different brightness components without the need to partition the image, thereby improving the image's adaptability to different ambient brightness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520700A_ABST
    Figure CN119520700A_ABST
Patent Text Reader

Abstract

The invention relates to an image saturation adjusting method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the steps of performing spatial transformation on an RGB color space of a to-be-processed image to obtain an HSV color space; determining a brightness component of the to-be-processed image according to the RGB color space; performing saturation adjustment on the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space; and performing spatial transformation on the target HSV color space to obtain a target RGB color space, and determining a target image according to the target RGB color space. By adopting the method, image saturation adjustment can be adaptively performed on the image according to different brightness conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of image processing technology, the images captured by the image sensor in different directions under the same shooting scene will have differences in brightness. Therefore, it is necessary to adjust the saturation of the captured image to improve the adaptability of the image to different ambient brightness. The current saturation adjustment usually stretches the color matrix coordinates of the captured image through a fixed mapping formula, and then processes the image in different regions according to the saturation. This leads to a sense of separation due to the large saturation difference between different regions, making it difficult for saturation adjustment to meet actual application requirements and difficult to complete high-precision saturation adjustment tasks. Therefore, there is an urgent need for an image color temperature adjustment method that can adaptively adjust the image saturation according to different brightness conditions, so as to achieve a more accurate saturation adjustment method. Summary of the invention

[0003] Based on this, it is necessary to provide an image saturation adjustment method, device, computer equipment, computer-readable storage medium and computer program product that can adaptively adjust the image saturation according to different brightness conditions in order to address the above technical problems.

[0004] In a first aspect, the present application provides a method for adjusting image saturation, comprising:

[0005] Perform spatial transformation on the RGB color space of the image to be processed to obtain the HSV color space;

[0006] Determine the brightness component of the image to be processed according to the RGB color space;

[0007] Adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space;

[0008] The target HSV color space is spatially transformed to obtain a target RGB color space, and a target image is determined according to the target RGB color space.

[0009] In one of the embodiments, adjusting the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space includes:

[0010] Determining saturation adjustment data according to the brightness component and a preset saturation adjustment table; wherein the preset saturation adjustment table is used to record the corresponding relationship between the brightness component and the saturation adjustment data;

[0011] The saturation of the HSV color space is adjusted using the saturation adjustment data to obtain the target HSV color space.

[0012] In one embodiment, determining the saturation adjustment data according to the brightness component and a preset saturation adjustment table includes:

[0013] Determine a saturation adjustment coefficient from the preset saturation adjustment table according to the brightness component;

[0014] Determining a weight of the saturation adjustment coefficient according to the brightness component;

[0015] Saturation calculation is performed according to the weight and the saturation adjustment coefficient to obtain the saturation adjustment data.

[0016] In one embodiment, the step of adjusting the saturation of the HSV color space by using the saturation adjustment data includes:

[0017] Performing saturation adjustment on the saturation component of the HSV color space according to the saturation adjustment data to obtain a target saturation component;

[0018] The target HSV color space is constructed according to the target saturation component and the HSV color space.

[0019] In one of the embodiments, before adjusting the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table, the method further includes:

[0020] Get the preset saturation target;

[0021] The preset saturation adjustment table is determined according to the preset saturation target.

[0022] In one embodiment, the method further comprises:

[0023] Performing real-time rendering on the target image to obtain a real-time rendering image;

[0024] The real-time rendering image is displayed.

[0025] In a second aspect, the present application further provides an image saturation adjustment device, comprising:

[0026] A space transformation module is used to perform space transformation on the RGB color space of the image to be processed to obtain the HSV color space;

[0027] A first determination module, used to determine the brightness component of the image to be processed according to the RGB color space;

[0028] A saturation adjustment module, used to adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space;

[0029] The second determination module is used to perform space transformation on the target HSV color space to obtain a target RGB color space, and determine a target image according to the target RGB color space.

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

[0031] Perform spatial transformation on the RGB color space of the image to be processed to obtain the HSV color space;

[0032] Determine the brightness component of the image to be processed according to the RGB color space;

[0033] Adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space;

[0034] The target HSV color space is spatially transformed to obtain a target RGB color space, and a target image is determined according to the target RGB color space.

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

[0036] Perform spatial transformation on the RGB color space of the image to be processed to obtain the HSV color space;

[0037] Determine the brightness component of the image to be processed according to the RGB color space;

[0038] Adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space;

[0039] The target HSV color space is spatially transformed to obtain a target RGB color space, and a target image is determined according to the target RGB color space.

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

[0041] Perform spatial transformation on the RGB color space of the image to be processed to obtain the HSV color space;

[0042] Determine the brightness component of the image to be processed according to the RGB color space;

[0043] Adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space;

[0044] The target HSV color space is spatially transformed to obtain a target RGB color space, and a target image is determined according to the target RGB color space.

[0045] The above-mentioned image saturation adjustment method, device, computer equipment, computer-readable storage medium and computer program product obtain HSV color space by performing spatial transformation on the RGB color space of the image to be processed; determine the brightness component of the image to be processed according to the RGB color space; adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space; perform spatial transformation on the target HSV color space to obtain a target RGB color space, and determine the target image according to the target RGB color space. Therefore, by adjusting the saturation of the HSV color space according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space, it is achieved that the corresponding saturation adjustment is performed for pixels of different brightness components in the image to be processed without partitioning the image, thereby improving the adaptability of the image to be processed to different ambient brightness. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] FIG1 is a diagram showing an application environment of a method for adjusting image saturation in one embodiment;

[0048] FIG2 is a schematic diagram of a flow chart of a method for adjusting image saturation in one embodiment;

[0049] FIG3 is a schematic diagram of a real-time rendering process of a method for adjusting image saturation in one embodiment;

[0050] FIG4 is a structural block diagram of an image saturation adjustment device in one embodiment;

[0051] FIG. 5 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

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

[0053] The image saturation adjustment method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. The terminal 102 communicates with the server 104 through a network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 obtains the HSV color space by performing spatial transformation on the RGB color space of the image to be processed; determines the brightness component of the image to be processed according to the RGB color space; adjusts the saturation of the HSV color space according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space; performs spatial transformation on the target HSV color space to obtain the target RGB color space, and determines the target image according to the target RGB color space. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head mounted device may be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0054] In an exemplary embodiment, as shown in FIG2 , a method for adjusting image saturation is provided, and the method is applied to the server 104 in FIG1 as an example for description, including the following steps 202 to 208. Among them:

[0055] Step 202: Perform space transformation on the RGB color space of the image to be processed to obtain the HSV color space.

[0056] The image to be processed may be obtained from some pre-prepared image sets, or may be an image obtained in real time through a camera device, but is not limited thereto. The RGB color space refers to a color space containing the three primary colors of red, green, and blue. It should be noted that each color in the HSV color space is represented by hue (Hue, H), saturation (S), and value (V).

[0057] In some embodiments, the RGB color space of the image to be processed may be spatially transformed based on a preset conversion formula to obtain an HSV color space, or an artificial intelligence tool may be used to perform the spatial transformation, but the present invention is not limited thereto.

[0058] Among them, the preset conversion formula can be various RGB to HSV conversion formulas, not limited to specific conversion formulas, and the artificial intelligence tool can use the cvtColor function of Opencv, but is not limited to this.

[0059] Step 204: determine the brightness component of the image to be processed according to the RGB color space.

[0060] The brightness component refers to the brightness component in the YUV color space corresponding to the RGB color space.

[0061] In some embodiments, the RGB color space is spatially transformed to obtain a YUV color space, and the brightness component is determined based on the YUV color space.

[0062] The brightness component refers to the Y value in the YUV color space. The Y value in the YUV color space is used to represent brightness (Luminance or Luma), that is, the grayscale value, and the Y value corresponding to each pixel in the image to be processed may not be the same.

[0063] In some embodiments, the RGB color space of the image to be processed may be spatially transformed based on a preset YUV conversion formula, the RGB color space may be converted into a color difference signal, and the color difference signal may be re-quantized to obtain a YUV color space.

[0064] The conversion formula may adopt various YUV conversion formulas, for example, converting the RGB color space to the YUV color space according to the BT.601 standard, but is not limited thereto.

[0065] Step 206 , adjusting the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space.

[0066] In some embodiments, before adjusting the saturation of the HSV color space according to the brightness component and the preset saturation adjustment table, the method further includes: acquiring a preset saturation target; and determining a preset saturation adjustment table according to the preset saturation target.

[0067] Among them, the preset saturation target can be set according to actual needs. For example, for images taken in dim environments, the saturation target can be set to a high saturation requirement. Or for some specific style requirements, a specific saturation target can be used to meet specific style requirements. The saturation target can be a style or a specific saturation value, but is not limited to this.

[0068] In some embodiments, a saturation target set by a user may be obtained through the device, or a saturation target that can prevent the image from being overexposed may be obtained by analyzing image features of the image to be processed, or a pre-set default saturation target may be obtained.

[0069] In some embodiments, a default saturation adjustment table may be determined according to a default saturation target.

[0070] In this embodiment, by determining the corresponding saturation adjustment table according to the preset saturation target, the specific color temperature adjustment process can be effectively adjusted so that the specific color temperature adjustment is more accurate and meets the user's needs.

[0071] In some embodiments, the saturation of the HSV color space is adjusted according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space, including: determining saturation adjustment data according to the brightness component and the preset saturation adjustment table; wherein the preset saturation adjustment table is used to record the correspondence between the brightness component and the saturation adjustment data; and the saturation of the HSV color space is adjusted according to the saturation adjustment data to obtain a target HSV color space.

[0072] The saturation adjustment data may be saturation enhancement percentage data, but is not limited thereto.

[0073] In some embodiments, saturation adjustment data is determined based on a brightness component and a preset saturation adjustment table, including: determining a saturation adjustment coefficient from a preset saturation adjustment table based on the brightness component; determining a weight of the saturation adjustment coefficient based on the brightness component; performing saturation calculation based on the weight and the saturation adjustment coefficient to obtain saturation adjustment data.

[0074] In some embodiments, the saturation adjustment coefficient is determined from a preset saturation adjustment table according to the brightness component. For example, in a default saturation adjustment table, the saturation adjustment table is as follows:

[0075] Sat_gain={0x3f, 0x3c, 0x38, 0x34, 0x30, 0x28, 0x20, 0x18, 0x10, 0x0c, 0x0a, 0x08, 0x04, 0x02};

[0076] Among them, Sat_gain is a saturation adjustment table. The first data gain value in the table corresponds to the saturation adjustment coefficient of the saturation when the brightness component is equal to 0, and so on. The saturation adjustment coefficient is used to determine the saturation adjustment data, and the data in the table is set from large to small.

[0077] It should be noted that since the bit width of the brightness component is generally 8 bits, and the preset saturation adjustment table is 16 values, it is necessary to first shift the brightness component right by 4 bits to obtain an index between 0 and 15, and the saturation adjustment coefficient can be determined according to the index.

[0078] It should be further explained that the first value in the saturation adjustment table corresponds to the gain value when the brightness component is relatively small, and the gain value is relatively large at this time; the latter value corresponds to the gain value when the Y value is relatively large, and the gain value is relatively small at this time. This design effectively prevents the oversaturation of highlight pixels, thereby preventing the processed image from being overexposed.

[0079] In some embodiments, the last 4 bits of the brightness component are used as the weight of the saturation adjustment coefficient, and the saturation is calculated based on the weight and the saturation adjustment coefficient to obtain saturation adjustment data for subsequent precise adjustment of the saturation.

[0080] Specifically, assuming that the brightness component of a pixel is 120, the value is 7 after shifting right four bits, and the remainder is 8; in the preset saturation adjustment table, the value with subscript 7 is (counting from 0) -13, and the number with subscript (7+1) is -15. Use 8 as the weight between -13 and -15 (note that the sum of the weights here is 16) to calculate the final saturation adjustment data. The specific calculation formula is as follows: ((-13)*8+(-15)*(16-8)) / 16=-14.

[0081] In some embodiments, the saturation of the HSV color space is adjusted using saturation adjustment data, including: adjusting the saturation component of the HSV color space according to the saturation adjustment data to obtain a target saturation component; and constructing a target HSV color space according to the target saturation component and the HSV color space.

[0082] The saturation adjustment data may refer to saturation gain.

[0083] In some embodiments, the S (Saturation) component in the HSV color space, that is, the saturation component, can be multiplied by the saturation adjustment data and shifted right by 2 bits to obtain the adjusted target saturation component, thereby achieving a precise saturation adjustment process.

[0084] In some embodiments, the saturation component in the HSV color space is replaced with the target saturation component, thereby obtaining the target HSV color space.

[0085] Step 208, performing space transformation on the target HSV color space to obtain a target RGB color space, and determining a target image according to the target RGB color space.

[0086] In some embodiments, the target HSV color space may be spatially transformed using a preset conversion formula to obtain a target RGB color space.

[0087] The conversion formula may adopt various RGB conversion formulas, but the same conversion formula should be used as much as possible in the spatial transformation to avoid errors caused by incompatible results of direct conversions using different formulas.

[0088] In some embodiments, the target image can be obtained by inputting the target RGB color space into the image generation software.

[0089] In the above-mentioned image saturation adjustment method, the RGB color space of the image to be processed is spatially transformed to obtain the HSV color space; the brightness component of the image to be processed is determined according to the RGB color space; the saturation of the HSV color space is adjusted according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space; the target HSV color space is spatially transformed to obtain the target RGB color space, and the target image is determined according to the target RGB color space. Therefore, by adjusting the saturation of the HSV color space according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space, the corresponding saturation adjustment is achieved for the pixels of different brightness components in the image to be processed without the need for partitioning the image, thereby improving the adaptability of the image to be processed to different ambient brightness.

[0090] In an exemplary embodiment, as shown in FIG3 , the real-time rendering step includes steps 302 to 304. Among them:

[0091] Step 302: Render the target image in real time to obtain a real-time rendering image.

[0092] In some embodiments, during the process of saturation adjustment of the target image, the changes in the image during each specific saturation adjustment process are rendered in real time to obtain a real-time rendering image of the corresponding stage, thereby improving the observation details of the changes in the saturation adjustment process of the entire image, and thus being more conducive to the subsequent specific judgment of further adjustment of the image saturation.

[0093] Step 304: display the real-time rendering image.

[0094] In some embodiments, a more sophisticated real-time rendering process can be performed through third-party software. In the specific color temperature adjustment process, the corresponding saturation adjustment data will be uploaded to the corresponding third-party software for real-time rendering to improve the real-time display accuracy of the saturation adjustment process.

[0095] In this embodiment, by rendering the target image in real time to obtain a real-time rendering image, and displaying the real-time rendering image in real time, the observation details of the changes in the entire image saturation adjustment process can be improved, which is more conducive to the subsequent specific judgment of further adjustment of the image saturation.

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

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

[0098] In an exemplary embodiment, as shown in FIG4 , an image saturation adjustment device is provided, comprising: a space transformation module 401, a first determination module 402, a saturation adjustment module 403, and a second determination module 404, wherein:

[0099] A space transformation module 401 is used to perform space transformation on the RGB color space of the image to be processed to obtain an HSV color space;

[0100] A first determination module 402, configured to determine a brightness component of an image to be processed according to an RGB color space;

[0101] The saturation adjustment module 403 is used to adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space;

[0102] The second determination module 404 is used to perform space transformation on the target HSV color space to obtain a target RGB color space, and determine the target image according to the target RGB color space.

[0103] In some embodiments, the saturation adjustment module 403 is also used to determine the saturation adjustment data according to the brightness component and the preset saturation adjustment table; wherein the preset saturation adjustment table is used to record the correspondence between the brightness component and the saturation adjustment data; the saturation of the HSV color space is adjusted by the saturation adjustment data to obtain the target HSV color space.

[0104] In some embodiments, the saturation adjustment module 403 is also used to determine a saturation adjustment coefficient from a preset saturation adjustment table according to the brightness component; determine the weight of the saturation adjustment coefficient according to the brightness component; perform saturation calculation according to the weight and the saturation adjustment coefficient to obtain saturation adjustment data.

[0105] In some embodiments, the saturation adjustment module 403 is further used to perform saturation adjustment on the saturation component of the HSV color space according to the saturation adjustment data to obtain a target saturation component; and construct a target HSV color space according to the target saturation component and the HSV color space.

[0106] In some embodiments, the image saturation adjustment device further includes: an adjustment table determination module, which is used to obtain a preset saturation target; and determine a preset saturation adjustment table according to the preset saturation target.

[0107] In some embodiments, the device further includes: a real-time rendering module, which is used to render the target image in real time to obtain a real-time rendering image; and to display the real-time rendering image.

[0108] In the above-mentioned image saturation adjustment device, the RGB color space of the image to be processed is spatially transformed to obtain the HSV color space; the brightness component of the image to be processed is determined according to the RGB color space; the saturation of the HSV color space is adjusted according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space; the target HSV color space is spatially transformed to obtain the target RGB color space, and the target image is determined according to the target RGB color space. Therefore, by adjusting the saturation of the HSV color space according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space, it is achieved that the corresponding saturation adjustment is performed for the pixels of different brightness components in the image to be processed without the need for partitioning the image, thereby improving the adaptability of the image to be processed to different ambient brightness.

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

[0110] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset saturation adjustment table data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an image saturation adjustment method is implemented.

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

[0112] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0113] Perform spatial transformation on the RGB color space of the image to be processed to obtain the HSV color space;

[0114] Determine the brightness component of the image to be processed according to the RGB color space;

[0115] The saturation of the HSV color space is adjusted according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space;

[0116] The target HSV color space is spatially transformed to obtain a target RGB color space, and the target image is determined according to the target RGB color space.

[0117] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining saturation adjustment data based on the brightness component and a preset saturation adjustment table; wherein the preset saturation adjustment table is used to record the correspondence between the brightness component and the saturation adjustment data; and adjusting the saturation of the HSV color space through the saturation adjustment data to obtain the target HSV color space.

[0118] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a saturation adjustment coefficient from a preset saturation adjustment table according to the brightness component; determining a weight of the saturation adjustment coefficient according to the brightness component; performing saturation calculation based on the weight and the saturation adjustment coefficient to obtain saturation adjustment data.

[0119] In one embodiment, when the processor executes the computer program, the following steps are also implemented: saturation adjustment is performed on the saturation component of the HSV color space according to the saturation adjustment data to obtain a target saturation component; and a target HSV color space is constructed according to the target saturation component and the HSV color space.

[0120] In one embodiment, before adjusting the saturation of the HSV color space according to the brightness component and the preset saturation adjustment table, the processor further implements the following steps when executing the computer program: obtaining a preset saturation target; and determining a preset saturation adjustment table according to the preset saturation target.

[0121] In one embodiment, when the processor executes the computer program, the following steps are also implemented: rendering the target image in real time to obtain a real-time rendering image; and displaying the real-time rendering image.

[0122] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0123] Perform spatial transformation on the RGB color space of the image to be processed to obtain the HSV color space;

[0124] Determine the brightness component of the image to be processed according to the RGB color space;

[0125] The saturation of the HSV color space is adjusted according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space;

[0126] The target HSV color space is spatially transformed to obtain a target RGB color space, and the target image is determined according to the target RGB color space.

[0127] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining saturation adjustment data based on the brightness component and a preset saturation adjustment table; wherein the preset saturation adjustment table is used to record the correspondence between the brightness component and the saturation adjustment data; and adjusting the saturation of the HSV color space through the saturation adjustment data to obtain the target HSV color space.

[0128] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a saturation adjustment coefficient from a preset saturation adjustment table according to the brightness component; determining a weight of the saturation adjustment coefficient according to the brightness component; performing saturation calculation based on the weight and the saturation adjustment coefficient to obtain saturation adjustment data.

[0129] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: saturation adjustment is performed on the saturation component of the HSV color space according to the saturation adjustment data to obtain a target saturation component; and a target HSV color space is constructed according to the target saturation component and the HSV color space.

[0130] In one embodiment, before the saturation of the HSV color space is adjusted according to the brightness component and the preset saturation adjustment table, the computer program, when executed by the processor, further implements the following steps: obtaining a preset saturation target; and determining a preset saturation adjustment table according to the preset saturation target.

[0131] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: rendering the target image in real time to obtain a real-time rendering image; and displaying the real-time rendering image.

[0132] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0133] Perform spatial transformation on the RGB color space of the image to be processed to obtain the HSV color space;

[0134] Determine the brightness component of the image to be processed according to the RGB color space;

[0135] The saturation of the HSV color space is adjusted according to the brightness component and the preset saturation adjustment table to obtain the target HSV color space;

[0136] The target HSV color space is spatially transformed to obtain a target RGB color space, and the target image is determined according to the target RGB color space.

[0137] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining saturation adjustment data based on the brightness component and a preset saturation adjustment table; wherein the preset saturation adjustment table is used to record the correspondence between the brightness component and the saturation adjustment data; and adjusting the saturation of the HSV color space through the saturation adjustment data to obtain the target HSV color space.

[0138] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a saturation adjustment coefficient from a preset saturation adjustment table according to the brightness component; determining a weight of the saturation adjustment coefficient according to the brightness component; performing saturation calculation based on the weight and the saturation adjustment coefficient to obtain saturation adjustment data.

[0139] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: saturation adjustment is performed on the saturation component of the HSV color space according to the saturation adjustment data to obtain a target saturation component; and a target HSV color space is constructed according to the target saturation component and the HSV color space.

[0140] In one embodiment, before the saturation of the HSV color space is adjusted according to the brightness component and the preset saturation adjustment table, the computer program, when executed by the processor, further implements the following steps: obtaining a preset saturation target; and determining a preset saturation adjustment table according to the preset saturation target.

[0141] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: rendering the target image in real time to obtain a real-time rendering image; and displaying the real-time rendering image.

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

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

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

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

Claims

1. A method for adjusting image saturation, characterized in that: The method comprises: Perform spatial transformation on the RGB color space of the image to be processed to obtain the HSV color space; Determine the brightness component of the image to be processed according to the RGB color space; Adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space; The target HSV color space is spatially transformed to obtain a target RGB color space, and a target image is determined according to the target RGB color space.

2. The method according to claim 1, characterized in that: The step of adjusting the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space includes: Determining saturation adjustment data according to the brightness component and a preset saturation adjustment table; wherein the preset saturation adjustment table is used to record the corresponding relationship between the brightness component and the saturation adjustment data; The saturation of the HSV color space is adjusted using the saturation adjustment data to obtain the target HSV color space.

3. The method according to claim 2, characterized in that The determining of saturation adjustment data according to the brightness component and a preset saturation adjustment table includes: Determine a saturation adjustment coefficient from the preset saturation adjustment table according to the brightness component; Determining a weight of the saturation adjustment coefficient according to the brightness component; Saturation calculation is performed according to the weight and the saturation adjustment coefficient to obtain the saturation adjustment data.

4. The method according to claim 2, characterized in that: The step of adjusting the saturation of the HSV color space by using the saturation adjustment data includes: Performing saturation adjustment on the saturation component of the HSV color space according to the saturation adjustment data to obtain a target saturation component; The target HSV color space is constructed according to the target saturation component and the HSV color space.

5. The method according to claim 1, characterized in that: Before adjusting the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table, the method further includes: Get the preset saturation target; The preset saturation adjustment table is determined according to the preset saturation target.

6. The method according to claim 1, characterized in that The method further comprises: Performing real-time rendering on the target image to obtain a real-time rendering image; The real-time rendering image is displayed.

7. An image saturation adjustment device, characterized in that: The device comprises: A space transformation module is used to perform space transformation on the RGB color space of the image to be processed to obtain the HSV color space; A first determination module, used to determine the brightness component of the image to be processed according to the RGB color space; A saturation adjustment module, used to adjust the saturation of the HSV color space according to the brightness component and a preset saturation adjustment table to obtain a target HSV color space; The second determination module is used to perform space transformation on the target HSV color space to obtain a target RGB color space, and determine a target image according to the target RGB color space.

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

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

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

Citation Information

Cited By

  • Image brightness adjustment method and device, electronic equipment and storage medium

    CN120431873A