Method and device for measuring spectral sensitivity function of camera

By obtaining the color response value of the reference image and using the pre-established sensitivity function library to generate the basis function, combined with weighted PCA calculation, the problem of inaccurate estimation of camera spectral sensitivity function in industrial production lines is solved, achieving higher accuracy and stability.

CN120378600APending Publication Date: 2025-07-25BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410671708.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the field of industrial production lines, the process of estimating the camera spectral sensitivity function in the prior art has low accuracy, resulting in inaccurate function estimation.

Method used

By obtaining the color response value of the reference image, and using the pre-established sensitivity function library to generate the basis function, combined with weighted PCA calculation, the spectral sensitivity function of the current batch camera module is fitted.

Benefits of technology

It improves the stability and accuracy of the camera spectral sensitivity function, and improves the inaccurate function estimation problem in the industrial production line field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378600A_ABST
    Figure CN120378600A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for measuring a spectral sensitivity function of a camera, and relates to the technical field of image processing. The method comprises the following steps: acquiring a reference image, and identifying a color response value of the reference image; generating a primary function by using a pre-established sensitivity function library; and obtaining a spectral sensitivity function of the camera module of the current batch according to the primary function and the color response value of the reference image. Compared with the prior art, the method has the advantages that the primary function is generated through the pre-established sensitivity function library, and then the spectral sensitivity function of the camera module of the current batch is determined through the primary function, so that a mode of obtaining the spectral sensitivity function through estimation in the prior art is replaced; therefore, the spectral sensitivity function of the current batch of camera modules is better in stability and higher in precision. Therefore, the problems of low process precision and inaccurate function estimation of camera spectral sensitivity function estimation in the industrial production line field are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular, to a method and device for measuring a camera spectral sensitivity function. Background Art

[0002] The camera spectral sensitivity function is crucial for many computer vision tasks, such as multispectral imaging, color rendering, and color constancy. The camera spectral sensitivity function can associate scene radiance information with the camera RGB response and is also often used for module consistency calibration. However, the camera spectral sensitivity function is not fixed and needs to be obtained by itself.

[0003] In the related art, in the industrial production line field, the indirect estimation method is usually adopted, and the camera spectral sensitivity function is estimated by the color values obtained by photographing a standard chart under a characteristic light source. This method takes a short time, but the accuracy is not accurate enough. There is also a direct measurement method, which uses a monochromator in cooperation with a spectrometer to measure the response of each channel of the camera in each spectral band. This method has high accuracy, but the measurement equipment is expensive and the measurement time is long, which is not suitable for industrial production line measurement.

[0004] Therefore, in the process of estimating the camera spectral sensitivity function in the industrial production line field, there are problems of low accuracy, which easily leads to inaccurate function estimation. Summary of the Invention

[0005] In view of this, the present application provides a method and device for measuring a camera spectral sensitivity function, mainly aiming to improve the problems of low accuracy in the process of estimating the camera spectral sensitivity function in the industrial production line field, which easily leads to inaccurate function estimation.

[0006] In a first aspect, the present application provides a method for measuring a camera spectral sensitivity function, including:

[0007] Obtain a reference image and identify the color response value of the reference image; the reference image is a preset format image obtained by photographing a color card by any camera module in the current batch of camera modules under a single light source;

[0008] Generate a basis function by using a pre-established sensitivity function library; the basis function is used to fit the spectral sensitivity function of the current batch of camera modules;

[0009] Obtain the spectral sensitivity function of the current batch of camera modules according to the basis function and the color response value of the reference image.

[0010] Optionally, the steps for constructing the pre-established sensitivity function library include: obtaining a first type of spectral sensitivity function and a second type of spectral sensitivity function through measurement; the first type of spectral sensitivity function is the spectral sensitivity function measured from a mobile phone and / or a single-lens reflex camera, and the second type of spectral sensitivity function is the spectral sensitivity function measured from any camera module in the current batch of camera modules; normalizing the first type of spectral sensitivity function and the second type of spectral sensitivity function to obtain the pre-established sensitivity function library.

[0011] Optionally, generating basis functions using the pre-established sensitivity function library includes: calculating weight values for generating basis functions based on the spectral sensitivity functions in the function library; performing weighted PCA calculation based on the weight values to obtain the basis functions.

[0012] Optionally, calculating the weight values for generating basis functions based on the spectral sensitivity functions in the function library includes: traversing and calculating the spectral sensitivity functions in the function library in combination with the spectral sensitivity function of any camera module in the current batch of camera modules to obtain the weight values for generating basis functions.

[0013] Optionally, after obtaining a reference image and identifying the color response value of the reference image, the method further includes: performing black level filtering on the reference picture; and / or, performing shadow correction on the reference picture; and / or, performing white balance processing on the reference picture.

[0014] Optionally, performing white balance processing on the reference picture includes: counting the initial color response values of each color in a preset area; calculating white balance coefficients based on the initial color response values; using the white balance coefficients to perform compensation processing on the initial color response values.

[0015] In a second aspect, the present application provides a measuring device for the spectral sensitivity function of a camera, including:

[0016] An acquisition unit configured to acquire a reference image and identify the color response value of the reference image; the reference image is a preset format image obtained by any camera module in the current batch of camera modules shooting a color card under a single light source;

[0017] A calculation unit configured to generate basis functions using a pre-established sensitivity function library; the basis functions are used to fit the spectral sensitivity function of the current batch of camera modules;

[0018] A determination unit configured to obtain the spectral sensitivity function of the current batch of camera modules according to the basis functions and the color response value of the reference image.

[0019] In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for measuring the camera spectral sensitivity function described in the first aspect is implemented.

[0020] In a fourth aspect, the present application provides an electronic device, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor. When the processor executes the computer program, the method for measuring the camera spectral sensitivity function described in the first aspect is implemented.

[0021] In a fifth aspect, the present application provides a chip, including one or more interface circuits and one or more processors; the interface circuit is configured to receive a signal from a memory of an electronic device and send the signal to the processor, and the signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device is caused to execute the method for measuring the camera spectral sensitivity function described in the first aspect.

[0022] By means of the above technical solution, a method and a device for measuring a camera spectral sensitivity function provided by the present application first obtain a reference image and identify the color response value of the reference image. Here, the reference image is a preset format image obtained by photographing a color card with any camera module in the current batch of camera modules under a single light source. Furthermore, a basis function for fitting the spectral sensitivity function of the current batch of camera modules is generated by using a pre-established sensitivity function library, and then the spectral sensitivity function of the current batch of camera modules is obtained according to the basis function and the color response value of the reference image. The present application generates a basis function through a pre-established sensitivity function library, and then determines the spectral sensitivity function of the current batch of camera modules through the basis function, thereby replacing the method of estimation and calculation in the related art, making the spectral sensitivity function of the current batch of camera modules obtained better in stability and higher in accuracy. Thus, the problem of low accuracy in the process of estimating the camera spectral sensitivity function and inaccurate function estimation in the industrial production line field is improved.

[0023] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0025] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0026] Figure 1 FIG. shows a schematic flowchart of a method for measuring the camera spectral sensitivity function provided by an embodiment of the present application;

[0027] Figure 2 FIG. shows a schematic flowchart of another method for measuring the camera spectral sensitivity function provided by an embodiment of the present application;

[0028] Figure 3 FIG. shows a schematic diagram of measuring the camera sensitivity functions of multiple mobile phones provided by an embodiment of the present application;

[0029] Figure 4 FIG. shows a schematic diagram of the change trend of a percentage variance index with the number of basis functions provided by an embodiment of the present application;

[0030] Figure 5 FIG. shows a schematic structural diagram of a device for measuring the camera spectral sensitivity function provided by an embodiment of the present application. Detailed Embodiments

[0031] Here, some embodiments of the present disclosure will be described in detail, and their examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. Various changes, deformations, and equivalents of the methods, devices, and / or systems described herein will become apparent after understanding the present disclosure. For example, the order of operations described herein is merely an example and is not limited to the orders set forth herein, but rather can be changed as will become apparent after understanding the present disclosure, except for operations that must be performed in a specific order. Additionally, for the sake of clarity and conciseness, the description of features known in the art may be omitted.

[0032] The embodiments described in some of the following embodiments of the present disclosure do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0033] The camera spectral sensitivity function can correlate scene radiance information with the camera's RGB response, which is crucial for many computer vision tasks, such as multispectral imaging, color rendering, and color constancy. In the mobile phone field, it is also used for module consistency calibration. However, the spectral sensitivity function is generally unknown and not provided by the manufacturer.

[0034] Currently, the methods for obtaining the spectral sensitivity function can be generally summarized into two categories: direct method and indirect method. The direct method uses a monochromator in combination with a spectrometer to measure the response of each channel of the camera in each spectral band. This method has high precision, but requires expensive measurement equipment and a relatively long measurement time, and is not suitable for measuring module data on the production line. The indirect method uses an estimation method to estimate the camera spectral sensitivity function through the color values obtained by photographing a standard chart under a characteristic light source. The accuracy of this method is not as high as that of direct measurement. Therefore, in the field of industrial production lines, there are problems of low accuracy and easy inaccurate function estimation in the process of estimating the camera spectral sensitivity function.

[0035] To improve the problems of low accuracy and easy inaccurate function estimation in the process of estimating the camera spectral sensitivity function in the field of industrial production lines. This embodiment provides a method for measuring the camera spectral sensitivity function, as Figure 1 shown, the method includes:

[0036] S101. Obtain a reference image and identify the color response values of the reference image.

[0037] First, the execution subject of the method for measuring the camera spectral sensitivity function proposed in this embodiment is an image signal processor (ISP, Image Signal Processor) or a device or chip that controls the image signal processor to perform image processing work. The reference image is a preset format image obtained by photographing a color chart under a single light source by any camera module in the current batch of camera modules. Here, any camera module in the current batch of camera modules refers to the camera modules produced in the current batch on the production line. A camera module is generally a functional module composed of a photosensitive element and a lens combined for shooting. The preset format can be the Raw format. The color chart refers to a standard chart, and in actual use, a standard ColorChecker color chart or a ColorChecker SG color chart, etc., can be selected. The color response values are also the response values of the camera (including R / G / B three). Actually, the response values here are the initial response values, and subsequent shadow correction, white balance processing, etc. can be used to process the initial color response values to exclude bad interferences.

[0038] S102. Generate basis functions using a pre-established sensitivity function library.

[0039] The basis functions are used to subsequently fit the spectral sensitivity function of the current batch of camera modules. Specifically, the basis functions are also the expression functions obtained through weighted PCA dimensionality reduction processing; since the principal component analysis method (PCA) needs to be used for subsequent processing, a camera spectral sensitivity function library needs to be prepared in advance. Here, PCA is a data preprocessing method that measures the difference of data with variance and can improve the problems of the direct pseudo-inverse method. One part of the database can select as many mobile phones and single-lens reflex cameras on the market as possible and obtain them using the direct measurement method. For the other part, the spectral sensitivity functions of the modules produced on the current production line also need to select random modules and measure them in advance using the direct method and add them to the database. The measured spectral sensitivity functions all need to be normalized to the maximum value to ensure that the sensitivity functions of each channel are in the range of [0, 1]. As Figure 3 shown, it is the camera sensitivity functions of multiple mobile phones measured. The function distribution includes three main peaks corresponding to the functions of the R, G, and B channels respectively.

[0040] Compared with the ordinary PCA method, the weighted PCA method can achieve the same accuracy with fewer basis functions. Therefore, calculating the weight values used to generate the basis functions can make the basis functions generated in PCA more accurate, thereby improving the accuracy.

[0041] S103. Obtain the spectral sensitivity function of the current batch of camera modules according to the basis functions and the color response values of the reference image.

[0042] In S103, matrix conversion can be performed through the replacement formula of the response value, so as to establish the connection between the color response value of the camera and the basis functions (as well as the coefficient matrix of the basis functions, etc.). The calculation process will be described later.

[0043] In this embodiment, first, a reference image is obtained, and the color response value of the reference image is identified. Here, the reference image is a preset format image obtained by a camera module in the current batch of camera modules taking a color card under a single light source. Then, using the pre-established sensitivity function library, basis functions for fitting the spectral sensitivity function of the current batch of camera modules are generated. Then, according to the basis functions and the color response values of the reference image, the spectral sensitivity function of the current batch of camera modules is obtained. In this embodiment, the basis functions are generated through the pre-established sensitivity function library, and then the spectral sensitivity function of the current batch of camera modules is determined through the basis functions, thereby replacing the estimation calculation method in the related art, making the spectral sensitivity function of the current batch of camera modules obtained have better stability and higher accuracy. Thus, it improves the problem of low accuracy in the process of estimating the camera spectral sensitivity function and inaccurate function estimation in the industrial production line field.

[0044] Optionally, the steps for constructing the pre-established sensitivity function library include: obtaining the first type of spectral sensitivity function and the second type of spectral sensitivity function through measurement; the first type of spectral sensitivity function is the spectral sensitivity function measured from a mobile phone and / or a single-lens reflex camera, and the second type of spectral sensitivity function is the spectral sensitivity function measured from any camera module in the current batch of camera modules; normalizing the first type of spectral sensitivity function and the second type of spectral sensitivity function to obtain the pre-established sensitivity function library.

[0045] In this embodiment, the essence of the function library is a database. One part of the database can select as many mobile phones and single-lens reflex cameras on the market as possible and be obtained by using the direct measurement method. Another part is the spectral sensitivity function of the modules produced on the current production line. Random modules also need to be selected and measured in advance using the direct method and added to the database. It should be noted here that the purpose of this embodiment is to estimate the spectral sensitivity function of the camera in the current batch. Although the second type of spectral sensitivity function is also taken from the current batch, its purpose is to improve the comprehensiveness of the samples. For example, in some cases, the difference between the mobile phones and single-lens reflex cameras on the market and this batch is relatively large. Collecting the spectral sensitivity function of this batch can improve the sample coverage of the database. In one embodiment, the spectral sensitivity function of the historical production batch can also be selected to further enrich the function library.

[0046] Optionally, using the pre-established sensitivity function library to generate basis functions includes: calculating the weight values for generating the basis functions based on the spectral sensitivity functions in the function library; performing weighted PCA calculation based on the weight values to obtain the basis functions.

[0047] In this embodiment, the basis functions are used to fit the spectral sensitivity function of the camera module in the current batch. There may be multiple basis functions, and the expression of the basis functions is usually similar to the spectral sensitivity function of the final camera module in the current batch. Of course, the fewer the number of basis functions, that is, the smaller the function represented by the basis functions and the spectral sensitivity function, the fewer basis functions can be used to achieve the same accuracy. The weight values are the respective weight values of each spectral sensitivity function in the function library, and actually represent the similarity degree between each spectral sensitivity function in the function library and the basis function to be generated. Finally, perform weighted PCA calculation based on the weight values to obtain the basis functions.

[0048] Optionally, calculating the weight values for generating the basis functions based on the spectral sensitivity functions in the function library includes: traversing and calculating the spectral sensitivity functions in the function library in combination with the spectral sensitivity function of any camera module in the current batch of camera modules to obtain the weight values for generating the basis functions.

[0049] By traversing and calculating the spectral sensitivity functions in the function library using the spectral sensitivity function of any camera module in the current batch of camera modules, the weight values for generating the basis functions are obtained. The weight values generated here are calculated by using the spectral sensitivity functions in the function library as data samples to calculate the similarity (weight value) between each spectral sensitivity function in the function library and the spectral sensitivity function of any camera module in the current batch of camera modules. Then, the basis functions are generated based on these weight values. In other words, since the spectral sensitivity function of any camera module in the current batch of camera modules is unknown, in order to make the obtained spectral sensitivity function more accurate, each spectral sensitivity function in the pre-established function library is calculated to calculate the similarity between each function in the existing function library and the unknown spectral sensitivity function of the current batch. This similarity is also used as the weight value for generating the basis functions. The basis functions here are used to fit the spectral sensitivity function of the camera modules in the current batch.

[0050] Optionally, after obtaining the reference image and identifying the color response value of the reference image, the method further includes: performing black level filtering on the reference picture; and / or, performing shadow correction on the reference picture; and / or, performing white balance processing on the reference picture.

[0051] In this embodiment, firstly, the generation of the black level is due to the fact that the sensor itself has dark current, resulting in a certain output voltage even when there is no light irradiation. Therefore, this part of the voltage value needs to be subtracted during the image processing, otherwise it will affect subsequent modules such as white balance of the image. The reason for shadow correction is that the lens, infrared cut-off filter, and image sensor are the main parts causing lens shadows. Shadows include luminance shadows and chromaticity shadows, and correction generally removes this part of the shadows through a dedicated module to improve the image processing effect.

[0052] Optionally, performing white balance processing on the reference picture includes: statistically calculating the initial color response values of each color in a preset area; calculating the white balance coefficient based on the initial color response values; and compensating the initial color response values using the white balance coefficient.

[0053] In this embodiment, the response value of the camera needs to undergo white balance preprocessing, which can eliminate the differences between different units of the same type of light source on the production line. Because the light source also decays over time during use, there will be different light effects even for the same light source. Therefore, white balance processing is required. By statistically calculating the initial color response values of each color in a preset area to obtain the white balance coefficient and then performing compensation processing, the differences between different units of the same type of light source on the production line can be minimized.

[0054] Furthermore, in order to better demonstrate the technical solution proposed in this embodimentFigure 2 A flowchart showing a case of a method for measuring the spectral sensitivity function of a camera is presented, including steps such as black level erasure, lens shading correction, white balance processing, and weighted PCA calculation combined with a spectral sensitivity function library to obtain the spectral sensitivity function.

[0055] First, a RAW format image is captured by any camera module in the current batch of camera modules under a single light source. Here, a camera module refers to a camera module where the photosensitive element and the lens are combined, such as the functional module for taking pictures in a mobile phone or a camera. The light source is selected as an LED light source without spikes, and at the same time, the consistency and stability of the light source should be relatively good to be suitable for mass production lines. A color card refers to a standard chart, and in actual use, a standard ColorChecker color card or a ColorChecker SG color card, etc., can be selected.

[0056] After obtaining the RAW format picture, that is, the reference image, it is provided to an image signal processor for black level subtraction processing. The image signal processor processes the RAW image output by the optical sensor to make it a signal that conforms to the true perception of the human eye and outputs it. In this step, the color response values (including R / G / B three kinds) of the reference image are actually obtained. The purpose of black level subtraction is to avoid the influence on white balance caused by voltage value jumps. The generation of black level is due to the fact that the sensor itself has dark current, resulting in a certain output voltage even when there is no light irradiation. Therefore, this part of the voltage value needs to be subtracted during the image processing process, otherwise it will affect subsequent modules such as white balance of the image.

[0057] Furthermore, lens shading correction is performed. The reason for shading correction is that components such as the lens, infrared cut-off filter, and image sensor are the main parts causing lens shading. Among them, the shading includes luminance shading and chromaticity shading, and the correction generally removes this part of the shading through a dedicated module to improve the image processing effect.

[0058] Through white balance processing, the differences between different units of the same type of light source in the production line can be minimized. Here, taking the standard ColorChecker color card as an example, of course, other standard color cards can also be selected. The 19th to 24th color patches of the ColorChecker color card are gray color patches, and the 20th to 23rd color patches can be selected as the reference color patches for preprocessing. The same corresponding gray color patches are selected as reference color patches for other standard color cards. First, calculate the average values of the camera responses r / g and b / g of the 20th to 23rd color patches of the ColorChecker color card. The image after lens shading correction is in Bayer format, and it is necessary to statistically obtain the average R, Gr, Gb, B of the image within the picked color patch range, and take G=(Gr + Gb) / 2.

[0059] The correlation coefficient of the white balance diagonal matrix is calculated by the following formula:

[0060] max_gain = max([r / g, b / g, 1.0]) (Formula 1)

[0061]

[0062] Specific operation mode of white balance:

[0063]

[0064] After white balance processing, it is necessary to establish a camera spectral sensitivity function library next. The essence of the function library is a database. For one part of the database, as many mobile phones and single-lens reflex cameras as possible on the market (the first type of spectral sensitivity function) can be selected and obtained by the direct measurement method. For the other part, the spectral sensitivity functions of the modules produced on the current production line (the second type of spectral sensitivity function) also need to select random modules and measure them in advance by the direct method and add them to the database. The reason for collecting the spectral sensitivity functions of the modules produced on the current production line is to improve the comprehensiveness of the function samples. For example, in some cases, the differences between the mobile phones and single-lens reflex cameras on the market and this batch are relatively large. Collecting the spectral sensitivity functions of this batch can improve the sample coverage of the database. In addition, all measured spectral sensitivity functions need to be normalized to the maximum value to ensure that the sensitivity functions of each channel are within the range of [0, 1].

[0065] After the function library is constructed, it can be learned that for a three-channel RGB camera, the response value calculation method is as follows:

[0066]

[0067] where I k is the color response value of the k-th channel. R(λ) is the spectral reflectance, L(λ) is the spectral energy distribution of the light source, C k (λ), k = R, G, B are the camera spectral sensitivity functions. The upper and lower limits of the integral, 380 and 780, are only examples and are respectively the upper and lower limits of the distribution interval of the function (see Figure 3 ).

[0068] For the convenience of calculation, the above integral process is written in a discrete form:

[0069] I mx1 = R mxn ·L nxn ·C nx1 = R mxn ·L nxn ·B nxk ·A kx1 (Formula 4)

[0070] Among them, m represents the number of samples, n represents the spectral dimension, and k represents the number of basis functions. B nxk : Basis function matrix, A kx1 : Corresponding coefficients. The reflectance of the standard color card can be measured, and the light source spectrum is measured by selecting the master light source of the production line. The camera spectral sensitivity function C k (λ), k = R, G, B is transformed into the basis function matrix and the corresponding coefficients.

[0071] Optionally, for ease of calculation, it can be further transformed into a matrix based on Equation Four:

[0072] I = MA

[0073] A = M + I

[0074] Q = M + = AI + (Equation Five)

[0075] Here, the "+" represents the generalized inverse matrix of the corresponding matrix, and Equation Five can be obtained through singular value decomposition (SVD).

[0076] Furthermore, the weighted PCA method is used to obtain the basis functions. Compared with the ordinary PCA method, the weighted PCA method can achieve the same accuracy with fewer basis functions. The weighted PCA introduces weights on the basis of the ordinary PCA to reflect the degree of closeness to the camera spectral sensitivity function of the current batch. Specifically, the weight value for generating the basis functions is calculated through the formula:

[0077]

[0078] In the formula, w i is the weight value of the i-th function, r is the spectral sensitivity function of any camera module in the current batch of camera modules; is the sensitivity function in the database, k is the weight parameter, and GFC i is the substitution parameter. The weight value for generating the basis functions can be obtained based on Equation Six.

[0079] Finally, the basis functions are generated. First, the number of basis functions is determined. The selection of the number of basis functions is the key to the PCA method and needs to be determined in advance. At the same time, the number of basis functions does not change in the real-time fast estimation scheme of the production line. In this embodiment, the percentage variance index is introduced. The larger this index, the smaller the difference between the function represented by the basis functions and the original function. Generally, selecting basis functions with an index greater than 0.98 can accurately restore the original function. For example Figure 4The figure shows the variation trend of the index with the number of basis functions. The abscissa is the selected number of the current basis function (m in Equation 7), and the ordinate is the index value. n in Equation 7 is the number of functions in the function library. L i are the eigenvalues obtained by decomposing based on the PCA method.

[0080]

[0081] After the above steps, the generated basis functions (including the basis functions themselves and the number of basis functions) are finally determined. Then, substituting the basis functions into the matrix transformed by Equation 5, the spectral sensitivity function of the current batch of camera modules can be determined.

[0082] In a feasible embodiment, Tikhonov regularization is introduced to improve the stability of the results:

[0083]

[0084] T is the transpose matrix, + is the generalized inverse matrix, and the addition of the minimum value α can appropriately improve the solution of the ill-conditioned problem. Select the spectral sensitivity function of the current batch of modules. The reflectance of the standard color card can be measured, and the light source spectrum is measured using the master light source on the production line. Here, numerical integration is used to simulate the response to the standard color card. The simulated response values also need to go through the white balance step. Combining the coefficient matrix A corresponding to the spectral sensitivity function of the current batch of modules obtained by weighted PCA decomposition, Q can be obtained through the above formula.

[0085] Among them, Q can be regarded as a conversion matrix to establish a connection between the camera response and the basis function coefficient matrix. Q can be solved by the optimization method, and then the corresponding spectral sensitivity function can be calculated through the camera response value. The finally required spectral sensitivity function can be expressed as BA, where B is the basis function matrix obtained by weighted PCA decomposition, and A = QI. Therefore, the spectral sensitivity function is obtained by combining the basis functions obtained by weighted PCA decomposition, the calculated conversion matrix Q, and the camera response matrix I after white balance.

[0086] In this embodiment, the weights of each function in the sensitivity function library are introduced through the weighted PCA method, making the basis functions generated in the PCA more accurate. As a result, the spectral sensitivity function of the current batch of camera modules calculated finally has better stability and higher accuracy. Thus, it improves the problems of low accuracy in the process of estimating the camera spectral sensitivity function and inaccurate function estimation in the industrial production line field.

[0087] Furthermore, as Figures 1 to 4 a specific implementation of the method shown, this embodiment provides a measuring device for the camera spectral sensitivity function, as Figure 5As shown in the figure, the device includes: an acquisition unit 51, a calculation unit 52, and a determination unit 53.

[0088] The acquisition unit 51 is configured to acquire a reference image and identify the color response value of the reference image; the reference image is a preset format image obtained by photographing a color card under a single light source by any one of the camera modules in the current batch of camera modules.

[0089] The calculation unit 52 is configured to generate a basis function by using a pre-established sensitivity function library; the basis function is used to fit the spectral sensitivity function of the camera modules in the current batch.

[0090] The determination unit 53 is configured to obtain the spectral sensitivity function of the camera modules in the current batch according to the basis function and the color response value of the reference image.

[0091] In a specific application scenario, the calculation unit 52 is specifically configured to measure and obtain a first type of spectral sensitivity function and a second type of spectral sensitivity function; the first type of spectral sensitivity function is the spectral sensitivity function measured from a mobile phone and / or a single-lens reflex camera, and the second type of spectral sensitivity function is the spectral sensitivity function measured from any one of the camera modules in the current batch of camera modules; perform normalization processing on the first type of spectral sensitivity function and the second type of spectral sensitivity function to obtain the pre-established sensitivity function library.

[0092] In a specific application scenario, the calculation unit 52 is further specifically configured to traverse and calculate the spectral sensitivity functions in the function library in combination with the spectral sensitivity function of any one of the camera modules in the current batch of camera modules to obtain the weight values for generating the basis function.

[0093] In a specific application scenario, the calculation unit 52 is further specifically configured to calculate the weight values for generating the basis function based on the spectral sensitivity functions in the function library; perform weighted PCA calculation based on the weight values to obtain the basis function.

[0094] In a specific application scenario, the calculation unit 52 is further specifically configured to traverse and calculate the spectral sensitivity functions in the function library in combination with the spectral sensitivity function of any one of the camera modules in the current batch of camera modules to obtain the weight values for generating the basis function.

[0095] In a specific application scenario, the acquisition unit 51 is further specifically configured to perform black level filtering on the reference picture; and / or perform shadow correction on the reference picture; and / or perform white balance processing on the reference picture.

[0096] In a specific application scenario, the acquisition unit 51 is further specifically configured to count the initial color response values of each color in a preset area; based on the initial color response values, calculate a white balance coefficient; and use the white balance coefficient to perform compensation processing on the initial color response values.

[0097] It should be noted that for other corresponding descriptions of each functional unit involved in the method for measuring the camera spectral sensitivity function provided in this embodiment, reference can be made to Figures 1 to 4 the corresponding description in

[0098] Based on the method as described above in Figures 1 to 4 Accordingly, this embodiment further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method as described above in Figures 1 to 4 is implemented.

[0099] Based on such an understanding, the technical solution of this application can be embodied in the form of a software product, and the software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of this application.

[0100] Based on the method as described above in Figures 1 to 4 and Figure 5 the virtual device embodiment as described above, in order to achieve the above object, this embodiment of the application further provides an electronic device, such as intelligent terminals such as a smart phone, a tablet computer, a drone, a smart robot, etc., and the device includes a storage medium and a processor; the storage medium is used for storing a computer program; the processor is used for executing the computer program to implement the method as described above in Figures 1 to 4 is implemented.

[0101] Optionally, the above-mentioned physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, sensors, an audio circuit, a WI-FI module, and so on. The user interface may include a display screen (Display), an input unit such as a keyboard (Keyboard), etc., and optionally the user interface may further include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0102] Those skilled in the art can understand that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine some components, or have different component arrangements.

[0103] The storage medium may further include an operating system and a network communication module. The operating system is a program for managing the hardware and software resources of the above-mentioned physical devices, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to implement communication between components inside the storage medium, as well as communication with other hardware and software in the information processing physical device.

[0104] Based on the method as Figures 1 to 4 described above, and Figure 5 the virtual device embodiment as Figures 1 to 4 described above, this embodiment further provides a chip, including one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from the memory of the electronic device and send the signal to the processor, and the signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device is caused to execute the method as

[0105] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or can also be implemented by hardware. By applying the solution of this embodiment, compared with the current existing technology, by introducing the weights of the functions in the sensitivity function library through the weighted PCA method, the basis functions generated in the PCA are more accurate, so that the spectral sensitivity function of the current batch of camera modules finally calculated has better stability and higher accuracy. Thus, it improves the problem of low accuracy in the process of estimating the camera spectral sensitivity function and inaccurate function estimation in the industrial production line field.

[0106] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including the element.

[0107] The above are only specific embodiments of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments described herein, but rather will conform to the broadest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for measuring a camera spectral sensitivity function, characterized in that, Including: Obtain a reference image and identify the color response value of the reference image; The reference image is a preset format image obtained by photographing a color card under a single light source by any one of the camera modules in the current batch of camera modules; Generate basis functions using a pre-established sensitivity function library; The basis functions are used to fit the spectral sensitivity function of the camera modules in the current batch; According to the basis functions and the color response values of the reference image, obtain the spectral sensitivity function of the camera modules in the current batch.

2. The method according to claim 1, wherein The construction steps of the pre-established sensitivity function library include: Measure the first type of spectral sensitivity function and the second type of spectral sensitivity function; the first type of spectral sensitivity function is the spectral sensitivity function measured from a mobile phone and / or a single-lens reflex camera, and the second type of spectral sensitivity function is the spectral sensitivity function measured from any one of the camera modules in the current batch of camera modules; Normalize the first type of spectral sensitivity function and the second type of spectral sensitivity function to obtain the pre-established sensitivity function library.

3. The method according to claim 1, characterized in that, The generating basis functions using a pre-established sensitivity function library includes: Based on the spectral sensitivity functions in the function library, calculate the weight values for generating the basis functions; Perform weighted PCA calculation based on the weight values to obtain the basis functions.

4. The method according to claim 3, characterized in that, The calculating the weight values for generating the basis functions based on the spectral sensitivity functions in the function library includes: Combined with the spectral sensitivity function of any one of the camera modules in the current batch of camera modules, traverse and calculate the spectral sensitivity functions in the function library to obtain the weight values for generating the basis functions.

5. The method according to claim 1, characterized in that After obtaining the reference image and identifying the color response value of the reference image, the method further includes: Performing black level filtering on the reference picture; and / or, Performing shadow correction on the reference picture; and / or, Performing white balance processing on the reference picture.

6. The method according to claim 5, wherein The performing white balance processing on the reference picture includes: Count the initial color response values of each color in a preset area; Based on the initial color response values, calculate the white balance coefficients; Use the white balance coefficients to perform compensation processing on the initial color response values.

7. A measuring device for a camera spectral sensitivity function, characterized in that, Including: An acquisition unit configured to obtain a reference image and identify the color response value of the reference image; The reference image is a preset format image obtained by photographing a color card under a single light source by any one of the camera modules in the current batch of camera modules; A calculation unit configured to generate basis functions using a pre-established sensitivity function library; The basis functions are used to fit the spectral sensitivity function of the camera modules in the current batch; A determination unit configured to obtain the spectral sensitivity function of the camera modules in the current batch according to the basis functions and the color response values of the reference image.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 6.

9. An electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 6.

10. A chip, characterized in that, Comprising one or more interface circuits and one or more processors; the interface circuits are configured to receive signals from a memory of an electronic device and send the signals to the processors, the signals including computer instructions stored in the memory; when the processors execute the computer instructions, the electronic device is caused to perform the method according to any one of claims 1 to 6.