Method and device for detecting color reducibility of mobile phone camera and medium
By acquiring and processing color chart images from mobile phone cameras under multi-light source conditions, and combining deep learning models and attention weights, the problem of insufficient color modeling across light sources is solved, and efficient and stable detection of color reproduction of mobile phone cameras is achieved.
Patent Information
- Application Number
- CN202511963714.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-02-13
AI Technical Summary
Existing mobile phone camera color reproduction detection technologies suffer from insufficient cross-light source color modeling and unstable high-dimensional error evaluation under multi-light source conditions, making it difficult for the detection results to accurately reflect the true imaging performance in complex lighting scenarios.
Images of the standard color chart are captured by a mobile phone camera under various light source conditions. Geometric alignment and color block region division are performed to obtain a cross-light source color block observation matrix. Illumination correction and high-dimensional color embedding are performed through a deep learning model. Color reproduction error index is calculated by combining attention weights to generate a pass/fail test conclusion.
It achieves adaptive aggregation and high-dimensional representation of key color block features under complex lighting conditions, enhances the robustness and discriminative power of color feature extraction, and provides a stable and reliable basis for camera quality detection.
Smart Images

Figure CN121531118A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image quality detection, and in particular to a mobile phone camera color restorability detection method, device and medium. BACKGROUND
[0002] With the rapid development of mobile imaging technology, mobile phone cameras have gradually evolved from early low-pixel, simple imaging modes to comprehensive imaging systems integrating high-resolution sensors, multi-camera collaborative imaging, computational photography algorithms, and artificial intelligence enhanced processing. In imaging quality evaluation, color restorability, as an important indicator of measuring the authenticity and visual consistency of camera imaging, has always been the focus of research and industry. Existing detection methods mainly rely on standard color card shooting experiments, which involve collecting color card images under controlled light source conditions, calculating the color difference between the captured images and the standard reference colors, and forming objective and quantitative color restorability evaluation results. With the development of deep learning and image processing algorithms, some studies have attempted to combine color data under multi-light source environments with high-dimensional feature analysis techniques, aiming to achieve more comprehensive quantitative detection and evaluation of camera imaging performance.
[0003] However, the existing technology still has deficiencies in color restorability detection under multi-light source conditions. On the one hand, traditional methods often rely on image data under a single or small number of light sources, lack of systematic modeling of color non-linear variation rules in cross-light source environments, resulting in detection results that are difficult to accurately reflect the true imaging performance in complex lighting scenarios. On the other hand, existing solutions generally use low-dimensional statistical features or simple color difference indicators for evaluation, and have not fully utilized the joint advantages of deep learning and high-dimensional feature embedding, unable to establish an end-to-end optimization model between lighting correction, feature representation, and error measurement, limiting the stability and generalization ability of the detection results in large-scale terminal quality inspection and algorithm iteration. SUMMARY
[0004] In view of the above existing problems, the present application is proposed.
[0005] Therefore, the present application provides a mobile phone camera color restorability detection method to solve the problems of insufficient cross-light source color modeling and unstable high-dimensional error evaluation in existing mobile phone camera color restorability detection technology.
[0006] To solve the above technical problems, the present application provides the following technical solutions:
[0007] In a first aspect, the present application provides a mobile phone camera color restorability detection method, which includes,
[0008] Collecting a set of color card images of a standard color card captured by a mobile phone camera under multiple light source conditions;
[0009] After the geometric alignment of the color card image set, the color block region is divided, and the cross-light source color block observation matrix is obtained through color block feature extraction;
[0010] The cross-light source color block observation matrix is converted into target color space coordinates, and the cross-light source color coordinate matrix is obtained after illumination correction;
[0011] The cross-light source color coordinate matrix is input into a deep learning model to output a color block level high-dimensional color embedding matrix, and the high-dimensional color embedding vector set corresponding to the measured mobile phone camera is obtained by combining the attention weight;
[0012] Based on the high-dimensional color embedding vector set, the color restoration error index is calculated by combining the standard reference library;
[0013] According to the color restoration error index, the eligibility determination is performed to generate the eligibility detection conclusion.
[0014] As a preferred scheme of the mobile phone camera color restoration detection method, the color card image set is geometrically aligned, and the cross-light source color block observation matrix is obtained through color block feature extraction, and the specific steps are as follows,
[0015] The light source identifier, image format and frame number of each color card image in the color card image set are extracted to obtain a color card image set with light source identifier;
[0016] In the color card image set with light source identifier, the standard color card four corner points are positioned by using the positioning mark, and the homography matrix calculation method is used to map all color card images to a unified reference plane, and the rotation, translation and perspective distortion in the shooting process are eliminated to generate a geometrically aligned color card image set;
[0017] According to the layout coordinates of the standard color card, each color card image in the geometrically aligned color card image set is partitioned to generate a color block region;
[0018] The median of the center pixel in the color block region is extracted as the color block representative value to obtain the color block feature data corresponding to the color card image set;
[0019] The color block feature data is sorted and combined according to the light source type, color block number and image format to generate a cross-light source color block observation matrix.
[0020] As a preferred scheme of the mobile phone camera color restoration detection method, the cross-light source color block observation matrix is converted into target color space coordinates, and the specific steps are as follows,
[0021] The light source identifier, color block number and three-channel value in the cross-light source color block observation matrix are read one by one to establish a cross-light source channel record table;
[0022] Based on the cross light source channel recording table, the three-channel sequence is unified into R channel, G channel and B channel to form a cross light source RGB color block matrix;
[0023] The cross light source RGB color block matrix is subjected to interval linear stretching according to the black level and white saturation level of the mobile phone camera to generate a cross light source linear RGB color block matrix;
[0024] According to the neutral gray block value in the cross light source linear RGB color block matrix, the white balance gain is calculated, and linear proportional correction is performed to obtain a cross light source white balance RGB color block matrix;
[0025] The cross light source white balance RGB color block matrix is subjected to linear matrix transformation to obtain a cross light source XYZ color block matrix;
[0026] The cross light source XYZ color block matrix is mapped to D50 reference white through Bradford color adaptation transformation to generate a cross light source D50-XYZ color block matrix.
[0027] As a preferred scheme of the mobile phone camera color restoration detection method, the steps of performing illumination correction to obtain a cross light source color coordinate matrix are as follows,
[0028] Based on the cross light source D50-XYZ color block matrix, a cross light source Lab color block matrix is obtained through a CIELab standard formula, and a small first-order compensation term is calculated in combination with a light source nominal color temperature and an environment color temperature record;
[0029] The cross light source Lab color block matrix is subjected to differential level correction through the small first-order compensation term to generate a cross light source corrected Lab color block matrix;
[0030] The cross light source corrected Lab color block matrix is rearranged into a cross light source color coordinate matrix according to the light source sequence and the color block sequence number.
[0031] As a preferred scheme of the mobile phone camera color restoration detection method, the steps of inputting the cross light source color coordinate matrix into a deep learning model to output a color block level high-dimensional color embedding matrix are as follows,
[0032] The light source index, the color block index and the three-channel values are extracted from the cross light source color coordinate matrix, and dimension consistency and index order verification are performed to generate a cross light source color coordinate tensor;
[0033] The cross light source color coordinate tensor is subjected to standardization processing according to the channel to generate a standardized cross light source color coordinate tensor;
[0034] The standardized cross-light source color coordinate tensor is flattened into a one-dimensional sequence according to the light source order and color block number, and the three channels are kept stacked in parallel to construct a serialized cross-light source color coordinate tensor.
[0035] The serialized cross-light source color coordinate tensor is input into the deep learning model, the intermediate representation tensor is output, and after being sliced according to the color patch number, it is merged into a color patch-level high-dimensional color embedding matrix through a fully connected mapping head.
[0036] As a preferred embodiment of the method for detecting the color reproduction performance of a mobile phone camera according to the present invention, the specific steps for obtaining the high-dimensional color embedding vector set corresponding to the tested mobile phone camera by combining attention weights are as follows.
[0037] The high-dimensional color embedding matrix at the color block level is weighted and aggregated by attention weights to generate the aggregated high-dimensional color embedding matrix at the color block level.
[0038] Based on the aggregated color block-level high-dimensional color embedding matrix, unit sphere normalization is performed according to the vector norm, and gentle clipping is performed on the outlier vectors of the deviation to obtain the normalized color block-level high-dimensional color embedding matrix.
[0039] The normalized color block-level high-dimensional color embedding matrix is packaged according to the color block number to form a high-dimensional color embedding vector set.
[0040] As a preferred embodiment of the method for detecting the color reproduction performance of a mobile phone camera according to the present invention, the specific steps for calculating the color reproduction error index based on a high-dimensional color embedding vector set and a standard reference library are as follows.
[0041] The high-dimensional color embedding vector set is mapped one-to-one with the standard reference library according to the color patch index, and the reference mean vector and reference covariance matrix are calculated to form a reference statistical set;
[0042] Based on the reference statistical set, Mahalanobis distance and cosine similarity difference are calculated to obtain the color block level error vector, and robust standardization is performed to generate a color block level standardized error score table.
[0043] The importance weights of color patches are generated based on the trace of the reference covariance matrix and normalized. The color patch-level standardized error score table is then aggregated according to the normalized color patch importance weights to generate a color reproduction error index.
[0044] As a preferred embodiment of the method for detecting the color reproduction performance of a mobile phone camera according to the present invention, the specific steps for determining the pass / fail status based on the color reproduction error index and generating a pass / fail test conclusion are as follows.
[0045] Collect the color reproduction error index of a set of historical qualified samples to obtain the judgment threshold;
[0046] Based on the color reproduction error index and the judgment threshold, the pass / fail status is determined, and a pass / fail test conclusion is generated.
[0047] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the method for detecting the color reproduction of a mobile phone camera as described in the first aspect of the present invention.
[0048] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the method for detecting the color reproduction of a mobile phone camera as described in the first aspect of the present invention.
[0049] The beneficial effects of this invention are as follows: By inputting the cross-light source color coordinate matrix into a deep learning model and combining it with attention weights to extract high-dimensional color embedding vectors, adaptive aggregation and high-dimensional representation of key color block features under complex lighting conditions are achieved, enhancing the robustness and discriminative power of color feature extraction. Subsequently, based on the statistical distribution matching between the high-dimensional color embedding vector set and the standard reference library, a color reproduction error index is generated by comprehensively considering Mahalanobis distance, cosine similarity difference, and color block importance weights, and a pass / fail judgment is made. This achieves an objective quantitative evaluation of the color reproduction performance of the camera, providing a stable and reliable technical basis for camera quality inspection under multi-light source imaging conditions. Attached Figure Description
[0050] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Fig. 1 A flowchart for a method to detect the color reproduction of a mobile phone camera.
[0052] Fig. 2 This is a flowchart for cross-light source color space conversion and illumination correction.
[0053] Fig. 3 A flowchart for deep learning modeling and high-dimensional color embedding vector set acquisition.
[0054] Fig. 4 This is a flowchart for calculating the color reproduction error index and determining its pass / failability. Detailed Implementation
[0055] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0056] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0057] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0058] Reference Figs. 1-4 As one embodiment of the present invention, this embodiment provides a method for detecting the color reproduction performance of a mobile phone camera, comprising the following steps:
[0059] S1: A collection of color chart images captured by a mobile phone camera under various light source conditions;
[0060] Furthermore, during the acquisition under multi-light source conditions, the camera of the mobile phone under test was fixedly mounted on the testing bracket, and the imaging plane was kept perpendicular to the surface of the standard color card. The standard color card was fixedly placed in the center of the testing platform, and three standard light sources were turned on in sequence: a D65 daylight source, an A-type tungsten filament lamp source, and an F11 fluorescent lamp source. The illuminance of each light source was controlled at 1000±50 lx and the color temperature deviation did not exceed ±50 K. Under each light source, imaging was performed using a fixed focal length, a fixed ISO of 200, a fixed exposure time of 1 / 60 second, and a white balance mode locked at the D65 reference point. Three frames of RAW format images and three frames of JPEG format images were continuously acquired. During the saving process, each frame of image was labeled with the light source type, image format, and frame number. All images were classified and stored according to the light source type, image format, and frame number, forming a collection of color card images captured by the mobile phone camera under multiple light source conditions.
[0061] S2: After geometrically aligning the color card image set, divide the color block regions and obtain the cross-light source color block observation matrix through color block feature extraction;
[0062] S2.1: Extract the light source identifier, image format, and frame number of each frame of the color card image from the color card image set to obtain a color card image set with light source identifier;
[0063] Furthermore, within the color chart image set, each frame of the color chart image is read from a file, and the attribute information stored in the image file is parsed. During the parsing process, the light source type, image format, and frame number recorded in the image file name and header information are extracted and stored in a corresponding index table. The extracted light source identifier, image format, and frame number are bound together with the corresponding color chart image, so that each frame of the color chart image carries complete light source identifier information, forming a set that can distinguish images under different light source conditions, serving as a color chart image set with light source identifiers.
[0064] S2.2: In the set of color card images with light source markings, using the positioning marks of the four corner points of the standard color card, the homography matrix calculation method is used to map all color card images onto a unified reference plane, and eliminate the rotation, translation and perspective distortion during the shooting process to generate a geometrically aligned set of color card images.
[0065] Furthermore, in the set of color chart images with light source markers, for each frame of the color chart image, the positioning marks at the four corner points of the standard color chart are used as reference points for geometric correction. By detecting the corner point positions, the coordinates of the four corner points in the image plane are determined, and a correspondence is established between these coordinates and the coordinates of the four corner points in the standard color chart reference plane. After establishing the correspondence, a homography matrix calculation method is used to generate a mapping matrix from the current image plane to the standard reference plane. The mapping matrix is used to perform a geometric transformation on the entire color chart image, mapping all color chart images to a unified reference plane, and simultaneously eliminating rotation, translation, and perspective distortion during the shooting process. After completing the mapping of all color chart images, a geometrically aligned set of color chart images is obtained.
[0066] S2.3: According to the layout coordinates of the standard color chart, each color chart image in the geometrically aligned color chart image set is partitioned to generate color block regions;
[0067] Furthermore, within the geometrically aligned color chart image set, the layout coordinates of the standard color chart are used as the basis for partitioning. For each frame of the geometrically aligned color chart image, the color chart image is divided block by block according to the predefined rectangular coordinate area in the standard color chart layout, ensuring that each partition corresponds to a color block of the standard color chart. During the partitioning process, edge alignment processing is performed on the boundary pixels to ensure that each color block area is completely consistent with the actual distribution of the standard color chart. After all color blocks are partitioned, each color chart image is split into multiple color block areas, generating color block regions.
[0068] It should be noted that the layout coordinates of the standard color chart refer to the fixed two-dimensional coordinate range established for each color block in the reference plane according to the physical arrangement of the standard color chart. The fixed two-dimensional coordinate range is determined by the row and column position of the color chart and can uniquely identify the specific position and boundary of each color block in the reference plane. The predefined rectangular coordinate area is a rectangular area in the geometrically aligned color chart image, divided according to the row and column distribution corresponding to the layout coordinates of the standard color chart. Each rectangular area corresponds one-to-one with a color block in the standard color chart and is used to limit the sampling range of the color block in the image, thereby ensuring that the extracted color block feature data can strictly correspond to the actual position of the standard color chart.
[0069] S2.4: Extract the median of the center pixel from the color block region as the representative value of the color block to obtain the color block feature data corresponding to the color card image set;
[0070] Furthermore, within each color block region, pixels within that region are processed centrally, and a selection of pixels from the center of each region are chosen as a candidate set. The pixel values of this candidate set are statistically analyzed, and the median of the three-channel values is extracted. This median is then used as the representative value for the color block region, characterizing its color features within the image. This effectively reduces the interference of noise or local anomalies on the representative value. After extracting the representative values for all color block regions, the color block feature data corresponding to the color chart image set is obtained.
[0071] S2.5: Sort and combine the color patch feature data according to the light source type, color patch number and image format to generate a cross-light source color patch observation matrix;
[0072] Furthermore, after obtaining the color patch feature data, all color patch feature data are sorted according to the light source type, color patch number, and image format. Color patch feature data under the same light source type are centralized, and under each light source condition, they are arranged according to the color patch number. The feature data of the same color patch are then classified according to the image format. Through sequential sorting and grouping, all color patch feature data are combined in an orderly manner to form a complete data structure. This complete data structure can simultaneously reflect the differences in light source conditions, color patch numbers, and image formats, generating a cross-light source color patch observation matrix.
[0073] S3: Convert the cross-light source color patch observation matrix into target color space coordinates and perform illumination correction to obtain the cross-light source color coordinate matrix;
[0074] S3.1: Read the light source identifier, color block number and three-channel values in the cross-light source color block observation matrix one by one, and establish a cross-light source channel record table;
[0075] Furthermore, in the cross-source color patch observation matrix, the data content of each record is read one by one, and the source identifier, color patch number and three-channel values contained in the data content are extracted and stored in a unified table structure according to the record order. During storage, an index is created for each record to ensure that the source identifier, color patch number and three-channel values can correspond one-to-one, and a cross-source channel record table is obtained, thus achieving the goal of extracting and uniformly storing the original information of the cross-source color patch observation matrix one by one.
[0076] It should be noted that the three-channel values refer to the pixel response values in the red, green, and blue channels after the mobile phone camera captures the color chart image. The pixel response values are directly derived from the optical response of the pixels in the color chart image set and can fully characterize the color characteristics of each color block under different light source conditions.
[0077] S3.2: Based on the cross-light source channel record table, the three channels are unified into R channel, G channel and B channel to form a cross-light source RGB color block matrix;
[0078] Furthermore, based on the cross-light source channel record table, the three channel values in each record are unified in order. The three channel values are arranged in the order of R channel, G channel and B channel, and the unified channel values are rewritten into the record table. This generates a cross-light source RGB color block matrix containing all light source identifiers, color block numbers and three channel values in a consistent arrangement, thus achieving standardization and consistency of channel order across the cross-light source range.
[0079] S3.3: Perform range linear scaling on the cross-light source RGB color block matrix according to the black level and white saturation level of the mobile phone camera to generate a cross-light source linear RGB color block matrix;
[0080] Furthermore, in the cross-light source RGB color block matrix, the black level and white saturation level data of the mobile phone camera are called, and the three-channel values of each color block are linearly scaled according to the range of black level and white saturation level, so that the channel values are mapped to a standardized linear range, and the whole replacement is completed in the matrix to obtain the cross-light source linear RGB color block matrix.
[0081] The three-channel values of each color block are linearly scaled according to the range of black level and white saturation level, as expressed by:
[0082] ;
[0083] in, For linearized light source Lower color block In the passage The response value, Light source in the cross-light source RGB color block matrix Lower color block In the passage The response value, For channel The corresponding black level value, For channel The corresponding white saturation level value;
[0084] It should be noted that the black level and white saturation level are derived from the calibration data of the mobile phone camera. The black level represents the lower limit of the sensor's baseline response when there is no light input, while the white saturation level represents the upper limit of the sensor's saturation response when there is strong light input. These values are obtained by the mobile phone camera before it leaves the factory or is tested, and are used to limit the linear mapping range of the RGB color block matrix across light sources.
[0085] S3.4: Calculate the white balance gain based on the neutral gray block values in the cross-light source linear RGB color block matrix, and perform linear scaling correction to obtain the cross-light source white balance RGB color block matrix;
[0086] Furthermore, in the cross-source linear RGB color block matrix, the three-channel values of the neutral gray block are located as the neutral gray block values. The white balance gain is calculated based on the neutral gray block values and applied to all color blocks in the cross-source linear RGB color block matrix. The three channels are then linearly proportionally corrected to obtain the cross-source white balance RGB color block matrix, thus realizing the white balance correction of the cross-source linear RGB color block matrix.
[0087] S3.5: Perform a linear matrix transformation on the cross-light source white balance RGB color block matrix to obtain the cross-light source XYZ color block matrix;
[0088] Furthermore, in the cross-source white balance RGB color block matrix, a linear matrix transformation is performed on the three-channel values of each color block. The matrix used is the calibrated color conversion matrix. Through matrix transformation, the three-channel values of the cross-source white balance RGB color block matrix are mapped to the CIE XYZ color space coordinates to obtain the cross-source XYZ color block matrix, thus realizing the spatial conversion from the cross-source white balance RGB color block matrix to the cross-source XYZ color block matrix.
[0089] It should be noted that the calibrated color conversion matrix is obtained by acquiring the standard color card under controlled light source conditions using a spectrally calibrated standard camera or spectrophotometer. During the acquisition process, the true tristimulus values of the standard color card in the CIEXYZ color space are recorded simultaneously. A one-to-one pairing relationship is established between the RGB response values acquired by the mobile phone camera and the true XYZ values of the standard color card. The optimal linear mapping matrix from the RGB three channels to the XYZ tristimulus values is solved using the least squares fitting method. After the solution is completed, this matrix is stored as the color conversion matrix and used to uniformly convert the cross-light source white balance RGB color block matrix to the CIEXYZ color space during the detection process.
[0090] S3.6: Map the cross-light source XYZ color block matrix to the D50 reference white through the Bradford color adaptation transformation to generate the cross-light source D50-XYZ color block matrix;
[0091] Furthermore, in the cross-light source XYZ color block matrix, the Bradford color adaptation transformation method is used to map the coordinate values of each color block in the CIE XYZ color space to a standard environment with D50 as the reference white, and then complete the replacement in the cross-light source XYZ color block matrix to generate a cross-light source D50-XYZ color block matrix, thus realizing the color adaptation uniformity of the cross-light source XYZ color block matrix under different light source conditions.
[0092] S3.7: Based on the cross-source D50-XYZ color block matrix, the cross-source Lab color block matrix is obtained through the CIELab standard formula, and a small first-order compensation term is calculated by combining the nominal color temperature of the source and the ambient color temperature record.
[0093] Furthermore, in the cross-source D50-XYZ color block matrix, the CIELab standard formula is called to convert the three-channel values of each color block in the CIEXYZ color space into coordinate values of the L channel, a channel, and b channel, thus obtaining the cross-source Lab color block matrix. During the conversion process, the nominal color temperature of the light source and the ambient color temperature are combined to calculate a small first-order compensation term, realizing the conversion and compensation preparation from the cross-source D50-XYZ color block matrix to the cross-source Lab color block matrix.
[0094] The CIELab standard formula is:
[0095] ;
[0096] ;
[0097] ;
[0098] in, For light sources in the Lab color block matrix across light sources Lower color block The brightness component, For light sources in the Lab color block matrix across light sources Lower color block The green-red chromaticity component, For light sources in the Lab color block matrix across light sources Lower color block The blue-yellow chromaticity component, For light sources in the D50-XYZ color block matrix across light sources Lower color block X channel tristimulation value, For light sources in the D50-XYZ color block matrix across light sources Lower color block Y-channel tristimulation value, For light sources in the D50-XYZ color block matrix across light sources Lower color block Z-channel tristimulation value, The X channel tristimulus values for the D50 reference white point in the CIEXYZ color space. The Y channel tristimulus values of the D50 reference white point in the CIEXYZ color space. The Z channel tristimulus values of the D50 reference white point in the CIEXYZ color space. This refers to the luminance scaling constant in the CIELab standard formula. This refers to the luminance offset constant in the CIELab standard formula. This refers to the green-to-red chromaticity ratio constant in the CIELab standard formula. This is the blue-yellow chromaticity ratio constant in the CIELab standard formula.
[0099] It should be noted that the nominal color temperature of the light source is the color temperature parameter provided by the manufacturer for D65 daylight light source, type A tungsten filament lamp light source and F11 fluorescent lamp light source under standard conditions, while the ambient color temperature record is the result of real-time measurement and storage of the actual color temperature of the light source in the test environment by color temperature measurement equipment during the specific acquisition process. The combination of the two can reflect the difference between the theoretical value and the actual value of the light source, and is used for micro-grading correction of the Lab color block matrix across light sources.
[0100] S3.8: Perform micro-level correction on the cross-source Lab color patch matrix by using a small first-order compensation term to generate a cross-source corrected Lab color patch matrix;
[0101] Furthermore, a small first-order compensation term is invoked in the cross-source Lab color block matrix to perform micro-level correction on the L channel, a channel, and b channel of each color block. After the correction is completed, a cross-source correction Lab color block matrix is generated, realizing color temperature fine-tuning and deviation correction of the cross-source Lab color block matrix.
[0102] S3.9: Rearrange the Lab color patch matrix for cross-light source correction according to the light source order and color patch number into a cross-light source color coordinate matrix;
[0103] Furthermore, in the cross-light source correction Lab color block matrix, the L, a, and b channels of all color blocks are rearranged according to the arrangement rules of light source order and color block number to ensure that the data in the matrix has a fixed arrangement order in the light source dimension and color block dimension, thereby generating a cross-light source color coordinate matrix and realizing the structured output of the cross-light source correction Lab color block matrix to the cross-light source color coordinate matrix.
[0104] S4: Input the cross-light source color coordinate matrix into the deep learning model, output a color block-level high-dimensional color embedding matrix, and combine the attention weights to obtain the high-dimensional color embedding vector set corresponding to the tested mobile phone camera;
[0105] S4.1: Extract the light source index, color block index and three-channel values from the cross-light source color coordinate matrix, and perform dimension consistency and index ordering checks to generate a cross-light source color coordinate tensor;
[0106] Furthermore, the light source index, color block index, and three-channel values are extracted line by line from the cross-light source color coordinate matrix and recombined into structured data units. During the processing, the order of the light source index and color block index is checked to ensure that the arrangement conforms to the predetermined order. At the same time, the number and arrangement of the three-channel values are checked to avoid data errors caused by missing or misaligned values. After the dimension consistency and index ordering are checked, a cross-light source color coordinate tensor is generated, realizing the conversion from the cross-light source color coordinate matrix to the cross-light source color coordinate tensor.
[0107] It should be noted that the established order requires the light source index to be arranged in the order of D65 daylight source, A-type tungsten filament lamp source, and F11 fluorescent lamp source.
[0108] S4.2: Standardize the cross-light source color coordinate tensor by channel to generate a standardized cross-light source color coordinate tensor;
[0109] Furthermore, based on the cross-light source color coordinate tensor, the values of the three channels are standardized to adjust the distribution of values of different channels to a uniform range in order to eliminate the scale difference between channels. The standardized values are then refilled into the cross-light source color coordinate tensor to form a new matrix representation, which serves as the standardized cross-light source color coordinate tensor, thus realizing the channel standardization of the cross-light source color coordinate tensor.
[0110] S4.3: Flatten the standardized cross-light source color coordinate tensor into a one-dimensional sequence according to the light source order and color block number, and retain the three channels stacked in parallel to construct a serialized cross-light source color coordinate tensor.
[0111] Furthermore, in the standardized cross-light source color coordinate tensor, the tensor is flattened into a linear sequence one by one according to the light source order and color block number, while maintaining the parallel stacking of the three-channel values without being broken, so that the three-channel values of each color block remain intact in the sequence. After flattening, a serialized cross-light source color coordinate tensor with a one-dimensional sequence structure is constructed, realizing the structural transformation from the standardized cross-light source color coordinate tensor to the serialized cross-light source color coordinate tensor.
[0112] S4.4: Input the serialized cross-light source color coordinate tensor into the deep learning model, output the intermediate representation tensor, and then slice it according to the color block number and merge it into a color block-level high-dimensional color embedding matrix through a fully connected mapping head;
[0113] Furthermore, the serialized cross-light source color coordinate tensor is input into a deep learning model. In the deep learning model, it is processed sequentially through convolutional layers, normalization layers, and nonlinear activation layers to extract intermediate representation tensors that can characterize the differences in cross-light source features. The intermediate representation tensors are sliced according to the color patch number, and the slicing results are input into a fully connected mapping head for mapping and merging to obtain a color patch-level high-dimensional color embedding matrix. This realizes the representation transformation from the serialized cross-light source color coordinate tensor to the color patch-level high-dimensional color embedding matrix.
[0114] Furthermore, a graph neural network (Graph Neural Network) model was chosen for the deep learning model. Graph Neural Networks can express the correlation between different color patches in the cross-light source color coordinate tensor by constructing relationships between nodes and edges, and can learn the global consistency of color performance under cross-light source conditions by combining light source index information. During training, cross-light source color coordinate matrices from a standard reference library were prepared as training input, and each cross-light source color coordinate matrix was paired with its corresponding standard color label to construct a training dataset. The training dataset was input into the Graph Neural Network model, and forward propagation was used to extract the high-dimensional representation vector of each color patch. The difference between this vector and the embedding vector in the standard reference library was calculated to generate a loss value. The loss value calculation process employed a contrastive learning method, requiring that the high-dimensional vectors of the same color patch be similar under different light source conditions, while the high-dimensional vectors of different color patches remain distinct. After obtaining the loss value, backpropagation and parameter update methods were used to optimize the weight parameters of the Graph Neural Network model. After multiple rounds of iterative training, the Graph Neural Network model was able to stably output a high-dimensional color embedding matrix at the color patch level that conforms to the reference standard.
[0115] It should be noted that the standard reference library refers to the data set used as a comparison benchmark in the detection method. The data set consists of color coordinate data obtained by collecting standard color cards under multi-light source conditions using a standard camera or spectrophotometer that has been calibrated with high precision. After long-term stability verification and statistical processing, each color block in the standard reference library corresponds to a standard color coordinate across light sources and its reference embedding vector in high-dimensional space. The standard reference library is used to perform color block-by-color block pairing and comparison with the high-dimensional color embedding vector set generated by the camera of the tested mobile phone during the entire detection process, thereby providing a consistent and reliable reference benchmark for calculating the color reproduction error index.
[0116] S4.5: Weighted aggregation of the color block-level high-dimensional color embedding matrix is performed through attention weights to generate an aggregated color block-level high-dimensional color embedding matrix;
[0117] Furthermore, based on the color block-level high-dimensional color embedding matrix, attention weights are used to perform weighted aggregation of the high-dimensional vectors of different color blocks. The contribution of each color block vector is dynamically adjusted according to the distribution of attention weights, thereby improving the attention to key color blocks while maintaining the overall structure. After weighted aggregation, the aggregated color block-level high-dimensional color embedding matrix is obtained, realizing cross-light source aggregation of the color block-level high-dimensional color embedding matrix.
[0118] S4.6: Based on the aggregated color block-level high-dimensional color embedding matrix, unit ball normalization is performed according to the vector norm, and the abnormal vectors of the deviation are gently clipped to obtain the normalized color block-level high-dimensional color embedding matrix.
[0119] Furthermore, in the aggregated high-dimensional color embedding matrix at the color block level, each vector is normalized to a unit sphere according to the vector norm, so that the length of all high-dimensional vectors is consistent, thereby avoiding deviations caused by differences in numerical scale. At the same time, vectors that deviate abnormally are gently pruned to prevent individual extreme values from interfering with the overall distribution. After this processing, a normalized high-dimensional color embedding matrix at the color block level is obtained, realizing the normalization and anomaly correction of the aggregated high-dimensional color embedding matrix at the color block level.
[0120] It should be noted that the vector norm is a metric used to measure the overall size of a high-dimensional vector. When processing aggregated high-dimensional color embedding matrices at the color block level, the role of the vector norm is to calculate the overall length of each high-dimensional vector and map it onto the unit sphere, so that the lengths of all vectors remain consistent.
[0121] S4.7: Pack the normalized color block-level high-dimensional color embedding matrix according to the color block number to form a high-dimensional color embedding vector set;
[0122] Furthermore, in the normalized color block-level high-dimensional color embedding matrix, the color blocks are sequentially packaged according to their index numbers, and the high-dimensional vector corresponding to each color block is stored in a unified data structure to ensure a one-to-one correspondence with the color block index. After packaging, a high-dimensional color embedding vector set is formed, realizing the aggregation and output of the normalized color block-level high-dimensional color embedding matrix into a high-dimensional color embedding vector set.
[0123] S5: Based on a high-dimensional color embedding vector set and combined with a standard reference library, calculate the color reproduction error index;
[0124] S5.1: Map the high-dimensional color embedding vector set to the standard reference library one-to-one according to the color patch index, and calculate the reference mean vector and the reference covariance matrix to form a reference statistical set;
[0125] Furthermore, in the high-dimensional color embedding vector set, each color patch has a corresponding high-dimensional vector representation. The standard reference library also stores reference embedding vectors for color patches under multi-light source conditions. The high-dimensional color embedding vector set and the standard reference library are mapped one-to-one according to the color patch index, ensuring that the measured vector and reference vector for the same color patch are strictly paired. After pairing, statistical processing is performed on the reference embedding vectors in the standard reference library to calculate the reference mean vector for each color patch in high-dimensional space, which represents the central characterization of the color patch under multi-light source conditions. Simultaneously, the reference covariance matrix for each color patch is calculated to describe its distribution and correlation in high-dimensional space, forming a reference statistical set that provides a statistical benchmark for subsequent error calculations.
[0126] S5.2: Based on the reference statistical set, calculate the Mahalanobis distance and cosine similarity difference to obtain the color block level error vector, and perform robust standardization to generate a color block level standardized error score table;
[0127] Furthermore, based on the reference statistical set, the measured vectors in the high-dimensional color embedding vector set are compared with the corresponding reference mean vectors. The Mahalanobis distance of each color patch is calculated using the reference covariance matrix to characterize the statistical deviation of the measured vectors relative to the reference distribution. Simultaneously, the cosine similarity between the measured vectors in the high-dimensional color embedding vector set and the corresponding reference mean vectors is calculated, and the difference between the two similarities is taken as the cosine similarity difference to characterize the degree of deviation of the measured vectors in direction. The Mahalanobis distance and the cosine similarity difference are combined to obtain the color patch-level error vector. Robust standardization is then performed on this vector, using the median and median absolute deviation to eliminate the influence of extreme values on the overall distribution, making the error values between different color patches comparable, and generating a color patch-level standardized error score table.
[0128] The expression for calculating the difference between the Mahalanobis distance and the cosine distance is:
[0129] ;
[0130] ;
[0131] in, For color blocks Mahalanobis distance, For color blocks cosine difference, Embedding vectors to create color patches for high-dimensional colors The normalized embedding vector, For color swatches in the standard reference library The reference mean vector, For color swatches in the standard reference library The reference covariance matrix, For color swatches in the standard reference library The inverse of the reference covariance matrix, This indicates transpose.
[0132] S5.3: Generate color block importance weights based on the trace of the reference covariance matrix and normalize them. Aggregate the color block-level standardized error score table according to the normalized color block importance weights to generate a color reproduction error index.
[0133] Furthermore, based on the color patch-level standardized error score table, the trace of the covariance matrix of each color patch in the reference statistical set is calculated. The magnitude of the trace value reflects the stability of the color patch in high-dimensional space. By taking the reciprocal of the trace values of all color patches and normalizing them, the importance weight of each color patch is obtained, giving color patches with higher stability a greater weight in the overall evaluation. The color patch-level standardized error score table is then mapped one-to-one with the normalized color patch importance weights and weighted and aggregated to obtain a single overall error value. This overall error value is the color reproduction error index, used to characterize the overall color reproduction performance of the tested mobile phone camera under multi-light source conditions.
[0134] S6: Determine the pass / fail status based on the color reproduction error index and generate a pass / fail test conclusion;
[0135] S6.1: Collect the color reproduction error index of the historical qualified sample set and obtain the judgment threshold;
[0136] Furthermore, from the historical set of qualified samples, the color reproduction error index calculated for each sample during the testing process is retrieved and compiled into a distribution sequence. Statistical analysis is performed on this distribution sequence, and the percentile position at the high end of the distribution is extracted as a threshold reference point. This statistical result is then used as the final judgment threshold, providing a clear benchmark for subsequent judgment steps, thereby achieving the goal of obtaining the judgment threshold.
[0137] S6.2: Based on the color reproduction error index and combined with the judgment threshold, the pass / fail determination is made and a pass / fail test conclusion is generated;
[0138] Furthermore, during the judgment process, the color reproduction error index corresponding to the tested mobile phone camera is compared with the judgment threshold. If the color reproduction error index is within the threshold, a qualified conclusion is output; if the color reproduction error index exceeds the threshold, a unqualified conclusion is output. Finally, the judgment results are generated into a qualified test conclusion in a unified data format, thus realizing the qualified judgment based on the color reproduction error index and the judgment threshold.
[0139] This embodiment also provides a computer device applicable to the method for detecting the color reproduction of a mobile phone camera, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method for detecting the color reproduction of a mobile phone camera as proposed in the above embodiment.
[0140] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0141] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the detection method for color reproduction of a mobile phone camera as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0142] In summary, this invention achieves adaptive aggregation and high-dimensional representation of key color block features under complex lighting conditions by inputting the cross-light source color coordinate matrix into a deep learning model and combining it with attention weights for high-dimensional color embedding vector extraction. This enhances the robustness and discriminative power of color feature extraction. Subsequently, based on the statistical distribution matching between the high-dimensional color embedding vector set and the standard reference library, a color reproduction error index is generated by comprehensively considering Mahalanobis distance, cosine similarity difference, and color block importance weights, and a pass / fail determination is made. This provides an objective quantitative evaluation of the color reproduction performance of the camera and offers a stable and reliable technical basis for camera quality inspection under multi-light source imaging conditions.
[0143] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for detecting the color reproduction performance of a mobile phone camera, characterized in that: include, A collection of color chart images captured by a mobile phone camera under various light source conditions; After geometric alignment of the color chart image set, color block regions are divided, and cross-light source color block observation matrix is obtained by extracting color block features; The cross-light source color patch observation matrix is converted into target color space coordinates, and illumination correction is performed to obtain the cross-light source color coordinate matrix; The cross-light source color coordinate matrix is input into the deep learning model, and the output is a high-dimensional color embedding matrix at the color block level. The high-dimensional color embedding vector set corresponding to the tested mobile phone camera is obtained by combining the attention weights. Based on a high-dimensional color embedding vector set and combined with a standard reference library, the color reproduction error index is calculated. The pass / fail status is determined based on the color reproduction error index, and a pass / fail test conclusion is generated.
2. The method for detecting the color reproduction of a mobile phone camera as described in claim 1, characterized in that: The process involves geometrically aligning the color chart image set, dividing it into color block regions, and then extracting color block features to obtain a cross-light source color block observation matrix. The specific steps are as follows: Extract the light source identifier, image format, and frame number of each frame of the color chart image set to obtain a color chart image set with light source identifiers; In a set of color chart images with light source markings, using the positioning marks at the four corners of the standard color chart, the homography matrix calculation method is used to map all color chart images onto a unified reference plane, and eliminate rotation, translation and perspective distortion during the shooting process to generate a geometrically aligned set of color chart images. According to the layout coordinates of the standard color chart, each color chart image in the geometrically aligned color chart image set is partitioned to generate color block regions; The median of the center pixel in the color block region is extracted as the representative value of the color block to obtain the color block feature data corresponding to the color card image set; The color patch feature data are sorted and combined according to the light source type, color patch number, and image format to generate a cross-light source color patch observation matrix.
3. The method for detecting the color reproduction of a mobile phone camera as described in claim 2, characterized in that: The specific steps for converting the cross-light source color patch observation matrix into target color space coordinates are as follows. Read the light source identifier, color block number and three-channel values in the cross-light source color block observation matrix one by one, and establish a cross-light source channel record table; Based on the cross-light source channel recording table, the three channels are unified into R channel, G channel and B channel to form a cross-light source RGB color block matrix; The cross-light source RGB color block matrix is linearly scaled according to the black level and white saturation level of the mobile phone camera to generate a cross-light source linear RGB color block matrix; Based on the neutral gray block values in the cross-light source linear RGB color block matrix, the white balance gain is calculated and linear scaling correction is performed to obtain the cross-light source white balance RGB color block matrix. A linear matrix transformation is performed on the cross-light source white balance RGB color block matrix to obtain the cross-light source XYZ color block matrix; The cross-source XYZ color block matrix is mapped to the D50 reference white through the Bradford color adaptation transformation to generate the cross-source D50-XYZ color block matrix.
4. The method for detecting the color reproduction of a mobile phone camera as described in claim 3, characterized in that: The illumination correction process yields a cross-light source color coordinate matrix. The specific steps are as follows: Based on the cross-source D50-XYZ color block matrix, the cross-source Lab color block matrix is obtained through the CIELab standard formula, and a small first-order compensation term is calculated by combining the nominal color temperature of the source and the ambient color temperature record. A cross-source calibrated Lab color block matrix is generated by performing micro-level correction on the cross-source Lab color block matrix through a small first-order compensation term. The Lab color swatch matrix for cross-light source correction is rearranged into a cross-light source color coordinate matrix according to the light source order and color swatch number.
5. The method for detecting the color reproduction of a mobile phone camera as described in claim 4, characterized in that: The specific steps for inputting the cross-light source color coordinate matrix into the deep learning model and outputting a high-dimensional color embedding matrix at the color block level are as follows. Extract the light source index, color block index and three-channel values from the cross-light source color coordinate matrix, and perform dimension consistency and index ordering checks to generate a cross-light source color coordinate tensor; The cross-light source color coordinate tensor is standardized by channel to generate a standardized cross-light source color coordinate tensor. The standardized cross-light source color coordinate tensor is flattened into a one-dimensional sequence according to the light source order and color block number, and the three channels are kept stacked in parallel to construct a serialized cross-light source color coordinate tensor. The serialized cross-light source color coordinate tensor is input into the deep learning model, the intermediate representation tensor is output, and after being sliced according to the color patch number, it is merged into a color patch-level high-dimensional color embedding matrix through a fully connected mapping head.
6. The method for detecting the color reproduction of a mobile phone camera as described in claim 5, characterized in that: The specific steps for obtaining the high-dimensional color embedding vector set corresponding to the tested mobile phone camera by combining attention weights are as follows. The high-dimensional color embedding matrix at the color block level is weighted and aggregated by attention weights to generate the aggregated high-dimensional color embedding matrix at the color block level. Based on the aggregated color block-level high-dimensional color embedding matrix, unit sphere normalization is performed according to the vector norm, and gentle clipping is performed on the outlier vectors of the deviation to obtain the normalized color block-level high-dimensional color embedding matrix. The normalized color block-level high-dimensional color embedding matrix is packaged according to the color block number to form a high-dimensional color embedding vector set.
7. The method for detecting the color reproduction of a mobile phone camera as described in claim 6, characterized in that: The method for calculating the color reproduction error index based on a high-dimensional color embedding vector set and a standard reference library is as follows: The high-dimensional color embedding vector set is mapped one-to-one with the standard reference library according to the color patch index, and the reference mean vector and reference covariance matrix are calculated to form a reference statistical set; Based on the reference statistical set, Mahalanobis distance and cosine similarity difference are calculated to obtain the color block level error vector, and robust standardization is performed to generate a color block level standardized error score table. The importance weights of color patches are generated based on the trace of the reference covariance matrix and normalized. The color patch-level standardized error score table is then aggregated according to the normalized color patch importance weights to generate a color reproduction error index.
8. The method for detecting the color reproduction of a mobile phone camera as described in claim 7, characterized in that: The process of determining passability based on color reproduction error indicators and generating a pass / fail test conclusion involves the following steps: Collect the color reproduction error index of a set of historical qualified samples to obtain the judgment threshold; Based on the color reproduction error index and the judgment threshold, the pass / fail status is determined, and a pass / fail test conclusion is generated.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the method for detecting the color reproduction of a mobile phone camera as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the method for detecting the color reproduction of a mobile phone camera as described in any one of claims 1 to 8.
Citation Information
Cited By
Near monochromatic light source mixed white light achromatic high-quality imaging method
CN121981893A
White cloth color deviation detection method and system based on virtual target color calibration
CN122361292A