CN117201950A - Hue adjustment method, hue adjustment device, and readable storage medium - Google Patents

Hue adjustment method, hue adjustment device, and readable storage medium Download PDF

Info

Publication number
CN117201950A
CN117201950A CN202311171334.0A CN202311171334A CN117201950A CN 117201950 A CN117201950 A CN 117201950A CN 202311171334 A CN202311171334 A CN 202311171334A CN 117201950 A CN117201950 A CN 117201950A
Authority
CN
China
Prior art keywords
correction matrix
color correction
hue adjustment
target
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311171334.0A
Other languages
Chinese (zh)
Inventor
杨汉培
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TP Link Technologies Co Ltd
Original Assignee
TP Link Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN202311171334.0A priority Critical patent/CN117201950A/en
Publication of CN117201950A publication Critical patent/CN117201950A/en
Pending legal-status Critical Current

Links

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Image Processing (AREA)

Abstract

The application is applicable to the technical field of image processing and provides a hue adjustment method, a hue adjustment device and a readable storage medium. The hue adjustment method comprises the following steps: acquiring original RGB data of an image, hue adjustment parameters and a plurality of color correction matrixes; determining a target correction matrix according to the hue adjustment parameters and the plurality of color correction matrices; and obtaining corrected RGB data of the image according to the original RGB data of the image and the target correction matrix. By processing the original RGB data of the image using the target correction matrix, the processing logic of the hue adjustment operation is simplified, and the computational complexity and the cost of the hue adjustment device are reduced.

Description

Hue adjustment method, hue adjustment device, and readable storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a hue adjustment method, a hue adjustment device, and a readable storage medium.
Background
In image processing, by adjusting the hue, the overall hue in the image can be changed, thereby affecting the visual perception and color appearance of the image.
The industrial camera is also called as an industrial video camera, and has higher image stability, transmission capability, anti-interference capability and the like compared with the traditional civil camera. In practical applications, a user is required to adjust the overall hue of a picture of an industrial camera.
Currently, an industrial camera generally adopts an image processor (Image Signal Processing, ISP) to perform hue adjustment, the ISP firstly converts an RGB color space into a color space with separated brightness and color, such as a YUV color space or an HSV color space, then adjusts the hue, and then converts the color space back to the RGB color space after the adjustment is completed. In the hue adjustment process, each pixel point performs color space conversion twice at a hardware end, so that processing logic is complex, and the calculation complexity and the cost of an industrial camera are high.
Disclosure of Invention
The embodiment of the application provides a hue adjustment method, a hue adjustment device and a readable storage medium, which simplify processing logic of hue adjustment operation and reduce calculation complexity and cost of an industrial camera.
In a first aspect, an embodiment of the present application provides a hue adjustment method, including:
acquiring original RGB data of an image, hue adjustment parameters and a plurality of color correction matrixes;
determining a target correction matrix according to the hue adjustment parameters and the plurality of color correction matrices;
and obtaining corrected RGB data of the image according to the original RGB data of the image and the target correction matrix.
In a possible implementation manner of the first aspect, the determining a target correction matrix according to the hue adjustment parameter and the plurality of color correction matrices includes:
if the hue adjustment parameter is equal to a preset value, determining a first color correction matrix of the plurality of color correction matrices as the target correction matrix;
if the hue adjustment parameter is not equal to the preset value, determining a target color correction matrix in the plurality of color correction matrices according to the hue adjustment parameter, and determining the target correction matrix according to the first color correction matrix and the target color correction matrix; wherein the target color correction matrix is generated from the first color correction matrix.
In a possible implementation manner of the first aspect, the determining the target correction matrix according to the first color correction matrix and the target color correction matrix includes:
determining a first weight corresponding to the first color correction matrix and a second weight corresponding to the target color correction matrix according to the hue adjustment parameter and the preset value;
and determining the target correction matrix according to the first color correction matrix, the target color correction matrix, the first weight and the second weight.
In a possible implementation manner of the first aspect, the determining, according to the hue adjustment parameter and the preset value, a first weight corresponding to the first color correction matrix and a second weight corresponding to the target color correction matrix includes:
if the hue adjustment parameter is greater than the preset value, the first weight is 1- [ (a-b)/b ], and the second weight is (a-b)/b;
if the hue adjustment parameter is smaller than the preset value, the first weight is a/b, and the second weight is 1- (a/b);
wherein a represents the hue adjustment parameter and b represents the preset value.
In a possible implementation manner of the first aspect, the method further includes:
displaying a color adjustment interface;
and acquiring the first color correction matrix input by a user in the color adjustment interface.
In a possible implementation manner of the first aspect, the plurality of color correction matrices includes a first color correction matrix, a second color correction matrix, and a third color correction matrix in a form of 3*3;
the 1 st row, the 2 nd row and the 3 rd row of the second color correction matrix respectively correspond to the 2 nd row, the 3 rd row and the 1 st row of the first color correction matrix;
the 1 st, 2 nd and 3 rd rows of the third color correction matrix correspond to the 3 rd, 1 st and 2 nd rows of the first color correction matrix, respectively.
In a possible implementation manner of the first aspect, acquiring the hue adjustment parameter includes:
displaying a color adjustment interface, wherein the color adjustment interface comprises prompt information which is used for assisting a user in selecting the hue adjustment parameters;
and acquiring the hue adjustment parameters input by the user in the color adjustment interface.
In a possible implementation manner of the first aspect, the method further includes:
and displaying the image with the adjusted hue according to the corrected RGB data of the image.
In a second aspect, an embodiment of the present application provides a hue adjustment device, including:
the acquisition module is used for acquiring the original RGB data of the image, the hue adjustment parameters and a plurality of color correction matrixes;
a matrix determining module, configured to determine a target correction matrix according to the hue adjustment parameter and the plurality of color correction matrices;
and the image processing module is used for obtaining corrected RGB data of the image according to the original RGB data of the image and the target correction matrix.
In a possible implementation manner of the second aspect, the matrix determining module is configured to:
if the hue adjustment parameter is equal to a preset value, determining a first color correction matrix of the plurality of color correction matrices as the target correction matrix;
if the hue adjustment parameter is not equal to the preset value, determining a target color correction matrix in the plurality of color correction matrices according to the hue adjustment parameter, and determining the target correction matrix according to the first color correction matrix and the target color correction matrix; wherein the target color correction matrix is generated from the first color correction matrix.
In a possible implementation manner of the second aspect, the matrix determining module is configured to:
determining a first weight corresponding to the first color correction matrix and a second weight corresponding to the target color correction matrix according to the hue adjustment parameter and the preset value;
and determining the target correction matrix according to the first color correction matrix, the target color correction matrix, the first weight and the second weight.
In a possible implementation manner of the second aspect, the matrix determining module is configured to:
if the hue adjustment parameter is greater than the preset value, the first weight is 1- [ (a-b)/b ], and the second weight is (a-b)/b;
if the hue adjustment parameter is smaller than the preset value, the first weight is a/b, and the second weight is 1- (a/b);
wherein a represents the hue adjustment parameter and b represents the preset value.
In a possible implementation manner of the second aspect, the display device further includes a display module;
the display module is used for displaying the color adjustment interface;
and the acquisition module is used for acquiring the first color correction matrix input by the user in the color adjustment interface.
In a possible implementation manner of the second aspect, the plurality of color correction matrices includes a first color correction matrix, a second color correction matrix, and a third color correction matrix in a form of 3*3;
the 1 st row, the 2 nd row and the 3 rd row of the second color correction matrix respectively correspond to the 2 nd row, the 3 rd row and the 1 st row of the first color correction matrix;
the 1 st, 2 nd and 3 rd rows of the third color correction matrix correspond to the 3 rd, 1 st and 2 nd rows of the first color correction matrix, respectively.
In a possible implementation manner of the second aspect, the display device further includes a display module;
the display module is used for displaying a color adjustment interface, wherein the color adjustment interface comprises prompt information, and the prompt information is used for assisting a user in selecting the hue adjustment parameters;
and the acquisition module is used for acquiring the hue adjustment parameters input by the user in the color adjustment interface.
In a possible implementation manner of the second aspect, the display device further includes a display module;
and the display module is used for displaying the image with the adjusted hue according to the corrected RGB data of the image.
In a third aspect, an embodiment of the present application provides a hue adjustment device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the method according to the first aspect when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements a method as described in the first aspect above.
The hue adjustment method provided by the application comprises the steps of firstly obtaining the original RGB data of an image, hue adjustment parameters and a plurality of color correction matrixes, then determining a target correction matrix according to the hue adjustment parameters and the plurality of color correction matrixes, and then obtaining corrected RGB data of the image according to the original RGB data of the image and the target correction matrix, wherein only simple matrix transformation and fusion processing are involved, the processing logic of hue adjustment operation is simplified, and the calculation complexity and the equipment cost are reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a hue adjustment method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a color adjustment interface according to an embodiment of the present application;
FIG. 3 is another schematic diagram of a color adjustment interface according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a color phase adjustment device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a hue adjustment device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In order to facilitate understanding of the technical solution in the embodiments of the present application, a part of the concepts related to the embodiments of the present application will be first described below.
1. RGB data of an image
First, RGB is a color model that is used in digital image processing to process and display color images. R, G, B represents Red (Red), green (Green) and Blue (Blue), respectively, and other colors can be formed by adjusting combinations of Red, green and Blue light of different intensities.
In the RGB model, the color of each pixel is represented by the numerical values of three components of red, green, and blue. The value of each component typically ranges from 0 to 255, where 0 represents no contribution of the color component and 255 represents the maximum contribution of the color component. Thus, the RGB color of one pixel can be represented by one triplet. For example, (255, 0) represents pure red, (0,255,0) represents pure green, and (0,0,255) represents pure blue. Wherein, by adjusting the values of the three components of red, green and blue, various colors can be created.
Second, since a pixel is the smallest constituent unit of an image, the image can be regarded as a matrix composed of a plurality of pixels. In summary, the RGB data of the image according to the embodiments of the present application may be represented by a pixel matrix, where the value of each element is an RGB triplet of the corresponding pixel.
2. Color correction matrix
The color correction matrix is a matrix used for image processing and color correction, and contains a series of correction parameters for mapping the original color values of an input image to a target color space to achieve a desired color representation or to correct color deviations in the image.
The following detailed description of the present application is provided with specific embodiments, and the same or similar concepts or processes are not described in detail in the embodiments.
Referring to fig. 1, fig. 1 is a flowchart of a hue adjustment method according to an embodiment of the present application. The hue adjustment method provided in this embodiment may be a hue adjustment device or a hue adjustment apparatus. The hue adjustment device or hue adjustment apparatus has a hue adjustment function, for example, including but not limited to an industrial camera, a video camera, and the like. The present application is described by taking a hue adjustment device as an example.
As shown in fig. 1, the hue adjustment method provided in this embodiment may include:
s101, acquiring original RGB data of an image, hue adjustment parameters and a plurality of color correction matrixes.
The hue adjustment device can convert the original information of the image into RGB data based on the existing image or the image acquired by the image sensor, and further acquire the original RGB data of the image.
Alternatively, in one implementation, the raw RGB data is acquired from an already saved image.
In this implementation, the stored image file is parsed to obtain the original RGB data by reading it. The operation is simpler, and a better hue adjustment result can be obtained by repeatedly processing one image.
Alternatively, in another implementation, the raw RGB data for the image is acquired in real time.
In the implementation mode, the RGB data is directly acquired from a real-time image source (such as a camera), and the acquired RGB data can be analyzed and processed in real time to meet the actual demands.
The hue adjustment parameters are set by the user by himself, and the user can adjust the overall tendency of the colors in the image by changing the hue adjustment parameters, so that the flexibility and the freedom degree are improved.
The hue adjustment parameter is usually represented in the form of a value having a preset value adjustment range. In the present embodiment, the value of the range boundary value of the hue adjustment parameter is not limited. The user can achieve the desired hue adjustment by adjusting the value of the hue adjustment parameter. For example, the range of setting the hue adjustment parameter is 0 to 255, and the user can take an arbitrary value within this range as the hue adjustment parameter value. Alternatively, when the hue adjustment parameter value ranges from 128 to 0, the red component gradually becomes green, the green gradually becomes blue, the blue gradually becomes red, and the closer to 0, the larger the hue shift. When the hue adjustment parameter value ranges from 128 to 255, red gradually changes to blue, blue gradually changes to green, green gradually changes to red, and the closer to 255, the larger the hue shift.
Optionally, acquiring the hue adjustment parameter includes:
and displaying a color adjustment interface, wherein the color adjustment interface comprises prompt information which is used for assisting a user in selecting hue adjustment parameters.
And acquiring hue adjustment parameters input by a user in a color adjustment interface.
The present embodiment is not limited to the specific contents and layout in the color adjustment interface. Fig. 2 is a schematic diagram of a color adjustment interface according to an embodiment of the present application. As shown in fig. 2, in the color adjustment interface 20, a prompt message "the value range of the hue adjustment parameter is 0 to 255" is displayed below the input box 23 of the hue adjustment parameter, and the value range of the hue adjustment parameter is defined. In fig. 2, the hue adjustment parameter set by the user is 128.
The plurality of color correction matrices may include a first color correction matrix, a second color correction matrix, and a third color correction matrix. The hue adjustment of the image can be achieved by at least one of the plurality of color correction matrices.
Alternatively, the color correction matrix may be preset and stored in the hue adjustment device. The implementation mode is simple.
Alternatively, the color correction matrix may be set by the user, and the correction parameters in the color correction matrix may be adjusted and modified. The method is more flexible and changeable, and the user can adjust parameters in the correction matrix according to the self requirements, so that personalized correction is realized, and the hue of the image can be adjusted according to the user requirements, so that the method is closer to the user requirements.
Alternatively, a partial color correction matrix of the plurality of color correction matrices may be generated based on other color correction matrices. For example, the first color correction matrix is input or preset by a user, and the second color correction matrix and the third color correction matrix are generated based on the first color correction matrix, thereby obtaining a plurality of color correction matrices. Alternatively, the first color correction matrix may be calibrated by a professional means for a specific hue adjustment device.
Optionally, in one implementation, the hue adjustment method includes:
and displaying a color adjustment interface.
A first color correction matrix input by a user in a color adjustment interface is acquired.
Still illustrated by way of example in fig. 2. In the color adjustment interface 20, the user is provided with an option of whether to use a preset first color correction matrix, and when the user selects the single selection box 25 preceding "no", a custom matrix is input as the first color correction matrix in the immediately following input box 27.
Optionally, in another implementation, the hue adjustment method includes:
and displaying a color adjustment interface.
And acquiring a preset first color correction matrix according to user operation.
Fig. 3 is another schematic diagram of a color adjustment interface according to an embodiment of the present application. As shown in fig. 3, in the color adjustment interface 30, the user is provided with an option of whether to use the preset first color correction matrix, and if the user selects the single box 24 before yes, it indicates that the user selects to use the preset first color correction matrix in the hue adjustment process.
In one possible implementation, the plurality of color correction matrices includes a first color correction matrix, a second color correction matrix, and a third color correction matrix in the form of 3*3.
Row 1, row 2 and row 3 of the second color correction matrix correspond to row 2, row 3 and row 1 of the first color correction matrix, respectively.
The 1 st, 2 nd and 3 rd rows of the third color correction matrix correspond to the 3 rd, 1 st and 2 nd rows of the first color correction matrix, respectively.
The following is an example. Assume that the first color correction matrix isAccording to the generation rule of the second color correction matrix and the third color correction matrix, the second color correction matrix isThe third color correction matrix is +.>
According to the generation rule, the second color correction matrix and the third color correction matrix are generated based on the first color correction matrix, and different color correction matrices can pay attention to and adjust different color attributes, so that more accurate and expected color performance is finally obtained.
S102, determining a target correction matrix according to the hue adjustment parameters and the plurality of color correction matrices.
The target correction matrix is used for performing hue correction on the original RGB data of the image.
Optionally, determining the target correction matrix according to the hue adjustment parameter and the plurality of color correction matrices includes:
if the hue adjustment parameter is equal to a preset value, determining a first color correction matrix of the plurality of color correction matrices as a target correction matrix.
If the hue adjustment parameter is not equal to the preset value, determining a target color correction matrix in the plurality of color correction matrices according to the hue adjustment parameter, and determining the target correction matrix according to the first color correction matrix and the target color correction matrix. Wherein the target color correction matrix is generated from the first color correction matrix.
Specifically, the preset value may be determined according to a value range of the hue adjustment parameter, and may be any value in the value range of the hue adjustment parameter. Optionally, the preset value may be set to be an intermediate value of the value range, so as to ensure balance of hue adjustment. For example, when the value range of the hue adjustment parameter is 0 to 1023, the preset value may be determined to be 512 based on the value range. When the value range of the hue adjustment parameter is 0-255, the preset value is determined to be 128 based on the value range.
By way of example and not limitation, assume that the plurality of color correction matrices includes a first color correction matrix P1, a second color correction matrix P2, and a third color correction matrix P3. The second color correction matrix P2 and the third color correction matrix P3 are generated from the first color correction matrix P1, and the generation rule is described with reference to the correlation in S101. Assume that the hue adjustment parameter has a value ranging from 0 to 255 and a preset value of 128.
If the hue adjustment parameter set by the user is 128, the target correction matrix is the first color correction matrix.
If the hue adjustment parameter set by the user is greater than 0 and less than 128, the target color correction matrix is a second color correction matrix, and the target correction matrix is determined according to the first color correction matrix and the second color correction matrix.
If the hue adjustment parameter set by the user is greater than 128 and less than 255, the target color correction matrix is a third color correction matrix, and the target correction matrix is determined according to the first color correction matrix and the third color correction matrix.
Based on different values of the hue adjustment parameters, different color correction matrices are selected and finally the target correction matrix is determined, so that the color performance of the image can show different tendencies, and further different visual effects are generated.
Optionally, to more reasonably adjust the hue of the image, determining the target correction matrix according to the first color correction matrix and the target color correction matrix includes:
and determining a first weight corresponding to the first color correction matrix and a second weight corresponding to the target color correction matrix according to the hue adjustment parameter and the preset value.
And determining the target correction matrix according to the first color correction matrix, the target color correction matrix, the first weight and the second weight.
Alternatively, the target correction matrix may be calculated according to the following formula:
E=d1*A+d2*B
wherein E represents a target correction matrix, a represents a first color correction matrix, B represents a target color correction matrix, d1 represents a first weight, and d2 represents a second weight.
Optionally, in order to more accurately adjust the hue of the image to achieve the desired color performance, determining, according to the hue adjustment parameter and the preset value, a first weight corresponding to the first color correction matrix and a second weight corresponding to the target color correction matrix includes:
if the hue adjustment parameter is greater than a preset value, the first weight is 1- [ (a-b)/b ], and the second weight is (a-b)/b.
If the hue adjustment parameter is smaller than the preset value, the first weight is a/b, and the second weight is 1- (a/b).
Wherein a represents a hue adjustment parameter and b represents a preset value.
As an example and not by way of limitation, if the hue adjustment parameter is greater than a preset value, the target correction matrix may be calculated according to the following formula:
if the hue adjustment parameter is smaller than the preset value, the target correction matrix can be calculated according to the following formula:
wherein E represents a target correction matrix, a represents a first color correction matrix, B represents a target color correction matrix, a represents a hue adjustment parameter, and B represents a preset value.
For example. Assume that the hue adjustment parameter range is 0 to 255 and the preset value b is 128. The color correction matrix includes a first color correction matrix P1, a second color correction matrix P2, and a third color correction matrix P3. When the hue adjustment parameter a is 64, the target color correction matrix is a second color correction matrix, and the target color correction matrix can be selected from the group consisting ofCalculated, i.e.)>When the hue adjustment parameter a is 192, the target color correction matrix is the third color correction matrix, and the target correction matrix is +.>I.e.)>
S103, obtaining corrected RGB data of the image according to the original RGB data of the image and the target correction matrix.
Alternatively, the target correction matrix may be multiplied by each element in the original RGB data of the image to obtain the corrected RGB data of the image. Wherein elements in the RGB data of the image are represented by RGB triples of pixels.
By way of example only, and not by way of limitation,representing the target correction matrix +.>Raw RGB data representing a pixel in an image, matrix-phase a target correction matrix with the raw RGB dataThe product of the multiplication, i.e.,wherein (1)>Correction of RGB data representing an image and +.>Corresponding elements. The method of multiplying the target correction matrix by the original RGB data of the image is simple in implementation mode, and the obtained corrected RGB data of the image is more accurate.
Optionally, the hue adjustment method provided in this embodiment further includes:
and displaying the image with the adjusted hue according to the corrected RGB data of the image.
For example, referring to fig. 2 or 3, an original image, which the user determines to be subjected to hue adjustment, is displayed in the original image area 21. After the setting of the hue adjustment parameters is completed and the first color correction matrix to be used is determined, the determination button 26 is clicked, the corrected RGB data of the image is obtained according to the hue adjustment method provided in the present embodiment, and the image after the hue adjustment is displayed in the corrected image area 22.
Therefore, according to the hue adjustment method provided by the embodiment, the original RGB data of the image, the hue adjustment parameters and the plurality of color correction matrixes are firstly obtained, then the target correction matrix is determined according to the hue adjustment parameters and the plurality of color correction matrixes, and then the corrected RGB data of the image is obtained according to the original RGB data of the image and the target correction matrix, so that the user can realize the overall color trends of different phases by only changing the hue adjustment parameters, the user operation is simplified, and the user experience is improved. In addition, the hue adjustment method relates to simple matrix transformation and fusion processing, simplifies processing logic of hue adjustment operation, and reduces calculation complexity. Meanwhile, by utilizing the color correction matrix module in the image processor, the conversion of YUV color space or HSV color space is not required to be carried out on RGB color space, the adjustment of the hue can be realized without adding extra hardware resources, and the cost of hue adjustment equipment is reduced.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
Fig. 4 is a schematic structural diagram of a hue adjustment device according to an embodiment of the present application, where each module is configured to perform each step in the embodiment corresponding to fig. 1, and for convenience of explanation, only a portion related to the embodiment of the present application is shown. Referring to fig. 4, the hue adjustment device provided in this embodiment includes:
an acquisition module 41 for acquiring original RGB data of an image, hue adjustment parameters and a plurality of color correction matrices;
a matrix determining module 42 for determining a target correction matrix based on the hue adjustment parameter and the plurality of color correction matrices;
an image processing module 43 for obtaining corrected RGB data of the image based on the original RGB data of the image and the target correction matrix.
Optionally, the matrix determining module 42 is configured to:
if the hue adjustment parameter is equal to a preset value, determining a first color correction matrix of the plurality of color correction matrices as the target correction matrix;
if the hue adjustment parameter is not equal to the preset value, determining a target color correction matrix in the plurality of color correction matrices according to the hue adjustment parameter, and determining the target correction matrix according to the first color correction matrix and the target color correction matrix; wherein the target color correction matrix is generated from the first color correction matrix.
Optionally, the matrix determining module 42 is configured to:
determining a first weight corresponding to the first color correction matrix and a second weight corresponding to the target color correction matrix according to the hue adjustment parameter and the preset value;
and determining the target correction matrix according to the first color correction matrix, the target color correction matrix, the first weight and the second weight.
Optionally, the matrix determining module 42 is configured to:
if the hue adjustment parameter is greater than the preset value, the first weight is 1- [ (a-b)/b ], and the second weight is (a-b)/b;
if the hue adjustment parameter is smaller than the preset value, the first weight is a/b, and the second weight is 1- (a/b);
wherein a represents the hue adjustment parameter and b represents the preset value.
Optionally, the hue adjustment device further comprises a display module;
the display module is used for displaying the color adjustment interface;
an obtaining module 41, configured to obtain the first color correction matrix input by the user in the color adjustment interface.
Optionally, the plurality of color correction matrices includes a first color correction matrix, a second color correction matrix, and a third color correction matrix in the form of 3*3;
the 1 st row, the 2 nd row and the 3 rd row of the second color correction matrix respectively correspond to the 2 nd row, the 3 rd row and the 1 st row of the first color correction matrix;
the 1 st, 2 nd and 3 rd rows of the third color correction matrix correspond to the 3 rd, 1 st and 2 nd rows of the first color correction matrix, respectively.
Optionally, the hue adjustment device further comprises a display module;
the display module is used for displaying a color adjustment interface, wherein the color adjustment interface comprises prompt information, and the prompt information is used for assisting a user in selecting the hue adjustment parameters;
an obtaining module 41, configured to obtain the hue adjustment parameter input by the user in the color adjustment interface.
Optionally, the hue adjustment device further comprises a display module;
and the display module is used for displaying the image with the adjusted hue according to the corrected RGB data of the image.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Fig. 5 is a schematic structural diagram of a hue adjustment device according to an embodiment of the present application. As shown in fig. 5, the hue adjustment device includes: at least one processor 50, a memory 51 and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, the processor 50 implementing the steps of any of the various method embodiments described above when executing the computer program 52.
The processor may be a central processing unit (Central Processing Unit, CPU), it may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps for implementing the various method embodiments described above.
Embodiments of the present application provide a computer program product which, when run on a hue adjustment device, causes the hue adjustment device to perform steps that may be performed in the respective method embodiments described above.
Those skilled in the art will appreciate that the above-described integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer-readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer Memory, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
Those skilled in the art will appreciate that in the foregoing embodiments, the descriptions of the various embodiments are emphasized, and that in some instances, reference is made to related descriptions of other embodiments.
Those of skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (11)

1. A hue adjustment method, comprising:
acquiring original RGB data of an image, hue adjustment parameters and a plurality of color correction matrixes;
determining a target correction matrix according to the hue adjustment parameters and the plurality of color correction matrices;
and obtaining corrected RGB data of the image according to the original RGB data of the image and the target correction matrix.
2. The method of claim 1, wherein said determining a target correction matrix based on said hue adjustment parameter and said plurality of color correction matrices comprises:
if the hue adjustment parameter is equal to a preset value, determining a first color correction matrix of the plurality of color correction matrices as the target correction matrix;
if the hue adjustment parameter is not equal to the preset value, determining a target color correction matrix in the plurality of color correction matrices according to the hue adjustment parameter, and determining the target correction matrix according to the first color correction matrix and the target color correction matrix; wherein the target color correction matrix is generated from the first color correction matrix.
3. The method of claim 2, wherein the determining the target correction matrix from the first color correction matrix and the target color correction matrix comprises:
determining a first weight corresponding to the first color correction matrix and a second weight corresponding to the target color correction matrix according to the hue adjustment parameter and the preset value;
and determining the target correction matrix according to the first color correction matrix, the target color correction matrix, the first weight and the second weight.
4. The method of claim 3, wherein determining the first weight corresponding to the first color correction matrix and the second weight corresponding to the target color correction matrix according to the hue adjustment parameter and the preset value comprises:
if the hue adjustment parameter is greater than the preset value, the first weight is 1- [ (a-b)/b ], and the second weight is (a-b)/b;
if the hue adjustment parameter is smaller than the preset value, the first weight is a/b, and the second weight is 1- (a/b);
wherein a represents the hue adjustment parameter and b represents the preset value.
5. The method of claim 2, wherein the method further comprises:
displaying a color adjustment interface;
and acquiring the first color correction matrix input by a user in the color adjustment interface.
6. The method of any one of claims 1-5, wherein the plurality of color correction matrices includes a first color correction matrix, a second color correction matrix, and a third color correction matrix in the form of 3*3;
the 1 st row, the 2 nd row and the 3 rd row of the second color correction matrix respectively correspond to the 2 nd row, the 3 rd row and the 1 st row of the first color correction matrix;
the 1 st, 2 nd and 3 rd rows of the third color correction matrix correspond to the 3 rd, 1 st and 2 nd rows of the first color correction matrix, respectively.
7. The method of any one of claims 1-5, wherein obtaining hue adjustment parameters comprises:
displaying a color adjustment interface, wherein the color adjustment interface comprises prompt information which is used for assisting a user in selecting the hue adjustment parameters;
and acquiring the hue adjustment parameters input by the user in the color adjustment interface.
8. The method of any one of claims 1-5, wherein the method further comprises:
and displaying the image with the adjusted hue according to the corrected RGB data of the image.
9. A hue adjustment device, comprising:
the acquisition module is used for acquiring the original RGB data of the image, the hue adjustment parameters and a plurality of color correction matrixes;
a matrix determining module, configured to determine a target correction matrix according to the hue adjustment parameter and the plurality of color correction matrices;
and the image processing module is used for obtaining corrected RGB data of the image according to the original RGB data of the image and the target correction matrix.
10. A hue adjustment device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 8 when executing the computer program.
11. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 8.
CN202311171334.0A 2023-09-12 2023-09-12 Hue adjustment method, hue adjustment device, and readable storage medium Pending CN117201950A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311171334.0A CN117201950A (en) 2023-09-12 2023-09-12 Hue adjustment method, hue adjustment device, and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311171334.0A CN117201950A (en) 2023-09-12 2023-09-12 Hue adjustment method, hue adjustment device, and readable storage medium

Publications (1)

Publication Number Publication Date
CN117201950A true CN117201950A (en) 2023-12-08

Family

ID=88997413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311171334.0A Pending CN117201950A (en) 2023-09-12 2023-09-12 Hue adjustment method, hue adjustment device, and readable storage medium

Country Status (1)

Country Link
CN (1) CN117201950A (en)

Similar Documents

Publication Publication Date Title
US8358351B2 (en) Automatic tone mapping for cameras
CN111861922A (en) Method and device for adjusting color correction matrix and storage medium
JP2006134157A (en) Shading correction device, shading correction value computation device and imaging device
AU2013381285B9 (en) Color adjustment device, image display device, and color adjustment method
CN104869380A (en) Image processing apparatus and image processing method
US11962917B2 (en) Color adjustment method, color adjustment device, electronic device and computer-readable storage medium
CN112153356A (en) Image parameter determination method, image sensor, device, electronic device and storage medium
JP7463642B2 (en) Display effect enhancing method, device, and equipment
CN113590071A (en) Image processing method, apparatus, computer device and medium based on dithering
US20130093915A1 (en) Multi-Illuminant Color Matrix Representation and Interpolation Based on Estimated White Points
CN112243119B (en) White balance processing method and device, electronic equipment and storage medium
CN117201950A (en) Hue adjustment method, hue adjustment device, and readable storage medium
CN111064963A (en) Image data decoding method, device, computer equipment and storage medium
JPH1141622A (en) Image processor
TWI471848B (en) Method for correcting colors and image processing device
JP6413210B2 (en) Image processing apparatus, imaging apparatus, and program
JP2000201277A (en) Image correcting method
US11889131B2 (en) Video processing device, video processing method, monitor apparatus, computer device, and medium
TWI790732B (en) Image correction method and image correction device
JP6318497B2 (en) Image processing apparatus, imaging apparatus, and program
WO2021159414A1 (en) White balance control method and apparatus, electronic device and computer-readable storage medium
CN115426485A (en) Color correction matrix adjustment method, image pickup apparatus, electronic apparatus, and storage medium
CN117896508A (en) Standard light source-based image white balance processing method and device
JP2024032621A (en) Image processing method, image processing apparatus, and program
CN115866414A (en) Color correction method and system and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination