Camera characterization method and device, electronic equipment and storage medium
By adjusting the white dots using the target color adaptation matrix during the camera characterization process, the problem of favorable white dots in white balance is solved, and higher color correction accuracy and accuracy are achieved.
Patent Information
- Application Number
- CN202410675420.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, the color correction accuracy and accuracy of camera characteristic is affected by superimposed preference white points in white balance, and the difference in preference white points under different environments makes it difficult to effectively adjust.
By color reduction of the camera RGB response value, determine the preferred white point RGB value and color adaptation degree parameters, use the target color adaptation matrix to adjust the white point to avoid superimposing preferences in the white balance stage, and adjust the white point preferences based on the color adaptation degree and the target color adaptation matrix calculated by the preferred white point.
Improve the accuracy of camera characterization, reduce the accuracy and accuracy impact of the color correction stage, ensure that white point adjustment does not affect other colors, and improve the overall color correction effect.
Smart Images

Figure CN120378758A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a camera characterization method, apparatus, electronic device, and storage medium. Background Art
[0002] Camera characterization is divided into two independent parts, white balance and color correction, in the camera pipeline. The main purpose of white balance is to make the white point white and achieve color constancy. In related technologies, by implementing non-complete color adaptation in white balance, that is, superimposing a certain white point preference during white balance, it can better conform to the real perception of the human eye in various lighting environments.
[0003] However, the color correction matrix is implemented according to the situation where the white point is made white during offline calibration. Superimposing the preference during white balance will affect the accuracy and correctness of color correction. In addition, it is unrealistic to consider adjusting the white point preference during the calibration of the color correction matrix because the white point preference varies in different environments. Summary of the Invention
[0004] The present disclosure aims to at least solve one of the technical problems in the related technologies to some extent.
[0005] To this end, the first object of the present disclosure is to propose a camera characterization method to improve the accuracy of camera characterization.
[0006] The second object of the present disclosure is to propose a camera characterization apparatus.
[0007] The third object of the present disclosure is to propose an electronic device.
[0008] The fourth object of the present disclosure is to propose a computer-readable storage medium.
[0009] The fifth object of the present disclosure is to propose a computer program product.
[0010] To achieve the above object, an embodiment of the first aspect of the present disclosure provides a camera characterization method, including:
[0011] Performing color restoration on the camera RGB response value to obtain the color-restored camera RGB response value, where the color restoration includes white balance and color correction;
[0012] Determining the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value, and determining the target color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter;
[0013] Performing white point adjustment on the color-restored camera RGB response value by using the target color adaptation matrix to obtain the characterized RGB value.
[0014] Optionally, determining the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value includes:
[0015] Determining the white point RGB value, brightness, and color temperature corresponding to the camera RGB response value;
[0016] According to the white point RGB value, the brightness, and the first correspondence, determining the preferred white point RGB value corresponding to the camera RGB response value, where the first correspondence is the correspondence between the white point RGB value, brightness, and the preferred white point RGB value;
[0017] According to the brightness, the color temperature, and the second correspondence, determining the color adaptation degree parameter corresponding to the camera RGB response value, where the second correspondence is the correspondence between the brightness, color temperature, and the color adaptation degree parameter.
[0018] Optionally, determining the target color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter includes:
[0019] Determining an initial color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter;
[0020] According to the camera RGB response value and the third correspondence, determining the weight corresponding to the camera RGB response value, where the third correspondence is the correspondence between the camera RGB response value and the weight;
[0021] Determining the target color adaptation matrix according to the weight and the initial color adaptation matrix.
[0022] Optionally, determining the initial color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter includes:
[0023] Determining the target white point RGB value according to the preferred white point RGB value, the color adaptation degree parameter, and the original white point RGB value;
[0024] According to the first color conversion matrix and the second color conversion matrix, determining the target white point LMS value corresponding to the target white point RGB value and the original white point LMS value corresponding to the original white point RGB value, where the first color conversion matrix is the color conversion matrix between RGB color and XYZ color, and the second color conversion matrix is the color conversion matrix between XYZ color and LMS color;
[0025] Determining the initial color adaptation matrix according to the first color conversion matrix, the second color conversion matrix, the target white point LMS value, and the original white point LMS value.
[0026] Optionally, determining the target white point LMS value corresponding to the target white point RGB value and the original white point LMS value corresponding to the original white point RGB value according to the first color conversion matrix and the second color conversion matrix includes:
[0027] Determining the target white point XYZ value corresponding to the target white point RGB value and the original white point XYZ value corresponding to the original white point RGB value according to the first color conversion matrix;
[0028] Performing luminance normalization on the target white point XYZ value and the original white point XYZ value to obtain the normalized target white point XYZ value and the normalized original white point XYZ value;
[0029] Determining the target white point LMS value corresponding to the normalized target white point XYZ value and the original white point LMS value corresponding to the normalized original white point XYZ value according to the second color conversion matrix.
[0030] Optionally, performing color restoration on the camera RGB response value to obtain the color-restored camera RGB response value includes:
[0031] Performing white balance processing on the camera RGB response value using a white balance matrix to obtain the white-balanced camera RGB response value;
[0032] Performing color correction on the white-balanced camera RGB response value using a color correction matrix to obtain the color-restored camera RGB response value.
[0033] To achieve the above object, an embodiment of the second aspect of the present disclosure provides a camera characterization device, including:
[0034] A color restoration unit, configured to perform color restoration on the camera RGB response value to obtain the color-restored camera RGB response value, where the color restoration includes white balance and color correction;
[0035] A matrix determination unit, configured to determine the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value, and determine a target color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter;
[0036] A white point adjustment unit, configured to perform white point adjustment on the color-restored camera RGB response value using the target color adaptation matrix to obtain the characterized RGB value.
[0037] To achieve the above object, an embodiment of the third aspect of the present disclosure provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0038] The memory stores computer-executable instructions;
[0039] The processor executes the computer-executable instructions stored in the memory to implement the method shown in any one of the foregoing first aspects.
[0040] To achieve the above object, an embodiment of the fourth aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method shown in any one of the foregoing first aspects when executed by a processor.
[0041] To achieve the above object, an embodiment of the fifth aspect of the present disclosure provides a computer program product including a computer program, which implements the method shown in any one of the foregoing first aspects when executed by a processor.
[0042] In summary, the method, apparatus, electronic device, and storage medium provided by the present disclosure can reduce the situation where the accuracy and accuracy in the color correction stage are affected by only making the white point white and not superimposing preferences in the white balance stage. After color correction, a target color adaptation matrix that combines the color adaptation degree and the preferred white point is used to adjust the white point preference, which can adjust the white point without overly affecting other colors and improve the accuracy of camera characterization.
[0043] Additional aspects and advantages of the present disclosure will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and / or additional aspects and advantages of the present disclosure will become apparent and be readily understood from the following description of the embodiments in conjunction with the drawings, where:
[0045] Figure 1 is a schematic flowchart of a camera pipeline provided by an embodiment of the present disclosure;
[0046] Figure 2 is a schematic flowchart of a camera characterization method provided by an embodiment of the present disclosure;
[0047] Figure 3 is a schematic diagram showing an R / G and B / G coordinate system provided by an embodiment of the present disclosure;
[0048] Figure 4 is a schematic diagram showing a weight curve provided by an embodiment of the present disclosure;
[0049] Figure 5 is a schematic flowchart of a camera characterization provided by an embodiment of the present disclosure;
[0050] Figure 6Schematic structural diagram of a camera characterization device provided by an embodiment of the present disclosure. Detailed implementation manners
[0051] The embodiments of the present disclosure will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements with the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present disclosure, but should not be construed as a limitation to the present disclosure.
[0052] Due to the differences between the response characteristics of the human eye and those of the camera, a characterization process needs to be introduced in the camera pipeline to convert the camera RGB response values to the standard RGB values related to display. Camera characterization generally can use a simple matrix to implement the conversion between the camera RGB response values and the standard RGB values, as shown in the following formula:
[0053]
[0054] Figure 1 Schematic flow diagram of a camera pipeline provided by an embodiment of the present disclosure. As Figure 1 shown, steps such as white balance, demosaicing, color correction, and gamma curve are executed in sequence. Among them, performing white balance in advance is more conducive to reducing interpolation errors in the demosaicing algorithm. During the white balance process, a certain light source estimation algorithm is used to estimate the white point (R, G, B) of the light source, and the white point is made white to achieve color constancy.
[0055] Generally, the human eye is not fully color adapted in a non-daylight environment. Under the condition of full color adaptation, the white paper seen by the human eye is white. However, in the condition of non-full color adaptation, the white paper seen by the human eye is not completely white and will carry a little light source color. This non-full color adaptation is usually realized in white balance on the camera pipeline, that is, a certain preference is superimposed on the basis of the white point to better conform to the true feelings of the human eye in various lighting environments.
[0056] However, the color correction matrix is calibrated offline according to the situation where the white point is made white. Superimposing the preference during white balance will affect the accuracy of color correction. In addition, it is not realistic to consider the white point preference adjustment during the calibration of the color correction matrix because the white point preferences vary in different environments.
[0057] The present disclosure will be described in detail below in combination with specific embodiments.
[0058] In the first embodiment, as Figure 2 shown, Figure 2The flowchart of a camera characterization method provided by an embodiment of the present disclosure. This method can be implemented depending on a computer program and can run on a device for camera characterization. The computer program can be integrated into an application or run as an independent tool application.
[0059] Among them, the camera characterization device can be an electronic device with camera characterization function.
[0060] Among them, the camera characterization method can be executed by an electronic device. The electronic device includes but is not limited to devices with camera functions such as cameras and terminals.
[0061] Specifically, the camera characterization method includes the following steps:
[0062] S101, perform color restoration on the camera RGB response value to obtain the color-restored camera RGB response value;
[0063] According to some embodiments, the camera RGB response value refers to the actual output value of the camera, which is used to reflect the sensitivity or response degree of the camera to the three channels of red (R), green (G), and blue (B) when recording an image.
[0064] In some embodiments, color restoration refers to restoring the captured or recorded color information as accurately as possible to the actual color in the original scene. The color restoration includes but is not limited to performing white balance and color correction.
[0065] S102, determine the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value, and determine the target color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter;
[0066] According to some embodiments, the preferred white point RGB value refers to the white point RGB value superimposed with a preference adjustment coefficient.
[0067] In some embodiments, the color adaptation degree parameter is used to indicate the adaptation degree of the human eye to different color lights.
[0068] According to some embodiments, the target color adaptation matrix refers to the color adaptation matrix superimposed with a preference adjustment coefficient.
[0069] S103, perform white point adjustment on the color-restored camera RGB response value using the target color adaptation matrix to obtain the characterized RGB value.
[0070] According to some embodiments, the characterized RGB value refers to the standard RGB value obtained by converting the camera RGB response value.
[0071] In summary, for the method provided in this embodiment, by only making the white point white during the white balance stage without superimposing preferences, the situation where the accuracy and accuracy in the color correction stage are affected can be reduced. After color correction, a target color adaptation matrix that combines the degree of color adaptation and the preferred white point is used to perform preference adjustment on the white point, which can adjust the white point without overly affecting other colors, and can improve the accuracy of camera characterization.
[0072] This embodiment also provides another method for camera characterization. This method can be executed by an electronic device.
[0073] Specifically, this method for camera characterization may include the following steps:
[0074] S201, perform white balance processing on the camera RGB response values using a white balance matrix to obtain the white-balanced camera RGB response values;
[0075] According to some embodiments, the white balance matrix can be, for example, a diagonal matrix, as shown in the following formula:
[0076]
[0077]
[0078] k1 = max_gain
[0079]
[0080] max_gain = max([R / G, B / G, 1.0])
[0081] Among them, k0, k1, and k2 are intermediate parameters. max_gain is the gain.
[0082] S202, perform color correction on the white-balanced camera RGB response values using a color correction matrix to obtain the color-restored camera RGB response values;
[0083] According to some embodiments, a color correction matrix (Color Correction Matrix, CCM) is used for color correction. This CCM can be obtained by calibration, for example.
[0084] In some embodiments, the CCM obtained after calibration can be, for example, as shown in the following formula:
[0085]
[0086] In some embodiments, the color-restored camera RGB response values can be, for example, as shown in the following formula:
[0087]
[0088] Among them, is the camera RGB response value after color restoration; is the camera RGB response value; M1 is the color restoration matrix, including the CCM and the white balance matrix.
[0089] S203, determine the white point RGB value, brightness, and color temperature corresponding to the camera RGB response value;
[0090] According to some embodiments, during the actual operation of the camera, the current brightness and color temperature can be provided by the automatic exposure algorithm and the automatic white balance algorithm running inside it.
[0091] In some embodiments, the white point RGB value can be calculated from the camera RGB response value. When the camera RGB response value (R, G, B) is obtained, the white point RGB value (R / G, B / G) can be calculated.
[0092] S204, determine the preferred white point RGB value corresponding to the camera RGB response value according to the white point RGB value, brightness, and the first correspondence;
[0093] According to some embodiments, the first correspondence is the correspondence between the white point RGB value, brightness, and the preferred white point RGB value. This first correspondence can be recorded by offline calibration, for example.
[0094] In some embodiments, the R / G and B / G coordinate systems can be adopted in the white balance algorithm, Figure 3 is a schematic diagram showing the R / G and B / G coordinate systems provided by the embodiments of the present disclosure. As Figure 3 shown, the R / G and B / G coordinate systems can be extended to a two-dimensional table; then, the two-dimensional table can be extended to a three-dimensional table by brightness, and the grid size can be adjusted according to the accuracy requirements.
[0095] In some embodiments, each grid point in the above three-dimensional table corresponds to a preferred white point RGB value, so that the first correspondence can be obtained. Among them, the preferred white point RGB value corresponding to the grid point can be obtained by multiplying the R / G coordinate and the B / G coordinate corresponding to the grid point by the preference adjustment coefficient, as shown in the following formula:
[0096]
[0097] Among them, ratio_r is the preference adjustment coefficient for the R channel, ratio_b is the preference adjustment coefficient for the B channel, and the ratio_r and ratio_b can be adjusted according to the actual application scenario or set by offline calibration. The preference adjustment coefficients corresponding to different brightness, different R / G coordinates, and different B / G coordinates can also be different.
[0098] According to some embodiments, when the white point RGB values and the brightness corresponding to the camera are obtained, if the corresponding values are not found in the three-dimensional table, the preferred white point RGB value target_illuminant corresponding to the white point RGB values and the brightness can be estimated by interpolation method.
[0099] S205. Determine the color adaptation degree parameter corresponding to the camera RGB response value according to the brightness, color temperature and the second corresponding relationship;
[0100] According to some embodiments, the second corresponding relationship is the corresponding relationship between the brightness, color temperature and the color adaptation degree parameter.
[0101] In some embodiments, the color adaptation degree parameter is related to factors such as the ambient light color temperature and the brightness. That is to say, the color adaptation degree parameter can be recorded in a two-dimensional table composed of the brightness and the color temperature. Among them, the first dimension represents the brightness and the second dimension represents the color temperature. Then, the color adaptation degree parameters corresponding to different brightnesses and color temperatures in the two-dimensional table can be calculated and recorded by means of calibration in the laboratory environment through psychophysical experiments, direct calculation according to the standard color appearance model theory, and fine-tuning according to the actual subjective scene.
[0102] In some embodiments, in the two-dimensional table composed of the brightness and the color temperature, the color temperature and brightness grouping can be set according to the actual accuracy requirements. For example, it can be grouped as follows:
[0103] Color temperature levels: [2300, 2856, 3500, 4000, 5000, 6500, 7500, 8500, 9500, 12000];
[0104] Brightness levels: [high brightness, low brightness].
[0105] Among them, the brightness level can also be set by the brightness (Brightness Value, BV) value calculated by the automatic exposure algorithm or other physical quantities representing the ambient brightness.
[0106] According to some embodiments, when the brightness and color temperature corresponding to the camera are obtained, if the corresponding values are not found in the two-dimensional table composed of the brightness and the color temperature, the color adaptation degree parameter ca_degree corresponding to the camera RGB response value can be estimated by interpolation method.
[0107] S206. Determine the initial color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter;
[0108] According to some embodiments, the target white point RGB value can be determined based on the preferred white point RGB value, the color adaptation degree parameter, and the original white point RGB value; based on the first color conversion matrix and the second color conversion matrix, the target white point LMS value corresponding to the target white point RGB value and the original white point LMS value corresponding to the original white point RGB value can be determined; based on the first color conversion matrix, the second color conversion matrix, the target white point LMS value, and the original white point LMS value, the initial color adaptation matrix can be determined. Therefore, the accuracy of determining the initial color adaptation matrix can be improved.
[0109] In some embodiments, the original white point RGB value RGB source For example, it can be as shown in the following formula:
[0110]
[0111] In some embodiments, the target white point RGB value RGB target For example, it can be determined according to the following formula:
[0112] RGB target = ca_degree * RGB source +(1 - ca_degree)*target_illuminant
[0113] According to some embodiments, the first color conversion matrix is a color conversion matrix between RGB color and XYZ color, and this first color conversion matrix includes the conversion matrix M from RGB color to XYZ color RGB2XYZ and the conversion matrix M from XYZ color to RGB color XYZ2RGB .
[0114] In some embodiments, the first color conversion matrix can be related to the standard RGB space adopted, and the standard RGB space includes but is not limited to sRGB, Display - P3, BT.2020, etc.
[0115] According to some embodiments, the second color conversion matrix is a color conversion matrix between XYZ color and LMS color. This second color conversion matrix includes the conversion matrix M from XYZ color to LMS color XYZ2LMS and the conversion matrix M from LMS color to XYZ color LMS2XYZ .
[0116] In some embodiments, the second color conversion matrix can be related to the color adaptation method adopted.
[0117] For example, when using the color adaptation method CAT16 used in the CIECAM16 color appearance model, the second color conversion matrix can be as shown in the following formula:
[0118]
[0119]
[0120] According to some embodiments, after obtaining the first color conversion matrix and the second color conversion matrix, first, the target white point XYZ value corresponding to the target white point RGB value can be determined according to the first color conversion matrix, XYZ target and the original white point XYZ value corresponding to the original white point RGB value, XYZ source , for example, it can be as shown in the following formula:
[0121] XYZ taeget = M RGB2XYZ RGB target
[0122] XYZ source = M RGB2XYZ RGB source
[0123] Next, the target white point XYZ value and the original white point XYZ value can be luminance-normalized to obtain the normalized target white point XYZ value, XYZ' target and the normalized original white point XYZ value, XYZ' source , for example, it can be as shown in the following formula:
[0124] XYZ′ target = XYZ target / Y target
[0125] XYZ′ source = M RGB2XYZ RGB source
[0126] Finally, the target white point LMS value corresponding to the normalized target white point XYZ value can be determined according to the second color conversion matrix, LMS target and the original white point LMS value corresponding to the normalized original white point XYZ value, LMS source , for example, it can be as shown in the following formula:
[0127] LMS target = M XYZ2LMS XYZ target
[0128] LMS source = m XYZ2LMS XYZ source
[0129] It should be noted that by performing brightness normalization on the target white point XYZ value and the original white point XYZ value, the brightness before and after color adaptation can be ensured to remain unchanged, and the color correction effect can be improved.
[0130] According to some embodiments, the initial color adaptation matrix M2 can be determined according to the standard color adaptation process in the color appearance model, as shown in the following formula:
[0131]
[0132] wherein, L target , M target , S target are the three components in LMS target , L source , M source , S source are the three components in LMS source . Among them, L represents the long wavelength, M represents the medium wavelength, and S represents the short wavelength.
[0133] S207. Determine the weight corresponding to the camera RGB response value according to the camera RGB response value and the third correspondence.
[0134] It should be noted that considering that special processing is required for the high-light area. For example, the area with overexposure such as a candle flame is white before applying the color adaptation matrix and will change color after applying the color adaptation matrix. Therefore, weights can be used to control the range of action of the color adaptation matrix.
[0135] According to some embodiments, the third correspondence is the correspondence between the camera RGB response value and the weight. This third correspondence can be, for example, a weight curve.
[0136] In some embodiments, Figure 4 is a schematic diagram showing a weight curve provided by an embodiment of the present disclosure. As Figure 4 shown, R + G + B is the total RGB parameter value corresponding to the camera RGB response value. When this RGB total parameter value is less than the first parameter threshold highlight_start, the weight weight is 0. When this RGB total parameter value is greater than the second parameter threshold highlight_end, the weight weight is 1. When this RGB total parameter value is not less than the first parameter threshold highlight_start and not greater than the second parameter threshold highlight_end, the weight weight shows a linear relationship.
[0137] S208. Determine the target color adaptation matrix according to the weight and the initial color adaptation matrix.
[0138] According to some embodiments, the target color adaptation matrix M'2 can be determined, for example, by the following formula:
[0139]
[0140] S209. The white point of the camera RGB response value after color restoration is adjusted by using a target color adaptation matrix to obtain the characterized RGB value.
[0141] According to some embodiments, the characterized RGB value can be determined according to the following formula:
[0142]
[0143] where, is the characterized RGB value.
[0144] It is easy to understand that from the above formula, it can be seen that the target color adaptation matrix M'2 acts after the color restoration matrix M1. That is to say, in the camera pipeline, full color adaptation is first achieved through white balance. Only the white point is made white in the white balance stage, then color correction is performed, and finally the target color adaptation matrix calculated by combining the color adaptation degree and the preferred white point adjusts the white point back. Therefore, the white point can be adjusted without overly affecting other colors.
[0145] It should be noted that, Figure 5 is a schematic flowchart of a camera characterization provided by an embodiment of the present disclosure. As Figure 5 shown, the CCM control algorithm is executed on the software side of the electronic device to calculate the CCM, and the chromatic adaptation matrix (CAM) is calculated. The CCM and the CAM are sequentially applied on the hardware side of the electronic device for camera characterization.
[0146] In summary, for the method provided by the embodiments of the present disclosure, first, the white balance processing is performed on the camera RGB response value by using a white balance matrix to obtain the white balance-adjusted camera RGB response value; the color correction matrix is used to perform color correction on the white balance-adjusted camera RGB response value to obtain the color-restored camera RGB response value; therefore, only the white point is made white in the white balance stage without superimposing preferences, which can reduce the situation that the accuracy and accuracy in the color correction stage are affected. Next, the white point RGB value, brightness, and color temperature corresponding to the camera RGB response value are determined; according to the white point RGB value, brightness, and the first correspondence relationship, the preferred white point RGB value corresponding to the camera RGB response value is determined; according to the brightness, color temperature, and the second correspondence relationship, the color adaptation degree parameter corresponding to the camera RGB response value is determined; therefore, the accuracy of determining the preferred white point RGB value and the color adaptation degree parameter can be improved. Next, the initial color adaptation matrix is determined according to the preferred white point RGB value and the color adaptation degree parameter; according to the camera RGB response value and the third correspondence relationship, the weight corresponding to the camera RGB response value is determined; according to the weight and the initial color adaptation matrix, the target color adaptation matrix is determined; therefore, special processing of the highlight area can be considered during the color adaptation process, and the color adaptation effect can be improved. Finally, the target color adaptation matrix is used to perform white point adjustment on the color-restored camera RGB response value to obtain the characterized RGB value; therefore, the white point can be adjusted according to preferences, and while adjusting the white point, other colors are not affected too much, which can improve the accuracy of camera characterization.
[0147] To implement the above embodiments, the present disclosure also proposes a camera characterization device.
[0148] As Figure 6 shown, the camera characterization device 600 includes:
[0149] A color restoration unit 601, configured to perform color restoration on the camera RGB response value to obtain the color-restored camera RGB response value, where the color restoration includes white balance and color correction;
[0150] A matrix determination unit 602, configured to determine the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value, and determine the target color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter;
[0151] A white point adjustment unit 603, configured to perform white point adjustment on the color-restored camera RGB response value by using the target color adaptation matrix to obtain the characterized RGB value.
[0152] Optionally, when the matrix determination unit 602 is configured to determine the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value, it is specifically configured to:
[0153] Determine the white point RGB values, brightness, and color temperature corresponding to the camera RGB response values;
[0154] According to the white point RGB values, brightness, and the first correspondence relationship, determine the preferred white point RGB values corresponding to the camera RGB response values, where the first correspondence relationship is the correspondence relationship between the white point RGB values, brightness, and the preferred white point RGB values;
[0155] According to the brightness, color temperature, and the second correspondence relationship, determine the color adaptation degree parameter corresponding to the camera RGB response values, where the second correspondence relationship is the correspondence relationship between the brightness, color temperature, and the color adaptation degree parameter.
[0156] Optionally, when the matrix determination unit 602 is used to determine the target color adaptation matrix according to the preferred white point RGB values and the color adaptation degree parameter, it specifically is used for:
[0157] Determine the initial color adaptation matrix according to the preferred white point RGB values and the color adaptation degree parameter;
[0158] According to the camera RGB response values and the third correspondence relationship, determine the weights corresponding to the camera RGB response values, where the third correspondence relationship is the correspondence relationship between the camera RGB response values and the weights;
[0159] Determine the target color adaptation matrix according to the weights and the initial color adaptation matrix.
[0160] Optionally, when the matrix determination unit 602 is used to determine the initial color adaptation matrix according to the preferred white point RGB values and the color adaptation degree parameter, it specifically is used for:
[0161] Determine the target white point RGB values according to the preferred white point RGB values, the color adaptation degree parameter, and the original white point RGB values;
[0162] According to the first color conversion matrix and the second color conversion matrix, determine the target white point LMS values corresponding to the target white point RGB values and the original white point LMS values corresponding to the original white point RGB values, where the first color conversion matrix is the color conversion matrix between RGB colors and XYZ colors, and the second color conversion matrix is the color conversion matrix between XYZ colors and LMS colors;
[0163] Determine the initial color adaptation matrix according to the first color conversion matrix, the second color conversion matrix, the target white point LMS values, and the original white point LMS values.
[0164] Optionally, when the matrix determination unit 602 is used to determine the target white point LMS values corresponding to the target white point RGB values and the original white point LMS values corresponding to the original white point RGB values according to the first color conversion matrix and the second color conversion matrix, it specifically is used for:
[0165] Determine the target white point XYZ value corresponding to the target white point RGB value and the original white point XYZ value corresponding to the original white point RGB value according to the first color conversion matrix;
[0166] Perform brightness normalization on the target white point XYZ value and the original white point XYZ value to obtain the normalized target white point XYZ value and the normalized original white point XYZ value;
[0167] Determine the target white point LMS value corresponding to the normalized target white point XYZ value and the original white point LMS value corresponding to the normalized original white point XYZ value according to the second color conversion matrix.
[0168] Optionally, when the color restoration unit 601 is used to perform color restoration on the camera RGB response value to obtain the color-restored camera RGB response value, it is specifically used for:
[0169] Perform white balance processing on the camera RGB response value using the white balance matrix to obtain the white-balanced camera RGB response value;
[0170] Perform color correction on the white-balanced camera RGB response value using the color correction matrix to obtain the color-restored camera RGB response value.
[0171] It should be noted that the foregoing explanation of the embodiments of the camera characterization method also applies to the camera characterization device of this embodiment, and will not be elaborated here.
[0172] In summary, the device provided by the embodiments of the present disclosure can reduce the situation where the accuracy and accuracy in the color correction stage are affected by only making the white point white without superimposing preferences in the white balance stage, and perform preference adjustment on the white point using the target color adaptation matrix that combines the color adaptation degree and the preferred white point after color correction, which can adjust the white point without overly affecting other colors and improve the accuracy of camera characterization.
[0173] To implement the above embodiments, the present disclosure also proposes an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided by the foregoing embodiments.
[0174] To implement the above embodiments, the present disclosure also proposes a computer-readable storage medium, in which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, they are used to implement the method provided by the foregoing embodiments.
[0175] To implement the above embodiments, the present disclosure also proposes a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the method provided by the foregoing embodiments.
[0176] The collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information involved in this disclosure all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0177] It should be noted that personal information from users should be collected for legal and reasonable purposes and should not be shared or sold outside of these legal uses. In addition, such collection / sharing should be carried out after obtaining the informed consent of the user, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization including authorizing relevant user information before the user uses this function. In addition, any necessary steps should be taken to safeguard and protect access to such personal information data and ensure that others with access to the personal information data comply with their privacy policies and procedures.
[0178] This disclosure anticipates providing embodiments in which users can selectively block the use or access of personal information data. That is, this disclosure anticipates providing hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by restricting data collection and deleting the data. In addition, when applicable, personal identifiers are removed from such personal information to protect the privacy of the user.
[0179] In the description of the foregoing embodiments, the descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0180] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of this disclosure, "a plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0181] Any process or method description represented in a flowchart or otherwise described herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a customized logic function or process. The scope of the preferred embodiments of the present disclosure includes additional implementations where functions may be executed not in the order shown or discussed, including in a substantially simultaneous manner according to the associated functions or in a reverse order, which should be understood by those skilled in the art to which the embodiments of the present disclosure pertain.
[0182] The logic and / or steps represented in a flowchart or otherwise described herein, for example, can be considered a sequenced list of executable instructions for implementing a logical function, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection having one or more wires (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable medium on which a program can be printed, as the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or otherwise appropriate processing as necessary, and then stored in a computer memory.
[0183] It should be understood that various parts of the present disclosure can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following techniques known in the art or a combination thereof can be used: discrete logic circuits having logic gates for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.
[0184] Those of ordinary skill in the art can understand that all or part of the steps carried out in the method of the above embodiments can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0185] In addition, in each of the various embodiments of the present disclosure, each functional unit may be integrated in a processing module, may exist separately physically for each unit, or two or more units may be integrated in a module. The above integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0186] The storage medium mentioned above may be a read-only memory, a magnetic disk, an optical disc, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present disclosure.
Claims
1. A method for camera characterization, characterized in that, Including: Performing color restoration on the camera RGB response value to obtain the color-restored camera RGB response value, where the color restoration includes white balance and color correction; Determining the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value, and determining the target color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter; Performing white point adjustment on the color-restored camera RGB response value by using the target color adaptation matrix to obtain the characterized RGB value.
2. The method according to claim 1, characterized in that, The determining the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value includes: Determining the white point RGB value, brightness, and color temperature corresponding to the camera RGB response value; Determining the preferred white point RGB value corresponding to the camera RGB response value according to the white point RGB value, the brightness, and the first correspondence, where the first correspondence is the correspondence between the white point RGB value, brightness, and the preferred white point RGB value; Determining the color adaptation degree parameter corresponding to the camera RGB response value according to the brightness, the color temperature, and the second correspondence, where the second correspondence is the correspondence between the brightness, color temperature, and the color adaptation degree parameter.
3. The method according to claim 1, characterized in that, The determining the target color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter includes: Determining the initial color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter; Determining the weight corresponding to the camera RGB response value according to the camera RGB response value and the third correspondence, where the third correspondence is the correspondence between the camera RGB response value and the weight; Determining the target color adaptation matrix according to the weight and the initial color adaptation matrix.
4. The method according to claim 3, characterized in that The determining the initial color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter includes: Determining the target white point RGB value according to the preferred white point RGB value, the color adaptation degree parameter, and the original white point RGB value; Determining the target white point LMS value corresponding to the target white point RGB value and the original white point LMS value corresponding to the original white point RGB value according to the first color conversion matrix and the second color conversion matrix, where the first color conversion matrix is the color conversion matrix between RGB color and XYZ color, and the second color conversion matrix is the color conversion matrix between XYZ color and LMS color; Determining the initial color adaptation matrix according to the first color conversion matrix, the second color conversion matrix, the target white point LMS value, and the original white point LMS value.
5. The method according to claim 4, wherein The determining the target white point LMS value corresponding to the target white point RGB value and the original white point LMS value corresponding to the original white point RGB value according to the first color conversion matrix and the second color conversion matrix includes: Determining the target white point XYZ value corresponding to the target white point RGB value and the original white point XYZ value corresponding to the original white point RGB value according to the first color conversion matrix; Perform brightness normalization on the target white point XYZ value and the original white point XYZ value to obtain the normalized target white point XYZ value and the normalized original white point XYZ value; Determine the target white point LMS value corresponding to the normalized target white point XYZ value and the original white point LMS value corresponding to the normalized original white point XYZ value according to the second color conversion matrix.
6. The method according to claim 1, wherein The color restoration of the camera RGB response value to obtain the color-restored camera RGB response value includes: Perform white balance processing on the camera RGB response value using the white balance matrix to obtain the white-balanced camera RGB response value; Perform color correction on the white-balanced camera RGB response value using the color correction matrix to obtain the color-restored camera RGB response value.
7. A camera characterization device, characterized in that, It includes: A color restoration unit for performing color restoration on the camera RGB response value to obtain the color-restored camera RGB response value, where the color restoration includes white balance and color correction; A matrix determination unit for determining the preferred white point RGB value and the color adaptation degree parameter corresponding to the camera RGB response value, and determining the target color adaptation matrix according to the preferred white point RGB value and the color adaptation degree parameter; A white point adjustment unit for performing white point adjustment on the color-restored camera RGB response value using the target color adaptation matrix to obtain the characterized RGB value.
8. An electronic device, characterized in that, It includes: A processor and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the computer execution instructions are executed by the processor, they are used to implement the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, It includes a computer program that, when executed by the processor, implements the method according to any one of claims 1 to 6.