Parameter debugging method and device, electronic equipment and computer readable storage medium
Patent Information
- Application Number
- CN202310095028.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-07
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-02-07
AI Technical Summary
The debugging process of the color correction matrix in the existing technology is complicated and inefficient.
The matrix parameters of the initial color correction matrix are labeled in the target color space, and the color cast information of the correction result image is determined by the labeled image. The matrix parameters are then adjusted according to the color cast information to obtain the target color correction matrix.
It simplifies the debugging process of the color correction matrix, saves debugging time, and improves debugging efficiency.
Smart Images

Figure CN116193272B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of imaging technology, specifically to a parameter adjustment method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] The Luther condition states that three linearly independent primary colors, when mixed, can represent any color. Since the color matching characteristics of a camera typically do not satisfy the Luther condition (meaning the RGB response of the camera's image sensor is usually not linearly independent), there is no linear relationship between the camera's color matching characteristics and the CIE (International Commission on Illumination) standard observer. Therefore, it is usually necessary to correct the camera's characteristics to make its output image colors closer to those of a standard observer. In practical image processing, a color correction matrix (CCM) is typically used to correct the image colors to approximate human visual perception or better align with subjective aesthetic preferences.
[0003] In actual image processing, although color correction matrices are used to correct the color of an image, color cast issues may still occur. If color cast issues arise, the color correction matrix needs to be adjusted. Currently, the methods for adjusting the color correction matrix are quite complex and inefficient. Summary of the Invention
[0004] This application discloses a parameter debugging method, apparatus, electronic device, and computer-readable storage medium, which can simplify the debugging process of the color correction matrix and improve debugging efficiency.
[0005] This application discloses a parameter debugging method, including:
[0006] The matrix parameters in the initial color correction matrix are labeled in the target color space, and the image information of the correction result image is labeled in the target color space to obtain a labeled image; wherein, the correction result image is obtained by color correction of the image based on the initial color correction matrix;
[0007] The color cast information of the corrected result image in the target color space is determined based on the labeled image;
[0008] Based on the color cast information, one or more matrix parameters marked in the annotation diagram are adjusted to obtain the target color correction matrix.
[0009] In one embodiment, determining the color cast information of the corrected result image in the target color space based on the labeled image includes:
[0010] Based on the annotation diagram, determine the actual values corresponding to each color block in the target color space of the correction result diagram;
[0011] The color cast information of the correction result image is determined based on the actual value corresponding to each color block and the standard value corresponding to each color block.
[0012] In one embodiment, determining the color cast information of the correction result image based on the actual value corresponding to each color patch and the standard value corresponding to each color patch includes:
[0013] A first line is drawn between the center point of the labeled image and the standard value corresponding to the target color patch, wherein the target color patch is any color patch; the center point is used to characterize the white balance of the corrected result image;
[0014] Determine the second line connecting the standard value and the actual value corresponding to the target color block in the annotation diagram;
[0015] The color deviation direction of the target color block is determined based on the angle between the extension of the first line connecting the target color block and the second line connecting the target color block.
[0016] In one embodiment, adjusting one or more matrix parameters labeled in the annotation map based on the color cast information includes:
[0017] The first matrix parameter that matches the color deviation direction of the target color block at the marked position in the annotation diagram is decreased, and the second matrix parameter that is adjacent to the first matrix parameter at the marked position in the annotation diagram is increased. The second matrix parameter matches the opposite direction of the color deviation direction at the marked position in the annotation diagram.
[0018] In one embodiment, annotating the matrix parameters in the initial color correction matrix in the target color space includes:
[0019] Determine the principal component matrix parameters and subcomponent matrix parameters of the initial color correction matrix;
[0020] The subcomponent matrix parameters are labeled in the target color space;
[0021] The step of adjusting one or more matrix parameters of the annotation based on the color cast information to obtain the target color correction matrix includes:
[0022] Based on the color cast information, the parameters of one or more subcomponent matrices are adjusted to obtain the target color correction matrix.
[0023] In one embodiment, adjusting the parameters of one or more subcomponent matrices based on the color cast information to obtain the target color correction matrix includes:
[0024] The target subcomponent matrix parameters to be adjusted are determined based on the color cast information.
[0025] Based on the principal component matrix parameters corresponding to the target subcomponent matrix parameters to be adjusted, the target subcomponent matrix parameters are adjusted to obtain a target color correction matrix where the sum of the matrix parameters in each row is 1.
[0026] In one embodiment, the target color space includes the Lab color space.
[0027] This application discloses a parameter debugging device, including:
[0028] The annotation module is used to annotate the matrix parameters in the initial color correction matrix in the target color space, and to annotate the image information of the correction result image in the target color space to obtain an annotated image; wherein, the correction result image is obtained by color correction of the image based on the initial color correction matrix;
[0029] A color cast determination module is used to determine the color cast information of the corrected result image in the target color space based on the labeled image;
[0030] The adjustment module is used to adjust one or more matrix parameters marked in the annotation map according to the color deviation information to obtain the target color correction matrix.
[0031] This application discloses an electronic device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to implement the method described in any of the above embodiments.
[0032] This application discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in any of the above embodiments.
[0033] The parameter adjustment method, apparatus, electronic device, and computer-readable storage medium disclosed in this application annotate the matrix parameters in the initial color correction matrix in the target color space, and annotate the image information of the correction result image in the target color space to obtain an annotated image. Based on the annotated image, the color cast information of the correction result image in the target color space is determined, and then one or more matrix parameters annotated in the annotated image are adjusted based on the color cast information to obtain the target color correction matrix. Based on the annotated image, color cast can be easily distinguished, and the corresponding matrix parameters can be adjusted. This simplifies the adjustment process of the color correction matrix, greatly saves the adjustment time of the adjustment personnel, and improves the adjustment efficiency. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a block diagram of an image processing circuit in one embodiment;
[0036] Figure 2 Here is a flowchart of a parameter debugging method in one embodiment;
[0037] Figure 3A This is a schematic diagram of the annotation in one embodiment;
[0038] Figure 3B This is a schematic diagram of the annotation in another embodiment;
[0039] Figure 4 A flowchart of a parameter debugging method in another embodiment;
[0040] Figure 5 This is a schematic diagram of color cast information in one embodiment;
[0041] Figure 6 This is a block diagram of a parameter adjustment device in one embodiment;
[0042] Figure 7 This is a structural block diagram of an electronic device in one embodiment. Detailed Implementation
[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0044] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0045] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first connection may be referred to as a second connection, and similarly, a second connection may be referred to as a first connection. Both the first connection and the second connection are connections, but they are not the same connection. The term "multiple" as used in this application refers to two or more.
[0046] This application provides an electronic device, which may include, but is not limited to, mobile phones, smart wearable devices, tablet computers, PCs (Personal Computers), vehicle terminals, digital cameras, etc., and this application does not limit the scope of the devices. The electronic device includes an image processing circuit, which can be implemented using hardware and / or software components and may include various processing units that define an ISP (Image Signal Processing) pipeline. Figure 1 This is a block diagram of an image processing circuit in one embodiment. For ease of explanation, Figure 1 Only aspects of the image processing techniques relevant to embodiments of this application are shown.
[0047] like Figure 1As shown, the image processing circuit includes an ISP processor 140 and a control logic unit 150. Image data captured by the imaging device 110 is first processed by the ISP processor 140, which analyzes the image data to capture image statistics that can be used to determine one or more control parameters of the imaging device 110. The imaging device 110 may include one or more lenses 112 and an image sensor 114. The image sensor 114 may include a color filter array (such as a Bayer filter), and can acquire light intensity and wavelength information captured by each imaging pixel, providing a set of raw image data that can be processed by the ISP processor 140. An attitude sensor 120 (such as a three-axis gyroscope, Hall sensor, accelerometer, etc.) can provide the acquired image processing parameters (such as image stabilization parameters) to the ISP processor 140 based on the attitude sensor 120 interface type. The attitude sensor 120 interface can be an SMIA (Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above interfaces.
[0048] It should be noted that, although Figure 1 Only one imaging device 110 is shown in the illustration, but in this embodiment, at least two imaging devices 110 may be included. Each imaging device 110 may correspond to one image sensor 114, or multiple imaging devices 110 may correspond to one image sensor 114; this is not limited here. The operation of each imaging device 110 can be referred to the description above.
[0049] In addition, image sensor 114 can also send raw image data to attitude sensor 120. Attitude sensor 120 can provide raw image data to ISP processor 140 based on attitude sensor 120 interface type, or attitude sensor 120 can store raw image data in image memory 130.
[0050] The ISP processor 140 processes raw image data pixel by pixel in various formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits. The ISP processor 140 may perform one or more image processing operations on the raw image data and collect statistical information about the image data. The image processing operations may be performed with the same or different bit depth precision.
[0051] The ISP processor 140 can also receive image data from the image memory 130. For example, the attitude sensor 120 interface sends raw image data to the image memory 130, and the raw image data in the image memory 130 is then provided to the ISP processor 140 for processing. The image memory 130 may be part of a memory device, a storage device, or a separate dedicated memory within an electronic device, and may include DMA (Direct Memory Access) features.
[0052] Upon receiving raw image data from image sensor 114 interface, attitude sensor 120 interface, or image memory 130, ISP processor 140 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 130 for further processing before display. ISP processor 140 receives processed data from image memory 130 and performs image data processing on the processed data in the raw domain and in the RGB and YCbCr color spaces. The processed image data may be output to display 160 for user viewing and / or further processed by a graphics engine or GPU (Graphics Processing Unit). Furthermore, the output of ISP processor 140 may also be sent to image memory 130, and display 160 may read image data from image memory 130. In one embodiment, image memory 130 may be configured to implement one or more frame buffers.
[0053] The statistical data determined by the ISP processor 140 can be sent to the control logic unit 150. For example, the statistical data may include image sensor 114 statistics such as gyroscope vibration frequency, automatic exposure, automatic white balance, automatic focus, flicker detection, black level compensation, and lens 112 shading correction. The control logic unit 150 may include a processor and / or microcontroller executing one or more routines (such as firmware) that determine control parameters for the imaging device 110 and the ISP processor 140 based on the received statistical data. For example, the control parameters for the imaging device 110 may include attitude sensor 120 control parameters (e.g., gain, integral time for exposure control, image stabilization parameters, etc.), camera flash control parameters, camera image stabilization shift parameters, lens 112 control parameters (e.g., focal length for focusing or zooming), or combinations of these parameters. The ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (e.g., during RGB processing), and lens 112 shading correction parameters.
[0054] In the image processing of an ISP, after de-mosaicing of the image acquired by the imaging device 110, color correction is usually performed, followed by gamma correction. The color correction matrix adjusts the image's color by subtracting the components of two other colors from one color to increase its saturation, thus making the color of the color-corrected image closer to human visual perception and more in line with subjective aesthetics. For example, the color correction matrix can be represented as a 3×3 matrix in equation (1):
[0055]
[0056] A color correction matrix linearly maps input pixel values (R, G, B) to new pixel values (R′, G′, B′). By selecting the matrix parameters, the mapped color is made to better match human perception. In actual image processing, when color casts appear in a color-corrected image, the color correction matrix needs to be adjusted. Although the color correction algorithm is relatively simple, the adjustment method is cumbersome. It typically requires the technician to export the raw image and then import it into the appropriate tool for color calibration, resulting in low efficiency.
[0057] This application provides a parameter debugging method, apparatus, electronic device, and computer-readable storage medium, which can simplify the debugging process of color correction matrix, greatly save debugging time for debugging personnel, and improve debugging efficiency.
[0058] like Figure 2 As shown, in one embodiment, a parameter debugging method is provided, which can be applied to electronic devices, including but not limited to tablets, laptops, smartphones, wearable devices, and PCs (Personal Computers). The method may include the following steps:
[0059] Step 210: Label the matrix parameters in the initial color correction matrix in the target color space, and label the image information of the correction result image in the target color space to obtain the labeled image.
[0060] The initial color correction matrix refers to the color correction matrix to be adjusted. This initial color correction matrix can be a 3×3 matrix or a matrix of other sizes, such as 4×3, but is not limited to these. The correction result image refers to the image obtained by color correction based on the initial color correction matrix. Optionally, this image can be the image obtained after de-mosaic processing of the image acquired by the imaging device. By using the initial color correction matrix to color correct this image, the correction result image can be obtained.
[0061] The matrix parameters in the initial color correction matrix can be labeled in the target color space. As one implementation, this target color space can include the Lab color space, also known as the CIE L*a*b* color space. It is a color model established according to an international standard for color measurement developed by the CIE, which compensates for the shortcomings of both RGB (red, green, blue) and CMYK (a subtractive color model). The Lab color space consists of one lightness channel and two color channels. Each color is represented by three numbers: L, a, and b. L* represents lightness, a* represents the component from green to red, and b* represents the component from blue to yellow.
[0062] In some embodiments, the initial color correction matrix corresponds to a first color space. The initial color correction matrix can be first converted from the first color space to the target color space, and then the matrix parameters in the initial color correction matrix can be annotated in the target color space. Optionally, the first color space can be the RGB color space. Since the RGB color space cannot be directly converted to the Lab color space, the initial color correction matrix can first be converted from the RGB color space to the XYZ space according to the first conversion formula between the RGB and XYZ color spaces, and then converted from the XYZ space to the Lab color space according to the second conversion formula between the XYZ and Lab color spaces.
[0063] For example, the first conversion formula can be shown as equation (2):
[0064]
[0065] The second conversion formula can be shown in equations (3) and (4):
[0066]
[0067]
[0068] The matrix parameters in the initial color correction matrix can be substituted into equation (2) to obtain the values in the XYZ space. Then, the values in the XZY space can be substituted into equations (3) and (4) to obtain the values in the Lab color space. The values in the Lab color space can then be marked in the Lab color space.
[0069] The electronic device can also annotate the image information of the calibration result image in the target color space. This image information may include, but is not limited to, one or more of the following: the pixel value of each pixel in the calibration result image in the target color space, the saturation of the calibration result image, and white balance. Similar to the annotation of the initial color calibration matrix, when annotating the calibration result image, each pixel in the calibration result image can first be converted from the current first color space to the target color space. Furthermore, each pixel in the calibration result image can first be converted from the RGB color space to the Lab color space. The conversion method is similar to that of the initial color calibration matrix, and will not be repeated here.
[0070] The annotation map can reflect the matrix parameters of the initial color correction matrix and the image information of the correction result map. For example, Figure 3A This is a schematic diagram of a labeled figure in one embodiment. For example... Figure 3A As shown in the figure, ① to ⑥ represent the matrix parameters of the initial color correction matrix. Optionally, the indexes of the matrix parameters in the initial color correction matrix can be defined. For example, the indexes can be defined as follows: In the diagram, b1 is defined as ①, g1 as ②, r2 as ③, b2 as ④, g3 as ⑤, and r3 as ⑥, but not limited to these definitions. The center point (solid circle) of the annotation diagram is used to characterize the white balance of the corrected image. The squares in the annotation diagram represent the standard values of each color patch, and each square corresponds to one color patch. The line connecting the center point and the square represents the intensity of saturation; the longer the line, the higher the saturation, and the shorter the line, the lower the saturation. The letters R, Y, G, C, B, and M can represent different color ranges.
[0071] Figure 3B This is a schematic diagram of a labeled figure in another embodiment. For example... Figure 3B As shown, the annotation diagram may also include hollow dots. Hollow dots represent the actual value of the calibration result diagram in each color block. Each hollow dot can correspond to a color block. The line connecting the square and hollow dots corresponding to the same color block can represent the difference between the actual value and the standard value of the calibration result diagram in that color block.
[0072] Step 220: Determine the color cast information of the corrected result image in the target color space based on the annotation image.
[0073] Color cast information can characterize the color cast of the calibration result image. Color cast information can include the color cast direction and color cast difference value of each color block in the calibration result image. The color cast direction refers to the color range to which the color is cast, such as red color blocks being cast towards pink, green color blocks being cast towards yellow, etc. The color cast difference value refers to the magnitude of the color range to which the color is cast.
[0074] Step 230: Adjust one or more matrix parameters marked in the annotation map according to the color cast information to obtain the target color correction matrix.
[0075] The electronic device can determine the matrix parameters to be adjusted based on color cast information, and adjust these parameters accordingly. These parameters can be matched to the color cast direction of the color patch, for example, using... Figure 3A For example, assuming the color block next to R represents a red color block, if the red color block shifts towards the Y direction (leaning towards orange), the matrix parameters to be adjusted can be determined to be ① and ②, namely b1 and g1; if the red color block shifts towards the M direction (leaning towards pink), the matrix parameters to be adjusted can also be determined to be ① and ②.
[0076] By adjusting the matrix parameters that match the color cast direction of the color patch, the color cast can be improved, resulting in a more accurate target color correction matrix. By annotating the matrix parameters of the initial color correction matrix in the target color space, the debugging personnel can easily determine the matrix parameters that need adjustment by observing the annotated diagram, making the debugging process simple and quick.
[0077] In this embodiment, the matrix parameters in the initial color correction matrix are labeled in the target color space, and the image information of the correction result image is labeled in the target color space to obtain a labeled image. The color cast information of the correction result image in the target color space is determined based on the labeled image. Then, one or more matrix parameters labeled in the labeled image are adjusted based on the color cast information to obtain the target color correction matrix. Color cast can be easily distinguished based on the labeled image, and the corresponding matrix parameters can be adjusted. This simplifies the debugging process of the color correction matrix, greatly saves the debugging time of the debugging personnel, and improves the debugging efficiency.
[0078] like Figure 4 As shown, in another embodiment, a parameter debugging method is provided, which can be applied to the above-mentioned electronic device. The method may include the following steps:
[0079] Step 402: Determine the principal component matrix parameters and subcomponent matrix parameters of the initial color correction matrix.
[0080] During the debugging of the color correction matrix, it is necessary to ensure that the sum of the matrix parameters in each row of the color correction matrix is always 1. Therefore, the principal component matrix parameters and subcomponent matrix parameters of the initial color correction matrix can be determined first, and then the matrix parameters can be adjusted. Optionally, the matrix parameters on the diagonal of the initial color correction matrix can be determined as the principal component matrix parameters, and the other matrix parameters can be determined as the subcomponent matrix parameters. For example, the initial color correction matrix is... Then r1, g2, and b3 can be the parameters of the principal component matrix, and r2, r3, g1, g3, b1, and b2 can be the parameters of the secondary component matrix.
[0081] Step 404: Label the subcomponent matrix parameters in the target color space, and label the image information of the correction result image in the target color space to obtain the labeled image.
[0082] The parameters of each subcomponent matrix of the initial color correction matrix can be labeled in the target color space. Specifically, the index of each subcomponent matrix parameter of the initial color correction matrix can be defined, the subcomponent matrix parameters can be converted from the RGB color space to the XYZ space, and then from the XYZ space to the Lab color space to obtain the value of each subcomponent matrix parameter in the Lab color space, and the corresponding index can be labeled in the annotation diagram.
[0083] Step 406: Determine the color cast information of the corrected result image in the target color space based on the annotation image.
[0084] The annotation diagram may include standard values corresponding to multiple color patches, as well as the actual values of the calibrated result image in each color patch. Electronic devices can determine the actual values of each color patch in the target color space based on the annotation diagram, and determine the color cast information of the calibrated result image based on the actual values and standard values of each color patch.
[0085] As one implementation method, taking a target color patch as an example, the target color patch can be any color patch. A first line connecting the center point of the annotation diagram and the standard value corresponding to the target color patch can be determined. Figure 3A For example, the center point of the annotation image is a solid circle, and the standard value is a square. The first line connecting the center point of the annotation image and the standard value corresponding to the target color block represents the saturation of the target color block. A second line connecting the standard value and the actual value of the target color block in the annotation image can be determined; this second line represents the difference between the actual value and the standard value of the target color block in the corrected image. The direction of color cast of the target color block can be determined based on the angle between the extension of the first line and the second line.
[0086] Figure 5 This is a schematic diagram of color cast information in one embodiment. For example... Figure 5 As shown, taking color block 15 in the annotation diagram as an example, color block 15 can correspond to red. The first line connecting the center point (i.e., the solid dot) of the annotation diagram and the square of color block 15, and the second line connecting the square of color block 15 and the hollow dot, can be determined. The angle p between the extension of the first line and the second line can be determined. According to the angle p, it can be determined that color block 15 is biased towards the Y direction, that is, red is biased towards orange. The size of the angle p can also represent the degree of color deviation. The larger the angle, the greater the degree of color deviation.
[0087] Optionally, the degree of color deviation can also be determined based on the length of the second line connecting the standard value and the actual value corresponding to the target color block, and the aforementioned included angle. The larger the included angle and the longer the length of the second connection, the greater the degree of color deviation.
[0088] Step 408: Adjust the parameters of one or more subcomponent matrices based on the color cast information to obtain the target color correction matrix.
[0089] The electronic device can determine the matrix parameters to be adjusted in the annotation diagram based on the color cast direction of the target color block, and then adjust these parameters. The first matrix parameter, whose annotation position matches the color cast direction of the target color block, can be decreased, while the second matrix parameter, whose annotation position is adjacent to the first matrix parameter, can be increased. The annotation position of the second matrix parameter can be understood as being in the opposite direction to the color cast direction; the second matrix parameter's annotation position in the annotation diagram matches the opposite direction of the color cast direction.
[0090] For example, with Figure 3A For example, suppose the red patch next to R shifts towards direction M (leaning towards pink). We can determine that the matrix parameters to be adjusted are ① and ②. Then, we can decrease ① (b1), whose label position matches this color shift direction, and increase ② (g1), whose label position is adjacent to ①. That is, in whichever direction the color shift occurs, we decrease the matrix parameter matching that direction and increase the adjacent matrix parameter to correct the color shift. Furthermore, we can determine the adjustment value of the matrix parameters to be adjusted based on the degree of color shift corresponding to the target color patch, such as increasing or decreasing the value. Adjusting the matrix parameters based on the color shift direction and degree of each color patch can improve the accuracy of the adjustment and obtain a target color correction matrix with better color correction.
[0091] It is understood that, in the embodiments of this application, the first matrix parameter and the second matrix parameter mentioned above are both secondary component matrix parameters. The target secondary component matrix parameter to be adjusted can be determined based on the color cast information. Based on the principal component matrix parameter corresponding to the target secondary component matrix parameter, the target secondary component matrix parameter is adjusted to obtain a target color correction matrix where the sum of the matrix parameters in each row is 1. The principal component matrix parameter corresponding to the target secondary component matrix parameter can refer to the principal component matrix parameter in the same row as the target secondary component matrix parameter in the color correction matrix. For example, if the principal component matrix parameter b1 corresponds to b3, when adjusting b1, the value of b3 can be considered so that the result of b1 + b2 + b3 is always 1. By dividing the color correction matrix into principal and secondary components and using the principal component matrix parameter to determine the adjustment of the secondary component matrix parameter, it can be ensured that the adjusted target color correction matrix is more accurate.
[0092] Optionally, to ensure the accuracy of the three primary colors, the color cast of red, green, and blue can be adjusted first. This can be done by adjusting the corresponding matrix parameters in the annotation diagram based on the direction and degree of color cast for the red, green, and blue color blocks, and then adjusting the color cast of other colors. This improves the color correction effect of the target color correction matrix and increases the accuracy of the calibration.
[0093] In this embodiment, the initial color correction matrix is divided into principal component matrix parameters and secondary component matrix parameters. The secondary component matrix parameters are adjusted according to the color cast information of the correction result image. At the same time, the principal component matrix parameters are used to adjust the secondary component matrix parameters to ensure that the sum of the matrix parameters of each row of the target color correction matrix is 1, thereby improving the accuracy of debugging the color correction matrix.
[0094] like Figure 6 As shown, a parameter adjustment device 600 is provided, which can be applied to the aforementioned electronic equipment. The parameter adjustment device 600 includes a labeling module 610, a color deviation determination module 620, and an adjustment module 630.
[0095] The annotation module 610 is used to annotate the matrix parameters in the initial color correction matrix in the target color space, and to annotate the image information of the correction result image in the target color space to obtain an annotated image; wherein, the correction result image is obtained by color correction of the image based on the initial color correction matrix.
[0096] In one embodiment, the target color space includes the Lab color space.
[0097] The color cast determination module 620 is used to determine the color cast information of the corrected result image in the target color space based on the annotation image.
[0098] The adjustment module 630 is used to adjust one or more matrix parameters marked in the annotation map according to the color deviation information to obtain the target color correction matrix.
[0099] In this embodiment, the matrix parameters in the initial color correction matrix are labeled in the target color space, and the image information of the correction result image is labeled in the target color space to obtain a labeled image. The color cast information of the correction result image in the target color space is determined based on the labeled image. Then, one or more matrix parameters labeled in the labeled image are adjusted based on the color cast information to obtain the target color correction matrix. Color cast can be easily distinguished based on the labeled image, and the corresponding matrix parameters can be adjusted. This simplifies the debugging process of the color correction matrix, greatly saves the debugging time of the debugging personnel, and improves the debugging efficiency.
[0100] In one embodiment, the annotation module 610 is further configured to determine the principal component matrix parameters and subcomponent matrix parameters of the initial color correction matrix; and to annotate the subcomponent matrix parameters in the target color space.
[0101] The adjustment module 630 is also used to adjust the parameters of one or more subcomponent matrices of the annotation based on the color cast information to obtain the target color correction matrix.
[0102] In one embodiment, the adjustment module 630 is further configured to determine the target subcomponent matrix parameters to be adjusted based on the color cast information; and adjust the target subcomponent matrix parameters according to the principal component matrix parameters corresponding to the target subcomponent matrix parameters to be adjusted, so as to obtain a target color correction matrix in which the sum of the matrix parameters of each row is 1.
[0103] In one embodiment, the color deviation determination module 620 is further configured to determine the actual value of each color block in the target color space of the correction result image based on the annotation image; and determine the color deviation information of the correction result image based on the actual value of each color block and the standard value of each color block.
[0104] In one embodiment, the color cast determination module 620 is further configured to determine a first line connecting the center point of the annotation map and the standard value corresponding to the target color block, wherein the target color block is any color block; determine a second line connecting the standard value and the actual value corresponding to the target color block in the annotation map; and determine the color cast direction of the target color block based on the angle between the extension of the first line connecting the target color block and the second line connecting the target color block; the center point is used to characterize the white balance of the correction result map.
[0105] In one embodiment, the adjustment module 630 is further configured to decrease the first matrix parameter that matches the color deviation direction of the target color block at the annotation position in the annotation diagram, and increase the second matrix parameter that is adjacent to the first matrix parameter at the annotation position in the annotation diagram, wherein the second matrix parameter matches the opposite direction of the color deviation direction at the annotation position in the annotation diagram.
[0106] In this embodiment, the initial color correction matrix is divided into principal component matrix parameters and secondary component matrix parameters. The secondary component matrix parameters are adjusted according to the color cast information of the correction result image. At the same time, the principal component matrix parameters are used to adjust the secondary component matrix parameters to ensure that the sum of the matrix parameters of each row of the target color correction matrix is 1, thereby improving the accuracy of debugging the color correction matrix.
[0107] In one embodiment, an electronic device is provided, which can be a head-mounted display device, and its internal structure diagram can be as follows: Figure 7As shown, the electronic device includes a processor, memory, and network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the aforementioned parameter debugging method. The display device of the electronic device can be a liquid crystal display screen, etc., and the input device can be buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or gamepad, etc.
[0108] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0109] In one embodiment, the parameter debugging device provided in this application can be implemented as a computer program, and the computer program can be implemented in the form of, for example... Figure 7 The device operates on the electronic device shown. The electronic device's memory can store the various program modules that make up the parameter debugging device, for example, Figure 6 The annotation module 610, color deviation determination module 620, and adjustment module 630 are shown. The computer program comprised of these modules causes the processor to execute the steps in the parameter adjustment methods of the various embodiments of this application described in this specification.
[0110] This application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the methods described in the above embodiments.
[0111] This application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the above embodiments.
[0112] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, ROM, etc.
[0113] Any references to memory, storage, databases, or other media used herein may include non-volatile and / or volatile memory. Suitable non-volatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache. By way of illustration and not limitation, RAM may take many forms, such as Static RAM (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus DRAM (RDRAM), and Direct Rambus DRAM (DRDRAM).
[0114] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also recognize that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application. It should be noted that "multiple" in this application includes "two or more".
[0115] In the various embodiments of this application, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0116] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they can be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0117] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0118] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0119] The foregoing has provided a detailed description of a parameter debugging method, apparatus, electronic device, and computer-readable storage medium disclosed in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A parameter adjustment method, characterized in that, include: The matrix parameters in the initial color correction matrix are labeled in the target color space, and the image information of the correction result image is labeled in the target color space to obtain a labeled image; wherein, the correction result image is obtained by color correction of the image based on the initial color correction matrix; The color cast information of the corrected result image in the target color space is determined based on the labeled image; Based on the color cast information, one or more matrix parameters marked in the annotation diagram are adjusted to obtain the target color correction matrix; The color cast information includes the direction of color cast; determining the color cast information of the corrected result image in the target color space based on the labeled image includes: Based on the annotation diagram, determine the actual values corresponding to each color block in the target color space of the correction result diagram; A first line is drawn between the center point of the labeled image and the standard value corresponding to the target color patch, wherein the target color patch is any color patch; the center point is used to characterize the white balance of the corrected result image; Determine the second line connecting the standard value and the actual value corresponding to the target color block in the annotation diagram; The color deviation direction of the target color block is determined based on the angle between the extension of the first line connecting the target color block and the second line connecting the target color block.
2. The method according to claim 1, characterized in that, The step of adjusting one or more matrix parameters labeled in the annotation diagram according to the color cast information includes: The first matrix parameter that matches the color deviation direction of the target color block at the marked position in the annotation diagram is decreased, and the second matrix parameter that is adjacent to the first matrix parameter at the marked position in the annotation diagram is increased. The second matrix parameter matches the opposite direction of the color deviation direction at the marked position in the annotation diagram.
3. The method according to claim 1, characterized in that, The step of annotating the matrix parameters in the initial color correction matrix in the target color space includes: Determine the principal component matrix parameters and subcomponent matrix parameters of the initial color correction matrix; The subcomponent matrix parameters are labeled in the target color space; The step of adjusting one or more matrix parameters of the annotation based on the color cast information to obtain the target color correction matrix includes: Based on the color cast information, the parameters of one or more subcomponent matrices are adjusted to obtain the target color correction matrix.
4. The method according to claim 3, characterized in that, The step of adjusting the parameters of one or more subcomponent matrices based on the color cast information to obtain the target color correction matrix includes: The target subcomponent matrix parameters to be adjusted are determined based on the color cast information. Based on the principal component matrix parameters corresponding to the target subcomponent matrix parameters to be adjusted, the target subcomponent matrix parameters are adjusted to obtain a target color correction matrix where the sum of the matrix parameters in each row is 1.
5. The method according to any one of claims 1 to 4, characterized in that, The target color space includes the Lab color space.
6. A parameter adjustment device, characterized in that, include: The annotation module is used to annotate the matrix parameters in the initial color correction matrix in the target color space, and to annotate the image information of the correction result image in the target color space to obtain an annotated image; wherein, the correction result image is obtained by color correction of the image based on the initial color correction matrix; A color cast determination module is used to determine the color cast information of the corrected result image in the target color space based on the labeled image; The adjustment module is used to adjust one or more matrix parameters marked in the annotation map according to the color cast information to obtain the target color correction matrix; The color cast information includes the color cast direction; the color cast determination module is further configured to determine, based on the annotation diagram, the actual value corresponding to each color block in the target color space of the correction result diagram; determine a first line connecting the center point of the annotation diagram and the standard value corresponding to the target color block, wherein the target color block is any color block; the center point is used to characterize the white balance of the correction result diagram; determine a second line connecting the standard value and the actual value corresponding to the target color block in the annotation diagram; and determine the color cast direction of the target color block based on the angle between the extension of the first line connecting the target color block and the second line connecting the target color block.
7. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to perform the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Color correction matrix adjusting method and device, terminal equipment and medium
CN112073703A
