WO2023240650A1 - Color correction matrix calibration method and apparatus for camera module - Google Patents

Color correction matrix calibration method and apparatus for camera module Download PDF

Info

Publication number
WO2023240650A1
WO2023240650A1 PCT/CN2022/099623 CN2022099623W WO2023240650A1 WO 2023240650 A1 WO2023240650 A1 WO 2023240650A1 CN 2022099623 W CN2022099623 W CN 2022099623W WO 2023240650 A1 WO2023240650 A1 WO 2023240650A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera module
color correction
reference camera
correction matrix
matrix
Prior art date
Application number
PCT/CN2022/099623
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 PCT/CN2022/099623 priority Critical patent/WO2023240650A1/en
Priority to CN202280004091.9A priority patent/CN117616749A/en
Publication of WO2023240650A1 publication Critical patent/WO2023240650A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Definitions

  • the present disclosure relates to the field of camera technology, and in particular, to a color correction matrix calibration method and device for a camera module.
  • the main way to determine the color correction matrix of a camera module is to select a reference camera module from multiple camera modules of the same model; for the reference camera module, the reference camera module is used to compare the standard color card under various light sources. Shoot and obtain each image; for the image under each light source, process the image according to the image processing strategy, and then perform color space conversion to determine the color correction matrix of the reference camera module; use the color correction matrix as multiple cameras The module's color correction matrix.
  • the present disclosure provides a color correction matrix calibration method and device for a camera module.
  • a color correction matrix calibration method for a camera module includes: determining a plurality of camera modules; wherein the models of the plurality of camera modules are all the same, and One or more of the camera modules have different component parameters; for each camera module, determine the color correction matrix of the camera module according to the spectral response of the camera module; according to a plurality of the camera modules
  • the color correction matrix determines the calibration matrix between the non-reference camera module and the reference camera module among the plurality of camera modules, wherein, based on the calibration matrix, the color correction matrix of the reference camera module occurs When changing, the difference between the color reproduction indicators of the non-reference camera module and the reference camera module is maintained within a preset difference range.
  • the number of color correction matrices of the camera module is multiple, corresponding to different light sources; and based on the color correction matrices of multiple camera modules, multiple cameras are determined.
  • the calibration matrix between the non-reference camera module and the reference camera module in the module includes: for each non-reference camera module in the multiple camera modules, for each light source, obtain the non-reference camera The first color correction matrix of the module under the light source, and the second color correction matrix of the reference camera module under the light source; perform the first color correction matrix and the second color correction matrix. Ratio processing is performed to obtain the calibration matrix between the non-reference camera module and the reference camera module under the light source.
  • the method further includes: for each non-reference camera module, writing the calibration matrix between the non-reference camera module and the reference camera module into the non-reference camera module. In the first memory of the reference camera module, wherein the first memory does not allow changes to the written data; write the color correction matrix of the non-reference camera module into the non-reference camera module. in the second memory.
  • the method further includes: when the color correction matrix of the reference camera module is changed, obtaining the changed color correction matrix of the reference camera module; for each non-reference camera A module that determines the changed color of the non-reference camera module based on the changed color correction matrix of the reference camera module and the calibration matrix between the non-reference camera module and the reference camera module.
  • Correction matrix update the color correction matrix stored in the non-reference camera module according to the changed color correction matrix.
  • the modified color correction matrix of the reference camera module is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image
  • the processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space
  • the module's post-change color correction matrix is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image
  • the processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space
  • the module's post-change color correction matrix is performed by the reference camera module on the standard color card under various light sources.
  • the camera module includes: a lens, a sensor, a back-end image processing chip and software; correspondingly, the component parameters include at least one of the following: lens parameters, sensor parameters, rear End image processing chip parameters and soft board parameters.
  • a color correction matrix calibration device for a camera module.
  • the device includes: a first determination module for determining a plurality of camera modules; wherein a plurality of the cameras The models of the modules are all the same, and the component parameters of one or more of the camera modules are different; the second determination module is used to determine the camera for each camera module according to the spectral response of the camera module.
  • the color correction matrix of the module; the third determination module is used to determine the calibration between the non-reference camera module and the reference camera module in the plurality of camera modules according to the color correction matrix of the plurality of camera modules.
  • Matrix wherein, based on the calibration matrix, when the color correction matrix of the reference camera module is changed, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained at a preset value. within the difference range.
  • the number of color correction matrices of the camera module is multiple, corresponding to different light sources; the third determination module is specifically configured to target each of the plurality of camera modules.
  • a non-reference camera module for each light source, obtain the first color correction matrix of the non-reference camera module under the light source, and the second color correction matrix of the reference camera module under the light source. ; Perform ratio processing on the first color correction matrix and the second color correction matrix to obtain a calibration matrix between the non-reference camera module and the reference camera module under the light source.
  • the device further includes: a writing module, configured to write, for each non-reference camera module, the calibration matrix between the non-reference camera module and the reference camera module. , written into the first memory of the non-reference camera module, wherein the first memory does not allow changes to the written data; write the color correction matrix of the non-reference camera module into the in the secondary memory of the non-reference camera module.
  • a writing module configured to write, for each non-reference camera module, the calibration matrix between the non-reference camera module and the reference camera module. , written into the first memory of the non-reference camera module, wherein the first memory does not allow changes to the written data; write the color correction matrix of the non-reference camera module into the in the secondary memory of the non-reference camera module.
  • the device further includes: an acquisition module, a fourth determination module and an update module; wherein the acquisition module is configured to: when the color correction matrix of the reference camera module changes, Obtain the changed color correction matrix of the reference camera module; the fourth determination module is used for each non-reference camera module, according to the changed color correction matrix of the reference camera module, and the non-reference camera module
  • the calibration matrix between the reference camera module and the reference camera module is used to determine the changed color correction matrix of the non-reference camera module;
  • the update module is used to calculate the modified color correction matrix according to the changed color correction matrix.
  • the color correction matrix stored in the non-reference camera module is updated.
  • the modified color correction matrix of the reference camera module is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image
  • the processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space
  • the module's post-change color correction matrix is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image
  • the processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space
  • the module's post-change color correction matrix is performed by the reference camera module on the standard color card under various light sources.
  • the camera module includes: a lens, a sensor, a back-end image processing chip and software; correspondingly, the component parameters include at least one of the following: lens parameters, sensor parameters, rear End image processing chip parameters and soft board parameters.
  • an electronic device including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to Implement the color correction matrix calibration method of the camera module as described above.
  • a non-transitory computer-readable storage medium which when instructions in the storage medium are executed by a processor, enables the processor to execute the above-described camera module. Color correction matrix calibration method.
  • the camera is determined according to the spectral response of the camera module.
  • the color correction matrix of the module based on the color correction matrices of multiple camera modules, determine the calibration matrix between the non-reference camera module and the reference camera module in the multiple camera modules, where, based on the calibration matrix, in the reference camera
  • the color correction matrix of the module changes, the difference between the color reproduction indicators of the non-reference camera module and the reference camera module is maintained within the preset difference range, so that the color correction matrix of the reference camera module changes.
  • different color correction matrices for camera modules of the same model and different component parameters can be accurately and quickly determined to ensure consistent color restoration effects of different camera modules.
  • Figure 1 is a flow chart of a color correction matrix calibration method of a camera module according to an embodiment of the present disclosure
  • Figure 2 is a flow chart of a color correction matrix calibration method of a camera module according to another embodiment of the present disclosure
  • Figure 3 is a schematic structural diagram of a color correction matrix calibration device of a camera module according to an embodiment of the present disclosure
  • FIG. 4 is a structural block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
  • FIG. 1 is a flow chart of a color correction matrix calibration method of a camera module according to an embodiment of the present disclosure. It should be noted that the color correction matrix calibration method of the camera module in this embodiment is executed by the color correction matrix calibration device of the camera module.
  • the color correction matrix calibration device of the camera module can be implemented by software and/or hardware.
  • the color correction matrix calibration device of the camera module can be configured in an electronic device, which can include a terminal device with a camera such as a mobile terminal (such as a mobile phone), a tablet computer, or a camera device.
  • the following description takes the execution subject as an electronic device as an example.
  • the method includes the following steps:
  • Step 101 Determine multiple camera modules; wherein the models of the multiple camera modules are the same, and one or more camera modules have different component parameters.
  • the camera module mainly consists of the following components: lens, sensor, backend image processing chip (Backend IC), and flexible circuit board (FPC).
  • the lens is used to focus the light to the sensor.
  • Sensors are used to convert light signals into electrical signals.
  • the back-end image processing chip is used for image processing of images in the form of electrical signals.
  • the soft board is used to carry the back-end image processing chip.
  • the component parameters may include at least one of the following: lens parameters, sensor parameters, back-end image processing chip parameters, and soft board parameters.
  • the models of multiple camera modules are the same, which means that the models of corresponding components in the multiple camera modules are the same.
  • the lens model of one camera module is different from that of another camera module.
  • the lenses in the group are of the same model.
  • the component parameters of one or more camera modules are different, which means that the component parameters of some camera modules in multiple camera modules are different, and the component parameters of some camera modules are the same; or, all camera modules in multiple camera modules The component parameters are different.
  • the different component parameters of two camera modules it means that some component parameters in the two camera modules are the same and some component parameters are different; or, all component parameters in the two camera modules are different. For example, the parameters of the lenses in the two camera modules are different. This difference is caused by errors in the manufacturing process or production line production during the lens manufacturing process.
  • all possible component parameters of the component can be determined; and then for each component, one possible component parameter of each component is combined to obtain multiple combinations, That is, multiple camera modules with the same model and different component parameters.
  • Step 102 For each camera module, determine the color correction matrix of the camera module according to the spectral response of the camera module.
  • the method of obtaining the spectral response of the camera module may be to obtain the spectral response obtained by performing spectral measurement on the camera module with a spectrometer; or, calling the spectrometer to perform spectral measurement on the camera module to obtain the spectral response of the camera module. spectral response.
  • the camera module has a spectral response corresponding to each light source.
  • the image processing process of the captured image by the camera module can be, for example, performing Demosaic color interpolation processing and automatic white balance AWB processing on the captured RAW color space image to obtain an RGB color space image;
  • the image is converted using a color correction matrix to obtain an image in the sRGB color space;
  • the image in the sRGB color space is sequentially subjected to CV processing and 2DLut processing to obtain an image in the HSV color space, and then subsequent display processing is performed.
  • the color correction matrix is used to convert the image in the RGB color space to obtain the image in the sRGB color space.
  • Step 103 Determine the calibration matrix between the non-reference camera module and the reference camera module in the multiple camera modules based on the color correction matrices of the multiple camera modules, wherein based on the calibration matrix, the color of the reference camera module When the correction matrix is changed, the difference between the color reproduction indicators of the non-reference camera module and the reference camera module remains within the preset difference range.
  • one camera module in order to reduce the number of calibration matrices, one camera module can be selected from multiple camera modules as a reference camera module.
  • the reference camera module can be a golden camera among the multiple camera modules. Mods.
  • the number of color correction matrices of the camera module is multiple, corresponding to different light sources.
  • the process of the electronic device performing step 103 may be, for example, the process of determining the calibration matrix between the non-reference camera module and the reference camera module, for example, for each non-reference camera module in the plurality of camera modules. , for each light source, obtain the first color correction matrix of the non-reference camera module under the light source, and the second color correction matrix of the reference camera module under the light source; perform the first color correction matrix and the second color correction matrix Ratio processing is performed to obtain the calibration matrix between the non-reference camera module and the reference camera module under the light source.
  • a non-reference camera module can have multiple calibration matrices, and the number of calibration matrices is consistent with the number of light sources. It should be noted that the light sources here are multiple prescribed standard light sources.
  • the difference position between the color restoration indicators of the non-reference camera module and the reference camera module is within the preset difference range, which means based on the calibration matrix and the color correction matrix of the reference camera module.
  • the color correction matrix of the non-reference camera module can be determined; based on the color correction matrix, the non-reference camera module performs image processing (including color restoration processing) on the captured image to obtain the first color restoration of the image Index; refer to the second color restoration index of the image obtained by performing image processing on the captured image by the camera module; the difference between the first color restoration index and the second color restoration index is maintained within the preset difference range.
  • the electronic device may also perform the following process: for each non-reference camera module, write the calibration matrix between the non-reference camera module and the reference camera module into the non-reference camera module.
  • the first memory does not allow modification of the written data; write the color correction matrix of the non-reference camera module into the second memory of the non-reference camera module.
  • the first memory may be, for example, an OTP (One Time Programmable) type memory, which can only be programmed once. In other words, after programs or data are written to this type of memory, they cannot be changed or cleared again, thus ensuring the security of important data in the camera module.
  • OTP One Time Programmable
  • the color correction matrix calibration method of the camera module determines multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more camera modules are different; for each determine the color correction matrix of the camera module based on the spectral response of the camera module; determine the non-reference camera module and the reference camera module among the multiple camera modules based on the color correction matrices of multiple camera modules wherein, based on the calibration matrix, when the color correction matrix of the reference camera module changes, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained within the preset difference range , so that when the color correction matrix of the reference camera module changes, it can be combined with the calibration matrix to accurately and quickly determine the different color correction matrices of the same model of camera modules with different component parameters, ensuring that the color restoration effects of different camera modules are consistent.
  • FIG. 2 is a flow chart of a color correction matrix calibration method of a camera module according to another embodiment of the present disclosure.
  • the calibration matrix between the non-reference camera module and the reference camera module is written into the non-reference camera module In the first memory; after writing the color correction matrix of the non-reference camera module into the second memory of the non-reference camera module, the electronic device can also perform the following steps:
  • Step 201 When the color correction matrix of the reference camera module changes, obtain the changed color correction matrix of the reference camera module.
  • the modified color correction matrix of the reference camera module is determined based on the images captured by the reference camera module on the standard color card under various light sources; and the images are processed according to the specified image processing strategy. , obtain an image in the sRGB color space; perform color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determine the changed color correction matrix of the reference camera module based on the image in the Lab color space.
  • the standard color card may be, for example, a ColorChecker standard color card.
  • changes in the color correction matrix of the reference camera module can indicate changes in the image processing strategy, for example, changes in Demosaic color interpolation processing, changes in automatic white balance AWB processing, etc.
  • Step 202 For each non-reference camera module, determine the modified color correction matrix of the non-reference camera module based on the modified color correction matrix of the reference camera module and the calibration matrix between the non-reference camera module and the reference camera module. Color correction matrix.
  • the electronic device performs step 202, for example, by multiplying the changed color correction matrix and the calibration matrix of the reference camera module.
  • the resulting matrix is the changed color of the non-reference camera module. correction matrix.
  • the calculation formula of the color correction matrix after the change of the non-reference camera module can be as shown in the following formula (1):
  • M limit represents the changed color correction matrix of the non-reference camera module
  • M golden represents the changed color correction matrix of the reference camera module
  • H represents the calibration matrix between the non-reference camera module and the reference camera module.
  • Step 203 Update the color correction matrix stored in the non-reference camera module according to the changed color correction matrix.
  • the color correction matrix calibration method of the camera module determines multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more camera modules are different; for each determine the color correction matrix of the camera module based on the spectral response of the camera module; determine the non-reference camera module and the reference camera module among the multiple camera modules based on the color correction matrices of multiple camera modules calibration matrix between; when the color correction matrix of the reference camera module changes, obtain the changed color correction matrix of the reference camera module; for each non-reference camera module, perform color correction according to the changed color of the reference camera module matrix, and the calibration matrix between the non-reference camera module and the reference camera module to determine the changed color correction matrix of the non-reference camera module; based on the changed color correction matrix, correct the color stored in the non-reference camera module
  • the matrix is updated, so that when the color correction matrix of the reference camera module changes, the calibration matrix can be combined with the calibration matrix to accurately and quickly determine the different color correction matrices of
  • FIG. 3 is a schematic structural diagram of a color correction matrix calibration device of a camera module according to an embodiment of the present disclosure.
  • the color correction matrix calibration device of the camera module may include: a first determination module 301, a second determination module 302 and a third determination module 303;
  • the first determination module 301 is used to determine multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more of the camera modules are different;
  • the second determination module 302 is configured to determine, for each camera module, the color correction matrix of the camera module according to the spectral response of the camera module;
  • the third determination module 303 is configured to determine the calibration matrix between the non-reference camera module and the reference camera module in the plurality of camera modules according to the color correction matrices of the plurality of camera modules, wherein based on the According to the calibration matrix, when the color correction matrix of the reference camera module is changed, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained within a preset difference range.
  • the number of color correction matrices of the camera module is multiple, corresponding to different light sources; the third determination module 303 is specifically used for For each non-reference camera module in the plurality of camera modules, for each light source, obtain the first color correction matrix of the non-reference camera module under the light source, and the reference camera module under The second color correction matrix under the light source; performing ratio processing on the first color correction matrix and the second color correction matrix to obtain the non-reference camera module and the reference camera module under the light source calibration matrix between.
  • the device further includes: a writing module, configured to write, for each non-reference camera module, the calibration matrix between the non-reference camera module and the reference camera module. , written into the first memory of the non-reference camera module, wherein the first memory does not allow changes to the written data; write the color correction matrix of the non-reference camera module into the in the secondary memory of the non-reference camera module.
  • a writing module configured to write, for each non-reference camera module, the calibration matrix between the non-reference camera module and the reference camera module. , written into the first memory of the non-reference camera module, wherein the first memory does not allow changes to the written data; write the color correction matrix of the non-reference camera module into the in the secondary memory of the non-reference camera module.
  • the device further includes: an acquisition module, a fourth determination module and an update module; wherein the acquisition module is configured to: when the color correction matrix of the reference camera module changes, Obtain the modified color correction matrix of the reference camera module; the fourth determination module is used for each non-reference camera module, according to the modified color correction matrix of the reference camera module, and the non-reference camera module
  • the calibration matrix between the reference camera module and the reference camera module is used to determine the changed color correction matrix of the non-reference camera module;
  • the update module is used to calculate the modified color correction matrix according to the changed color correction matrix.
  • the color correction matrix stored in the non-reference camera module is updated.
  • the modified color correction matrix of the reference camera module is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image
  • the processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space
  • the module's post-change color correction matrix is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image
  • the processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space
  • the module's post-change color correction matrix is performed by the reference camera module on the standard color card under various light sources.
  • the camera module includes: a lens, a sensor, a back-end image processing chip and software; correspondingly, the component parameters include at least one of the following: lens parameters, sensor parameters, rear End image processing chip parameters and soft board parameters.
  • the color correction matrix calibration device of the camera module determines multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more camera modules are different; for each determine the color correction matrix of the camera module based on the spectral response of the camera module; determine the non-reference camera module and the reference camera module among the multiple camera modules based on the color correction matrices of multiple camera modules wherein, based on the calibration matrix, when the color correction matrix of the reference camera module changes, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained within the preset difference range , so that when the color correction matrix of the reference camera module changes, it can be combined with the calibration matrix to accurately and quickly determine the different color correction matrices of the same model of camera modules with different component parameters, ensuring that the color restoration effects of different camera modules are consistent.
  • an electronic device including: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement the above camera module Color correction matrix calibration method.
  • the present disclosure also proposes a storage medium.
  • the electronic device When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the above method.
  • the present disclosure also provides a computer program product.
  • the electronic device when the computer program product is executed by the processor of the electronic device, the electronic device can perform the above method.
  • FIG. 4 is a structural block diagram of an electronic device according to an exemplary embodiment.
  • the electronic device shown in FIG. 4 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 1000 includes a processor 111, which can be loaded into a random access memory (RAM, Random Access Memory) 113 according to a program stored in a read-only memory (ROM, Read Only Memory) 112 or from a memory 116 perform various appropriate actions and processing according to the program in it.
  • RAM random access memory
  • ROM Read Only Memory
  • RAM random access memory
  • various programs and data required for the operation of the electronic device 1000 are also stored.
  • the processor 111, ROM 112 and RAM 113 are connected to each other through a bus 114.
  • An input/output (I/O, Input/Output) interface 115 is also connected to bus 114 .
  • the following components are connected to the I/O interface 115: a memory 116 including a hard disk, etc.; and a communication section 117 including a network interface card such as a Local Area Network (LAN) card, a modem, etc., which is executed via a network such as the Internet. Communication processing; driver 118 is also connected to I/O interface 115 as needed.
  • a memory 116 including a hard disk, etc.
  • a communication section 117 including a network interface card such as a Local Area Network (LAN) card, a modem, etc., which is executed via a network such as the Internet.
  • Communication processing driver 118 is also connected to I/O interface 115 as needed.
  • embodiments of the present disclosure include a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program can be downloaded and installed from the network via the communication section 117 .
  • the computer program is executed by the processor 111, the above-described functions defined in the method of the present disclosure are performed.
  • a storage medium including instructions such as a memory including instructions, which can be executed by the processor 111 of the electronic device 1000 to complete the above method is also provided.
  • the storage medium may be a non-transitory computer-readable storage medium.
  • the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. .
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Color Image Communication Systems (AREA)

Abstract

A color correction matrix calibration method and apparatus for a camera module. The method comprises: determining a plurality of camera modules, wherein the models of the plurality of camera modules are the same, and component parameters of one or more camera modules are different; with regard to each camera module, determining a color correction matrix of the camera module according to a spectral response of the camera module; and according to color correction matrixes of the plurality of camera modules, determining a calibration matrix between a non-reference camera module and a reference camera module from among the plurality of camera modules, wherein on the basis of the calibration matrix, when the color correction matrix of the reference camera module is changed, the difference between color restoration indexes of the non-reference camera module and the reference camera module is maintained within a preset difference range.

Description

相机模组的色彩校正矩阵标定方法及装置Color correction matrix calibration method and device for camera module 技术领域Technical field
本公开涉及相机技术领域,尤其涉及一种相机模组的色彩校正矩阵标定方法及装置。The present disclosure relates to the field of camera technology, and in particular, to a color correction matrix calibration method and device for a camera module.
背景技术Background technique
目前,确定相机模组的色彩校正矩阵的方式主要为,从相同型号的多个相机模组中选择参考相机模组;针对参考相机模组,采用参考相机模组在各个光源下对标准色卡进行拍摄,得到各个图像;针对每个光源下的图像,按照图像处理策略对该图像进行处理,进而进行色彩空间转换,确定参考相机模组的色彩校正矩阵;将该色彩校正矩阵作为多个相机模组的色彩校正矩阵。At present, the main way to determine the color correction matrix of a camera module is to select a reference camera module from multiple camera modules of the same model; for the reference camera module, the reference camera module is used to compare the standard color card under various light sources. Shoot and obtain each image; for the image under each light source, process the image according to the image processing strategy, and then perform color space conversion to determine the color correction matrix of the reference camera module; use the color correction matrix as multiple cameras The module's color correction matrix.
上述方案中,相同型号的多个相机模组中,不同的相机模组具有不同的部件参数,也就是说,不同的相机模组之间存在部件参数上的误差,导致在采用相同色彩校正矩阵时,不同相机模组的色彩还原效果不一致。In the above solution, among multiple camera modules of the same model, different camera modules have different component parameters. That is to say, there are errors in component parameters between different camera modules, resulting in the use of the same color correction matrix. When doing this, the color reproduction effects of different camera modules are inconsistent.
发明内容Contents of the invention
本公开提供一种相机模组的色彩校正矩阵标定方法及装置。The present disclosure provides a color correction matrix calibration method and device for a camera module.
根据本公开实施例的第一方面,提供一种相机模组的色彩校正矩阵标定方法,所述方法包括:确定多个相机模组;其中,多个所述相机模组的型号均相同,且一个或者多个所述相机模组的部件参数不同;针对每个相机模组,根据所述相机模组的光谱响应,确定所述相机模组的色彩校正矩阵;根据多个所述相机模组的色彩校正矩阵,确定多个所述相机模组中非参考相机模组与参考相机模组之间的标定矩阵,其中,基于所述标定矩阵,在所述参考相机模组的色彩校正矩阵发生变更时,所述非参考相机模组与所述参考相机模组的色彩还原指标之间的差异维持在预设差异范围内。According to a first aspect of an embodiment of the present disclosure, a color correction matrix calibration method for a camera module is provided. The method includes: determining a plurality of camera modules; wherein the models of the plurality of camera modules are all the same, and One or more of the camera modules have different component parameters; for each camera module, determine the color correction matrix of the camera module according to the spectral response of the camera module; according to a plurality of the camera modules The color correction matrix determines the calibration matrix between the non-reference camera module and the reference camera module among the plurality of camera modules, wherein, based on the calibration matrix, the color correction matrix of the reference camera module occurs When changing, the difference between the color reproduction indicators of the non-reference camera module and the reference camera module is maintained within a preset difference range.
在本公开的一个实施例中,所述相机模组的色彩校正矩阵的数量为多个,对应不同的光源;所述根据多个所述相机模组的色彩校正矩阵,确定多个所述相机模组中非参考相机模组与参考相机模组之间的标定矩阵,包括:针对多个所述相机模组中的每个非参考相机模组,针对每个光源,获取所述非参考相机模组在所述光源下的第一色彩校正矩阵,以及所述参考相机模组在所述光源下的第二色彩校正矩阵;对所述第一色彩校正矩阵与所述第二色彩校正矩阵进行比值处理,得到所述光源下所述非参考相机模组与所述参考相机模组 之间的标定矩阵。In one embodiment of the present disclosure, the number of color correction matrices of the camera module is multiple, corresponding to different light sources; and based on the color correction matrices of multiple camera modules, multiple cameras are determined. The calibration matrix between the non-reference camera module and the reference camera module in the module includes: for each non-reference camera module in the multiple camera modules, for each light source, obtain the non-reference camera The first color correction matrix of the module under the light source, and the second color correction matrix of the reference camera module under the light source; perform the first color correction matrix and the second color correction matrix. Ratio processing is performed to obtain the calibration matrix between the non-reference camera module and the reference camera module under the light source.
在本公开的一个实施例中,所述方法还包括:针对每个非参考相机模组,将所述非参考相机模组与所述参考相机模组之间的标定矩阵,写入所述非参考相机模组的第一存储器中,其中,所述第一存储器不允许对写入的数据进行更改;将所述非参考相机模组的色彩校正矩阵,写入所述非参考相机模组的第二存储器中。In one embodiment of the present disclosure, the method further includes: for each non-reference camera module, writing the calibration matrix between the non-reference camera module and the reference camera module into the non-reference camera module. In the first memory of the reference camera module, wherein the first memory does not allow changes to the written data; write the color correction matrix of the non-reference camera module into the non-reference camera module. in the second memory.
在本公开的一个实施例中,所述方法还包括:在所述参考相机模组的色彩校正矩阵发生变更时,获取所述参考相机模组的变更后色彩校正矩阵;针对每个非参考相机模组,根据所述参考相机模组的变更后色彩校正矩阵,以及所述非参考相机模组与所述参考相机模组之间的标定矩阵,确定所述非参考相机模组的变更后色彩校正矩阵;根据所述变更后色彩校正矩阵,对所述非参考相机模组中存储的色彩校正矩阵进行更新处理。In one embodiment of the present disclosure, the method further includes: when the color correction matrix of the reference camera module is changed, obtaining the changed color correction matrix of the reference camera module; for each non-reference camera A module that determines the changed color of the non-reference camera module based on the changed color correction matrix of the reference camera module and the calibration matrix between the non-reference camera module and the reference camera module. Correction matrix: update the color correction matrix stored in the non-reference camera module according to the changed color correction matrix.
在本公开的一个实施例中,所述参考相机模组的变更后色彩校正矩阵的确定方式为,根据所述参考相机模组在各个光源下对标准色卡拍摄得到的图像;按照指定的图像处理策略对所述图像进行处理,获取sRGB色彩空间中的图像;对sRGB色彩空间中的图像进行色彩空间转换,得到Lab色彩空间中的图像;根据Lab色彩空间中的图像,确定所述参考相机模组的变更后色彩校正矩阵。In one embodiment of the present disclosure, the modified color correction matrix of the reference camera module is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image The processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space The module's post-change color correction matrix.
在本公开的一个实施例中,所述相机模组包括:镜头,传感器、后端图像处理芯片和软件;对应的,所述部件参数包括以下中的至少一种:镜头参数、传感器参数、后端图像处理芯片参数和软板参数。In one embodiment of the present disclosure, the camera module includes: a lens, a sensor, a back-end image processing chip and software; correspondingly, the component parameters include at least one of the following: lens parameters, sensor parameters, rear End image processing chip parameters and soft board parameters.
根据本公开实施例的第二方面,还提供一种相机模组的色彩校正矩阵标定装置,所述装置包括:第一确定模块,用于确定多个相机模组;其中,多个所述相机模组的型号均相同,且一个或者多个所述相机模组的部件参数不同;第二确定模块,用于针对每个相机模组,根据所述相机模组的光谱响应,确定所述相机模组的色彩校正矩阵;第三确定模块,用于根据多个所述相机模组的色彩校正矩阵,确定多个所述相机模组中非参考相机模组与参考相机模组之间的标定矩阵,其中,基于所述标定矩阵,在所述参考相机模组的色彩校正矩阵发生变更时,所述非参考相机模组与所述参考相机模组的色彩还原指标之间的差异维持在预设差异范围内。According to a second aspect of the embodiment of the present disclosure, a color correction matrix calibration device for a camera module is also provided. The device includes: a first determination module for determining a plurality of camera modules; wherein a plurality of the cameras The models of the modules are all the same, and the component parameters of one or more of the camera modules are different; the second determination module is used to determine the camera for each camera module according to the spectral response of the camera module. The color correction matrix of the module; the third determination module is used to determine the calibration between the non-reference camera module and the reference camera module in the plurality of camera modules according to the color correction matrix of the plurality of camera modules. Matrix, wherein, based on the calibration matrix, when the color correction matrix of the reference camera module is changed, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained at a preset value. within the difference range.
在本公开的一个实施例中,所述相机模组的色彩校正矩阵的数量为多个,对应不同的光源;所述第三确定模块具体用于,针对多个所述相机模组中的每个非参考相机模组,针对每个光源,获取所述非参考相机模组在所述光源下的第一色彩校正矩阵,以及所述参考相机模组在所述光源下的第二色彩校正矩阵;对所述第一色彩校正矩阵与所述第二色彩校正矩阵进行比值处理,得到所述光源下所述非参考相机模组与所述参考相机模组之间的标 定矩阵。In one embodiment of the present disclosure, the number of color correction matrices of the camera module is multiple, corresponding to different light sources; the third determination module is specifically configured to target each of the plurality of camera modules. A non-reference camera module, for each light source, obtain the first color correction matrix of the non-reference camera module under the light source, and the second color correction matrix of the reference camera module under the light source. ; Perform ratio processing on the first color correction matrix and the second color correction matrix to obtain a calibration matrix between the non-reference camera module and the reference camera module under the light source.
在本公开的一个实施例中,所述装置还包括:写入模块,用于针对每个非参考相机模组,将所述非参考相机模组与所述参考相机模组之间的标定矩阵,写入所述非参考相机模组的第一存储器中,其中,所述第一存储器不允许对写入的数据进行更改;将所述非参考相机模组的色彩校正矩阵,写入所述非参考相机模组的第二存储器中。In one embodiment of the present disclosure, the device further includes: a writing module, configured to write, for each non-reference camera module, the calibration matrix between the non-reference camera module and the reference camera module. , written into the first memory of the non-reference camera module, wherein the first memory does not allow changes to the written data; write the color correction matrix of the non-reference camera module into the in the secondary memory of the non-reference camera module.
在本公开的一个实施例中,所述装置还包括:获取模块、第四确定模块和更新模块;其中,所述获取模块,用于在所述参考相机模组的色彩校正矩阵发生变更时,获取所述参考相机模组的变更后色彩校正矩阵;所述第四确定模块,用于针对每个非参考相机模组,根据所述参考相机模组的变更后色彩校正矩阵,以及所述非参考相机模组与所述参考相机模组之间的标定矩阵,确定所述非参考相机模组的变更后色彩校正矩阵;所述更新模块,用于根据所述变更后色彩校正矩阵,对所述非参考相机模组中存储的色彩校正矩阵进行更新处理。In one embodiment of the present disclosure, the device further includes: an acquisition module, a fourth determination module and an update module; wherein the acquisition module is configured to: when the color correction matrix of the reference camera module changes, Obtain the changed color correction matrix of the reference camera module; the fourth determination module is used for each non-reference camera module, according to the changed color correction matrix of the reference camera module, and the non-reference camera module The calibration matrix between the reference camera module and the reference camera module is used to determine the changed color correction matrix of the non-reference camera module; the update module is used to calculate the modified color correction matrix according to the changed color correction matrix. The color correction matrix stored in the non-reference camera module is updated.
在本公开的一个实施例中,所述参考相机模组的变更后色彩校正矩阵的确定方式为,根据所述参考相机模组在各个光源下对标准色卡拍摄得到的图像;按照指定的图像处理策略对所述图像进行处理,获取sRGB色彩空间中的图像;对sRGB色彩空间中的图像进行色彩空间转换,得到Lab色彩空间中的图像;根据Lab色彩空间中的图像,确定所述参考相机模组的变更后色彩校正矩阵。In one embodiment of the present disclosure, the modified color correction matrix of the reference camera module is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image The processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space The module's post-change color correction matrix.
在本公开的一个实施例中,所述相机模组包括:镜头,传感器、后端图像处理芯片和软件;对应的,所述部件参数包括以下中的至少一种:镜头参数、传感器参数、后端图像处理芯片参数和软板参数。In one embodiment of the present disclosure, the camera module includes: a lens, a sensor, a back-end image processing chip and software; correspondingly, the component parameters include at least one of the following: lens parameters, sensor parameters, rear End image processing chip parameters and soft board parameters.
根据本公开实施例的第三方面,还提供一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令,以实现如上所述的相机模组的色彩校正矩阵标定方法。According to a third aspect of an embodiment of the present disclosure, an electronic device is further provided, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to Implement the color correction matrix calibration method of the camera module as described above.
根据本公开实施例的第四方面,还提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由处理器执行时,使得处理器能够执行如上所述的相机模组的色彩校正矩阵标定方法。According to a fourth aspect of the embodiment of the present disclosure, a non-transitory computer-readable storage medium is also provided, which when instructions in the storage medium are executed by a processor, enables the processor to execute the above-described camera module. Color correction matrix calibration method.
本公开的实施例提供的技术方案至少带来以下有益效果:The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
通过确定多个相机模组;其中,多个相机模组的型号均相同,且一个或者多个相机模组的部件参数不同;针对每个相机模组,根据相机模组的光谱响应,确定相机模组的色彩校正矩阵;根据多个相机模组的色彩校正矩阵,确定多个相机模组中非参考相机模组与参考相机模组之间的标定矩阵,其中,基于标定矩阵,在参考相机模组的色彩校正矩阵发生 变更时,非参考相机模组与参考相机模组的色彩还原指标之间的差异维持在预设差异范围内,从而能够在在参考相机模组的色彩校正矩阵发生变化时,能够结合标定矩阵准确快速地确定相同型号不同部件参数的相机模组的不同色彩校正矩阵,确保不同相机模组的色彩还原效果一致。By determining multiple camera modules; among them, the models of the multiple camera modules are the same, and the component parameters of one or more camera modules are different; for each camera module, the camera is determined according to the spectral response of the camera module. The color correction matrix of the module; based on the color correction matrices of multiple camera modules, determine the calibration matrix between the non-reference camera module and the reference camera module in the multiple camera modules, where, based on the calibration matrix, in the reference camera When the color correction matrix of the module changes, the difference between the color reproduction indicators of the non-reference camera module and the reference camera module is maintained within the preset difference range, so that the color correction matrix of the reference camera module changes. When combined with the calibration matrix, different color correction matrices for camera modules of the same model and different component parameters can be accurately and quickly determined to ensure consistent color restoration effects of different camera modules.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and do not limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The drawings herein are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the disclosure, and together with the description are used to explain the principles of the disclosure, and do not constitute undue limitations on the disclosure.
图1为本公开一个实施例的相机模组的色彩校正矩阵标定方法的流程图;Figure 1 is a flow chart of a color correction matrix calibration method of a camera module according to an embodiment of the present disclosure;
图2为本公开另一个实施例的相机模组的色彩校正矩阵标定方法的流程图;Figure 2 is a flow chart of a color correction matrix calibration method of a camera module according to another embodiment of the present disclosure;
图3为本公开一个实施例的相机模组的色彩校正矩阵标定装置的结构示意图;Figure 3 is a schematic structural diagram of a color correction matrix calibration device of a camera module according to an embodiment of the present disclosure;
图4为根据本公开一示例性实施例示出的一种电子设备的结构框图。FIG. 4 is a structural block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
具体实施方式Detailed ways
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to allow ordinary people in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。It should be noted that the terms "first", "second", etc. in the description and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with aspects of the disclosure as detailed in the appended claims.
图1为本公开一个实施例的相机模组的色彩校正矩阵标定方法的流程图。其中,需要说明的是,本实施例的相机模组的色彩校正矩阵标定方法由相机模组的色彩校正矩阵标定装置执行,该相机模组的色彩校正矩阵标定装置可以由软件和/或硬件实现,该相机模组的色彩校正矩阵标定装置可以配置在电子设备中,该电子设备可以包括移动终端(如手机)、平板电脑等具有相机的终端设备,或者可以为相机设备等。以下以执行主体为电子设备为例进行说明。FIG. 1 is a flow chart of a color correction matrix calibration method of a camera module according to an embodiment of the present disclosure. It should be noted that the color correction matrix calibration method of the camera module in this embodiment is executed by the color correction matrix calibration device of the camera module. The color correction matrix calibration device of the camera module can be implemented by software and/or hardware. , the color correction matrix calibration device of the camera module can be configured in an electronic device, which can include a terminal device with a camera such as a mobile terminal (such as a mobile phone), a tablet computer, or a camera device. The following description takes the execution subject as an electronic device as an example.
如图1所示,该方法包括以下步骤:As shown in Figure 1, the method includes the following steps:
步骤101,确定多个相机模组;其中,多个相机模组的型号均相同,且一个或者多个 相机模组的部件参数不同。Step 101: Determine multiple camera modules; wherein the models of the multiple camera modules are the same, and one or more camera modules have different component parameters.
在本公开实施例中,相机模组主要由以下几个部件组成:镜头(lens),传感器(sensor),后端图像处理芯片(Backend IC),软板(FPC)。其中,镜头用于将光线汇集到传感器。传感器用于将光信号转换为电信号。后端图像处理芯片用于对电信号形式的图像进行图像处理。软板用于承载后端图像处理芯片。对应的,部件参数可以包括以下中的至少一种:镜头参数、传感器参数、后端图像处理芯片参数和软板参数。In the embodiment of the present disclosure, the camera module mainly consists of the following components: lens, sensor, backend image processing chip (Backend IC), and flexible circuit board (FPC). Among them, the lens is used to focus the light to the sensor. Sensors are used to convert light signals into electrical signals. The back-end image processing chip is used for image processing of images in the form of electrical signals. The soft board is used to carry the back-end image processing chip. Correspondingly, the component parameters may include at least one of the following: lens parameters, sensor parameters, back-end image processing chip parameters, and soft board parameters.
一些实施例中,多个相机模组的型号均相同,是指多个相机模组中相应部件的型号均相同,例如,以镜头为例,一个相机模组的镜头型号,与另一个相机模组中的镜头型号相同。一个或者多个相机模组的部件参数不同,是指多个相机模组中部分相机模组的部件参数不同,部分相机模组的部件参数相同;或者,多个相机模组中所有相机模组的部件参数不同。In some embodiments, the models of multiple camera modules are the same, which means that the models of corresponding components in the multiple camera modules are the same. For example, taking lenses as an example, the lens model of one camera module is different from that of another camera module. The lenses in the group are of the same model. The component parameters of one or more camera modules are different, which means that the component parameters of some camera modules in multiple camera modules are different, and the component parameters of some camera modules are the same; or, all camera modules in multiple camera modules The component parameters are different.
其中,以两个相机模组的部件参数不同为例,是指两个相机模组中的部分部件参数相同,部分部件参数不同;或者,两个相机模组中的所有部件参数不同。例如,该两个相机模组中镜头的参数不同,该不同是镜头制作过程中制作工艺或者产线生产的误差导致的。Among them, taking the different component parameters of two camera modules as an example, it means that some component parameters in the two camera modules are the same and some component parameters are different; or, all component parameters in the two camera modules are different. For example, the parameters of the lenses in the two camera modules are different. This difference is caused by errors in the manufacturing process or production line production during the lens manufacturing process.
一些实施例中,可以针对相机模组中的每个部件,确定该部件的所有可能的部件参数;然后针对各个部件,将各个部件的一种可能的部件参数进行组合,从而得到多个组合,即多个型号相同且部件参数不同的相机模组。In some embodiments, for each component in the camera module, all possible component parameters of the component can be determined; and then for each component, one possible component parameter of each component is combined to obtain multiple combinations, That is, multiple camera modules with the same model and different component parameters.
步骤102,针对每个相机模组,根据相机模组的光谱响应,确定相机模组的色彩校正矩阵。Step 102: For each camera module, determine the color correction matrix of the camera module according to the spectral response of the camera module.
在本公开实施例中,相机模组的光谱响应的获取方式可以为,获取光谱仪对相机模组进行光谱测量得到的光谱响应;或者,调用光谱仪对相机模组进行光谱测量,以获取相机模组的光谱响应。In the embodiment of the present disclosure, the method of obtaining the spectral response of the camera module may be to obtain the spectral response obtained by performing spectral measurement on the camera module with a spectrometer; or, calling the spectrometer to perform spectral measurement on the camera module to obtain the spectral response of the camera module. spectral response.
其中,光谱响应的数量为多个,对应不同光源。也就是说,相机模组在每个光源下对应有一个光谱响应。Among them, there are multiple spectral responses, corresponding to different light sources. In other words, the camera module has a spectral response corresponding to each light source.
其中,相机模组对拍摄得到的图像的图像处理过程例如可以为,对拍摄得到的RAW色彩空间的图像进行Demosaic色彩插值处理以及自动白平衡AWB处理,得到RGB色彩空间的图像;对RGB色彩空间的图像采用色彩校正矩阵进行转换处理,得到sRGB色彩空间的图像;对sRGB色彩空间的图像依次进行CV处理和2DLut处理,得到HSV色彩空间的图像,进而进行后续的显示处理。Among them, the image processing process of the captured image by the camera module can be, for example, performing Demosaic color interpolation processing and automatic white balance AWB processing on the captured RAW color space image to obtain an RGB color space image; The image is converted using a color correction matrix to obtain an image in the sRGB color space; the image in the sRGB color space is sequentially subjected to CV processing and 2DLut processing to obtain an image in the HSV color space, and then subsequent display processing is performed.
上述图像处理过程中,色彩校正矩阵用于对RGB色彩空间的图像进行转换处理得到sRGB色彩空间的图像。In the above image processing process, the color correction matrix is used to convert the image in the RGB color space to obtain the image in the sRGB color space.
步骤103,根据多个相机模组的色彩校正矩阵,确定多个相机模组中非参考相机模组 与参考相机模组之间的标定矩阵,其中,基于标定矩阵,在参考相机模组的色彩校正矩阵发生变更时,非参考相机模组与参考相机模组的色彩还原指标之间的差异维持在预设差异范围内。Step 103: Determine the calibration matrix between the non-reference camera module and the reference camera module in the multiple camera modules based on the color correction matrices of the multiple camera modules, wherein based on the calibration matrix, the color of the reference camera module When the correction matrix is changed, the difference between the color reproduction indicators of the non-reference camera module and the reference camera module remains within the preset difference range.
在本公开实施例中,为了减少标定矩阵的数量,可以从多个相机模组中选择一个相机模组作为参考相机模组,例如,参考相机模组可以为多个相机模组中的golden相机模组。In the embodiment of the present disclosure, in order to reduce the number of calibration matrices, one camera module can be selected from multiple camera modules as a reference camera module. For example, the reference camera module can be a golden camera among the multiple camera modules. Mods.
一些实施例中,相机模组的色彩校正矩阵的数量为多个,对应不同的光源。对应的,电子设备执行步骤103的过程例如可以为确定非参考相机模组与参考相机模组之间的标定矩阵的过程例如可以为,针对多个相机模组中的每个非参考相机模组,针对每个光源,获取非参考相机模组在光源下的第一色彩校正矩阵,以及参考相机模组在光源下的第二色彩校正矩阵;对第一色彩校正矩阵与第二色彩校正矩阵进行比值处理,得到光源下非参考相机模组与参考相机模组之间的标定矩阵。In some embodiments, the number of color correction matrices of the camera module is multiple, corresponding to different light sources. Correspondingly, the process of the electronic device performing step 103 may be, for example, the process of determining the calibration matrix between the non-reference camera module and the reference camera module, for example, for each non-reference camera module in the plurality of camera modules. , for each light source, obtain the first color correction matrix of the non-reference camera module under the light source, and the second color correction matrix of the reference camera module under the light source; perform the first color correction matrix and the second color correction matrix Ratio processing is performed to obtain the calibration matrix between the non-reference camera module and the reference camera module under the light source.
其中,针对一个非参考相机模组,不同的光源对应有不同的标定矩阵。因此,一个非参考相机模组可以有多个标定矩阵,标定矩阵的数量与光源数量一致。其中,需要说明的是,此处的光源为规定的多个标准光源。Among them, for a non-reference camera module, different light sources correspond to different calibration matrices. Therefore, a non-reference camera module can have multiple calibration matrices, and the number of calibration matrices is consistent with the number of light sources. It should be noted that the light sources here are multiple prescribed standard light sources.
一些实施例中,基于标定矩阵,非参考相机模组与参考相机模组的色彩还原指标之间的差异位置在预设差异范围内,是指,基于标定矩阵以及参考相机模组的色彩校正矩阵,可以确定非参考相机模组的色彩校正矩阵;基于该色彩校正矩阵,非参考相机模组对拍摄得到的图像进行图像处理(包括色彩还原处理)得到的图像,获取该图像的第一色彩还原指标;参考相机模组对拍摄得到的图像进行图像处理得到的图像的第二色彩还原指标;该第一色彩还原指标与该第二色彩还原指标之间的差异维持在预设差异范围内。In some embodiments, based on the calibration matrix, the difference position between the color restoration indicators of the non-reference camera module and the reference camera module is within the preset difference range, which means based on the calibration matrix and the color correction matrix of the reference camera module. , the color correction matrix of the non-reference camera module can be determined; based on the color correction matrix, the non-reference camera module performs image processing (including color restoration processing) on the captured image to obtain the first color restoration of the image Index; refer to the second color restoration index of the image obtained by performing image processing on the captured image by the camera module; the difference between the first color restoration index and the second color restoration index is maintained within the preset difference range.
一些实施例中,步骤103之后,电子设备还可以执行以下过程:针对每个非参考相机模组,将非参考相机模组与参考相机模组之间的标定矩阵,写入非参考相机模组的第一存储器中,其中,第一存储器不允许对写入的数据进行更改;将非参考相机模组的色彩校正矩阵,写入非参考相机模组的第二存储器中。In some embodiments, after step 103, the electronic device may also perform the following process: for each non-reference camera module, write the calibration matrix between the non-reference camera module and the reference camera module into the non-reference camera module. In the first memory, the first memory does not allow modification of the written data; write the color correction matrix of the non-reference camera module into the second memory of the non-reference camera module.
其中,第一存储器例如可以为OTP(One Time Programmable,一次性可编程)类型的存储器,只能进行一次性编程。也就是说,程序或者数据写入该类型的存储器之后,将不可再次更改和清除,从而确保了相机模组中重要数据的安全性。The first memory may be, for example, an OTP (One Time Programmable) type memory, which can only be programmed once. In other words, after programs or data are written to this type of memory, they cannot be changed or cleared again, thus ensuring the security of important data in the camera module.
本公开实施例的相机模组的色彩校正矩阵标定方法,通过确定多个相机模组;其中,多个相机模组的型号均相同,且一个或者多个相机模组的部件参数不同;针对每个相机模组,根据相机模组的光谱响应,确定相机模组的色彩校正矩阵;根据多个相机模组的色彩校正矩阵,确定多个相机模组中非参考相机模组与参考相机模组之间的标定矩阵,其中,基于标定矩阵,在参考相机模组的色彩校正矩阵发生变更时,非参考相机模组与参考相机 模组的色彩还原指标之间的差异维持在预设差异范围内,从而能够在参考相机模组的色彩校正矩阵发生变化时,能够结合标定矩阵准确快速地确定相同型号不同部件参数的相机模组的不同色彩校正矩阵,确保不同相机模组的色彩还原效果一致。The color correction matrix calibration method of the camera module according to the embodiment of the present disclosure determines multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more camera modules are different; for each determine the color correction matrix of the camera module based on the spectral response of the camera module; determine the non-reference camera module and the reference camera module among the multiple camera modules based on the color correction matrices of multiple camera modules Wherein, based on the calibration matrix, when the color correction matrix of the reference camera module changes, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained within the preset difference range , so that when the color correction matrix of the reference camera module changes, it can be combined with the calibration matrix to accurately and quickly determine the different color correction matrices of the same model of camera modules with different component parameters, ensuring that the color restoration effects of different camera modules are consistent.
图2为本公开另一个实施例的相机模组的色彩校正矩阵标定方法的流程图。如图2所示,在图1所示实施例的基础上,针对每个非参考相机模组,将非参考相机模组与参考相机模组之间的标定矩阵,写入非参考相机模组第一存储器中;将非参考相机模组的色彩校正矩阵,写入非参考相机模组的第二存储器中之后,电子设备还可以执行以下步骤:FIG. 2 is a flow chart of a color correction matrix calibration method of a camera module according to another embodiment of the present disclosure. As shown in Figure 2, based on the embodiment shown in Figure 1, for each non-reference camera module, the calibration matrix between the non-reference camera module and the reference camera module is written into the non-reference camera module In the first memory; after writing the color correction matrix of the non-reference camera module into the second memory of the non-reference camera module, the electronic device can also perform the following steps:
步骤201,在参考相机模组的色彩校正矩阵发生变更时,获取参考相机模组的变更后色彩校正矩阵。Step 201: When the color correction matrix of the reference camera module changes, obtain the changed color correction matrix of the reference camera module.
在本公开实施例中,参考相机模组的变更后色彩校正矩阵的确定方式为,根据参考相机模组在各个光源下对标准色卡拍摄得到的图像;按照指定的图像处理策略对图像进行处理,获取sRGB色彩空间中的图像;对sRGB色彩空间中的图像进行色彩空间转换,得到Lab色彩空间中的图像;根据Lab色彩空间中的图像,确定参考相机模组的变更后色彩校正矩阵。其中,标准色卡例如可以为,ColorChecker标准色卡。In the embodiment of the present disclosure, the modified color correction matrix of the reference camera module is determined based on the images captured by the reference camera module on the standard color card under various light sources; and the images are processed according to the specified image processing strategy. , obtain an image in the sRGB color space; perform color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determine the changed color correction matrix of the reference camera module based on the image in the Lab color space. The standard color card may be, for example, a ColorChecker standard color card.
其中,参考相机模组的色彩校正矩阵发生变更,可以为图像处理策略发生变更,例如,Demosaic色彩插值处理存在变更、自动白平衡AWB处理存在变更等。Among them, changes in the color correction matrix of the reference camera module can indicate changes in the image processing strategy, for example, changes in Demosaic color interpolation processing, changes in automatic white balance AWB processing, etc.
步骤202,针对每个非参考相机模组,根据参考相机模组的变更后色彩校正矩阵,以及非参考相机模组与参考相机模组之间的标定矩阵,确定非参考相机模组的变更后色彩校正矩阵。Step 202: For each non-reference camera module, determine the modified color correction matrix of the non-reference camera module based on the modified color correction matrix of the reference camera module and the calibration matrix between the non-reference camera module and the reference camera module. Color correction matrix.
在本公开实施例中,电子设备执行步骤202的过程例如可以为,对参考相机模组的变更后色彩校正矩阵以及标定矩阵进行乘法处理,得到的矩阵即为非参考相机模组的变更后色彩校正矩阵。其中,非参考相机模组的变更后色彩校正矩阵的计算公式可以如以下公式(1)所示:In the embodiment of the present disclosure, the electronic device performs step 202, for example, by multiplying the changed color correction matrix and the calibration matrix of the reference camera module. The resulting matrix is the changed color of the non-reference camera module. correction matrix. Among them, the calculation formula of the color correction matrix after the change of the non-reference camera module can be as shown in the following formula (1):
M limit=M golden×H     (1) M limit =M golden ×H (1)
其中,M limit表示非参考相机模组的变更后色彩校正矩阵;M golden表示参考相机模组的变更后色彩校正矩阵;H表示非参考相机模组与参考相机模组之间的标定矩阵。 Among them, M limit represents the changed color correction matrix of the non-reference camera module; M golden represents the changed color correction matrix of the reference camera module; H represents the calibration matrix between the non-reference camera module and the reference camera module.
步骤203,根据变更后色彩校正矩阵,对非参考相机模组中存储的色彩校正矩阵进行更新处理。Step 203: Update the color correction matrix stored in the non-reference camera module according to the changed color correction matrix.
本公开实施例的相机模组的色彩校正矩阵标定方法,通过确定多个相机模组;其中,多个相机模组的型号均相同,且一个或者多个相机模组的部件参数不同;针对每个相机模组,根据相机模组的光谱响应,确定相机模组的色彩校正矩阵;根据多个相机模组的色彩 校正矩阵,确定多个相机模组中非参考相机模组与参考相机模组之间的标定矩阵;在参考相机模组的色彩校正矩阵发生变更时,获取参考相机模组的变更后色彩校正矩阵;针对每个非参考相机模组,根据参考相机模组的变更后色彩校正矩阵,以及非参考相机模组与参考相机模组之间的标定矩阵,确定非参考相机模组的变更后色彩校正矩阵;根据变更后色彩校正矩阵,对非参考相机模组中存储的色彩校正矩阵进行更新处理,从而能够在参考相机模组的色彩校正矩阵发生变化时,能够结合标定矩阵准确快速地确定相同型号不同部件参数的相机模组的不同色彩校正矩阵,确保不同相机模组的色彩还原效果一致。The color correction matrix calibration method of the camera module according to the embodiment of the present disclosure determines multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more camera modules are different; for each determine the color correction matrix of the camera module based on the spectral response of the camera module; determine the non-reference camera module and the reference camera module among the multiple camera modules based on the color correction matrices of multiple camera modules calibration matrix between; when the color correction matrix of the reference camera module changes, obtain the changed color correction matrix of the reference camera module; for each non-reference camera module, perform color correction according to the changed color of the reference camera module matrix, and the calibration matrix between the non-reference camera module and the reference camera module to determine the changed color correction matrix of the non-reference camera module; based on the changed color correction matrix, correct the color stored in the non-reference camera module The matrix is updated, so that when the color correction matrix of the reference camera module changes, the calibration matrix can be combined with the calibration matrix to accurately and quickly determine the different color correction matrices of camera modules of the same model with different component parameters, ensuring the color accuracy of different camera modules. The restoration effect is consistent.
图3为本公开一个实施例的相机模组的色彩校正矩阵标定装置的结构示意图。FIG. 3 is a schematic structural diagram of a color correction matrix calibration device of a camera module according to an embodiment of the present disclosure.
如图3所示,该相机模组的色彩校正矩阵标定装置可以包括:第一确定模块301、第二确定模块302和第三确定模块303;As shown in Figure 3, the color correction matrix calibration device of the camera module may include: a first determination module 301, a second determination module 302 and a third determination module 303;
其中,第一确定模块301,用于确定多个相机模组;其中,多个所述相机模组的型号均相同,且一个或者多个所述相机模组的部件参数不同;Wherein, the first determination module 301 is used to determine multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more of the camera modules are different;
第二确定模块302,用于针对每个相机模组,根据所述相机模组的光谱响应,确定所述相机模组的色彩校正矩阵;The second determination module 302 is configured to determine, for each camera module, the color correction matrix of the camera module according to the spectral response of the camera module;
第三确定模块303,用于根据多个所述相机模组的色彩校正矩阵,确定多个所述相机模组中非参考相机模组与参考相机模组之间的标定矩阵,其中,基于所述标定矩阵,在所述参考相机模组的色彩校正矩阵发生变更时,所述非参考相机模组与所述参考相机模组的色彩还原指标之间的差异维持在预设差异范围内。The third determination module 303 is configured to determine the calibration matrix between the non-reference camera module and the reference camera module in the plurality of camera modules according to the color correction matrices of the plurality of camera modules, wherein based on the According to the calibration matrix, when the color correction matrix of the reference camera module is changed, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained within a preset difference range.
在本公开的一个实施例中,在本公开的一个实施例中,所述相机模组的色彩校正矩阵的数量为多个,对应不同的光源;所述第三确定模块303具体用于,针对多个所述相机模组中的每个非参考相机模组,针对每个光源,获取所述非参考相机模组在所述光源下的第一色彩校正矩阵,以及所述参考相机模组在所述光源下的第二色彩校正矩阵;对所述第一色彩校正矩阵与所述第二色彩校正矩阵进行比值处理,得到所述光源下所述非参考相机模组与所述参考相机模组之间的标定矩阵。In one embodiment of the present disclosure, in an embodiment of the present disclosure, the number of color correction matrices of the camera module is multiple, corresponding to different light sources; the third determination module 303 is specifically used for For each non-reference camera module in the plurality of camera modules, for each light source, obtain the first color correction matrix of the non-reference camera module under the light source, and the reference camera module under The second color correction matrix under the light source; performing ratio processing on the first color correction matrix and the second color correction matrix to obtain the non-reference camera module and the reference camera module under the light source calibration matrix between.
在本公开的一个实施例中,所述装置还包括:写入模块,用于针对每个非参考相机模组,将所述非参考相机模组与所述参考相机模组之间的标定矩阵,写入所述非参考相机模组的第一存储器中,其中,所述第一存储器不允许对写入的数据进行更改;将所述非参考相机模组的色彩校正矩阵,写入所述非参考相机模组的第二存储器中。In one embodiment of the present disclosure, the device further includes: a writing module, configured to write, for each non-reference camera module, the calibration matrix between the non-reference camera module and the reference camera module. , written into the first memory of the non-reference camera module, wherein the first memory does not allow changes to the written data; write the color correction matrix of the non-reference camera module into the in the secondary memory of the non-reference camera module.
在本公开的一个实施例中,所述装置还包括:获取模块、第四确定模块和更新模块;其中,所述获取模块,用于在所述参考相机模组的色彩校正矩阵发生变更时,获取所述参考相机模组的变更后色彩校正矩阵;所述第四确定模块,用于针对每个非参考相机模组, 根据所述参考相机模组的变更后色彩校正矩阵,以及所述非参考相机模组与所述参考相机模组之间的标定矩阵,确定所述非参考相机模组的变更后色彩校正矩阵;所述更新模块,用于根据所述变更后色彩校正矩阵,对所述非参考相机模组中存储的色彩校正矩阵进行更新处理。In one embodiment of the present disclosure, the device further includes: an acquisition module, a fourth determination module and an update module; wherein the acquisition module is configured to: when the color correction matrix of the reference camera module changes, Obtain the modified color correction matrix of the reference camera module; the fourth determination module is used for each non-reference camera module, according to the modified color correction matrix of the reference camera module, and the non-reference camera module The calibration matrix between the reference camera module and the reference camera module is used to determine the changed color correction matrix of the non-reference camera module; the update module is used to calculate the modified color correction matrix according to the changed color correction matrix. The color correction matrix stored in the non-reference camera module is updated.
在本公开的一个实施例中,所述参考相机模组的变更后色彩校正矩阵的确定方式为,根据所述参考相机模组在各个光源下对标准色卡拍摄得到的图像;按照指定的图像处理策略对所述图像进行处理,获取sRGB色彩空间中的图像;对sRGB色彩空间中的图像进行色彩空间转换,得到Lab色彩空间中的图像;根据Lab色彩空间中的图像,确定所述参考相机模组的变更后色彩校正矩阵。In one embodiment of the present disclosure, the modified color correction matrix of the reference camera module is determined based on the images captured by the reference camera module on the standard color card under various light sources; according to the specified image The processing strategy processes the image to obtain an image in the sRGB color space; performs color space conversion on the image in the sRGB color space to obtain an image in the Lab color space; determines the reference camera based on the image in the Lab color space The module's post-change color correction matrix.
在本公开的一个实施例中,所述相机模组包括:镜头,传感器、后端图像处理芯片和软件;对应的,所述部件参数包括以下中的至少一种:镜头参数、传感器参数、后端图像处理芯片参数和软板参数。In one embodiment of the present disclosure, the camera module includes: a lens, a sensor, a back-end image processing chip and software; correspondingly, the component parameters include at least one of the following: lens parameters, sensor parameters, rear End image processing chip parameters and soft board parameters.
本公开实施例的相机模组的色彩校正矩阵标定装置,通过确定多个相机模组;其中,多个相机模组的型号均相同,且一个或者多个相机模组的部件参数不同;针对每个相机模组,根据相机模组的光谱响应,确定相机模组的色彩校正矩阵;根据多个相机模组的色彩校正矩阵,确定多个相机模组中非参考相机模组与参考相机模组之间的标定矩阵,其中,基于标定矩阵,在参考相机模组的色彩校正矩阵发生变更时,非参考相机模组与参考相机模组的色彩还原指标之间的差异维持在预设差异范围内,从而能够在参考相机模组的色彩校正矩阵发生变化时,能够结合标定矩阵准确快速地确定相同型号不同部件参数的相机模组的不同色彩校正矩阵,确保不同相机模组的色彩还原效果一致。The color correction matrix calibration device of the camera module according to the embodiment of the present disclosure determines multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more camera modules are different; for each determine the color correction matrix of the camera module based on the spectral response of the camera module; determine the non-reference camera module and the reference camera module among the multiple camera modules based on the color correction matrices of multiple camera modules Wherein, based on the calibration matrix, when the color correction matrix of the reference camera module changes, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained within the preset difference range , so that when the color correction matrix of the reference camera module changes, it can be combined with the calibration matrix to accurately and quickly determine the different color correction matrices of the same model of camera modules with different component parameters, ensuring that the color restoration effects of different camera modules are consistent.
根据本公开实施例的第三方面,还提供一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器,其中,处理器被配置为执行指令,以实现如上的相机模组的色彩校正矩阵标定方法。According to a third aspect of the embodiment of the present disclosure, an electronic device is also provided, including: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement the above camera module Color correction matrix calibration method.
为了实现上述实施例,本公开还提出了一种存储介质。In order to implement the above embodiments, the present disclosure also proposes a storage medium.
其中,当存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如上的方法。When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the above method.
为了实现上述实施例,本公开还提供一种计算机程序产品。In order to implement the above embodiments, the present disclosure also provides a computer program product.
其中,该计算机程序产品由电子设备的处理器执行时,使得电子设备能够执行如上的方法。Wherein, when the computer program product is executed by the processor of the electronic device, the electronic device can perform the above method.
图4为根据一示例性实施例示出的一种电子设备的结构框图。图4示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。FIG. 4 is a structural block diagram of an electronic device according to an exemplary embodiment. The electronic device shown in FIG. 4 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
如图4所示,电子设备1000包括处理器111,其可以根据存储在只读存储器(ROM,Read Only Memory)112中的程序或者从存储器116加载到随机访问存储器(RAM,Random Access Memory)113中的程序而执行各种适当的动作和处理。在RAM 113中,还存储有电子设备1000操作所需的各种程序和数据。处理器111、ROM 112以及RAM 113通过总线114彼此相连。输入/输出(I/O,Input/Output)接口115也连接至总线114。As shown in Figure 4, the electronic device 1000 includes a processor 111, which can be loaded into a random access memory (RAM, Random Access Memory) 113 according to a program stored in a read-only memory (ROM, Read Only Memory) 112 or from a memory 116 perform various appropriate actions and processing according to the program in it. In the RAM 113, various programs and data required for the operation of the electronic device 1000 are also stored. The processor 111, ROM 112 and RAM 113 are connected to each other through a bus 114. An input/output (I/O, Input/Output) interface 115 is also connected to bus 114 .
以下部件连接至I/O接口115:包括硬盘等的存储器116;以及包括诸如局域网(Local Area Network,LAN)卡、调制解调器等的网络接口卡的通信部分117,通信部分117经由诸如因特网的网络执行通信处理;驱动器118也根据需要连接至I/O接口115。The following components are connected to the I/O interface 115: a memory 116 including a hard disk, etc.; and a communication section 117 including a network interface card such as a Local Area Network (LAN) card, a modem, etc., which is executed via a network such as the Internet. Communication processing; driver 118 is also connected to I/O interface 115 as needed.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分117从网络上被下载和安装。在该计算机程序被处理器111执行时,执行本公开的方法中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication section 117 . When the computer program is executed by the processor 111, the above-described functions defined in the method of the present disclosure are performed.
在示例性实施例中,还提供了一种包括指令的存储介质,例如包括指令的存储器,上述指令可由电子设备1000的处理器111执行以完成上述方法。可选地,存储介质可以是非临时性计算机可读存储介质,例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a storage medium including instructions, such as a memory including instructions, which can be executed by the processor 111 of the electronic device 1000 to complete the above method is also provided. Optionally, the storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc. .
在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device . Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure that follow the general principles of the disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the disclosure. . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the disclosure is limited only by the appended claims.

Claims (14)

  1. 一种相机模组的色彩校正矩阵标定方法,其特征在于,所述方法包括:A color correction matrix calibration method for a camera module, characterized in that the method includes:
    确定多个相机模组;其中,多个所述相机模组的型号均相同,且一个或者多个所述相机模组的部件参数不同;Determine multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more of the camera modules are different;
    针对每个相机模组,根据所述相机模组的光谱响应,确定所述相机模组的色彩校正矩阵;For each camera module, determine the color correction matrix of the camera module according to the spectral response of the camera module;
    根据多个所述相机模组的色彩校正矩阵,确定多个所述相机模组中非参考相机模组与参考相机模组之间的标定矩阵,其中,基于所述标定矩阵,在所述参考相机模组的色彩校正矩阵发生变更时,所述非参考相机模组与所述参考相机模组的色彩还原指标之间的差异维持在预设差异范围内。According to the color correction matrices of a plurality of the camera modules, a calibration matrix between a non-reference camera module and a reference camera module in a plurality of the camera modules is determined, wherein based on the calibration matrix, in the reference When the color correction matrix of the camera module is changed, the difference between the color reproduction indicators of the non-reference camera module and the reference camera module is maintained within the preset difference range.
  2. 根据权利要求1所述的方法,其特征在于,所述相机模组的色彩校正矩阵的数量为多个,对应不同的光源;The method according to claim 1, characterized in that the number of color correction matrices of the camera module is multiple, corresponding to different light sources;
    所述根据多个所述相机模组的色彩校正矩阵,确定多个所述相机模组中非参考相机模组与参考相机模组之间的标定矩阵,包括:Determining the calibration matrix between the non-reference camera module and the reference camera module in the plurality of camera modules based on the color correction matrices of the plurality of camera modules includes:
    针对多个所述相机模组中的每个非参考相机模组,针对每个光源,获取所述非参考相机模组在所述光源下的第一色彩校正矩阵,以及所述参考相机模组在所述光源下的第二色彩校正矩阵;For each non-reference camera module in the plurality of camera modules, for each light source, obtain the first color correction matrix of the non-reference camera module under the light source, and the reference camera module a second color correction matrix under said light source;
    对所述第一色彩校正矩阵与所述第二色彩校正矩阵进行比值处理,得到所述光源下所述非参考相机模组与所述参考相机模组之间的标定矩阵。Perform ratio processing on the first color correction matrix and the second color correction matrix to obtain a calibration matrix between the non-reference camera module and the reference camera module under the light source.
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, characterized in that, the method further includes:
    针对每个非参考相机模组,将所述非参考相机模组与所述参考相机模组之间的标定矩阵,写入所述非参考相机模组的第一存储器中,其中,所述第一存储器不允许对写入的数据进行更改;For each non-reference camera module, write the calibration matrix between the non-reference camera module and the reference camera module into the first memory of the non-reference camera module, where the first A memory does not allow changes to written data;
    将所述非参考相机模组的色彩校正矩阵,写入所述非参考相机模组的第二存储器中。Write the color correction matrix of the non-reference camera module into the second memory of the non-reference camera module.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, further comprising:
    在所述参考相机模组的色彩校正矩阵发生变更时,获取所述参考相机模组的变更后色彩校正矩阵;When the color correction matrix of the reference camera module is changed, obtain the changed color correction matrix of the reference camera module;
    针对每个非参考相机模组,根据所述参考相机模组的变更后色彩校正矩阵,以及所述 非参考相机模组与所述参考相机模组之间的标定矩阵,确定所述非参考相机模组的变更后色彩校正矩阵;For each non-reference camera module, determine the non-reference camera according to the changed color correction matrix of the reference camera module and the calibration matrix between the non-reference camera module and the reference camera module The module's post-change color correction matrix;
    根据所述变更后色彩校正矩阵,对所述非参考相机模组中存储的色彩校正矩阵进行更新处理。According to the changed color correction matrix, the color correction matrix stored in the non-reference camera module is updated.
  5. 根据权利要求4所述的方法,其特征在于,所述参考相机模组的变更后色彩校正矩阵的确定方式为,The method according to claim 4, characterized in that the modified color correction matrix of the reference camera module is determined by:
    根据所述参考相机模组在各个光源下对标准色卡拍摄得到的图像;Images captured by the reference camera module on standard color cards under various light sources;
    按照指定的图像处理策略对所述图像进行处理,获取sRGB色彩空间中的图像;Process the image according to the specified image processing strategy to obtain an image in the sRGB color space;
    对sRGB色彩空间中的图像进行色彩空间转换,得到Lab色彩空间中的图像;Perform color space conversion on the image in the sRGB color space to obtain the image in the Lab color space;
    根据Lab色彩空间中的图像,确定所述参考相机模组的变更后色彩校正矩阵。According to the image in the Lab color space, the modified color correction matrix of the reference camera module is determined.
  6. 根据权利要求1所述的方法,其特征在于,所述相机模组包括:镜头,传感器、后端图像处理芯片和软件;The method according to claim 1, characterized in that the camera module includes: a lens, a sensor, a back-end image processing chip and software;
    对应的,所述部件参数包括以下中的至少一种:镜头参数、传感器参数、后端图像处理芯片参数和软板参数。Correspondingly, the component parameters include at least one of the following: lens parameters, sensor parameters, back-end image processing chip parameters and soft board parameters.
  7. 一种相机模组的色彩校正矩阵标定装置,其特征在于,所述装置包括:A color correction matrix calibration device for a camera module, characterized in that the device includes:
    第一确定模块,用于确定多个相机模组;其中,多个所述相机模组的型号均相同,且一个或者多个所述相机模组的部件参数不同;The first determination module is used to determine multiple camera modules; wherein the models of the multiple camera modules are the same, and the component parameters of one or more of the camera modules are different;
    第二确定模块,用于针对每个相机模组,根据所述相机模组的光谱响应,确定所述相机模组的色彩校正矩阵;a second determination module, configured to determine, for each camera module, the color correction matrix of the camera module according to the spectral response of the camera module;
    第三确定模块,用于根据多个所述相机模组的色彩校正矩阵,确定多个所述相机模组中非参考相机模组与参考相机模组之间的标定矩阵,其中,基于所述标定矩阵,在所述参考相机模组的色彩校正矩阵发生变更时,所述非参考相机模组与所述参考相机模组的色彩还原指标之间的差异维持在预设差异范围内。The third determination module is configured to determine the calibration matrix between the non-reference camera module and the reference camera module in the plurality of camera modules according to the color correction matrices of the plurality of camera modules, wherein based on the Calibration matrix, when the color correction matrix of the reference camera module is changed, the difference between the color restoration indicators of the non-reference camera module and the reference camera module is maintained within a preset difference range.
  8. 根据权利要求7所述的装置,其特征在于,所述相机模组的色彩校正矩阵的数量为多个,对应不同的光源;The device according to claim 7, characterized in that the number of color correction matrices of the camera module is multiple, corresponding to different light sources;
    所述第三确定模块具体用于,The third determination module is specifically used to:
    针对多个所述相机模组中的每个非参考相机模组,针对每个光源,获取所述非参考相机模组在所述光源下的第一色彩校正矩阵,以及所述参考相机模组在所述光源下的第二色 彩校正矩阵;For each non-reference camera module in the plurality of camera modules, for each light source, obtain the first color correction matrix of the non-reference camera module under the light source, and the reference camera module a second color correction matrix under said light source;
    对所述第一色彩校正矩阵与所述第二色彩校正矩阵进行比值处理,得到所述光源下所述非参考相机模组与所述参考相机模组之间的标定矩阵。Perform ratio processing on the first color correction matrix and the second color correction matrix to obtain a calibration matrix between the non-reference camera module and the reference camera module under the light source.
  9. 根据权利要求7或8所述的装置,其特征在于,所述装置还包括:写入模块,用于针对每个非参考相机模组,将所述非参考相机模组与所述参考相机模组之间的标定矩阵,写入所述非参考相机模组的第一存储器中,其中,所述第一存储器不允许对写入的数据进行更改;The device according to claim 7 or 8, characterized in that the device further includes: a writing module, configured to, for each non-reference camera module, compare the non-reference camera module and the reference camera module. The calibration matrix between groups is written into the first memory of the non-reference camera module, wherein the first memory does not allow changes to the written data;
    将所述非参考相机模组的色彩校正矩阵,写入所述非参考相机模组的第二存储器中。Write the color correction matrix of the non-reference camera module into the second memory of the non-reference camera module.
  10. 根据权利要求9所述的装置,其特征在于,所述装置还包括:获取模块、第四确定模块和更新模块;The device according to claim 9, characterized in that the device further includes: an acquisition module, a fourth determination module and an update module;
    其中,所述获取模块,用于在所述参考相机模组的色彩校正矩阵发生变更时,获取所述参考相机模组的变更后色彩校正矩阵;Wherein, the acquisition module is used to acquire the changed color correction matrix of the reference camera module when the color correction matrix of the reference camera module is changed;
    所述第四确定模块,用于针对每个非参考相机模组,根据所述参考相机模组的变更后色彩校正矩阵,以及所述非参考相机模组与所述参考相机模组之间的标定矩阵,确定所述非参考相机模组的变更后色彩校正矩阵;The fourth determination module is used for each non-reference camera module, according to the changed color correction matrix of the reference camera module, and the difference between the non-reference camera module and the reference camera module. Calibration matrix to determine the changed color correction matrix of the non-reference camera module;
    所述更新模块,用于根据所述变更后色彩校正矩阵,对所述非参考相机模组中存储的色彩校正矩阵进行更新处理。The update module is configured to update the color correction matrix stored in the non-reference camera module according to the changed color correction matrix.
  11. 根据权利要求10所述的装置,其特征在于,所述参考相机模组的变更后色彩校正矩阵的确定方式为,The device according to claim 10, wherein the modified color correction matrix of the reference camera module is determined by:
    根据所述参考相机模组在各个光源下对标准色卡拍摄得到的图像;Images captured by the reference camera module on standard color cards under various light sources;
    按照指定的图像处理策略对所述图像进行处理,获取sRGB色彩空间中的图像;Process the image according to the specified image processing strategy to obtain an image in the sRGB color space;
    对sRGB色彩空间中的图像进行色彩空间转换,得到Lab色彩空间中的图像;Perform color space conversion on the image in the sRGB color space to obtain the image in the Lab color space;
    根据Lab色彩空间中的图像,确定所述参考相机模组的变更后色彩校正矩阵。According to the image in the Lab color space, the modified color correction matrix of the reference camera module is determined.
  12. 根据权利要求7所述的装置,其特征在于,所述相机模组包括:镜头,传感器、后端图像处理芯片和软件;The device according to claim 7, wherein the camera module includes: a lens, a sensor, a back-end image processing chip and software;
    对应的,所述部件参数包括以下中的至少一种:镜头参数、传感器参数、后端图像处理芯片参数和软板参数。Correspondingly, the component parameters include at least one of the following: lens parameters, sensor parameters, back-end image processing chip parameters and soft board parameters.
  13. 一种电子设备,其特征在于,包括:An electronic device, characterized by including:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;memory for storing instructions executable by the processor;
    其中,所述处理器被配置为执行所述指令,以实现如权利要求1至6中任一项所述的相机模组的色彩校正矩阵标定方法。Wherein, the processor is configured to execute the instructions to implement the color correction matrix calibration method of the camera module according to any one of claims 1 to 6.
  14. 一种非临时性计算机可读存储介质,当所述存储介质中的指令由处理器执行时,使得处理器能够执行如权利要求1至6中任一项所述的相机模组的色彩校正矩阵标定方法。A non-transitory computer-readable storage medium that, when instructions in the storage medium are executed by a processor, enables the processor to execute the color correction matrix of the camera module according to any one of claims 1 to 6 Calibration method.
PCT/CN2022/099623 2022-06-17 2022-06-17 Color correction matrix calibration method and apparatus for camera module WO2023240650A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2022/099623 WO2023240650A1 (en) 2022-06-17 2022-06-17 Color correction matrix calibration method and apparatus for camera module
CN202280004091.9A CN117616749A (en) 2022-06-17 2022-06-17 Color correction matrix calibration method and device for camera module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/099623 WO2023240650A1 (en) 2022-06-17 2022-06-17 Color correction matrix calibration method and apparatus for camera module

Publications (1)

Publication Number Publication Date
WO2023240650A1 true WO2023240650A1 (en) 2023-12-21

Family

ID=89192894

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099623 WO2023240650A1 (en) 2022-06-17 2022-06-17 Color correction matrix calibration method and apparatus for camera module

Country Status (2)

Country Link
CN (1) CN117616749A (en)
WO (1) WO2023240650A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100277626A1 (en) * 2008-01-23 2010-11-04 Olympus Corporation Image processing device, image signal correction method, correction matrix calculation method, and imaging device
CN106204500A (en) * 2016-07-28 2016-12-07 电子科技大学 A kind of different cameral that realizes shoots the method that Same Scene color of image keeps constant
CN108712639A (en) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 Image color correction method, apparatus and system
CN109218698A (en) * 2018-10-19 2019-01-15 浙江大学 A kind of color digital camera color calibration method of high fault tolerance
CN113676639A (en) * 2021-08-17 2021-11-19 Oppo广东移动通信有限公司 Image processing method, processing device, electronic apparatus, and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100277626A1 (en) * 2008-01-23 2010-11-04 Olympus Corporation Image processing device, image signal correction method, correction matrix calculation method, and imaging device
CN106204500A (en) * 2016-07-28 2016-12-07 电子科技大学 A kind of different cameral that realizes shoots the method that Same Scene color of image keeps constant
CN108712639A (en) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 Image color correction method, apparatus and system
CN109218698A (en) * 2018-10-19 2019-01-15 浙江大学 A kind of color digital camera color calibration method of high fault tolerance
CN113676639A (en) * 2021-08-17 2021-11-19 Oppo广东移动通信有限公司 Image processing method, processing device, electronic apparatus, and medium

Also Published As

Publication number Publication date
CN117616749A (en) 2024-02-27

Similar Documents

Publication Publication Date Title
EP3542347B1 (en) Fast fourier color constancy
CN111292246B (en) Image color correction method, storage medium, and endoscope
CN113170028B (en) Method for generating image data of machine learning based imaging algorithm
CN105827897A (en) Adjustment card manufacturing method, system, color correction matrix debugging method and device
US8913135B2 (en) Method and apparatus for measuring response curve of an image sensor
WO2020010638A1 (en) Method and device for detecting defective pixel in image
CN108419067B (en) White balance parameter recording and adjusting method and device, storage medium, terminal and camera
CN104869380A (en) Image processing apparatus and image processing method
CN106576155A (en) Image processing apparatus, image capturing apparatus, image processing method, and program
CN115619787B (en) UV glue defect detection method, system, equipment and medium
US9854218B2 (en) Electronic system and image processing method
CN110852385B (en) Image processing method, device, equipment and storage medium
CN107948617A (en) Image processing method, device, computer-readable recording medium and computer equipment
CN106664370A (en) Image processing device, filter acquisition device, image processing method, filter acquisition method, program, and recording medium
WO2023240650A1 (en) Color correction matrix calibration method and apparatus for camera module
CN115049530A (en) Method, apparatus and system for debugging image signal processor
JP4007016B2 (en) Color reproduction characteristic measuring apparatus and color reproduction characteristic measuring method
CN109978926B (en) Automatic image fusion method and device and terminal equipment
CN117156289A (en) Color style correction method, system, electronic device, storage medium and chip
CN111354058A (en) Image coloring method and device, image acquisition equipment and readable storage medium
CN112950509B (en) Image processing method and device and electronic equipment
WO2023151210A1 (en) Image processing method, electronic device and computer-readable storage medium
JP2006301803A (en) Image recognition device and image recognition method
CN115426487A (en) Color correction matrix adjusting method and device, electronic equipment and readable storage medium
CN113709438B (en) White balance correction method, device, storage medium and equipment for image

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202280004091.9

Country of ref document: CN

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

Ref document number: 22946331

Country of ref document: EP

Kind code of ref document: A1