WO2021223185A1 - Camera and alignment method and apparatus therefor, and gimbal - Google Patents

Camera and alignment method and apparatus therefor, and gimbal Download PDF

Info

Publication number
WO2021223185A1
WO2021223185A1 PCT/CN2020/089055 CN2020089055W WO2021223185A1 WO 2021223185 A1 WO2021223185 A1 WO 2021223185A1 CN 2020089055 W CN2020089055 W CN 2020089055W WO 2021223185 A1 WO2021223185 A1 WO 2021223185A1
Authority
WO
WIPO (PCT)
Prior art keywords
white balance
camera
color
target
balance gain
Prior art date
Application number
PCT/CN2020/089055
Other languages
French (fr)
Chinese (zh)
Inventor
严毅民
陈安秋
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN202080004936.5A priority Critical patent/CN112655193A/en
Priority to PCT/CN2020/089055 priority patent/WO2021223185A1/en
Publication of WO2021223185A1 publication Critical patent/WO2021223185A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/45Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from two or more image sensors being of different type or operating in different modes, e.g. with a CMOS sensor for moving images in combination with a charge-coupled device [CCD] for still images
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/90Arrangement of cameras or camera modules, e.g. multiple cameras in TV studios or sports stadiums
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control

Definitions

  • This application relates to the field of camera technology, in particular to a camera alignment method, a camera alignment device, a camera, a pan-tilt, a computer-readable storage medium, and a computer program.
  • the embodiments of the present application provide a camera alignment method and device, which can solve the technical problem that the colors of photos or videos taken by different cameras in the same camera system have obvious differences.
  • an embodiment of the present application provides a camera alignment method, the camera has multiple cameras, and the method includes: determining a reference camera from the multiple cameras; determining a white balance gain of the reference camera; Determine the current color temperature corresponding to the white balance gain; for one or more target cameras among the cameras other than the reference camera in the plurality of cameras, perform the following operations to make each target camera and all White balance alignment between the reference cameras: determining a white balance gain mapping matrix corresponding to the current color temperature, wherein the white balance gain mapping matrix is used to characterize the white balance gain of the reference camera at the current color temperature A mapping relationship with the white balance gain of the target camera; and multiplying the white balance gain of the reference camera by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
  • an embodiment of the present application provides a camera alignment device.
  • the camera has multiple cameras.
  • the device includes a processor and a memory.
  • the memory is used to store instructions.
  • the instruction for implementing the following operations: determining a reference camera from the multiple cameras; determining the white balance gain of the reference camera; determining the current color temperature corresponding to the white balance gain;
  • One or more target cameras in the cameras other than the reference camera perform the following operations to achieve white balance alignment between each target camera and the reference camera: determine that it corresponds to the current color temperature
  • the white balance gain mapping matrix is used to characterize the mapping relationship between the white balance gain of the reference camera and the white balance gain of the target camera at the current color temperature; and
  • the white balance gain of the reference camera is multiplied by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
  • an embodiment of the present application provides a camera, including: a plurality of cameras; and the camera alignment device according to any one of the above-mentioned second aspects.
  • an embodiment of the present application provides a pan/tilt head, including: the camera according to any one of the foregoing third aspects.
  • an embodiment of the present application provides a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the camera alignment method according to any one of the first aspects.
  • an embodiment of the present application provides a computer program product containing instructions that, when the instructions are run on a computer, cause the computer to execute the camera alignment method described in any one of the first aspects above.
  • the embodiments of the present application provide a camera alignment method and device.
  • the white balance gain of a reference camera the white balance gain of other cameras is directly mapped through the white balance gain mapping matrix to obtain the white balance gains of other cameras.
  • the reason for the color deviation of the photo or video is the accuracy error during the mapping, and the accuracy error during the mapping is usually relatively small and relatively stable. Therefore, the camera alignment method adopted in this application can ensure that the color deviation of the photos or videos taken by different cameras is small. And it's relatively stable.
  • FIG. 1A is a schematic diagram 1 of an application scenario of a camera alignment method provided by an embodiment of this application;
  • FIG. 1B is a second schematic diagram of an application scenario of the camera alignment method provided by an embodiment of this application.
  • FIG. 2 is a schematic flowchart of a camera alignment method provided by an embodiment of the application.
  • 3A and 3B are schematic diagrams of realizing white balance alignment provided by an embodiment of the application.
  • Fig. 5 is a block diagram of a camera provided by an embodiment of the application.
  • the camera alignment method provided in the embodiments of the present application can be applied to any camera alignment process that requires white balance alignment and color alignment, and the camera alignment method can be specifically executed by a camera alignment device.
  • the camera alignment device may be a device applied to a camera system with two cameras.
  • a schematic diagram of an application scenario of the camera alignment method provided in an embodiment of the present application may be as shown in FIG. 1A.
  • the processor of the camera alignment device may use one camera of the camera system as a reference camera, and use the camera alignment method provided in the embodiment of the present application to process the other camera of the camera system.
  • the camera alignment device may also be a device applied to a camera system with three or more cameras.
  • a schematic diagram of the application scene of the camera alignment method provided by the embodiment of the present application may be as shown in FIG. 1B (in the figure) The case of three cameras is shown).
  • the processor of the camera alignment device may use one camera of the camera system as a reference camera, and process other cameras of the camera system using the camera alignment method provided in the embodiments of the present application.
  • FIGS. 1A and 1B are only schematic diagrams, and do not limit the structure of the camera.
  • the camera may also include a memory for storing related parameters such as white balance gain.
  • the type of the device including the camera alignment device may not be limited in the embodiment of the present application.
  • the device may be, for example, a smart camera, a smart phone, a smart robot, a tablet computer, and the like.
  • the camera alignment method provided by the embodiment of the application can directly map the white balance gain of other cameras according to the white balance gain of the reference camera and directly map the white balance gain of other cameras, thereby making the photos taken by the other cameras and the reference camera or
  • the reason for the difference in the color of the video is the accuracy error during the mapping, and the accuracy error during the mapping is usually relatively small and relatively stable. Therefore, the camera alignment method adopted in this application can ensure that the color deviation of photos or videos taken by different cameras is small and relatively stable.
  • the camera alignment method provided in the embodiments of the present application can be applied to the field of cameras, electronic devices with camera functions, and other fields, and the present application is not limited herein.
  • FIG. 2 is a schematic flowchart of a camera alignment method provided by an embodiment of the application.
  • the execution subject of this embodiment may be a camera alignment device, and specifically may be a processor of the camera alignment device.
  • the method of this embodiment may be applied to a camera with multiple cameras, for example, and the method may include S201 to S206, for example.
  • any one of the cameras may be determined as the reference camera of the application, and the remaining cameras may be determined as the target camera of the application.
  • the main camera in the camera may be determined as the reference camera of the application
  • the secondary camera may be determined as the target camera of the application.
  • one camera designated by the user may be determined as the reference camera of the application, and the remaining cameras may be determined as the target camera of the application.
  • various white balance algorithms may be used to calculate the white balance gain (ie, white balance value) of the reference camera.
  • an adaptive white balance algorithm may be used to calculate the white balance gain of the reference camera.
  • various color temperature estimation algorithms may be used to calculate the current color temperature corresponding to the white balance gain of the reference camera (hereinafter referred to as the current color temperature CT).
  • an adaptive color temperature estimation algorithm may be used to calculate the current color temperature.
  • S204 Perform the following operations (such as S205 and S206) for one or more target cameras among the cameras in the plurality of cameras other than the reference camera to achieve white balance alignment between each target camera and the reference camera.
  • the white balance gain mapping matrix corresponding to the current color temperature is used to characterize the mapping relationship between the white balance gain of the reference camera and the white balance gain of the target camera at the current color temperature. It should be understood that under the same color temperature, the white balance gain mapping relationship between different target cameras and the same reference camera may be the same or may be different.
  • a series of white balance gain matrices used to characterize the mapping relationship between the white balance gain of the reference camera and the white balance gain of each target camera under different color temperatures may be pre-calibrated.
  • the current color temperature CT can be used to filter out the white balance gain mapping matrix corresponding to the color temperature adjacent or similar to the current color temperature CT from a series of pre-calibrated white balance gain mapping matrices, and then map the selected white balance gain The matrix is linearly interpolated to obtain the white balance gain mapping matrix corresponding to the current color temperature CT.
  • S205 may include the following operations, for example:
  • the white balance gain mapping matrix corresponding to the current color temperature is determined based on the white balance gain mapping matrix calibrated for the adjacent color temperature.
  • a camera system has two cameras: camera A and camera B.
  • Camera A is the reference camera and camera B is the target camera.
  • adaptive white balance can be used first.
  • the algorithm calculates the white balance gain of camera A, and then uses the adaptive color temperature estimation algorithm to calculate the current color temperature CT 1 corresponding to the white balance gain of the camera A, and then selects the current color temperature from the pre-calibrated white balance gain mapping matrix
  • the white balance gain mapping matrix corresponding to the adjacent or similar color temperature of CT 1 is then linearly interpolated on the selected white balance gain mapping matrix to obtain the white balance gain mapping matrix corresponding to the current color temperature CT 1.
  • the current color temperature CT 1 is 4000K.
  • the two color temperatures of 3000K and 5000K adjacent to 4000K have been calibrated with two corresponding white balance gain mapping matrices.
  • the two white balance gain mapping matrices will be selected for calculation and
  • the white balance gain mapping matrix corresponding to 4000K may be, for example, the average of two white balance gain mapping matrices corresponding to 3000K and 5000K, respectively.
  • the current color temperature CT 1 is 2000K
  • the existing 3000K color temperature adjacent to 2000K has been calibrated with the corresponding white balance gain mapping matrix.
  • the white balance gain mapping matrix will be selected for calculating the corresponding current color temperature CT 1 White balance gain mapping matrix. Since 2000K points are located below 3000K points, the white balance gain mapping matrix corresponding to 3000K can be directly used as the white balance gain mapping matrix corresponding to 2000K.
  • the current color temperature CT 1 is 6000K
  • the existing 5000K color temperature adjacent to 6000K has been calibrated with the corresponding white balance gain mapping matrix.
  • This white balance gain mapping matrix will be selected for calculating the corresponding current color temperature CT 1 White balance gain mapping matrix. Since 6000K points are located above 5000K points, the white balance gain mapping matrix corresponding to 5000K can be directly used as the white balance gain mapping matrix corresponding to 6000K.
  • the calculation method is similar, except that different target cameras and the reference camera have respective white balance gain mapping matrices, which will not be repeated in this application.
  • calibrating the white balance gain mapping matrix between each target camera and the reference camera at different color temperatures may include, for example, performing the following operations at different color temperatures:
  • the first ratio of the average value of the three RGB channels in the central area of the white balance card is calculated based on the image data collected by the reference camera.
  • the second ratio of the average value of the three RGB channels in the central area of the white balance card is calculated based on the image data collected by each target camera.
  • a white balance gain mapping matrix used to characterize the white balance gain mapping relationship between the reference camera and the corresponding target camera at the corresponding color temperature is determined.
  • the main camera and sub-camera can be used to shoot the white balance card separately under different light sources (such as D65, TL84, A and other common light sources and other light sources with adjustable temperature and color).
  • different light sources such as D65, TL84, A and other common light sources and other light sources with adjustable temperature and color.
  • the Rgain and Bgain at and near the corresponding color temperature are used to calculate the white balance gain mapping matrix used to characterize the white balance gain mapping relationship between the main camera and the secondary camera at the color temperature. It should be noted that when using Rgain and Bgain to calculate the white balance gain mapping matrix, the weights of Rgain and Bgain of common light sources can be configured to be higher.
  • the method of calculating the white balance gain mapping matrix may include a polynomial fitting method, where the order of the polynomial is not limited in this application.
  • a camera system has two cameras: camera A and camera B, where camera A is the reference camera, and camera B is the target camera.
  • camera A is the reference camera
  • camera B is the target camera.
  • calculate the Rgain A and Bgain A of camera A and the Rgain B and Bgain B of camera B and use the Rgain and Bgain at and near the corresponding color temperature to calculate the color temperature to characterize the white balance gain between camera A and camera B
  • the white balance gain mapping matrix of the mapping relationship (for example, to calculate the white balance gain mapping matrix corresponding to 4000K, you can use the Rgain and Bgain of camera A and camera B corresponding to the light source in the range of 3500K to 4500K to participate in the calculation. The closer to the weight assigned to 4000K Higher).
  • the following formula 1 is a first-order polynomial fitting (a higher-order polynomial fitting can also be used), which can be used to calculate the white balance gain mapping matrix of the present application.
  • Formula 1 can be written in matrix form:
  • the white balance gain mapping matrix T of the present application can be obtained by the following formula, namely formula 2:
  • W is the weight matrix.
  • the weight matrix is a diagonal matrix, that is, each value on the diagonal of the W matrix is a weight value, and each weight value corresponds to a color temperature.
  • the current color temperature is estimated by referring to the white balance gain of the camera, and then the current color temperature and the pre-calibrated white balance gain mapping matrix are used to calculate the white balance gain mapping matrix corresponding to the current color temperature, and then the reference camera's white balance gain mapping matrix is calculated.
  • the white balance gain and the calculated white balance gain mapping matrix map the white balance gain of the target camera. Because this kind of mapping scheme is not a simple linear mapping strongly dependent on color temperature, but on the mapping of the white balance gain mapping matrix, and the white balance gain mapping matrix is calibrated for multiple different light sources on the one hand, and on the other hand Various operations such as translation and rotation can also be performed. Therefore, the mapping that depends on the white balance gain mapping matrix is a complex polynomial fitting. Therefore, the white balance gain conversion accuracy of the present application is higher.
  • the white balance of the camera alignment solution provided in this application is more stable. That is, no matter it is under the same temperature and different spectrum light source or under the same temperature and same spectrum light source, whether it is between cameras of different specifications or between cameras of the same specification, white balance is achieved through the camera alignment solution provided by this application. After alignment, the photos and videos taken by the multiple cameras of the camera system are not prone to color cast.
  • S206 Multiply the white balance gain of the reference camera by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
  • another path as shown in FIG. 3B (hereinafter referred to as the second path, that is, using the white balance statistical value mapping matrix) can also be used to calculate another white balance gain of the target camera, and then The white balance gains calculated through the two channels are merged to achieve white balance alignment between the target camera and the reference camera.
  • the first channel can effectively enhance the stability of the white balance, while the second channel has a larger adjustable space, this application makes the white balance alignment between different cameras possible. At the same time, stability and adjustability are taken into account.
  • the first channel and the second channel can be directly mapped on the white balance gain space and the white balance statistical value space respectively. The two mappings are not strongly dependent on the color temperature, so it can effectively improve the different specifications of cameras in the same temperature and different spectrum. The color cast problem under the light source.
  • the inventive idea of the first path is to directly map the white balance gain of the target camera based on the white balance gain of the reference camera.
  • the main error lies in the accuracy error during the mapping. Therefore, the error is relatively stable and there is no The situation of sudden error.
  • the white balance alignment result given by the first pass is not affected, and stability can be maintained. That is, this application can effectively solve the problem of color jumps caused by image changes before and after zooming when the same camera is zooming through the first path.
  • the inventive concept of the second path is to map the white balance statistics of the target camera based on the white balance statistics of the reference camera, and then use the white balance statistics of the target camera as the input of the adaptive white balance algorithm Calculate the white balance gain of the target camera. Since there are many adjustable parameters in the adaptive white balance algorithm, the second path has a large adjustable space. These parameters can be adjusted to improve the white balance gain conversion precision adjustment, thereby improving the accuracy of the final white balance alignment result sex.
  • the method may also include the following operations (that is, the relevant steps of the second path), for example:
  • the white balance statistical value mapping matrix corresponding to the current color temperature is used to represent the mapping relationship between the white balance statistical value of the reference camera and the white balance statistical value of each target camera at the current color temperature. It should be understood that under the same color temperature, the white balance statistical value mapping relationship between different target cameras and the same reference camera may be the same or may be different.
  • the white balance statistical value of the reference camera is multiplied by the white balance statistical value mapping matrix corresponding to the current color temperature determined in the foregoing steps to obtain the second white balance gain of each target camera.
  • the white balance gain of each target camera at the current color temperature is determined based on the first white balance gain and the corresponding second white balance gain.
  • the white balance statistical value used to characterize the white balance of the reference camera at different color temperatures and the white balance statistical value of each target camera can be pre-calibrated.
  • the white balance statistical value mapping matrix corresponding to the current color temperature you can first use the current color temperature CT to filter out the white balance corresponding to the color temperature adjacent or similar to the current color temperature CT from a series of pre-calibrated white balance statistical value mapping matrices The statistical value mapping matrix is then linearly interpolated on the selected white balance statistical value mapping matrix, so as to obtain the white balance statistical value mapping matrix corresponding to the current color temperature CT.
  • the white balance statistical value is based on color separation statistics.
  • the white balance statistics corresponding to each color block of the reference camera are multiplied by the corresponding white balance statistics value mapping matrix to obtain the corresponding color blocks of the target camera.
  • Statistic value of white balance is used to calculate the white balance gain of the target camera on the basis of the calibrated white balance statistical value of the target camera. It should be noted that in the adaptive white balance algorithm, the weight of the white balance statistical value corresponding to the color temperature closer to the current color temperature CT can be assigned a higher weight.
  • determining the white balance statistical value mapping matrix corresponding to the current color temperature may include, for example, the following operations:
  • the white balance statistical value mapping matrix corresponding to the current color temperature is determined based on the white balance statistical value mapping matrix calibrated for the adjacent color temperature.
  • a camera system has two cameras: camera A and camera B.
  • Camera A is the reference camera and camera B is the target camera.
  • adaptive white balance can be used first.
  • the algorithm calculates the white balance gain of camera A, and then uses the adaptive color temperature estimation algorithm to calculate the current color temperature CT 2 corresponding to the white balance gain of the camera A, and then selects the current color temperature CT 2 from the pre-calibrated white balance statistical value mapping matrix.
  • the white balance statistical value mapping matrix corresponding to the adjacent or similar color temperature of the color temperature CT 2 is then linearly interpolated on the selected white balance statistical value mapping matrix to obtain the white balance statistical value mapping matrix corresponding to the current color temperature CT 2.
  • the current color temperature CT 2 is 4000K.
  • the two color temperatures of 3000K and 5000K adjacent to 4000K have been calibrated with two corresponding white balance statistical value mapping matrices.
  • the two white balance statistical value mapping matrices will be selected for use Calculate the white balance statistical value mapping matrix corresponding to the current color temperature CT 2.
  • the white balance statistical value mapping matrix corresponding to 4000K may be, for example, the average of two white balance statistical value mapping matrices corresponding to 3000K and 5000K, respectively.
  • the current color temperature CT 2 is 2000K
  • the existing 3000K color temperature adjacent to 2000K has been calibrated with the corresponding white balance statistical value mapping matrix.
  • the white balance statistical value mapping matrix will be selected for calculation and the current color temperature CT 2 Corresponding white balance statistical value mapping matrix. Since 2000K points are located below 3000K points, the white balance statistical value mapping matrix corresponding to 3000K can be directly used as the white balance statistical value mapping matrix corresponding to 2000K.
  • the current color temperature CT 2 is 6000K
  • the existing 5000K color temperature adjacent to 6000K has been calibrated with the corresponding white balance statistical value mapping matrix.
  • the white balance statistical value mapping matrix will be selected for calculation and the current color temperature CT 2 Corresponding white balance statistical value mapping matrix. Since 6000K points are located above 5000K points, the white balance statistical value mapping matrix corresponding to 5000K can be directly used as the white balance statistical value mapping matrix corresponding to 6000K.
  • the calculation method is similar, except that different target cameras and the reference camera have their respective white balance statistical value mapping matrices, which will not be repeated in this application.
  • each white balance statistical value of the reference camera at the current color temperature for example, assuming a total of 32*32 white balance statistical values, and each white balance statistical value includes G/R and G/B
  • the white balance statistical value mapping matrix multiply each white balance statistical value by the obtained white balance statistical value mapping matrix to obtain the calibrated 32*32 white balance statistical value of the target camera at the current color temperature .
  • these calibrated statistical values are calculated as the input of the adaptive white balance algorithm to obtain the white balance gain of the target camera.
  • the weight of each white balance statistical value can be assigned according to the current color temperature calculated by the reference camera. For example, the closer the color temperature corresponding to the white balance statistical value is to the current color temperature, the higher the weight assigned to the white balance statistical value.
  • the calculation method is similar, except that different target cameras and the reference camera have their respective white balance statistical value mapping matrices, which will not be repeated in this application.
  • calibrating the white balance statistical value mapping matrix at different color temperatures may include, for example, performing the following operations at different color temperatures:
  • a third ratio of the average value of the three RGB channels in the central area of each color block on the second target color card is calculated.
  • a fourth ratio of the average value of the three RGB channels in the central area of each color block on the second target color card is calculated.
  • a white balance statistical value mapping matrix at the corresponding color temperature is determined.
  • the main camera and the sub-camera can be used to shoot Classic Color Checker under different light sources (such as D65, TL84, A and other common light sources and other light sources with adjustable temperature and color).
  • the Rgain and Bgain at and near the corresponding color temperature are used to calculate a white balance statistical value mapping matrix used to characterize the white balance statistical value mapping relationship between the main camera and the secondary camera at the color temperature. It should be noted that when Rgain and Bgain are used to calculate the white balance statistical value mapping matrix, the weights of Rgain and Bgain of common light sources can be configured higher.
  • the method of calculating the white balance statistical value mapping matrix may include a polynomial fitting method, wherein the order of the polynomial is not limited in this application.
  • the "calibration method of the white balance statistical value mapping matrix” is similar to the “calibration method of the white balance gain mapping matrix", the difference is that the white balance card data is used when calibrating the "white balance gain mapping matrix", and When calibrating the "white balance statistical value mapping matrix", the color card data containing multiple color blocks (such as Classic Color Checker color card or Digital SG Color Checker color card) is used. More specifically, the calibration of the "white balance statistical value mapping matrix" uses the data of different color patches on the color card.
  • determining the white balance gain of the target camera at the current color temperature based on the first white balance gain and the second white balance gain may include, for example, the following operations:
  • the first weight of the first white balance gain and the second weight of the second white balance gain are determined.
  • the white balance gain of the target camera at the current color temperature is determined.
  • the current color temperature and the Euclidean distance between the two white balance gains can be adjusted to blend the two white balance gains. Weight, and finally get the white balance gain of each target camera.
  • the first white balance gain is the white balance gain of the target camera obtained by directly mapping the white balance gain of the reference camera.
  • the main error is the accuracy error during the mapping. Although there is an error, it is relatively stable, so it can be used for white balance alignment. Initial positioning.
  • the second white balance gain is to first map the white balance statistics of the reference camera to obtain the white balance statistics of the target camera, and then use the white balance statistics of the target camera as the input of the adaptive white balance algorithm to calculate the target camera.
  • White balance gain value is to first map the white balance statistics of the reference camera to obtain the white balance statistics of the target camera.
  • the adjustment space of the second path is relatively large, and the accuracy of the final white balance gain value of the target camera can be improved through fine adjustment.
  • the fusion result of the two white balance gains can be obtained by weighted average.
  • color alignment in addition to realizing white balance alignment, color alignment can also be realized on this basis.
  • the method may further include, for example, after achieving white balance alignment between each target camera and the reference camera, for each target camera, executing the target camera and the reference camera.
  • the color alignment operation of the camera may further include, for example, after achieving white balance alignment between each target camera and the reference camera, for each target camera, executing the target camera and the reference camera.
  • the color alignment operation may include the following operations, for example:
  • 3DLUT 1 Based on the acquired first color lookup table, determine the color lookup table corresponding to the current color temperature for the reference camera (hereinafter referred to as 3DLUT 1 ), and based on the acquired second color lookup table, determine the color lookup corresponding to the current color temperature for the target camera
  • 3DLUT 2 The table (hereinafter referred to as 3DLUT 2 ) makes the target camera and the reference camera realize color alignment.
  • the color of the reference camera based on the photos and recorded video of 3DLUT 1 and the color of the target camera based on the photos and recorded video of 3DLUT 2 Alignment can be achieved.
  • performing color lookup table calibration on the target camera at different color temperatures includes performing the following operations at different color temperatures:
  • the reference camera is first calibrated with the CCM matrix (color correction matrix), and then the color look-up table is calibrated.
  • the target value can be a target value specified by an international standard, or a user-specified target value (for example, a target value that has been applied to a certain product).
  • the target camera is calibrated with the CCM matrix to align the color gamut of the target camera with the reference camera.
  • the target camera After aligning the color gamut of the target camera with the reference camera, based on the CCM matrix calibrated for the target camera and the color lookup table calibrated for the reference camera, the target camera is calibrated with a color lookup table, so that the color of the reference camera is calibrated at the same temperature
  • the look-up table is aligned with the color look-up table calibrated to the target camera. It should be noted that when calibrating the color lookup table for the target camera, the output value of the reference camera based on its calibrated color lookup table under the same color temperature can be used as the target value.
  • the target camera after the reference camera based on the output value of the calibrated color lookup table as the target value, the target camera is automatically calibrated with the color lookup table at the same color temperature, the target camera and the reference camera
  • the degree of color alignment can reach a higher level, for example, the degree of color alignment can reach 70 or more.
  • the color look-up table of the target camera can also be checked for the reference camera and the target camera.
  • the calibrated color look-up table can be adjusted manually. For example, after manual adjustment, the color alignment can reach more than 90.
  • the parameter range of the output value can be limited, for example, the obtained color search
  • the diagonal of the table is a straight line, so that the displacement between the actual value and the target value does not exceed the displacement threshold, so that the overall brightness of the color does not change, and the mapping distance of each point in the color lookup table does not exceed the preset value, etc. Wait.
  • the reference camera and the target camera may be used to collect the color card images for the same color card under the same environment and illumination. Then, based on the image collected by the reference camera, the CCM matrix calibration of the reference camera is performed and the color gamut is determined. Then for the difference between the actual value and the target value of each color block on the color card (such as on the 24 color card), first convert the RGB space to the LAB space, and then use the optimization algorithm (such as formula 3) in the LAB space to get 3x3 Matrix makes the actual value of each color block on the color card approach the target value.
  • the optimization algorithm such as formula 3
  • the target camera After obtaining the 3x3 matrix of the reference camera, the target camera is calibrated with the same CCM matrix based on the image collected by the target camera, and the same processing is performed on the color card (such as the 24-color card).
  • the target value at this time is replaced with the output value of the aforementioned reference camera based on its calibrated fixed color look-up table under the same color temperature.
  • the 3DLUT calibration of the reference camera includes shooting 24 color cards and 144 color cards, and optimizing the raw data of the shooting through the optimization algorithm to obtain a 16x16x16 RGB domain mapping 3DLUT, that is, the final color of the reference camera and the reference camera's 3DLUT calibration data.
  • the reference camera color After applying 3x3 matrix and 3DLUT on the reference camera, get the reference camera color, extract its RGB value, use the target camera to shoot 24 color cards and 144 color cards, use the 3x3 matrix to process the original data shot by the target camera to get the intermediate color, and then The intermediate color is optimized to obtain the 16x16x16 RGB domain mapping 3DLUT, that is, the final color of the target camera is finally obtained, and the 3DLUT calibration data of the target camera is obtained at the same time.
  • the 3DLUT is linearly interpolated according to different color temperatures.
  • the color temperature calculated based on the white balance gain can be directly used to interpolate the 3DLUT (such as formula 4). Get the same color as the reference camera.
  • FIG. 5 is a block diagram of a camera provided by an embodiment of the application.
  • the camera 500 may include, for example, multiple cameras 510 and a camera alignment device 520.
  • the camera alignment device 520 includes a processor 521 and a memory 522.
  • the memory 522 is used to store instructions, and the processor 521 calls the instructions stored in the memory 522 to perform the following operations: determine a reference camera from a plurality of cameras; determine the white balance gain of the reference camera; The current color temperature corresponding to the balance gain; for one or more target cameras among multiple cameras other than the reference camera, perform the following operations to achieve white balance alignment between each target camera and the reference camera: Determine and current The white balance gain mapping matrix corresponding to the color temperature, where the white balance gain mapping matrix is used to characterize the mapping relationship between the white balance gain of the reference camera and the white balance gain of the target camera at the current color temperature; and the white balance gain of the reference camera Multiply by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
  • the processor is further configured to: determine a white balance statistical value mapping matrix corresponding to the current color temperature, where the white balance statistical value mapping matrix is used to characterize the white balance statistical value of the reference camera at the current color temperature The mapping relationship with the white balance statistics of the target camera; determine the white balance statistics of the reference camera at the current color temperature; multiply the white balance statistics of the reference camera with the white balance statistics mapping matrix to obtain the target camera's white balance statistics A second white balance gain; and determining the white balance gain of the target camera at the current color temperature based on the first white balance gain and the second white balance gain.
  • the processor is further configured to: determine the first weight and the second weight of the first white balance gain based on the current color temperature and the Euclidean distance between the first white balance gain and the second white balance gain. The second weight of the white balance gain; and based on the first white balance gain and the second white balance gain, and the first weight and the second weight, the white balance gain of the target camera at the current color temperature is determined.
  • the processor is further configured to: after achieving white balance alignment between each target camera and the reference camera, for each target camera, perform a color alignment operation between the target camera and the reference camera.
  • the color alignment operation includes: obtaining a first color lookup table calibrated to the reference camera at different color temperatures; obtaining a second color lookup table calibrated to the target camera at different color temperatures, where The first color lookup table calibrated for the target camera and the second color lookup table calibrated for the reference camera under different color temperatures are aligned; based on the obtained first color lookup table, the color lookup table corresponding to the current color temperature is determined for the reference camera , And based on the acquired second color lookup table, determine the color lookup table corresponding to the current color temperature for the target camera, so that the target camera and the reference camera realize color alignment.
  • the processor is also used for different color temperatures: control the reference camera and the target camera to perform image acquisition for the first target color card in the same environment; based on the image data collected by the reference camera, the reference camera The camera is first calibrated by the CCM matrix, and then the color look-up table is calibrated; based on the image data collected by the target camera and the CCM matrix calibrated to the reference camera, the target camera is calibrated with the CCM matrix to align the color gamut of the target camera with the reference camera; and After aligning the color gamut of the target camera with the reference camera, based on the CCM matrix calibrated for the target camera and the color lookup table calibrated for the reference camera, the target camera is calibrated with a color lookup table, so that the color of the reference camera is calibrated at the same temperature The look-up table is aligned with the color look-up table calibrated to the target camera.
  • the processor is further configured to: determine the color temperature adjacent to the current color temperature; determine the white balance gain mapping matrix calibrated for the adjacent color temperature; and determine based on the white balance gain mapping matrix calibrated for the adjacent color temperature The white balance gain mapping matrix corresponding to the current color temperature.
  • the processor is also used under different color temperatures: control the reference camera and the target camera to capture images for the white balance card respectively; calculate the three RGB channels in the central area of the white balance card based on the image data collected by the reference camera Calculate the second ratio of the average value of the three RGB channels in the central area of the white balance card based on the image data collected by the target camera; and determine the second ratio based on the mapping relationship between the first ratio and the second ratio Corresponding to the white balance gain mapping matrix at the color temperature.
  • the processor is further configured to: determine a color temperature adjacent to the current color temperature; determine a white balance statistical value mapping matrix calibrated for the adjacent color temperature; and a white balance statistical value mapping based on the adjacent color temperature calibration The matrix determines the white balance statistical value mapping matrix corresponding to the current color temperature.
  • the processor is also used under different color temperatures: control the reference camera and the target camera to capture images for the second target color card respectively; calculate the color blocks on the second target color card based on the image data collected by the reference camera The third ratio of the average value of the three RGB channels in the central area; the fourth ratio of the average value of the three RGB channels in the central area of each color patch on the second target color card is calculated based on the image data collected by the target camera; and the fourth ratio is based on the second The mapping relationship between the ratio and the fourth ratio determines the white balance statistical value mapping matrix at the corresponding color temperature.
  • An embodiment of the present application also provides a pan/tilt head, which includes the camera described in the foregoing embodiment.
  • the above embodiments it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
  • software it can be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium.
  • Computer instructions can be sent from one website site, computer, server, or data center to another website site, computer via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) , Server or data center for transmission.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

Abstract

Disclosed are a camera alignment method and apparatus. The method comprises: determining a reference camera from a plurality of cameras; determining a white balance gain of the reference camera; determining the current color temperature corresponding to the white balance gain; for one or more target cameras of the other cameras of the plurality of cameras other than the reference camera, performing the following operation to realize white balance alignment between each target camera and the reference camera: determining a white balance gain mapping matrix corresponding to the current color temperature, wherein the white balance gain mapping matrix is used for characterizing a mapping relationship between the white balance gain of the reference camera and a white balance gain of the target camera under the current color temperature; and multiplying the white balance gain of the reference camera by the white balance gain mapping matrix to obtain a first white balance gain of the target camera. According to the present application, the white balance gains of the other cameras are obtained according to the the white balance gain of the reference camera and by means of direct mapping using the white balance gain mapping matrix, thus, the color difference between the other cameras and the reference camera depends on the error in precision during mapping, however, the error in precision during mapping is generally relatively small and relatively stable, and therefore, the camera alignment method used in the present application can ensure that the color difference between different cameras is relatively small and relatively stable.

Description

相机及其对齐方法和装置、云台Camera, alignment method and device thereof, and platform 技术领域Technical field
本申请涉及相机技术领域,尤其涉及一种相机对齐方法、一种相机对齐装置、一种相机、一种云台、一种计算机可读存储介质、一种计算机程序。This application relates to the field of camera technology, in particular to a camera alignment method, a camera alignment device, a camera, a pan-tilt, a computer-readable storage medium, and a computer program.
背景技术Background technique
近年来,支持双摄像头或多摄像头的相机系统越来越多。不同摄像头之间由于镜头、滤光片、光学传感器响应等差异,使得不同摄像头拍摄的照片或视频的颜色存在明显差异。In recent years, more and more camera systems support dual cameras or multiple cameras. Due to differences in the response of lenses, filters, and optical sensors between different cameras, the colors of photos or videos taken by different cameras are significantly different.
发明内容Summary of the invention
本申请实施例提供了一种相机对齐方法及装置,可以解决同一相机系统中不同摄像头拍摄的照片或视频的颜色存在明显差异的技术问题。The embodiments of the present application provide a camera alignment method and device, which can solve the technical problem that the colors of photos or videos taken by different cameras in the same camera system have obvious differences.
第一方面,本申请实施例提供一种相机对齐方法,所述相机具有多个摄像头,所述方法包括:从所述多个摄像头中确定一参考摄像头;确定所述参考摄像头的白平衡增益;确定与所述白平衡增益对应的当前色温;针对所述多个摄像头中除所述参考摄像头之外的其他摄像头中的一个或多个目标摄像头,执行以下操作使每个所述目标摄像头与所述参考摄像头之间实现白平衡对齐:确定与所述当前色温对应的白平衡增益映射矩阵,其中,所述白平衡增益映射矩阵用于表征在所述当前色温下所述参考摄像头的白平衡增益与所述目标摄像头的白平衡增益之间的映射关系;以及使所述参考摄像头的白平衡增益与所述白平衡增益映射矩阵相乘,以得到所述目标摄像头的第一白平衡增益。In a first aspect, an embodiment of the present application provides a camera alignment method, the camera has multiple cameras, and the method includes: determining a reference camera from the multiple cameras; determining a white balance gain of the reference camera; Determine the current color temperature corresponding to the white balance gain; for one or more target cameras among the cameras other than the reference camera in the plurality of cameras, perform the following operations to make each target camera and all White balance alignment between the reference cameras: determining a white balance gain mapping matrix corresponding to the current color temperature, wherein the white balance gain mapping matrix is used to characterize the white balance gain of the reference camera at the current color temperature A mapping relationship with the white balance gain of the target camera; and multiplying the white balance gain of the reference camera by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
第二方面,本申请实施例提供一种相机对齐装置,所述相机具有多个摄 像头,所述装置包括处理器和存储器,所述存储器用于存储指令,所述处理器调用所述存储器中存储的所述指令,用于实现以下操作:从所述多个摄像头中确定一参考摄像头;确定所述参考摄像头的白平衡增益;确定与所述白平衡增益对应的当前色温;针对所述多个摄像头中除所述参考摄像头之外的其他摄像头中的一个或多个目标摄像头,执行以下操作使每个所述目标摄像头与所述参考摄像头之间实现白平衡对齐:确定与所述当前色温对应的白平衡增益映射矩阵,其中,所述白平衡增益映射矩阵用于表征在所述当前色温下所述参考摄像头的白平衡增益与所述目标摄像头的白平衡增益之间的映射关系;以及使所述参考摄像头的白平衡增益与所述白平衡增益映射矩阵相乘,以得到所述目标摄像头的第一白平衡增益。In a second aspect, an embodiment of the present application provides a camera alignment device. The camera has multiple cameras. The device includes a processor and a memory. The memory is used to store instructions. The instruction for implementing the following operations: determining a reference camera from the multiple cameras; determining the white balance gain of the reference camera; determining the current color temperature corresponding to the white balance gain; One or more target cameras in the cameras other than the reference camera, perform the following operations to achieve white balance alignment between each target camera and the reference camera: determine that it corresponds to the current color temperature The white balance gain mapping matrix is used to characterize the mapping relationship between the white balance gain of the reference camera and the white balance gain of the target camera at the current color temperature; and The white balance gain of the reference camera is multiplied by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
第三方面,本申请实施例提供一种相机,包括:多个摄像头;以及上述第二方面任一项所述的相机对齐装置。In a third aspect, an embodiment of the present application provides a camera, including: a plurality of cameras; and the camera alignment device according to any one of the above-mentioned second aspects.
第四方面,本申请实施例提供一种云台,包括:上述第三方面任一项所述的相机。In a fourth aspect, an embodiment of the present application provides a pan/tilt head, including: the camera according to any one of the foregoing third aspects.
第五方面,本申请实施例提供一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得所述计算机执行上述第一方面任一项所述的相机对齐方法。In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, which when run on a computer, cause the computer to execute the camera alignment method according to any one of the first aspects.
第六方面,本申请实施例提供一种包含指令的计算机程序产品,当所述指令在计算机上运行时,使得所述计算机执行上述第一方面任一项所述的相机对齐方法。In a sixth aspect, an embodiment of the present application provides a computer program product containing instructions that, when the instructions are run on a computer, cause the computer to execute the camera alignment method described in any one of the first aspects above.
本申请实施例提供了一种相机对齐方法及装置,根据参考摄像头的白平衡增益,并通过白平衡增益映射矩阵直接进行映射得到其他摄像头的白平衡增益,由此使得其他摄像头与参考摄像头拍摄的照片或视频存在颜色偏差的原因在于映射时的精度误差,而映射时的精度误差通常比较小而且比较稳定,因此本申请采用的相机对齐方法可以保证不同摄像头拍摄的照片或视频的颜色偏差较小而且比较稳定。The embodiments of the present application provide a camera alignment method and device. According to the white balance gain of a reference camera, the white balance gain of other cameras is directly mapped through the white balance gain mapping matrix to obtain the white balance gains of other cameras. The reason for the color deviation of the photo or video is the accuracy error during the mapping, and the accuracy error during the mapping is usually relatively small and relatively stable. Therefore, the camera alignment method adopted in this application can ensure that the color deviation of the photos or videos taken by different cameras is small. And it's relatively stable.
附图说明Description of the drawings
图1A为本申请实施例提供的相机对齐方法的应用场景示意图一;FIG. 1A is a schematic diagram 1 of an application scenario of a camera alignment method provided by an embodiment of this application;
图1B为本申请实施例提供的相机对齐方法的应用场景示意图二;FIG. 1B is a second schematic diagram of an application scenario of the camera alignment method provided by an embodiment of this application;
图2为本申请一实施例提供的相机对齐方法的流程示意图;2 is a schematic flowchart of a camera alignment method provided by an embodiment of the application;
图3A和图3B为本申请一实施例提供的实现白平衡对齐的示意图;3A and 3B are schematic diagrams of realizing white balance alignment provided by an embodiment of the application;
图4为本申请一实施例提供的实现白平衡对齐和色彩对齐的示意图;4 is a schematic diagram of realizing white balance alignment and color alignment provided by an embodiment of the application;
图5为本申请实施例提供的相机的框图。Fig. 5 is a block diagram of a camera provided by an embodiment of the application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
本申请实施例提供的相机对齐方法可以应用于任何需要进行白平衡对齐和色彩对齐的相机对齐过程中,该相机对齐方法具体可以由相机对齐装置执行。该相机对齐装置可以为应用于具有两个摄像头的相机系统的装置,相应的,本申请实施例提供的相机对齐方法的应用场景示意图可以如图1A所示。具体的,该相机对齐装置的处理器可以以相机系统的一个摄像头作为参考摄像头,对该相机系统的另一个摄像头采用本申请实施例提供的相机对齐方法进行处理。The camera alignment method provided in the embodiments of the present application can be applied to any camera alignment process that requires white balance alignment and color alignment, and the camera alignment method can be specifically executed by a camera alignment device. The camera alignment device may be a device applied to a camera system with two cameras. Correspondingly, a schematic diagram of an application scenario of the camera alignment method provided in an embodiment of the present application may be as shown in FIG. 1A. Specifically, the processor of the camera alignment device may use one camera of the camera system as a reference camera, and use the camera alignment method provided in the embodiment of the present application to process the other camera of the camera system.
或者,该相机对齐装置也可以为应用于具有三个及三个以上摄像头的相机系统的装置,相应的,本申请实施例提供的相机对齐方法的应用场景示意图可以如图1B所示(图中示出了三个摄像头的情况)。具体的,该相机对齐装置的处理器可以以相机系统的一个摄像头作为参考摄像头,对该相机系统的其他摄像头采用本申请实施例提供的相机对齐方法进行处理。Alternatively, the camera alignment device may also be a device applied to a camera system with three or more cameras. Correspondingly, a schematic diagram of the application scene of the camera alignment method provided by the embodiment of the present application may be as shown in FIG. 1B (in the figure) The case of three cameras is shown). Specifically, the processor of the camera alignment device may use one camera of the camera system as a reference camera, and process other cameras of the camera system using the camera alignment method provided in the embodiments of the present application.
需要说明的是,图1A和图1B仅为示意图,并不对相机的结构作限定。例如相机还可以包括存储器,用于存储白平衡增益等相关参数。It should be noted that FIGS. 1A and 1B are only schematic diagrams, and do not limit the structure of the camera. For example, the camera may also include a memory for storing related parameters such as white balance gain.
需要说明的是,对于包括该相机对齐装置的设备的类型,本申请实施例可以不做限定,该设备例如可以为智能相机、智能手机、智能机器人、平板电脑等。It should be noted that the type of the device including the camera alignment device may not be limited in the embodiment of the present application. The device may be, for example, a smart camera, a smart phone, a smart robot, a tablet computer, and the like.
本申请实施例提供的相机对齐方法,可以根据参考摄像头的白平衡增益,并通过白平衡增益映射矩阵直接进行映射得到其他摄像头的白平衡增益,由此使得其他摄像头与参考摄像头所拍摄的照片或视频的颜色存在差异的原因在于映射时的精度误差,而映射时的精度误差通常比较小而且比较稳定,因 此本申请采用的相机对齐方法可以保证不同摄像头拍摄的照片或视频的颜色偏差较小而且比较稳定。The camera alignment method provided by the embodiment of the application can directly map the white balance gain of other cameras according to the white balance gain of the reference camera and directly map the white balance gain of other cameras, thereby making the photos taken by the other cameras and the reference camera or The reason for the difference in the color of the video is the accuracy error during the mapping, and the accuracy error during the mapping is usually relatively small and relatively stable. Therefore, the camera alignment method adopted in this application can ensure that the color deviation of photos or videos taken by different cameras is small and relatively stable.
需要说明的是,本申请实施例提供的相机对齐方法,可以应用于相机领域,以及具有相机功能的电子设备等领域,本申请在此不做限定。It should be noted that the camera alignment method provided in the embodiments of the present application can be applied to the field of cameras, electronic devices with camera functions, and other fields, and the present application is not limited herein.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Hereinafter, some embodiments of the present application will be described in detail with reference to the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
图2为本申请一实施例提供的相机对齐方法的流程示意图,本实施例的执行主体可以为相机对齐装置,具体可以为相机对齐装置的处理器。如图2所示,本实施例的方法例如可以应用于具有多个摄像头的相机,且该方法例如可以包括S201至S206。FIG. 2 is a schematic flowchart of a camera alignment method provided by an embodiment of the application. The execution subject of this embodiment may be a camera alignment device, and specifically may be a processor of the camera alignment device. As shown in FIG. 2, the method of this embodiment may be applied to a camera with multiple cameras, for example, and the method may include S201 to S206, for example.
S201,从多个摄像头中确定一参考摄像头。S201: Determine a reference camera from multiple cameras.
在一个实施例中,可以将相机中的任意一个摄像头确定为本申请的参考摄像头,同时将剩余的其他摄像头确定为本申请的目标摄像头。例如,可以将相机中的主摄像头确定为本申请的参考摄像头,同时将副摄像头确定为本申请的目标摄像头。In an embodiment, any one of the cameras may be determined as the reference camera of the application, and the remaining cameras may be determined as the target camera of the application. For example, the main camera in the camera may be determined as the reference camera of the application, and the secondary camera may be determined as the target camera of the application.
在另一个实施例中,可以将用户指定的一个摄像头确定为本申请的参考摄像头,同时将剩余的其他摄像头确定为本申请的目标摄像头。In another embodiment, one camera designated by the user may be determined as the reference camera of the application, and the remaining cameras may be determined as the target camera of the application.
S202,确定参考摄像头的白平衡增益。S202: Determine the white balance gain of the reference camera.
在本公开实施例中,可以利用各种白平衡算法计算参考摄像头的白平衡增益(即白平衡值)。在一个实施例中,例如可以利用自适应白平衡算法计算参考摄像头的白平衡增益。In the embodiments of the present disclosure, various white balance algorithms may be used to calculate the white balance gain (ie, white balance value) of the reference camera. In one embodiment, for example, an adaptive white balance algorithm may be used to calculate the white balance gain of the reference camera.
S203,确定与白平衡增益对应的当前色温。S203: Determine the current color temperature corresponding to the white balance gain.
在本公开实施例中,在S203中,可以利用各种色温估计算法计算与参考摄像头的白平衡增益对应的当前色温(以下简称当前色温CT)。在一个实施例中,例如可以利用自适应色温估计算法计算当前色温。In the embodiment of the present disclosure, in S203, various color temperature estimation algorithms may be used to calculate the current color temperature corresponding to the white balance gain of the reference camera (hereinafter referred to as the current color temperature CT). In one embodiment, for example, an adaptive color temperature estimation algorithm may be used to calculate the current color temperature.
S204,针对多个摄像头中除参考摄像头之外的其他摄像头中的一个或多个目标摄像头,执行以下操作(如S205和S206)使每个目标摄像头与参考摄像头之间实现白平衡对齐。S204: Perform the following operations (such as S205 and S206) for one or more target cameras among the cameras in the plurality of cameras other than the reference camera to achieve white balance alignment between each target camera and the reference camera.
S205,确定与当前色温对应的白平衡增益映射矩阵。S205: Determine a white balance gain mapping matrix corresponding to the current color temperature.
在本公开实施例中,与当前色温对应的白平衡增益映射矩阵用于表征在当前色温下参考摄像头的白平衡增益与目标摄像头的白平衡增益之间的映射 关系。应该理解,在相同色温下,不同目标摄像头与同一参考摄像头之间的白平衡增益映射关系可能相同,也可能不同。In the embodiment of the present disclosure, the white balance gain mapping matrix corresponding to the current color temperature is used to characterize the mapping relationship between the white balance gain of the reference camera and the white balance gain of the target camera at the current color temperature. It should be understood that under the same color temperature, the white balance gain mapping relationship between different target cameras and the same reference camera may be the same or may be different.
在本公开实施例中,在S205之前,可以预先标定用于表征不同色温下参考摄像头的白平衡增益与各目标摄像头的白平衡增益之间的映射关系的一系列白平衡增益矩阵。In the embodiment of the present disclosure, before S205, a series of white balance gain matrices used to characterize the mapping relationship between the white balance gain of the reference camera and the white balance gain of each target camera under different color temperatures may be pre-calibrated.
在S205,可以先利用当前色温CT从预先标定的一系列白平衡增益映射矩阵中筛选出与当前色温CT相邻或者相近的色温对应的白平衡增益映射矩阵,然后对选出的白平衡增益映射矩阵进行线性插值,从而求出与当前色温CT对应的白平衡增益映射矩阵。In S205, the current color temperature CT can be used to filter out the white balance gain mapping matrix corresponding to the color temperature adjacent or similar to the current color temperature CT from a series of pre-calibrated white balance gain mapping matrices, and then map the selected white balance gain The matrix is linearly interpolated to obtain the white balance gain mapping matrix corresponding to the current color temperature CT.
具体地,作为一个可选的实施例,S205例如可以包括如下操作:Specifically, as an optional embodiment, S205 may include the following operations, for example:
确定与当前色温临近的色温。Determine the color temperature close to the current color temperature.
确定针对该临近的色温标定的白平衡增益映射矩阵。Determine the white balance gain mapping matrix calibrated for the adjacent color temperature.
基于针对该临近的色温标定的白平衡增益映射矩阵确定与当前色温对应的白平衡增益映射矩阵。The white balance gain mapping matrix corresponding to the current color temperature is determined based on the white balance gain mapping matrix calibrated for the adjacent color temperature.
例如,一相机系统具有摄像头A和摄像头B两个摄像头,其中以摄像头A为参考摄像头,以摄像头B为目标摄像头,在对摄像头A和摄像头B进行白平衡对齐时,可以先利用自适应白平衡算法计算出摄像头A的白平衡增益,接着利用自适应色温估计算法计算出与该摄像头A的白平衡增益对应的当前色温CT 1,然后从预先标定的白平衡增益映射矩阵中选择与该当前色温CT 1相邻或者相近的色温对应的白平衡增益映射矩阵,进而对选出的白平衡增益映射矩阵进行线性插值,从而求出与当前色温CT 1对应的白平衡增益映射矩阵。 For example, a camera system has two cameras: camera A and camera B. Camera A is the reference camera and camera B is the target camera. When white balance alignment is performed on camera A and camera B, adaptive white balance can be used first. The algorithm calculates the white balance gain of camera A, and then uses the adaptive color temperature estimation algorithm to calculate the current color temperature CT 1 corresponding to the white balance gain of the camera A, and then selects the current color temperature from the pre-calibrated white balance gain mapping matrix The white balance gain mapping matrix corresponding to the adjacent or similar color temperature of CT 1 is then linearly interpolated on the selected white balance gain mapping matrix to obtain the white balance gain mapping matrix corresponding to the current color temperature CT 1.
比如当前色温CT 1为4000K,现有与4000K相邻的3000K和5000K两个色温已标定了对应的两个白平衡增益映射矩阵,该两个白平衡增益映射矩阵将被选出用于计算与当前色温CT 1对应的白平衡增益映射矩阵。并且由于4000K点位于3000K和5000K两点中心,因此与4000K对应的白平衡增益映射矩阵例如可以为分别与3000K和5000K对应的两个白平衡增益映射矩阵的平均。 For example, the current color temperature CT 1 is 4000K. The two color temperatures of 3000K and 5000K adjacent to 4000K have been calibrated with two corresponding white balance gain mapping matrices. The two white balance gain mapping matrices will be selected for calculation and The white balance gain mapping matrix corresponding to the current color temperature CT 1. And since the 4000K point is located at the center of the two points 3000K and 5000K, the white balance gain mapping matrix corresponding to 4000K may be, for example, the average of two white balance gain mapping matrices corresponding to 3000K and 5000K, respectively.
再比如当前色温CT 1为2000K,现有与2000K相邻的3000K一个色温已标定了对应的白平衡增益映射矩阵,该白平衡增益映射矩阵将被选出用于计算与当前色温CT 1对应的白平衡增益映射矩阵。由于2000K点位于3000K点以下,因此可以直接将与3000K对应的白平衡增益映射矩阵作为与2000K对应的白平衡增益映射矩阵。 For another example, the current color temperature CT 1 is 2000K, and the existing 3000K color temperature adjacent to 2000K has been calibrated with the corresponding white balance gain mapping matrix. The white balance gain mapping matrix will be selected for calculating the corresponding current color temperature CT 1 White balance gain mapping matrix. Since 2000K points are located below 3000K points, the white balance gain mapping matrix corresponding to 3000K can be directly used as the white balance gain mapping matrix corresponding to 2000K.
再比如当前色温CT 1为6000K,现有与6000K相邻的5000K一个色温已标定了对应的白平衡增益映射矩阵,该白平衡增益映射矩阵将被选出用于计算与当前色温CT 1对应的白平衡增益映射矩阵。由于6000K点位于5000K点以上,因此可以直接将与5000K对应的白平衡增益映射矩阵作为与6000K对应的白平衡增益映射矩阵。 For another example, the current color temperature CT 1 is 6000K, and the existing 5000K color temperature adjacent to 6000K has been calibrated with the corresponding white balance gain mapping matrix. This white balance gain mapping matrix will be selected for calculating the corresponding current color temperature CT 1 White balance gain mapping matrix. Since 6000K points are located above 5000K points, the white balance gain mapping matrix corresponding to 5000K can be directly used as the white balance gain mapping matrix corresponding to 6000K.
在本公开实施例中,如果存在多个目标摄像头,计算方法类似,只是不同目标摄像头与参考摄像头之间具有各自的白平衡增益映射矩阵,本申请在此不再赘述。In the embodiment of the present disclosure, if there are multiple target cameras, the calculation method is similar, except that different target cameras and the reference camera have respective white balance gain mapping matrices, which will not be repeated in this application.
进一步,在本公开实施例中,在不同色温下标定各目标摄像头与参考摄像头之间的白平衡增益映射矩阵例如可以包括在不同色温下执行以下操作:Further, in the embodiments of the present disclosure, calibrating the white balance gain mapping matrix between each target camera and the reference camera at different color temperatures may include, for example, performing the following operations at different color temperatures:
控制参考摄像头和各目标摄像头分别针对白平衡卡采集图像。Control the reference camera and each target camera to collect images for the white balance card respectively.
基于参考摄像头采集的图像数据计算白平衡卡中心区域的RGB三个通道的平均值的第一比值。The first ratio of the average value of the three RGB channels in the central area of the white balance card is calculated based on the image data collected by the reference camera.
基于各目标摄像头采集的图像数据计算白平衡卡中心区域的RGB三个通道的平均值的第二比值。The second ratio of the average value of the three RGB channels in the central area of the white balance card is calculated based on the image data collected by each target camera.
基于第一比值和与各目标摄像头对应的第二比值之间的映射关系,确定对应色温下用于表征参考摄像头与对应的目标摄像头之间的白平衡增益映射关系的白平衡增益映射矩阵。Based on the mapping relationship between the first ratio and the second ratio corresponding to each target camera, a white balance gain mapping matrix used to characterize the white balance gain mapping relationship between the reference camera and the corresponding target camera at the corresponding color temperature is determined.
以具有主、副两个摄像头的相机系统为例,可以在不同光源下(如D65、TL84、A等常见光源以及其他可调色温色调的光源)使用主摄像头和副摄像头分别拍摄白平衡卡,并分别基于两个摄像头所拍摄的图片计算白平衡卡中心区域的RGB三个通道的平均值的比值,即,Rgain=G/R、Ggain=G/G、Bgain=G/B(或Rgain=R/G,Ggain=G/G,Bgain=B/G)。进而使用对应色温下及该色温附近的Rgain和Bgain计算该色温下用于表征主摄像头与副摄像头之间的白平衡增益映射关系的白平衡增益映射矩阵。需要说明的是,在利用Rgain和Bgain计算白平衡增益映射矩阵时,常见光源的Rgain和Bgain的权重可以配置地更高一些。计算白平衡增益映射矩阵的方法可以包括多项式拟合法,其中本申请不限定多项式的阶数。Taking a camera system with two main and sub-cameras as an example, the main camera and sub-camera can be used to shoot the white balance card separately under different light sources (such as D65, TL84, A and other common light sources and other light sources with adjustable temperature and color). , And calculate the ratio of the average value of the three RGB channels in the central area of the white balance card based on the pictures taken by the two cameras, namely, Rgain=G/R, Ggain=G/G, Bgain=G/B (or Rgain =R/G, Ggain=G/G, Bgain=B/G). Furthermore, the Rgain and Bgain at and near the corresponding color temperature are used to calculate the white balance gain mapping matrix used to characterize the white balance gain mapping relationship between the main camera and the secondary camera at the color temperature. It should be noted that when using Rgain and Bgain to calculate the white balance gain mapping matrix, the weights of Rgain and Bgain of common light sources can be configured to be higher. The method of calculating the white balance gain mapping matrix may include a polynomial fitting method, where the order of the polynomial is not limited in this application.
例如,一相机系统具有摄像头A和摄像头B两个摄像头,其中以摄像头A为参考摄像头,以摄像头B为目标摄像头,在针对摄像头A和摄像头B标定白平衡增益映射矩阵时,可以分别在不同光源下计算摄像头A的Rgain A、Bgain A 以及摄像头B的Rgain B、Bgain B,并使用对应色温下及该色温附近的Rgain和Bgain计算该色温用于表征摄像头A与摄像头B之间的白平衡增益映射关系的白平衡增益映射矩阵(比如要计算4000K对应的白平衡增益映射矩阵,可使用3500K至4500K范围内光源下对应的摄像头A、摄像头B的Rgain和Bgain参与计算,越靠近4000K分配的权重越高)。下面的公式1为一阶多项式拟合(也可以使用更高阶的多项式拟合),可以用于计算本申请的白平衡增益映射矩阵。 For example, a camera system has two cameras: camera A and camera B, where camera A is the reference camera, and camera B is the target camera. When calibrating the white balance gain mapping matrix for camera A and camera B, you can use different light sources. Calculate the Rgain A and Bgain A of camera A and the Rgain B and Bgain B of camera B, and use the Rgain and Bgain at and near the corresponding color temperature to calculate the color temperature to characterize the white balance gain between camera A and camera B The white balance gain mapping matrix of the mapping relationship (for example, to calculate the white balance gain mapping matrix corresponding to 4000K, you can use the Rgain and Bgain of camera A and camera B corresponding to the light source in the range of 3500K to 4500K to participate in the calculation. The closer to the weight assigned to 4000K Higher). The following formula 1 is a first-order polynomial fitting (a higher-order polynomial fitting can also be used), which can be used to calculate the white balance gain mapping matrix of the present application.
公式1:Formula 1:
Figure PCTCN2020089055-appb-000001
Figure PCTCN2020089055-appb-000001
Figure PCTCN2020089055-appb-000002
Figure PCTCN2020089055-appb-000002
Figure PCTCN2020089055-appb-000003
Figure PCTCN2020089055-appb-000003
公式1可写成矩阵形式:Formula 1 can be written in matrix form:
Figure PCTCN2020089055-appb-000004
Figure PCTCN2020089055-appb-000004
因此,本申请的白平衡增益映射矩阵T可通过下式即公式2求得:Therefore, the white balance gain mapping matrix T of the present application can be obtained by the following formula, namely formula 2:
公式2:Formula 2:
Figure PCTCN2020089055-appb-000005
Figure PCTCN2020089055-appb-000005
其中,W为权重矩阵。该权重矩阵为对角矩阵,即在W矩阵的对角线上的每一个值为一个权重值,而每一个权重值对应于一个色温。Among them, W is the weight matrix. The weight matrix is a diagonal matrix, that is, each value on the diagonal of the W matrix is a weight value, and each weight value corresponds to a color temperature.
在本公开实施例中,通过参考摄像头的白平衡增益估计当前的色温,再利用当前的色温和预先标定的白平衡增益映射矩阵计算与当前色温对应的白平衡增益映射矩阵,进而利用参考摄像头的白平衡增益和计算得到的白平衡增益映射矩阵映射出目标摄像头的白平衡增益。由于该种映射方案并不是强依赖于色温的简单的线性映射,而是依赖于白平衡增益映射矩阵的映射,而白平衡增益映射矩阵一方面是针对多个不同的光源标定的,另一方面还可以进行平移、旋转等多种形式的运算,因而依赖于白平衡增益映射矩阵的映射属于复杂的多项式拟合,因此本申请的白平衡增益转换精度更高。In the embodiments of the present disclosure, the current color temperature is estimated by referring to the white balance gain of the camera, and then the current color temperature and the pre-calibrated white balance gain mapping matrix are used to calculate the white balance gain mapping matrix corresponding to the current color temperature, and then the reference camera's white balance gain mapping matrix is calculated. The white balance gain and the calculated white balance gain mapping matrix map the white balance gain of the target camera. Because this kind of mapping scheme is not a simple linear mapping strongly dependent on color temperature, but on the mapping of the white balance gain mapping matrix, and the white balance gain mapping matrix is calibrated for multiple different light sources on the one hand, and on the other hand Various operations such as translation and rotation can also be performed. Therefore, the mapping that depends on the white balance gain mapping matrix is a complex polynomial fitting. Therefore, the white balance gain conversion accuracy of the present application is higher.
此外,由于预先标定的白平衡增益映射矩阵是在不同光源下标定的,因此本申请提供的相机对齐方案的白平衡更加稳定。即,无论是在同温异谱光源下还是在同温同谱光源下,无论是在不同规格的摄像头之间还是在相同规格的摄像头之间,在通过本申请提供的相机对齐方案实现白平衡对齐后,相机系统的多个摄像头所拍摄的照片和视频都不容易出现偏色。In addition, since the pre-calibrated white balance gain mapping matrix is calibrated under different light sources, the white balance of the camera alignment solution provided in this application is more stable. That is, no matter it is under the same temperature and different spectrum light source or under the same temperature and same spectrum light source, whether it is between cameras of different specifications or between cameras of the same specification, white balance is achieved through the camera alignment solution provided by this application. After alignment, the photos and videos taken by the multiple cameras of the camera system are not prone to color cast.
S206,使参考摄像头的白平衡增益与白平衡增益映射矩阵相乘,以得到 目标摄像头的第一白平衡增益。S206: Multiply the white balance gain of the reference camera by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
需要说明的是,在本公开实施例中,除了可以利用如图3A所示的一条通路(以下称为第一通路,即利用白平衡增益映射矩阵)计算目标摄像头的白平衡增益以便使目标摄像头与参考摄像头实现白平衡对齐之外,还可以利用如图3B所示的另一条通路(以下称为第二通路,即利用白平衡统计值映射矩阵)计算目标摄像头的另一白平衡增益,进而对通过两条通路各自计算得到的白平衡增益进行融合,以便使目标摄像头与参考摄像头实现白平衡对齐。It should be noted that in the embodiments of the present disclosure, in addition to a path as shown in FIG. In addition to achieving white balance alignment with the reference camera, another path as shown in FIG. 3B (hereinafter referred to as the second path, that is, using the white balance statistical value mapping matrix) can also be used to calculate another white balance gain of the target camera, and then The white balance gains calculated through the two channels are merged to achieve white balance alignment between the target camera and the reference camera.
需要说明的是,使用双通路融合的方案,由于第一通路可以有效增强白平衡的稳定性,而第二路存在较大的可调空间,因而本申请使得不同摄像头之间的白平衡对齐可以同时兼顾稳定性和可调性。并且,第一通路和第二通路可以分别直接在白平衡增益空间与白平衡统计值空间上进行映射,两种映射都不强依赖于色温,因而可以有效改善不同规格的摄像头在同温异谱光源下存在的偏色的问题。It should be noted that using the dual-channel fusion scheme, since the first channel can effectively enhance the stability of the white balance, while the second channel has a larger adjustable space, this application makes the white balance alignment between different cameras possible. At the same time, stability and adjustability are taken into account. In addition, the first channel and the second channel can be directly mapped on the white balance gain space and the white balance statistical value space respectively. The two mappings are not strongly dependent on the color temperature, so it can effectively improve the different specifications of cameras in the same temperature and different spectrum. The color cast problem under the light source.
在本公开实施例中,第一通路的发明构思在于直接基于参考摄像头的白平衡增益进行映射得到目标摄像头的白平衡增益,其主要误差在于映射时的精度误差,因此误差比较稳定,不会有误差突变的情况。另外,对于目标摄像头由于变焦而形成画面视角变化,进而导致白平衡统计值变化的情况,第一通路给出的白平衡对齐结果并不受影响,可以保持稳定性。即,本申请通过第一通路可以有效解决同一摄像头进行变焦时变焦前后画面变化容易导致颜色跳变的问题。In the embodiment of the present disclosure, the inventive idea of the first path is to directly map the white balance gain of the target camera based on the white balance gain of the reference camera. The main error lies in the accuracy error during the mapping. Therefore, the error is relatively stable and there is no The situation of sudden error. In addition, for the situation where the target camera changes the viewing angle of the screen due to zooming, which results in a change in the white balance statistical value, the white balance alignment result given by the first pass is not affected, and stability can be maintained. That is, this application can effectively solve the problem of color jumps caused by image changes before and after zooming when the same camera is zooming through the first path.
在本公开实施例中,第二通路的发明构思在于基于参考摄像头的白平衡统计值进行映射得到目标摄像头的白平衡统计值,接着将目标摄像头的白平衡统计值作为自适应白平衡算法的输入进行计算得到目标摄像头的白平衡增益。由于自适应白平衡算法中存在许多可调节的参数,因此第二通路的可调空间较大,可以通过调整这些参数来提高白平衡增益的换算精调,进而提高最终的白平衡对齐结果的准确性。In the embodiments of the present disclosure, the inventive concept of the second path is to map the white balance statistics of the target camera based on the white balance statistics of the reference camera, and then use the white balance statistics of the target camera as the input of the adaptive white balance algorithm Calculate the white balance gain of the target camera. Since there are many adjustable parameters in the adaptive white balance algorithm, the second path has a large adjustable space. These parameters can be adjusted to improve the white balance gain conversion precision adjustment, thereby improving the accuracy of the final white balance alignment result sex.
以下将结合具体实施例详细阐述双通路融合的白平衡对齐方案。The white balance alignment scheme of dual-path fusion will be described in detail below in conjunction with specific embodiments.
作为一个可选的实施例,该方法除了包括上述步骤(即第一通路的相关步骤)之外,例如还可以包括如下操作(即第二通路的相关步骤):As an optional embodiment, in addition to the above-mentioned steps (that is, the relevant steps of the first path), the method may also include the following operations (that is, the relevant steps of the second path), for example:
确定与当前色温对应的白平衡统计值映射矩阵。其中,与当前色温对应的白平衡统计值映射矩阵用于表征在当前色温下参考摄像头的白平衡统计值 与各目标摄像头的白平衡统计值之间的映射关系。应该理解,在相同色温下,不同目标摄像头与同一参考摄像头之间的白平衡统计值映射关系可能相同,也可能不同。Determine the white balance statistical value mapping matrix corresponding to the current color temperature. Wherein, the white balance statistical value mapping matrix corresponding to the current color temperature is used to represent the mapping relationship between the white balance statistical value of the reference camera and the white balance statistical value of each target camera at the current color temperature. It should be understood that under the same color temperature, the white balance statistical value mapping relationship between different target cameras and the same reference camera may be the same or may be different.
确定参考摄像头在当前色温下的白平衡统计值。Determine the white balance statistical value of the reference camera at the current color temperature.
使参考摄像头的白平衡统计值与前述步骤确定的与当前色温对应的白平衡统计值映射矩阵相乘,以得到各目标摄像头的第二白平衡增益。The white balance statistical value of the reference camera is multiplied by the white balance statistical value mapping matrix corresponding to the current color temperature determined in the foregoing steps to obtain the second white balance gain of each target camera.
基于第一白平衡增益和对应的第二白平衡增益确定各目标摄像头在当前色温下的白平衡增益。The white balance gain of each target camera at the current color temperature is determined based on the first white balance gain and the corresponding second white balance gain.
在本公开实施例中,在确定与当前色温对应的白平衡统计值映射矩阵之前,可以预先标定用于表征不同色温下参考摄像头的白平衡统计值与各目标摄像头的白平衡统计值之间的映射关系的一系列白平衡统计值映射矩阵。In the embodiments of the present disclosure, before the white balance statistical value mapping matrix corresponding to the current color temperature is determined, the white balance statistical value used to characterize the white balance of the reference camera at different color temperatures and the white balance statistical value of each target camera can be pre-calibrated. A series of white balance statistical value mapping matrix of the mapping relationship.
在确定与当前色温对应的白平衡统计值映射矩阵时,可以先利用当前色温CT从预先标定的一系列白平衡统计值映射矩阵中筛选出与当前色温CT相邻或者相近的色温对应的白平衡统计值映射矩阵,然后对选出的白平衡统计值映射矩阵进行线性插值,从而求出与当前色温CT对应的白平衡统计值映射矩阵。When determining the white balance statistical value mapping matrix corresponding to the current color temperature, you can first use the current color temperature CT to filter out the white balance corresponding to the color temperature adjacent or similar to the current color temperature CT from a series of pre-calibrated white balance statistical value mapping matrices The statistical value mapping matrix is then linearly interpolated on the selected white balance statistical value mapping matrix, so as to obtain the white balance statistical value mapping matrix corresponding to the current color temperature CT.
在本公开实施例中,白平衡统计值是分色块统计的。白平衡统计值例如可以包括Rgain=G/R、Bgain=G/B(或Rgain=R/G、Bgain=B/G;或RGB三通道的平均值,其中RGB三通道的平均值可以转换为Rgain和Bgain)。In the embodiment of the present disclosure, the white balance statistical value is based on color separation statistics. The white balance statistics may include, for example, Rgain=G/R, Bgain=G/B (or Rgain=R/G, Bgain=B/G; or the average value of three RGB channels, where the average value of the three RGB channels can be converted to Rgain and Bgain).
以白平衡统计值为Rgain=G/R、Bgain=G/B为例,将参考摄像头的各色块对应的白平衡统计值乘上对应的白平衡统计值映射矩阵可以得到目标摄像头的各色块对应的白平衡统计值。然后,使用自适应白平衡算法在校准后的目标摄像头的白平衡统计值的基础上计算目标摄像头的白平衡增益。需要说明的是,在自适应白平衡算法中,可以将越接近当前色温CT的色温对应的白平衡统计值的权重分配的越高一些。Taking the white balance statistics as Rgain=G/R and Bgain=G/B as an example, the white balance statistics corresponding to each color block of the reference camera are multiplied by the corresponding white balance statistics value mapping matrix to obtain the corresponding color blocks of the target camera. Statistic value of white balance. Then, an adaptive white balance algorithm is used to calculate the white balance gain of the target camera on the basis of the calibrated white balance statistical value of the target camera. It should be noted that in the adaptive white balance algorithm, the weight of the white balance statistical value corresponding to the color temperature closer to the current color temperature CT can be assigned a higher weight.
具体地,作为一个可选的实施例,确定与当前色温对应的白平衡统计值映射矩阵例如可以包括如下操作:Specifically, as an optional embodiment, determining the white balance statistical value mapping matrix corresponding to the current color temperature may include, for example, the following operations:
确定与当前色温临近的色温。Determine the color temperature close to the current color temperature.
确定针对该临近的色温标定的白平衡统计值映射矩阵。Determine the white balance statistical value mapping matrix calibrated for the adjacent color temperature.
基于针对该临近的色温标定的白平衡统计值映射矩阵确定与当前色温对应的白平衡统计值映射矩阵。The white balance statistical value mapping matrix corresponding to the current color temperature is determined based on the white balance statistical value mapping matrix calibrated for the adjacent color temperature.
例如,一相机系统具有摄像头A和摄像头B两个摄像头,其中以摄像头A为参考摄像头,以摄像头B为目标摄像头,在对摄像头A和摄像头B进行白平衡对齐时,可以先利用自适应白平衡算法计算出摄像头A的白平衡增益,接着利用自适应色温估计算法计算出与该摄像头A的白平衡增益对应的当前色温CT 2,然后从预先标定的白平衡统计值映射矩阵中选择与该当前色温CT 2相邻或者相近的色温对应的白平衡统计值映射矩阵,进而对选出的白平衡统计值映射矩阵进行线性插值,从而求出与当前色温CT 2对应的白平衡统计值映射矩阵。 For example, a camera system has two cameras: camera A and camera B. Camera A is the reference camera and camera B is the target camera. When white balance alignment is performed on camera A and camera B, adaptive white balance can be used first. The algorithm calculates the white balance gain of camera A, and then uses the adaptive color temperature estimation algorithm to calculate the current color temperature CT 2 corresponding to the white balance gain of the camera A, and then selects the current color temperature CT 2 from the pre-calibrated white balance statistical value mapping matrix. The white balance statistical value mapping matrix corresponding to the adjacent or similar color temperature of the color temperature CT 2 is then linearly interpolated on the selected white balance statistical value mapping matrix to obtain the white balance statistical value mapping matrix corresponding to the current color temperature CT 2.
比如当前色温CT 2为4000K,现有与4000K相邻的3000K和5000K两个色温已标定了对应的两个白平衡统计值映射矩阵,该两个白平衡统计值映射矩阵将被选出用于计算与当前色温CT 2对应的白平衡统计值映射矩阵。并且由于4000K点位于3000K和5000K两点中心,因此与4000K对应的白平衡统计值映射矩阵例如可以为与3000K和5000K分别对应的两个白平衡统计值映射矩阵的平均。 For example, the current color temperature CT 2 is 4000K. The two color temperatures of 3000K and 5000K adjacent to 4000K have been calibrated with two corresponding white balance statistical value mapping matrices. The two white balance statistical value mapping matrices will be selected for use Calculate the white balance statistical value mapping matrix corresponding to the current color temperature CT 2. And since the 4000K point is located at the center of the two points 3000K and 5000K, the white balance statistical value mapping matrix corresponding to 4000K may be, for example, the average of two white balance statistical value mapping matrices corresponding to 3000K and 5000K, respectively.
再比如当前色温CT 2为2000K,现有与2000K相邻的3000K一个色温已标定了对应的白平衡统计值映射矩阵,该白平衡统计值映射矩阵将被选出用于计算与当前色温CT 2对应的白平衡统计值映射矩阵。由于2000K点位于3000K点以下,因此可以直接将与3000K对应的白平衡统计值映射矩阵作为与2000K对应的白平衡统计值映射矩阵。 For another example, the current color temperature CT 2 is 2000K, and the existing 3000K color temperature adjacent to 2000K has been calibrated with the corresponding white balance statistical value mapping matrix. The white balance statistical value mapping matrix will be selected for calculation and the current color temperature CT 2 Corresponding white balance statistical value mapping matrix. Since 2000K points are located below 3000K points, the white balance statistical value mapping matrix corresponding to 3000K can be directly used as the white balance statistical value mapping matrix corresponding to 2000K.
再比如当前色温CT 2为6000K,现有与6000K相邻的5000K一个色温已标定了对应的白平衡统计值映射矩阵,该白平衡统计值映射矩阵将被选出用于计算与当前色温CT 2对应的白平衡统计值映射矩阵。由于6000K点位于5000K点以上,因此可以直接将与5000K对应的白平衡统计值映射矩阵作为与6000K对应的白平衡统计值映射矩阵。 For another example, the current color temperature CT 2 is 6000K, and the existing 5000K color temperature adjacent to 6000K has been calibrated with the corresponding white balance statistical value mapping matrix. The white balance statistical value mapping matrix will be selected for calculation and the current color temperature CT 2 Corresponding white balance statistical value mapping matrix. Since 6000K points are located above 5000K points, the white balance statistical value mapping matrix corresponding to 5000K can be directly used as the white balance statistical value mapping matrix corresponding to 6000K.
在本公开实施例中,如果存在多个目标摄像头,计算方法类似,只是不同目标摄像头与参考摄像头之间具有各自的白平衡统计值映射矩阵,本申请在此不再赘述。In the embodiment of the present disclosure, if there are multiple target cameras, the calculation method is similar, except that different target cameras and the reference camera have their respective white balance statistical value mapping matrices, which will not be repeated in this application.
进一步,在确定参考摄像头在当前色温下的白平衡统计值(例如,假设共32*32个白平衡统计值,且每个白平衡统计值包括G/R和G/B)以及与当前色温对应的白平衡统计值映射矩阵之后,将每个白平衡统计值乘上所求得的白平衡统计值映射矩阵,即可得到目标摄像头在当前色温下的校准后的32*32个 白平衡统计值。接着,将这些校准后的统计值作为自适应白平衡算法的输入进行计算,即可得到目标摄像头的白平衡增益。其中,在计算目标摄像头的白平衡增益的自适应白平衡算法中,可以根据参考摄像头计算的当前色温来分配各白平衡统计值的权重。例如与白平衡统计值对应的色温越接近当前色温,该白平衡统计值被分配的权重可以越高。Further, when determining the white balance statistical value of the reference camera at the current color temperature (for example, assuming a total of 32*32 white balance statistical values, and each white balance statistical value includes G/R and G/B) and corresponding to the current color temperature After the white balance statistical value mapping matrix, multiply each white balance statistical value by the obtained white balance statistical value mapping matrix to obtain the calibrated 32*32 white balance statistical value of the target camera at the current color temperature . Then, these calibrated statistical values are calculated as the input of the adaptive white balance algorithm to obtain the white balance gain of the target camera. Among them, in the adaptive white balance algorithm for calculating the white balance gain of the target camera, the weight of each white balance statistical value can be assigned according to the current color temperature calculated by the reference camera. For example, the closer the color temperature corresponding to the white balance statistical value is to the current color temperature, the higher the weight assigned to the white balance statistical value.
在本公开实施例中,如果存在多个目标摄像头,计算方法类似,只是不同目标摄像头与参考摄像头之间具有各自的白平衡统计值映射矩阵,本申请在此不再赘述。In the embodiment of the present disclosure, if there are multiple target cameras, the calculation method is similar, except that different target cameras and the reference camera have their respective white balance statistical value mapping matrices, which will not be repeated in this application.
进一步,在本公开实施例中,在不同色温下标定白平衡统计值映射矩阵例如可以包括不同色温下执行以下操作:Further, in the embodiments of the present disclosure, calibrating the white balance statistical value mapping matrix at different color temperatures may include, for example, performing the following operations at different color temperatures:
控制参考摄像头和各目标摄像头分别针对第二目标色卡采集图像。Control the reference camera and each target camera to collect images for the second target color card respectively.
基于参考摄像头采集的图像数据计算第二目标色卡上各色块中心区域的RGB三个通道的平均值的第三比值。Based on the image data collected by the reference camera, a third ratio of the average value of the three RGB channels in the central area of each color block on the second target color card is calculated.
基于各目标摄像头采集的图像数据计算第二目标色卡上各色块中心区域的RGB三个通道的平均值的第四比值。Based on the image data collected by each target camera, a fourth ratio of the average value of the three RGB channels in the central area of each color block on the second target color card is calculated.
基于第二比值和第四比值之间的映射关系,确定对应色温下的白平衡统计值映射矩阵。Based on the mapping relationship between the second ratio and the fourth ratio, a white balance statistical value mapping matrix at the corresponding color temperature is determined.
以具有主、副两个摄像头的相机系统为例,可以在不同光源下(如D65、TL84、A等常见光源以及其他可调色温色调的光源)使用主摄像头和副摄像头分别拍摄Classic Color Checker色卡或Digital SG Color Checker色卡(或其他色卡),并分别基于这两个摄像头所拍摄的图片计算色卡上各个色块的中心区域的RGB三个通道的平均值的比值,即,Rgain=G/R、Bgain=G/B(或Rgain=R/G,Bgain=B/G)。进而使用对应色温下及该色温附近的Rgain和Bgain计算该色温下用于表征主摄像头与副摄像头之间的白平衡统计值的映射关系的白平衡统计值映射矩阵。需要说明的是,在利用Rgain和Bgain计算白平衡统计值映射矩阵时,常见光源的Rgain和Bgain的权重可以配置地更高一些。计算白平衡统计值映射矩阵的方法可以包括多项式拟合法,其中本申请不限定多项式的阶数。Take a camera system with a main and a sub-camera as an example. The main camera and the sub-camera can be used to shoot Classic Color Checker under different light sources (such as D65, TL84, A and other common light sources and other light sources with adjustable temperature and color). Color card or Digital SG Color Checker color card (or other color card), and calculate the ratio of the average value of the three RGB channels in the central area of each color block on the color card based on the pictures taken by the two cameras, that is, Rgain=G/R, Bgain=G/B (or Rgain=R/G, Bgain=B/G). Furthermore, the Rgain and Bgain at and near the corresponding color temperature are used to calculate a white balance statistical value mapping matrix used to characterize the white balance statistical value mapping relationship between the main camera and the secondary camera at the color temperature. It should be noted that when Rgain and Bgain are used to calculate the white balance statistical value mapping matrix, the weights of Rgain and Bgain of common light sources can be configured higher. The method of calculating the white balance statistical value mapping matrix may include a polynomial fitting method, wherein the order of the polynomial is not limited in this application.
应该理解,“白平衡统计值映射矩阵的标定方法”与“白平衡增益映射矩阵的标定方法”类似,不同之处在于标定“白平衡增益映射矩阵”时使用的是白平衡卡的数据,而标定“白平衡统计值映射矩阵”时使用的是含有多 种色块的色卡数据(如Classic Color Checker色卡或Digital SG Color Checker色卡)。更具体地说,标定“白平衡统计值映射矩阵”使用的是色卡上不同色块区域的数据。It should be understood that the "calibration method of the white balance statistical value mapping matrix" is similar to the "calibration method of the white balance gain mapping matrix", the difference is that the white balance card data is used when calibrating the "white balance gain mapping matrix", and When calibrating the "white balance statistical value mapping matrix", the color card data containing multiple color blocks (such as Classic Color Checker color card or Digital SG Color Checker color card) is used. More specifically, the calibration of the "white balance statistical value mapping matrix" uses the data of different color patches on the color card.
此外,作为一个可选的实施例,基于第一白平衡增益和第二白平衡增益确定目标摄像头在当前色温下的白平衡增益例如可以包括如下操作:In addition, as an optional embodiment, determining the white balance gain of the target camera at the current color temperature based on the first white balance gain and the second white balance gain may include, for example, the following operations:
基于当前色温、以及第一白平衡增益和第二白平衡增益之间的欧式距离,确定第一白平衡增益的第一权重和第二白平衡增益的第二权重。Based on the current color temperature and the Euclidean distance between the first white balance gain and the second white balance gain, the first weight of the first white balance gain and the second weight of the second white balance gain are determined.
基于第一白平衡增益和第二白平衡增益、以及第一权重和第二权重,确定目标摄像头在当前色温下的白平衡增益。Based on the first white balance gain and the second white balance gain, and the first weight and the second weight, the white balance gain of the target camera at the current color temperature is determined.
在本公开实施例中,在通过上述两个通路分别得到两个白平衡增益后,根据当前色温、以及这两个白平衡增益之间的欧式距离可以调整融合这两个白平衡增益所使用的权重,最终得到各目标摄像头的白平衡增益。In the embodiment of the present disclosure, after the two white balance gains are obtained through the above two channels, the current color temperature and the Euclidean distance between the two white balance gains can be adjusted to blend the two white balance gains. Weight, and finally get the white balance gain of each target camera.
例如,这两个白平衡增益之间的欧式距离越大,则可以将第一白平衡增益的权重配置的越高。第一白平衡增益是直接对参考摄像头的白平衡增益进行映射得到的目标摄像头的白平衡增益,其主要误差在于映射时的精度误差,虽然有误差但是比较稳定,因此可以用于白平衡对齐的初步定位。而第二白平衡增益是先对参考摄像头的白平衡统计值进行映射得到目标摄像头的白平衡统计值,再将目标摄像头的白平衡统计值作为自适应白平衡算法的输入进行计算得到的目标摄像头的白平衡增益值。由于自适应白平衡算法中存在许多可调节的参数,因此第二通路的可调空间较大,可以通过精调提高最终得到的目标摄像头的白平衡增益值的准确性。在得到第一白平衡增益和第二白平衡增益的权重后,即可通过加权平均得到这两个白平衡增益的融合结果。For example, the greater the Euclidean distance between the two white balance gains, the higher the weight of the first white balance gain can be configured. The first white balance gain is the white balance gain of the target camera obtained by directly mapping the white balance gain of the reference camera. The main error is the accuracy error during the mapping. Although there is an error, it is relatively stable, so it can be used for white balance alignment. Initial positioning. The second white balance gain is to first map the white balance statistics of the reference camera to obtain the white balance statistics of the target camera, and then use the white balance statistics of the target camera as the input of the adaptive white balance algorithm to calculate the target camera. White balance gain value. Since there are many adjustable parameters in the adaptive white balance algorithm, the adjustment space of the second path is relatively large, and the accuracy of the final white balance gain value of the target camera can be improved through fine adjustment. After the weights of the first white balance gain and the second white balance gain are obtained, the fusion result of the two white balance gains can be obtained by weighted average.
进一步,在本公开实施例中,除了可以实现白平衡对齐之外,还可以在此基础上实现色彩对齐。Further, in the embodiments of the present disclosure, in addition to realizing white balance alignment, color alignment can also be realized on this basis.
具体地,在本公开实施例中,如图4所示,该方法例如还可以包括:在每个目标摄像头与参考摄像头之间实现白平衡对齐后,针对每个目标摄像头,执行目标摄像头与参考摄像头的色彩对齐操作。Specifically, in an embodiment of the present disclosure, as shown in FIG. 4, the method may further include, for example, after achieving white balance alignment between each target camera and the reference camera, for each target camera, executing the target camera and the reference camera. The color alignment operation of the camera.
更具体地,在本公开实施例中,该色彩对齐操作例如可以包括如下操作:More specifically, in the embodiment of the present disclosure, the color alignment operation may include the following operations, for example:
获取在不同色温下对参考摄像头标定的第一颜色查找表(如3DLUT)。Obtain the first color lookup table (such as 3DLUT) calibrated to the reference camera under different color temperatures.
获取在不同色温下对目标摄像头标定的第二颜色查找表,其中,在不同色温下对目标摄像头标定的第一颜色查找表与在不同色温下对参考摄像头标 定的第二颜色查找表已对齐。Obtain a second color lookup table calibrated for the target camera at different color temperatures, where the first color lookup table calibrated for the target camera at different color temperatures is aligned with the second color lookup table calibrated for the reference camera at different color temperatures.
基于获取的第一颜色查找表,针对参考摄像头确定与当前色温对应的颜色查找表(以下称为3DLUT 1),并基于获取的第二颜色查找表,针对目标摄像头确定与当前色温对应的颜色查找表(以下称为3DLUT 2),使得目标摄像头与参考摄像头实现色彩对齐。 Based on the acquired first color lookup table, determine the color lookup table corresponding to the current color temperature for the reference camera (hereinafter referred to as 3DLUT 1 ), and based on the acquired second color lookup table, determine the color lookup corresponding to the current color temperature for the target camera The table (hereinafter referred to as 3DLUT 2 ) makes the target camera and the reference camera realize color alignment.
需要说明的是,在本公开实施例中,在得到3DLUT 1和3DLUT 2后,参考摄像头基于3DLUT 1拍摄的照片和录制的视频的色彩与目标摄像头基于3DLUT 2拍摄的照片和录制的视频的色彩便可实现对齐。 It should be noted that, in the embodiments of the present disclosure, after obtaining 3DLUT 1 and 3DLUT 2 , the color of the reference camera based on the photos and recorded video of 3DLUT 1 and the color of the target camera based on the photos and recorded video of 3DLUT 2 Alignment can be achieved.
进一步,在本公开实施例中,在不同色温下对目标摄像头进行颜色查找表标定包括在不同色温下执行以下操作:Further, in the embodiments of the present disclosure, performing color lookup table calibration on the target camera at different color temperatures includes performing the following operations at different color temperatures:
控制参考摄像头和目标摄像头在相同环境下分别针对第一目标色卡进行图像采集。Control the reference camera and the target camera to perform image collection for the first target color card respectively in the same environment.
基于参考摄像头采集的图像数据,对参考摄像头先进行CCM矩阵(色彩校正矩阵)标定,再进行颜色查找表标定。需要说明的是,在针对参考摄像头标定颜色查找表时,目标值可以使用国际标准规定的目标值,也可以使用用户指定的目标值(例如已经应用在某款产品上的目标值等)。Based on the image data collected by the reference camera, the reference camera is first calibrated with the CCM matrix (color correction matrix), and then the color look-up table is calibrated. It should be noted that when calibrating the color lookup table for the reference camera, the target value can be a target value specified by an international standard, or a user-specified target value (for example, a target value that has been applied to a certain product).
基于目标摄像头采集的图像数据和对参考摄像头标定的CCM矩阵,对目标摄像头进行CCM矩阵标定,以使目标摄像头与参考摄像头对齐色域。Based on the image data collected by the target camera and the CCM matrix calibrated to the reference camera, the target camera is calibrated with the CCM matrix to align the color gamut of the target camera with the reference camera.
在使目标摄像头与参考摄像头对齐色域后,基于对目标摄像头标定的CCM矩阵和对参考摄像头标定的颜色查找表,对目标摄像头进行颜色查找表标定,使得在相同温度下对参考摄像头标定的颜色查找表与对目标摄像头标定的颜色查找表对齐。需要说明的是,在针对目标摄像头标定颜色查找表时,可以将相同色温下参考摄像头基于其已标定的颜色查找表的输出值作为目标值。After aligning the color gamut of the target camera with the reference camera, based on the CCM matrix calibrated for the target camera and the color lookup table calibrated for the reference camera, the target camera is calibrated with a color lookup table, so that the color of the reference camera is calibrated at the same temperature The look-up table is aligned with the color look-up table calibrated to the target camera. It should be noted that when calibrating the color lookup table for the target camera, the output value of the reference camera based on its calibrated color lookup table under the same color temperature can be used as the target value.
需要说明的是,在本公开实施例中,在将参考摄像头基于其已标定的颜色查找表的输出值作为目标值,在相同色温下对目标摄像头自动标定颜色查找表后,目标摄像头与参考摄像头的色彩对齐程度可以达到较高水平,例如色彩对齐程度可以达到70以上。It should be noted that, in the embodiments of the present disclosure, after the reference camera based on the output value of the calibrated color lookup table as the target value, the target camera is automatically calibrated with the color lookup table at the same color temperature, the target camera and the reference camera The degree of color alignment can reach a higher level, for example, the degree of color alignment can reach 70 or more.
为了使参考摄像头和目标摄像头的色彩对齐程度达到更高水平,在另一个可选的实施例中,在基于上述操作自动标定目标摄像头的颜色查找表后,还可以对针对参考摄像头和目标摄像头已标定的颜色查找表进行手动调整。 例如经手动调整后色彩对齐程度可以达到90以上。In order to achieve a higher level of color alignment between the reference camera and the target camera, in another optional embodiment, after the color look-up table of the target camera is automatically calibrated based on the above operation, the color lookup table of the target camera can also be checked for the reference camera and the target camera. The calibrated color look-up table can be adjusted manually. For example, after manual adjustment, the color alignment can reach more than 90.
此外,在本公开实施例中,为了达到更好的色彩对齐效果,在参考摄像头的输出值作为目标摄像头的目标值时,可以对输出值的参数范围进行限制,例如,使所得到的颜色查找表的对角线为直线,使实际值与目标值之间的位移不超出位移阈值,使色彩的整体亮度不发生变化,使颜色查找表中每个点的映射距离不超出预设值,等等。In addition, in the embodiments of the present disclosure, in order to achieve a better color alignment effect, when the output value of the reference camera is used as the target value of the target camera, the parameter range of the output value can be limited, for example, the obtained color search The diagonal of the table is a straight line, so that the displacement between the actual value and the target value does not exceed the displacement threshold, so that the overall brightness of the color does not change, and the mapping distance of each point in the color lookup table does not exceed the preset value, etc. Wait.
具体地,在白平衡对齐的基础上,可以先在相同环境和光照下,使用参考摄像头和目标摄像头分别针对相同的色卡采集色卡图像。然后基于参考摄像头采集的图像对参考摄像头进行CCM矩阵标定并确定色域。进而针对色卡上(如24色卡上)每个色块的实际值和目标值之间的差别,首先将RGB空间转换为LAB空间,然后在LAB空间使用优化算法(如公式3)得到3x3矩阵,使得色卡上每个色块的实际值逼近目标值。Specifically, on the basis of white balance alignment, the reference camera and the target camera may be used to collect the color card images for the same color card under the same environment and illumination. Then, based on the image collected by the reference camera, the CCM matrix calibration of the reference camera is performed and the color gamut is determined. Then for the difference between the actual value and the target value of each color block on the color card (such as on the 24 color card), first convert the RGB space to the LAB space, and then use the optimization algorithm (such as formula 3) in the LAB space to get 3x3 Matrix makes the actual value of each color block on the color card approach the target value.
公式3:Formula 3:
Figure PCTCN2020089055-appb-000006
Figure PCTCN2020089055-appb-000006
在得到参考摄像头的3x3矩阵后,基于目标摄像头采集的图像对目标摄像头进行相同的CCM矩阵标定,并针对色卡(如24色卡)进行相同的处理。其中此时的目标值换成相同色温下前述参考摄像头基于其已标定的定颜色查找表的输出值。After obtaining the 3x3 matrix of the reference camera, the target camera is calibrated with the same CCM matrix based on the image collected by the target camera, and the same processing is performed on the color card (such as the 24-color card). The target value at this time is replaced with the output value of the aforementioned reference camera based on its calibrated fixed color look-up table under the same color temperature.
对参考摄像头进行3DLUT标定包括,拍摄24色卡和144色卡,并通过优化算法对拍摄的原始数据进行优化得到16x16x16的RGB域的映射3DLUT,即得到参考摄像头最终的色彩,同时得到参考摄像头的3DLUT标定数据。The 3DLUT calibration of the reference camera includes shooting 24 color cards and 144 color cards, and optimizing the raw data of the shooting through the optimization algorithm to obtain a 16x16x16 RGB domain mapping 3DLUT, that is, the final color of the reference camera and the reference camera's 3DLUT calibration data.
在参考摄像头上应用3x3矩阵和3DLUT之后,得到参考摄像头色彩,提取其RGB值,使用目标摄像头拍摄24色卡和144色卡,应用3x3矩阵对目标摄像头拍摄的原始数据进行处理得到中间色彩,再对中间色彩进行优化得到16x16x16的RGB域的映射3DLUT,即最终得到目标摄像头最终的色彩,同时得到目标摄像头的3DLUT标定数据。After applying 3x3 matrix and 3DLUT on the reference camera, get the reference camera color, extract its RGB value, use the target camera to shoot 24 color cards and 144 color cards, use the 3x3 matrix to process the original data shot by the target camera to get the intermediate color, and then The intermediate color is optimized to obtain the 16x16x16 RGB domain mapping 3DLUT, that is, the final color of the target camera is finally obtained, and the 3DLUT calibration data of the target camera is obtained at the same time.
之后根据不同的色温对3DLUT进行线性插值,这时由于参考摄像头与目标摄像头的白平衡已经对齐,所以此处可以直接使用基于白平衡增益计算得到的色温对3DLUT进行插值(如公式4)即可得到与参考摄像头相同的色彩。Then the 3DLUT is linearly interpolated according to different color temperatures. At this time, since the white balance of the reference camera and the target camera have been aligned, the color temperature calculated based on the white balance gain can be directly used to interpolate the 3DLUT (such as formula 4). Get the same color as the reference camera.
公式4:Formula 4:
result 3dlut=(hig htemp-ct)*hightemp 3diut+(ct-lowtemp)*lowtemp 3dlut result 3dlut =(hig htemp-ct)* hightemp 3diut +(ct-lowtemp)*lowtemp 3dlut
图5为本申请实施例提供的相机的框图,如图5所示,该相机500例如可以包括:多个摄像头510和相机对齐装置520,进一步该相机对齐装置520包括处理器521和存储器522。FIG. 5 is a block diagram of a camera provided by an embodiment of the application. As shown in FIG. 5, the camera 500 may include, for example, multiple cameras 510 and a camera alignment device 520. Further, the camera alignment device 520 includes a processor 521 and a memory 522.
具体地,存储器522用于存储指令,处理器521调用存储器522中存储的所述指令,用于执行以下操作:从多个摄像头中确定一参考摄像头;确定参考摄像头的白平衡增益;确定与白平衡增益对应的当前色温;针对多个摄像头中除参考摄像头之外的其他摄像头中的一个或多个目标摄像头,执行以下操作使每个目标摄像头与参考摄像头之间实现白平衡对齐:确定与当前色温对应的白平衡增益映射矩阵,其中,白平衡增益映射矩阵用于表征在当前色温下参考摄像头的白平衡增益与目标摄像头的白平衡增益之间的映射关系;以及使参考摄像头的白平衡增益与白平衡增益映射矩阵相乘,以得到目标摄像头的第一白平衡增益。Specifically, the memory 522 is used to store instructions, and the processor 521 calls the instructions stored in the memory 522 to perform the following operations: determine a reference camera from a plurality of cameras; determine the white balance gain of the reference camera; The current color temperature corresponding to the balance gain; for one or more target cameras among multiple cameras other than the reference camera, perform the following operations to achieve white balance alignment between each target camera and the reference camera: Determine and current The white balance gain mapping matrix corresponding to the color temperature, where the white balance gain mapping matrix is used to characterize the mapping relationship between the white balance gain of the reference camera and the white balance gain of the target camera at the current color temperature; and the white balance gain of the reference camera Multiply by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
作为一个可选的实施例,该处理器还用于:确定与当前色温对应的白平衡统计值映射矩阵,其中,白平衡统计值映射矩阵用于表征在当前色温下参考摄像头的白平衡统计值与目标摄像头的白平衡统计值之间的映射关系;确定参考摄像头在当前色温下的白平衡统计值;使参考摄像头的白平衡统计值与白平衡统计值映射矩阵相乘,以得到目标摄像头的第二白平衡增益;以及基于第一白平衡增益和第二白平衡增益确定目标摄像头在当前色温下的白平衡增益。As an optional embodiment, the processor is further configured to: determine a white balance statistical value mapping matrix corresponding to the current color temperature, where the white balance statistical value mapping matrix is used to characterize the white balance statistical value of the reference camera at the current color temperature The mapping relationship with the white balance statistics of the target camera; determine the white balance statistics of the reference camera at the current color temperature; multiply the white balance statistics of the reference camera with the white balance statistics mapping matrix to obtain the target camera's white balance statistics A second white balance gain; and determining the white balance gain of the target camera at the current color temperature based on the first white balance gain and the second white balance gain.
作为一个可选的实施例,该处理器还用于:基于当前色温、以及第一白平衡增益和第二白平衡增益之间的欧式距离,确定第一白平衡增益的第一权重和第二白平衡增益的第二权重;以及基于第一白平衡增益和第二白平衡增益、以及第一权重和第二权重,确定目标摄像头在当前色温下的白平衡增益。As an optional embodiment, the processor is further configured to: determine the first weight and the second weight of the first white balance gain based on the current color temperature and the Euclidean distance between the first white balance gain and the second white balance gain. The second weight of the white balance gain; and based on the first white balance gain and the second white balance gain, and the first weight and the second weight, the white balance gain of the target camera at the current color temperature is determined.
作为一个可选的实施例,该处理器还用于:在每个目标摄像头与参考摄像头之间实现白平衡对齐后,针对每个目标摄像头,执行目标摄像头与参考摄像头的色彩对齐操作。As an optional embodiment, the processor is further configured to: after achieving white balance alignment between each target camera and the reference camera, for each target camera, perform a color alignment operation between the target camera and the reference camera.
作为一个可选的实施例,色彩对齐操作包括:获取在不同色温下对参考摄像头标定的第一颜色查找表;获取在不同色温下对目标摄像头标定的第二颜色查找表,其中,在不同色温下对目标摄像头标定的第一颜色查找表与在不同色温下对参考摄像头标定的第二颜色查找表已对齐;基于获取的第一颜色查找表,针对参考摄像头确定与当前色温对应的颜色查找表,并基于获取 的第二颜色查找表,针对目标摄像头确定与当前色温对应的颜色查找表,使得目标摄像头与参考摄像头实现色彩对齐。As an optional embodiment, the color alignment operation includes: obtaining a first color lookup table calibrated to the reference camera at different color temperatures; obtaining a second color lookup table calibrated to the target camera at different color temperatures, where The first color lookup table calibrated for the target camera and the second color lookup table calibrated for the reference camera under different color temperatures are aligned; based on the obtained first color lookup table, the color lookup table corresponding to the current color temperature is determined for the reference camera , And based on the acquired second color lookup table, determine the color lookup table corresponding to the current color temperature for the target camera, so that the target camera and the reference camera realize color alignment.
作为一个可选的实施例,该处理器还用于在不同色温下:控制参考摄像头和目标摄像头在相同环境下分别针对第一目标色卡进行图像采集;基于参考摄像头采集的图像数据,对参考摄像头先进行CCM矩阵标定,再进行颜色查找表标定;基于目标摄像头采集的图像数据和对参考摄像头标定的CCM矩阵,对目标摄像头进行CCM矩阵标定,以使目标摄像头与参考摄像头对齐色域;以及在使目标摄像头与参考摄像头对齐色域后,基于对目标摄像头标定的CCM矩阵和对参考摄像头标定的颜色查找表,对目标摄像头进行颜色查找表标定,使得在相同温度下对参考摄像头标定的颜色查找表与对目标摄像头标定的颜色查找表对齐。As an optional embodiment, the processor is also used for different color temperatures: control the reference camera and the target camera to perform image acquisition for the first target color card in the same environment; based on the image data collected by the reference camera, the reference camera The camera is first calibrated by the CCM matrix, and then the color look-up table is calibrated; based on the image data collected by the target camera and the CCM matrix calibrated to the reference camera, the target camera is calibrated with the CCM matrix to align the color gamut of the target camera with the reference camera; and After aligning the color gamut of the target camera with the reference camera, based on the CCM matrix calibrated for the target camera and the color lookup table calibrated for the reference camera, the target camera is calibrated with a color lookup table, so that the color of the reference camera is calibrated at the same temperature The look-up table is aligned with the color look-up table calibrated to the target camera.
作为一个可选的实施例,该处理器还用于:确定与当前色温临近的色温;确定针对临近的色温标定的白平衡增益映射矩阵;以及基于针对临近的色温标定的白平衡增益映射矩阵确定与当前色温对应的白平衡增益映射矩阵。As an optional embodiment, the processor is further configured to: determine the color temperature adjacent to the current color temperature; determine the white balance gain mapping matrix calibrated for the adjacent color temperature; and determine based on the white balance gain mapping matrix calibrated for the adjacent color temperature The white balance gain mapping matrix corresponding to the current color temperature.
作为一个可选的实施例,该处理器还用于不同色温下:控制参考摄像头和目标摄像头分别针对白平衡卡采集图像;基于参考摄像头采集的图像数据计算白平衡卡中心区域的RGB三个通道的平均值的第一比值;基于目标摄像头采集的图像数据计算白平衡卡中心区域的RGB三个通道的平均值的第二比值;以及基于第一比值和第二比值之间的映射关系,确定对应色温下的白平衡增益映射矩阵。As an optional embodiment, the processor is also used under different color temperatures: control the reference camera and the target camera to capture images for the white balance card respectively; calculate the three RGB channels in the central area of the white balance card based on the image data collected by the reference camera Calculate the second ratio of the average value of the three RGB channels in the central area of the white balance card based on the image data collected by the target camera; and determine the second ratio based on the mapping relationship between the first ratio and the second ratio Corresponding to the white balance gain mapping matrix at the color temperature.
作为一个可选的实施例,该处理器还用于:确定与当前色温临近的色温;确定针对临近的色温标定的白平衡统计值映射矩阵;以及基于针对临近的色温标定的白平衡统计值映射矩阵确定与当前色温对应的白平衡统计值映射矩阵。As an optional embodiment, the processor is further configured to: determine a color temperature adjacent to the current color temperature; determine a white balance statistical value mapping matrix calibrated for the adjacent color temperature; and a white balance statistical value mapping based on the adjacent color temperature calibration The matrix determines the white balance statistical value mapping matrix corresponding to the current color temperature.
作为一个可选的实施例,该处理器还用于不同色温下:控制参考摄像头和目标摄像头分别针对第二目标色卡采集图像;基于参考摄像头采集的图像数据计算第二目标色卡上各色块中心区域的RGB三个通道的平均值的第三比值;基于目标摄像头采集的图像数据计算第二目标色卡上各色块中心区域的RGB三个通道的平均值的第四比值;以及基于第二比值和第四比值之间的映射关系,确定对应色温下的白平衡统计值映射矩阵。As an optional embodiment, the processor is also used under different color temperatures: control the reference camera and the target camera to capture images for the second target color card respectively; calculate the color blocks on the second target color card based on the image data collected by the reference camera The third ratio of the average value of the three RGB channels in the central area; the fourth ratio of the average value of the three RGB channels in the central area of each color patch on the second target color card is calculated based on the image data collected by the target camera; and the fourth ratio is based on the second The mapping relationship between the ratio and the fourth ratio determines the white balance statistical value mapping matrix at the corresponding color temperature.
应该理解,本实施例提供的相机对齐装置,可以用于执行前述方法实施 例的技术方案,其实现原理和技术效果与方法实施例类似,在此不再赘述。It should be understood that the camera alignment device provided in this embodiment can be used to implement the technical solutions of the foregoing method embodiments, and its implementation principles and technical effects are similar to those of the method embodiments, and will not be repeated here.
本申请实施例还提供了一种云台,包括:上述实施例所述的相机。An embodiment of the present application also provides a pan/tilt head, which includes the camera described in the foregoing embodiment.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者通过计算机可读存储介质进行传输。计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium. Computer instructions can be sent from one website site, computer, server, or data center to another website site, computer via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) , Server or data center for transmission. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present application. Scope.

Claims (24)

  1. 一种相机对齐方法,所述相机具有多个摄像头,其特征在于,所述方法包括:A camera alignment method, the camera having multiple cameras, characterized in that the method includes:
    从所述多个摄像头中确定一参考摄像头;Determining a reference camera from the plurality of cameras;
    确定所述参考摄像头的白平衡增益;Determining the white balance gain of the reference camera;
    确定与所述白平衡增益对应的当前色温;Determining the current color temperature corresponding to the white balance gain;
    针对所述多个摄像头中除所述参考摄像头之外的其他摄像头中的一个或多个目标摄像头,执行以下操作使每个所述目标摄像头与所述参考摄像头之间实现白平衡对齐:For one or more target cameras among the cameras other than the reference camera among the plurality of cameras, perform the following operations to achieve white balance alignment between each of the target cameras and the reference camera:
    确定与所述当前色温对应的白平衡增益映射矩阵,其中,所述白平衡增益映射矩阵用于表征在所述当前色温下所述参考摄像头的白平衡增益与所述目标摄像头的白平衡增益之间的映射关系;以及Determine the white balance gain mapping matrix corresponding to the current color temperature, where the white balance gain mapping matrix is used to characterize the white balance gain of the reference camera and the white balance gain of the target camera at the current color temperature. The mapping relationship between; and
    使所述参考摄像头的白平衡增益与所述白平衡增益映射矩阵相乘,以得到所述目标摄像头的第一白平衡增益。The white balance gain of the reference camera is multiplied by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    确定与所述当前色温对应的白平衡统计值映射矩阵,其中,所述白平衡统计值映射矩阵用于表征在所述当前色温下所述参考摄像头的白平衡统计值与所述目标摄像头的白平衡统计值之间的映射关系;Determine a white balance statistical value mapping matrix corresponding to the current color temperature, wherein the white balance statistical value mapping matrix is used to characterize the white balance statistical value of the reference camera and the white balance of the target camera at the current color temperature. Balance the mapping relationship between statistical values;
    确定所述参考摄像头在所述当前色温下的白平衡统计值;Determining the white balance statistical value of the reference camera at the current color temperature;
    使所述参考摄像头的所述白平衡统计值与所述白平衡统计值映射矩阵相乘,以得到所述目标摄像头的第二白平衡增益;以及Multiplying the white balance statistical value of the reference camera by the white balance statistical value mapping matrix to obtain the second white balance gain of the target camera; and
    基于所述第一白平衡增益和所述第二白平衡增益确定所述目标摄像头在所述当前色温下的白平衡增益。Determine the white balance gain of the target camera at the current color temperature based on the first white balance gain and the second white balance gain.
  3. 根据权利要求2所述的方法,其特征在于,所述基于所述第一白平衡增益和所述第二白平衡增益确定所述目标摄像头在所述当前色温下的白平衡增益,包括:The method according to claim 2, wherein the determining the white balance gain of the target camera at the current color temperature based on the first white balance gain and the second white balance gain comprises:
    基于所述当前色温、以及所述第一白平衡增益和所述第二白平衡增益之间的欧式距离,确定所述第一白平衡增益的第一权重和所述第二白平衡增益的第二权重;以及Based on the current color temperature and the Euclidean distance between the first white balance gain and the second white balance gain, the first weight of the first white balance gain and the second weight of the second white balance gain are determined. Two weights; and
    基于所述第一白平衡增益和所述第二白平衡增益、以及所述第一权重和所述第二权重,确定所述目标摄像头在所述当前色温下的白平衡增益。Based on the first white balance gain and the second white balance gain, and the first weight and the second weight, the white balance gain of the target camera at the current color temperature is determined.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,还包括:在每个所述目标摄像头与所述参考摄像头之间实现白平衡对齐后,针对每个所述目标摄像头,The method according to any one of claims 1 to 3, further comprising: after achieving white balance alignment between each of the target cameras and the reference camera, for each of the target cameras,
    执行目标摄像头与所述参考摄像头的色彩对齐操作。Perform a color alignment operation between the target camera and the reference camera.
  5. 根据权利要求4所述的方法,其特征在于,所述色彩对齐操作包括:The method according to claim 4, wherein the color alignment operation comprises:
    获取在不同色温下对所述参考摄像头标定的第一颜色查找表;Acquiring a first color lookup table calibrated to the reference camera under different color temperatures;
    获取在不同色温下对所述目标摄像头标定的第二颜色查找表,其中,在不同色温下对所述目标摄像头标定的第一颜色查找表与在不同色温下对所述参考摄像头标定的第二颜色查找表已对齐;Acquire a second color lookup table calibrated for the target camera at different color temperatures, wherein the first color lookup table calibrated for the target camera at different color temperatures and the second color lookup table calibrated for the reference camera at different color temperatures The color lookup table is aligned;
    基于获取的第一颜色查找表,针对所述参考摄像头确定与所述当前色温对应的颜色查找表,并基于获取的第二颜色查找表,针对所述目标摄像头确定与所述当前色温对应的颜色查找表,使得所述目标摄像头与所述参考摄像头实现色彩对齐。Based on the acquired first color lookup table, determine the color lookup table corresponding to the current color temperature for the reference camera, and determine the color corresponding to the current color temperature for the target camera based on the acquired second color lookup table The lookup table enables the target camera and the reference camera to achieve color alignment.
  6. 根据权利要求5所述的方法,其特征在于,在不同色温下对所述目标摄像头进行颜色查找表标定包括:在不同色温下,The method of claim 5, wherein the calibration of the color lookup table on the target camera under different color temperatures comprises: under different color temperatures,
    控制所述参考摄像头和所述目标摄像头在相同环境下分别针对第一目标色卡进行图像采集;Controlling the reference camera and the target camera to respectively perform image collection for the first target color card in the same environment;
    基于所述参考摄像头采集的图像数据,对所述参考摄像头先进行CCM矩阵标定,再进行颜色查找表标定;Based on the image data collected by the reference camera, first perform CCM matrix calibration on the reference camera, and then perform color lookup table calibration;
    基于所述目标摄像头采集的图像数据和对所述参考摄像头标定的CCM矩阵,对所述目标摄像头进行CCM矩阵标定,以使所述目标摄像头与所述参考摄像头对齐色域;以及Performing CCM matrix calibration on the target camera based on the image data collected by the target camera and the CCM matrix calibrated for the reference camera, so that the target camera is aligned with the color gamut of the reference camera; and
    在使所述目标摄像头与所述参考摄像头对齐色域后,基于对所述目标摄像头标定的CCM矩阵和对所述参考摄像头标定的颜色查找表,对所述目标摄像头进行颜色查找表标定,使得在相同温度下对所述参考摄像头标定的颜色查找表与对所述目标摄像头标定的颜色查找表对齐。After aligning the color gamut of the target camera with the reference camera, based on the CCM matrix calibrated for the target camera and the color lookup table calibrated for the reference camera, the target camera is calibrated with a color lookup table, so that The color lookup table calibrated for the reference camera at the same temperature is aligned with the color lookup table calibrated for the target camera.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述确定与所述当前色温对应的白平衡增益映射矩阵,包括:The method according to any one of claims 1 to 6, wherein the determining a white balance gain mapping matrix corresponding to the current color temperature comprises:
    确定与所述当前色温临近的色温;Determining a color temperature close to the current color temperature;
    确定针对所述临近的色温标定的白平衡增益映射矩阵;以及Determining a white balance gain mapping matrix calibrated for the adjacent color temperature; and
    基于所述针对临近的色温标定的白平衡增益映射矩阵确定与所述当前色 温对应的白平衡增益映射矩阵。The white balance gain mapping matrix corresponding to the current color temperature is determined based on the white balance gain mapping matrix calibrated for the adjacent color temperature.
  8. 根据权利要求7所述的方法,其特征在于,在不同色温下标定白平衡增益映射矩阵包括:不同色温下,The method according to claim 7, wherein calibrating the white balance gain mapping matrix under different color temperatures comprises: under different color temperatures,
    控制所述参考摄像头和所述目标摄像头分别针对白平衡卡采集图像;Controlling the reference camera and the target camera to collect images for the white balance card respectively;
    基于所述参考摄像头采集的图像数据计算白平衡卡中心区域的RGB三个通道的平均值的第一比值;Calculating a first ratio of the average value of the three RGB channels in the central area of the white balance card based on the image data collected by the reference camera;
    基于所述目标摄像头采集的图像数据计算白平衡卡中心区域的RGB三个通道的平均值的第二比值;以及Calculating the second ratio of the average value of the three RGB channels in the central area of the white balance card based on the image data collected by the target camera; and
    基于所述第一比值和所述第二比值之间的映射关系,确定对应色温下的白平衡增益映射矩阵。Based on the mapping relationship between the first ratio and the second ratio, a white balance gain mapping matrix at the corresponding color temperature is determined.
  9. 根据权利要求2至8中任一项所述的方法,其特征在于,所述确定与所述当前色温对应的白平衡统计值映射矩阵,包括:The method according to any one of claims 2 to 8, wherein the determining a white balance statistical value mapping matrix corresponding to the current color temperature comprises:
    确定与所述当前色温临近的色温;Determining a color temperature close to the current color temperature;
    确定针对所述临近的色温标定的白平衡统计值映射矩阵;以及Determining a white balance statistical value mapping matrix calibrated for the adjacent color temperature; and
    基于所述针对临近的色温标定的白平衡统计值映射矩阵确定与所述当前色温对应的白平衡统计值映射矩阵。A white balance statistical value mapping matrix corresponding to the current color temperature is determined based on the white balance statistical value mapping matrix calibrated for the adjacent color temperature.
  10. 根据权利要求9所述的方法,其特征在于,在不同色温下标定白平衡统计值映射矩阵包括:不同色温下,The method according to claim 9, wherein calibrating the white balance statistical value mapping matrix under different color temperatures comprises: under different color temperatures,
    控制所述参考摄像头和所述目标摄像头分别针对第二目标色卡采集图像;Controlling the reference camera and the target camera to respectively capture images for a second target color card;
    基于所述参考摄像头采集的图像数据计算第二目标色卡上各色块中心区域的RGB三个通道的平均值的第三比值;Calculating a third ratio of the average value of the three RGB channels of the central area of each color block on the second target color card based on the image data collected by the reference camera;
    基于所述目标摄像头采集的图像数据计算第二目标色卡上各色块中心区域的RGB三个通道的平均值的第四比值;以及Calculating the fourth ratio of the average value of the three RGB channels in the central area of each color block on the second target color card based on the image data collected by the target camera; and
    基于所述第二比值和所述第四比值之间的映射关系,确定对应色温下的白平衡统计值映射矩阵。Based on the mapping relationship between the second ratio and the fourth ratio, a white balance statistical value mapping matrix at the corresponding color temperature is determined.
  11. 一种相机对齐装置,所述相机具有多个摄像头,其特征在于,所述装置包括处理器和存储器,所述存储器用于存储指令,所述处理器调用所述存储器中存储的所述指令,用于实现以下操作:A camera alignment device, the camera has a plurality of cameras, wherein the device includes a processor and a memory, the memory is used for storing instructions, and the processor calls the instructions stored in the memory, Used to achieve the following operations:
    从所述多个摄像头中确定一参考摄像头;Determining a reference camera from the plurality of cameras;
    确定所述参考摄像头的白平衡增益;Determining the white balance gain of the reference camera;
    确定与所述白平衡增益对应的当前色温;Determining the current color temperature corresponding to the white balance gain;
    针对所述多个摄像头中除所述参考摄像头之外的其他摄像头中的一个或多个目标摄像头,执行以下操作使每个所述目标摄像头与所述参考摄像头之间实现白平衡对齐:For one or more target cameras among the cameras other than the reference camera among the plurality of cameras, perform the following operations to achieve white balance alignment between each of the target cameras and the reference camera:
    确定与所述当前色温对应的白平衡增益映射矩阵,其中,所述白平衡增益映射矩阵用于表征在所述当前色温下所述参考摄像头的白平衡增益与所述目标摄像头的白平衡增益之间的映射关系;以及Determine the white balance gain mapping matrix corresponding to the current color temperature, where the white balance gain mapping matrix is used to characterize the white balance gain of the reference camera and the white balance gain of the target camera at the current color temperature. The mapping relationship between; and
    使所述参考摄像头的白平衡增益与所述白平衡增益映射矩阵相乘,以得到所述目标摄像头的第一白平衡增益。The white balance gain of the reference camera is multiplied by the white balance gain mapping matrix to obtain the first white balance gain of the target camera.
  12. 根据权利要求11所述的装置,其特征在于,所述处理器还用于:The device according to claim 11, wherein the processor is further configured to:
    确定与所述当前色温对应的白平衡统计值映射矩阵,其中,所述白平衡统计值映射矩阵用于表征在所述当前色温下所述参考摄像头的白平衡统计值与所述目标摄像头的白平衡统计值之间的映射关系;Determine a white balance statistical value mapping matrix corresponding to the current color temperature, wherein the white balance statistical value mapping matrix is used to characterize the white balance statistical value of the reference camera and the white balance of the target camera at the current color temperature. Balance the mapping relationship between statistical values;
    确定所述参考摄像头在所述当前色温下的白平衡统计值;Determining the white balance statistical value of the reference camera at the current color temperature;
    使所述参考摄像头的所述白平衡统计值与所述白平衡统计值映射矩阵相乘,以得到所述目标摄像头的第二白平衡增益;以及Multiplying the white balance statistical value of the reference camera by the white balance statistical value mapping matrix to obtain the second white balance gain of the target camera; and
    基于所述第一白平衡增益和所述第二白平衡增益确定所述目标摄像头在所述当前色温下的白平衡增益。Determine the white balance gain of the target camera at the current color temperature based on the first white balance gain and the second white balance gain.
  13. 根据权利要求12所述的装置,其特征在于,所述处理器还用于:The device according to claim 12, wherein the processor is further configured to:
    基于所述当前色温、以及所述第一白平衡增益和所述第二白平衡增益之间的欧式距离,确定所述第一白平衡增益的第一权重和所述第二白平衡增益的第二权重;以及Based on the current color temperature and the Euclidean distance between the first white balance gain and the second white balance gain, the first weight of the first white balance gain and the second weight of the second white balance gain are determined. Two weights; and
    基于所述第一白平衡增益和所述第二白平衡增益、以及所述第一权重和所述第二权重,确定所述目标摄像头在所述当前色温下的白平衡增益。Based on the first white balance gain and the second white balance gain, and the first weight and the second weight, the white balance gain of the target camera at the current color temperature is determined.
  14. 根据权利要求11至13中任一项所述的装置,其特征在于,所述处理器还用于:在每个所述目标摄像头与所述参考摄像头之间实现白平衡对齐后,针对每个所述目标摄像头,执行目标摄像头与所述参考摄像头的色彩对齐操作。The device according to any one of claims 11 to 13, wherein the processor is further configured to: after achieving white balance alignment between each of the target camera and the reference camera, for each The target camera performs a color alignment operation between the target camera and the reference camera.
  15. 根据权利要求14所述的装置,其特征在于,所述色彩对齐操作包括:The device of claim 14, wherein the color alignment operation comprises:
    获取在不同色温下对所述参考摄像头标定的第一颜色查找表;Acquiring a first color lookup table calibrated to the reference camera under different color temperatures;
    获取在不同色温下对所述目标摄像头标定的第二颜色查找表,其中,在 不同色温下对所述目标摄像头标定的第一颜色查找表与在不同色温下对所述参考摄像头标定的第二颜色查找表已对齐;Acquire a second color lookup table calibrated for the target camera at different color temperatures, wherein the first color lookup table calibrated for the target camera at different color temperatures and the second color lookup table calibrated for the reference camera at different color temperatures The color lookup table is aligned;
    基于获取的第一颜色查找表,针对所述参考摄像头确定与所述当前色温对应的颜色查找表,并基于获取的第二颜色查找表,针对所述目标摄像头确定与所述当前色温对应的颜色查找表,使得所述目标摄像头与所述参考摄像头实现色彩对齐。Based on the acquired first color lookup table, determine the color lookup table corresponding to the current color temperature for the reference camera, and determine the color corresponding to the current color temperature for the target camera based on the acquired second color lookup table The lookup table enables the target camera and the reference camera to achieve color alignment.
  16. 根据权利要求15所述的装置,其特征在于,所述处理器还用于:在不同色温下,The device according to claim 15, wherein the processor is further configured to: under different color temperatures,
    控制所述参考摄像头和所述目标摄像头在相同环境下分别针对第一目标色卡进行图像采集;Controlling the reference camera and the target camera to respectively perform image collection for the first target color card in the same environment;
    基于所述参考摄像头采集的图像数据,对所述参考摄像头先进行CCM矩阵标定,再进行颜色查找表标定;Based on the image data collected by the reference camera, first perform CCM matrix calibration on the reference camera, and then perform color lookup table calibration;
    基于所述目标摄像头采集的图像数据和对所述参考摄像头标定的CCM矩阵,对所述目标摄像头进行CCM矩阵标定,以使所述目标摄像头与所述参考摄像头对齐色域;以及Performing CCM matrix calibration on the target camera based on the image data collected by the target camera and the CCM matrix calibrated for the reference camera, so that the target camera is aligned with the color gamut of the reference camera; and
    在使所述目标摄像头与所述参考摄像头对齐色域后,基于对所述目标摄像头标定的CCM矩阵和对所述参考摄像头标定的颜色查找表,对所述目标摄像头进行颜色查找表标定,使得在相同温度下对所述参考摄像头标定的颜色查找表与对所述目标摄像头标定的颜色查找表对齐。After aligning the color gamut of the target camera with the reference camera, based on the CCM matrix calibrated for the target camera and the color lookup table calibrated for the reference camera, the target camera is calibrated with a color lookup table, so that The color lookup table calibrated for the reference camera at the same temperature is aligned with the color lookup table calibrated for the target camera.
  17. 根据权利要求11至16中任一项所述的装置,其特征在于,所述处理器还用于:The device according to any one of claims 11 to 16, wherein the processor is further configured to:
    确定与所述当前色温临近的色温;Determining a color temperature close to the current color temperature;
    确定针对所述临近的色温标定的白平衡增益映射矩阵;以及Determining a white balance gain mapping matrix calibrated for the adjacent color temperature; and
    基于所述针对临近的色温标定的白平衡增益映射矩阵确定与所述当前色温对应的白平衡增益映射矩阵。The white balance gain mapping matrix corresponding to the current color temperature is determined based on the white balance gain mapping matrix calibrated for the adjacent color temperature.
  18. 根据权利要求17所述的装置,其特征在于,所述处理器还用于:不同色温下,The device according to claim 17, wherein the processor is further configured to: under different color temperatures,
    控制所述参考摄像头和所述目标摄像头分别针对白平衡卡采集图像;Controlling the reference camera and the target camera to collect images for the white balance card respectively;
    基于所述参考摄像头采集的图像数据计算白平衡卡中心区域的RGB三个通道的平均值的第一比值;Calculating a first ratio of the average value of the three RGB channels in the central area of the white balance card based on the image data collected by the reference camera;
    基于所述目标摄像头采集的图像数据计算白平衡卡中心区域的RGB三个 通道的平均值的第二比值;以及Calculating the second ratio of the average value of the three RGB channels in the central area of the white balance card based on the image data collected by the target camera; and
    基于所述第一比值和所述第二比值之间的映射关系,确定对应色温下的白平衡增益映射矩阵。Based on the mapping relationship between the first ratio and the second ratio, a white balance gain mapping matrix at the corresponding color temperature is determined.
  19. 根据权利要求12至18中任一项所述的装置,其特征在于,所述处理器还用于:The device according to any one of claims 12 to 18, wherein the processor is further configured to:
    确定与所述当前色温临近的色温;Determining a color temperature close to the current color temperature;
    确定针对所述临近的色温标定的白平衡统计值映射矩阵;以及Determining a white balance statistical value mapping matrix calibrated for the adjacent color temperature; and
    基于所述针对临近的色温标定的白平衡统计值映射矩阵确定与所述当前色温对应的白平衡统计值映射矩阵。A white balance statistical value mapping matrix corresponding to the current color temperature is determined based on the white balance statistical value mapping matrix calibrated for the adjacent color temperature.
  20. 根据权利要求19所述的装置,其特征在于,所述处理器还用于:不同色温下,The device according to claim 19, wherein the processor is further configured to: under different color temperatures,
    控制所述参考摄像头和所述目标摄像头分别针对第二目标色卡采集图像;Controlling the reference camera and the target camera to respectively capture images for a second target color card;
    基于所述参考摄像头采集的图像数据计算第二目标色卡上各色块中心区域的RGB三个通道的平均值的第三比值;Calculating a third ratio of the average value of the three RGB channels of the central area of each color block on the second target color card based on the image data collected by the reference camera;
    基于所述目标摄像头采集的图像数据计算第二目标色卡上各色块中心区域的RGB三个通道的平均值的第四比值;以及Calculating the fourth ratio of the average value of the three RGB channels in the central area of each color block on the second target color card based on the image data collected by the target camera; and
    基于所述第二比值和所述第四比值之间的映射关系,确定对应色温下的白平衡统计值映射矩阵。Based on the mapping relationship between the second ratio and the fourth ratio, a white balance statistical value mapping matrix at the corresponding color temperature is determined.
  21. 一种相机,包括:A camera including:
    多个摄像头;以及Multiple cameras; and
    权利要求11至20中任一项所述的相机对齐装置。The camera alignment device according to any one of claims 11 to 20.
  22. 一种云台,包括:A pan-tilt, including:
    权利要求21所述的相机。The camera of claim 21.
  23. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算机上运行时,使得所述计算机执行如权利要求1-10任一项所述的相机对齐方法。A computer-readable storage medium, characterized by comprising instructions, which when run on a computer, causes the computer to execute the camera alignment method according to any one of claims 1-10.
  24. 一种包含指令的计算机程序产品,其特征在于,当所述指令在计算机上运行时,使得所述计算机执行如权利要求1-10任一项所述的相机对齐方法。A computer program product containing instructions, characterized in that, when the instructions are run on a computer, the computer is caused to execute the camera alignment method according to any one of claims 1-10.
PCT/CN2020/089055 2020-05-07 2020-05-07 Camera and alignment method and apparatus therefor, and gimbal WO2021223185A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080004936.5A CN112655193A (en) 2020-05-07 2020-05-07 Camera, alignment method and device thereof and cradle head
PCT/CN2020/089055 WO2021223185A1 (en) 2020-05-07 2020-05-07 Camera and alignment method and apparatus therefor, and gimbal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/089055 WO2021223185A1 (en) 2020-05-07 2020-05-07 Camera and alignment method and apparatus therefor, and gimbal

Publications (1)

Publication Number Publication Date
WO2021223185A1 true WO2021223185A1 (en) 2021-11-11

Family

ID=75368412

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/089055 WO2021223185A1 (en) 2020-05-07 2020-05-07 Camera and alignment method and apparatus therefor, and gimbal

Country Status (2)

Country Link
CN (1) CN112655193A (en)
WO (1) WO2021223185A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115272471A (en) * 2022-08-30 2022-11-01 杭州微影软件有限公司 Method, device and equipment for determining optical center position
CN115460391A (en) * 2022-09-13 2022-12-09 浙江大华技术股份有限公司 Image simulation method, image simulation device, storage medium and electronic device
CN117014733A (en) * 2023-10-08 2023-11-07 荣耀终端有限公司 Shooting correction method, device and equipment

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125419A (en) * 2021-11-26 2022-03-01 西安诺瓦星云科技股份有限公司 Camera adjusting method and device in multi-camera system and multi-camera system
CN114449243B (en) * 2022-01-28 2023-12-12 青岛海信移动通信技术有限公司 White balance method and terminal equipment
CN114554170A (en) * 2022-03-08 2022-05-27 三星半导体(中国)研究开发有限公司 Method of multi-sensor white balance synchronization and electronic device using the same
TWI806681B (en) * 2022-06-28 2023-06-21 宏碁股份有限公司 White balance coefficient correction method and electronic device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9100584B1 (en) * 2014-04-18 2015-08-04 Altek Semiconductor Corporation Camera array correction method
US20160182874A1 (en) * 2014-12-22 2016-06-23 Motorola Mobility Llc Multiple Camera Apparatus and Method for Synchronized Auto White Balance
CN106131527A (en) * 2016-07-26 2016-11-16 深圳众思科技有限公司 Dual camera color synchronization method, device and terminal
CN106713887A (en) * 2017-01-03 2017-05-24 捷开通讯(深圳)有限公司 Mobile terminal, and white balance adjustment method
CN107820023A (en) * 2017-11-05 2018-03-20 信利光电股份有限公司 A kind of color synchronous method of multi-cam module
CN107979726A (en) * 2017-11-28 2018-05-01 信利光电股份有限公司 The matching method and full shot of a kind of full shot
CN109218561A (en) * 2018-11-30 2019-01-15 豪威科技(上海)有限公司 The synchronous method and device of multi-cam
CN109672871A (en) * 2017-10-17 2019-04-23 华为技术有限公司 White balance information synchronous method, device and computer-readable medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137272B (en) * 2011-03-21 2012-11-28 西安理工大学 Method for calibrating colors of multiple cameras in open environment
US9247223B2 (en) * 2013-01-25 2016-01-26 Blackberry Limited Reduce operating environment effect using multiple cameras

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9100584B1 (en) * 2014-04-18 2015-08-04 Altek Semiconductor Corporation Camera array correction method
US20160182874A1 (en) * 2014-12-22 2016-06-23 Motorola Mobility Llc Multiple Camera Apparatus and Method for Synchronized Auto White Balance
CN106131527A (en) * 2016-07-26 2016-11-16 深圳众思科技有限公司 Dual camera color synchronization method, device and terminal
CN106713887A (en) * 2017-01-03 2017-05-24 捷开通讯(深圳)有限公司 Mobile terminal, and white balance adjustment method
CN109672871A (en) * 2017-10-17 2019-04-23 华为技术有限公司 White balance information synchronous method, device and computer-readable medium
CN107820023A (en) * 2017-11-05 2018-03-20 信利光电股份有限公司 A kind of color synchronous method of multi-cam module
CN107979726A (en) * 2017-11-28 2018-05-01 信利光电股份有限公司 The matching method and full shot of a kind of full shot
CN109218561A (en) * 2018-11-30 2019-01-15 豪威科技(上海)有限公司 The synchronous method and device of multi-cam

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115272471A (en) * 2022-08-30 2022-11-01 杭州微影软件有限公司 Method, device and equipment for determining optical center position
CN115460391A (en) * 2022-09-13 2022-12-09 浙江大华技术股份有限公司 Image simulation method, image simulation device, storage medium and electronic device
CN115460391B (en) * 2022-09-13 2024-04-16 浙江大华技术股份有限公司 Image simulation method and device, storage medium and electronic device
CN117014733A (en) * 2023-10-08 2023-11-07 荣耀终端有限公司 Shooting correction method, device and equipment
CN117014733B (en) * 2023-10-08 2024-04-12 荣耀终端有限公司 Shooting correction method, device and equipment

Also Published As

Publication number Publication date
CN112655193A (en) 2021-04-13

Similar Documents

Publication Publication Date Title
WO2021223185A1 (en) Camera and alignment method and apparatus therefor, and gimbal
CN110830778B (en) Imaging device color correction method, imaging device color correction device, electronic device and storage medium
US8890974B2 (en) Methods and systems for automatic white balance
US7623160B2 (en) Image processing method, image processing program, image processing apparatus, imaging apparatus, imaging method, and imaging program
US9483849B2 (en) Method and apparatus for controlling camera for color calibration of multi-displays
JP2008504751A (en) Automatic white balance method and apparatus
WO2015109693A1 (en) Method and system for image color calibration
CN111292246A (en) Image color correction method, storage medium, and endoscope
WO2012024163A2 (en) Image capture with identification of illuminant
CN108234971A (en) White balance parameter determines method, white balance adjustment method and device, storage medium, terminal
TW201537982A (en) Image sensing apparatus and color-correction matrix correcting method and look-up table establishing method
WO2019104047A1 (en) Global tone mapping
TW201830337A (en) Method and device for performing automatic white balance on an image
WO2021051307A1 (en) Image color calibration method, camera devices, and image color calibration system
US20150245003A1 (en) White balance compensation method and electronic apparatus using the same
TWI782481B (en) Auto white balance adjusting method and auto white balance adjusting system
WO2022036539A1 (en) Color consistency correction method and device for multiple cameras
US9131200B2 (en) White balance adjusting method with scene detection and device thereof
TW201830335A (en) Method and device for determining an illuminant of an image and for chromatic adaptation of an image
KR101143834B1 (en) Aparatus and metod for controlling auto white balance
KR20160099978A (en) Electronic system and image processing method
CN116233381A (en) Color correction method and device, electronic equipment and storage medium
US20230421916A1 (en) White balance coefficient correction method and electronic device
CN113473101A (en) Color correction method and device, electronic equipment and storage medium
KR100753195B1 (en) Method and device for detecting color temperature

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20934829

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20934829

Country of ref document: EP

Kind code of ref document: A1