A machine vision-based camera color consistency calibration method
By constructing a two-dimensional pixel coordinate matrix and a pixel-level spatial color response analysis network, a correction gain coefficient matrix is generated, which solves the problem of local color deviation in wide dynamic range scenes and color consistency calibration in complex spectral environments, and achieves high-precision color consistency calibration effect.
Patent Information
- Application Number
- CN202610620720.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-08
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies are insufficient in calibrating color consistency among multiple devices under wide dynamic range scenarios with significant local color deviations and complex spectral environments. Traditional methods ignore the non-uniformity of sensor pixel-level spatial response and the non-linearity of spectral response, resulting in low color calibration accuracy.
By acquiring RAW format image data, a two-dimensional pixel coordinate matrix is constructed and sinusoidal position encoding is performed. Combined with a pixel-level spatial color response analysis network, a correction gain coefficient matrix is generated to eliminate spatial response differences and establish color space conversion relationships, thereby achieving pixel-by-pixel color correction.
It achieves the elimination of local color deviation in wide dynamic range scenes and high-precision color consistency calibration in complex spectral environments, improving the spatial consistency perception and color feature comparability of computer vision tasks.
Smart Images

Figure CN122457754A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method for calibrating camera color consistency based on machine vision. Background Technology
[0002] In the fields of machine vision and computer vision, camera color consistency calibration is a key technology to ensure the color uniformity of images output from multiple cameras. With the rapid development of industrial automation, intelligent monitoring, and computer vision applications, multi-camera collaborative operation has become the mainstream configuration. However, due to differences in sensor manufacturing processes, optical system characteristics, and environmental factors, different cameras often exhibit significant differences in color response. In recent years, deep learning-based color correction methods have gradually emerged, using convolutional neural networks to learn color transformation mappings, thus improving the accuracy of color calibration in computer vision tasks to a certain extent.
[0003] However, existing technical solutions still have shortcomings: First, traditional methods often use globally uniform correction parameters, ignoring the non-uniformity of sensor pixel-level spatial response, resulting in significant color deviation in local areas under wide dynamic range scenarios; second, color space conversion often relies on simple linear matrix mapping, failing to fully integrate the nonlinear differences in spectral response and the statistical characteristics of channel response distribution, making it difficult to achieve high-precision color consistency calibration for multiple cameras in complex spectral environments. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a machine vision-based camera color consistency calibration method to solve the problems of significant local color deviation in wide dynamic range scenes and insufficient accuracy of multi-camera color consistency calibration in complex spectral environments in existing technologies.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a camera color consistency calibration method based on machine vision, comprising: acquiring raw RAW format image data of the current scene, and constructing a two-dimensional pixel coordinate matrix according to the pixel distribution of the raw RAW format image data; performing sinusoidal position encoding processing on the two-dimensional pixel coordinate matrix to obtain an encoded feature map characterizing the spatial positional relationship and positional change law of pixels; performing pixel alignment fusion with the encoded feature map and the raw RAW format image data to obtain position constraint fusion features, and inputting the position constraint fusion features into a pixel-level spatial color response analysis network to extract spatial non-uniform color response features in the raw RAW format image data to obtain calibration features corresponding to each pixel. A positive gain coefficient matrix is used to perform pixel-by-pixel response amplitude modulation on the original RAW format image data to obtain a spatially homogenized intermediate image that eliminates spatial response differences. The standard virtual camera spectral response curve is called to establish the color space conversion relationship between the current camera and the standard virtual camera. Combined with the response distribution characteristics of each color channel of the spatially homogenized intermediate image, a color space mapping parameter set is obtained. The color space mapping parameter set is used to perform a global color transformation on the spatially homogenized intermediate image and convert it to a preset standard reference color space to obtain a virtual space mapping image. The virtual space mapping image is then subjected to gamma correction and color gamut cropping to obtain a color consistency calibration image.
[0007] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for constructing the two-dimensional pixel coordinate matrix are as follows: Acquire raw RAW format image data of the current scene and read sensor metadata that records the optical axis center offset; The actual optical center coordinates are obtained based on sensor metadata, and the pixel positions of the original RAW format image data are normalized using the actual optical center coordinates to obtain a normalized coordinate matrix. Based on the arrangement of the Bayer array in the original RAW format image data, a Bayer phase coding matrix with the same dimensions as the normalized coordinate matrix is generated; The normalized coordinate matrix and the Bayer phase coding matrix are stacked and fused in the channel dimension to obtain a two-dimensional pixel coordinate matrix.
[0008] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for obtaining the encoded feature map representing the spatial positional relationship and positional change law of pixels are as follows: The two-dimensional pixel coordinate matrix is decoupled and separated in the channel dimension to obtain normalized horizontal coordinate data, normalized vertical coordinate data, and Bayer phase identifier data; Based on the normalized horizontal and vertical coordinate data, the radial distance matrix of each pixel relative to the optical center is obtained. Gaussian weighted logarithmic frequency integral coding was performed on the radial distance matrix, normalized abscissa data, normalized ordinate data, and Bayer phase identifier data to obtain the coding feature values; The encoded feature values of all pixels are combined to form an encoded feature map that represents the spatial positional relationship and positional change pattern of pixels.
[0009] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for obtaining the position constraint fusion feature are as follows: Bayer phase unrolling and pixel rearrangement are performed on the original RAW format image data to obtain phase-aligned image data corresponding to the original pixel topological positions. Phase-aligned image data and coded feature maps are matched one-to-one according to pixel position and fused at the channel level to obtain initial fused features with enhanced position conditions; The initial fusion features enhanced by location conditions are input into the conditional modulation branch to generate spatial modulation parameters corresponding to each pixel position. The initial fusion features are then subjected to pixel-by-pixel adaptive modulation using the spatial modulation parameters to obtain the location-constrained fusion features.
[0010] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for obtaining the correction gain coefficient matrix corresponding to each pixel are as follows: The position-constrained fusion features are input into the dynamic convolutional analysis branch, and combined with the original RAW local statistical information of the corresponding pixel neighborhood, a position-related dynamic convolutional kernel is generated. Local response analysis is performed on the position-constrained fusion features to obtain continuous spatial response features; A pixel heterogeneous association graph is constructed based on continuous spatial response features, and the neighborhood response information of each pixel is propagated and uniformly aggregated using the pixel heterogeneous association graph to obtain spatially non-uniform color response features. Based on the spatial non-uniform color response characteristics, the response deviation of each pixel is estimated pixel by pixel, generating a correction gain coefficient matrix with the same size as the original RAW format image data.
[0011] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for obtaining the spatially homogenized intermediate image that eliminates spatial response differences are as follows: The original RAW format image data is linearized and the correction gain coefficient matrix is adjusted to the same dimension to obtain the linear light intensity matrix and the aligned gain coefficient matrix. Log-Normal adaptive modulation integral calculation is performed on the linear light intensity matrix and the aligned gain coefficient matrix to obtain the modulated pixel light intensity value; The modulated pixel light intensity values are subjected to dynamic range constraint processing to obtain the restricted light intensity matrix; By recombining the limiting light intensity matrix and combining it with the global tone mapping curve, a spatially homogenized intermediate image is obtained that eliminates spatial response differences.
[0012] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for establishing the color space conversion relationship between the current camera and the standard virtual camera are as follows: Retrieve the three-channel spectral response curves of the standard virtual camera and the current camera from the pre-stored spectral fingerprint database to obtain a set of spectral response vectors; Based on the set of spectral response vectors, the color space transformation tensor elements are derived channel by channel through the spectral manifold projection integration mechanism. The color space conversion tensor elements are encapsulated into a parameterized mapping structure according to the channel correspondence to obtain the color space conversion relationship between the current camera and the standard virtual camera.
[0013] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for obtaining the color space mapping parameter set are as follows: Histogram statistics and probability density estimation are performed on each color channel of the spatially homogenized intermediate image to obtain the channel response distribution density function; Based on the relationship between the channel response distribution density function and the color space conversion, the color space mapping parameter values are calculated channel by channel using distribution-weighted spectral coupling integral operation. The color space mapping parameter values are encapsulated in channel index order to obtain the color space mapping parameter set.
[0014] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for obtaining the virtual space mapping image are as follows: The color space mapping parameter set is structured and analyzed to obtain the chromaticity homography parameter matrix, the brightness mapping parameter set, the gray axis constraint parameter set, and the channel coupling compensation parameter set; Based on the chromaticity homography parameter matrix, the luminance mapping parameter group, the gray axis constraint parameter group, and the channel coupling compensation parameter group, the spatially homogenized intermediate image is decomposed into chromaticity and luminance components to obtain the color representation to be transformed. Based on the color representation to be transformed, a joint transformation is performed using the chromaticity homography parameter matrix, the brightness mapping parameter group, and the gray axis constraint parameter group. Then, each color channel is reconstructed in a preset standard reference color space to obtain the initial mapped image. Based on the initial mapping image, global channel compensation is performed using the channel coupling compensation parameter set to obtain the virtual space mapping image.
[0015] As a preferred embodiment of the machine vision-based camera color consistency calibration method of the present invention, the specific steps for obtaining the color consistency calibration image are as follows: The virtual space-mapped image is processed by channel traversal, the linear light intensity value of each pixel is extracted and the row and column index positions are recorded to obtain the image data set to be processed; Based on the image data set to be processed and the preset standard gamma value and color gamut boundary threshold, the corrected pixel value is calculated pixel by pixel; The corrected pixel values of all pixels are reassembled in the original image row and column order and then quantized to obtain a color consistency calibration image.
[0016] The beneficial effects of this invention are as follows: by using Gaussian weighted logarithmic frequency integral encoding, a refined modeling of pixel spatial position and response nonuniformity is achieved, eliminating local color deviation in wide dynamic range scenes and improving spatial consistency perception in computer vision tasks; by using spectral manifold projection integral operation to calculate the color space transformation relation tensor, a deep coupling mapping of nonlinear spectral response differences is achieved, ensuring the comparability of color features of multi-source images in computer vision, and achieving high color calibration accuracy and realistic color gamut reproduction in complex spectral environments. Attached Figure Description
[0017] 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.
[0018] Figure 1 This is a flowchart of a machine vision-based camera color consistency calibration method.
[0019] Figure 2 A flowchart for constructing a two-dimensional pixel matrix.
[0020] Figure 3 A flowchart for generating the correction gain coefficient matrix.
[0021] Figure 4 This is a comparison chart of radial color difference variations under wide dynamic range conditions using different methods.
[0022] Figure 5 This is a comparison chart of the overall color difference under different light source conditions using different methods. Detailed Implementation
[0023] 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.
[0024] 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.
[0025] 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.
[0026] Reference Figures 1-5 As one embodiment of the present invention, this embodiment provides a camera color consistency calibration method based on machine vision, including the following steps: S1. Acquire the original RAW format image data of the current scene, and construct a two-dimensional pixel coordinate matrix based on the pixel distribution of the original RAW format image data.
[0027] Acquire raw RAW format image data of the current scene and read sensor metadata that records the optical axis center offset.
[0028] The specific process includes: when acquiring RAW format image data of the current scene, the image sensor converts the incident light signal into charge and outputs RAW format image data in the form of a pixel array without color interpolation, white balance adjustment or gamma correction. At the same time, it reads sensor metadata that records the optical axis center offset from the image sensor's register or embedded storage area. This optical axis center offset represents the two-dimensional coordinate offset between the projection point of the optical principal axis on the image sensor plane and the physical center of the image sensor. This offset is caused by lens assembly error, sensor installation deviation or optical distortion. In subsequent processing, it is used to spatially align or respond to the pixel positions in the RAW format image data to ensure spatial consistency and color accuracy of images in different viewpoints or multi-camera configurations.
[0029] The actual optical center coordinates are obtained based on sensor metadata, and the pixel positions of the original RAW format image data are normalized using the actual optical center coordinates to obtain a normalized coordinate matrix.
[0030] The specific process includes obtaining the actual optical center coordinates based on sensor metadata. The sensor metadata contains the optical axis center offset, which represents the two-dimensional offset of the projection point of the optical principal axis on the image sensor plane relative to the physical center of the image sensor. The row and column coordinates of the physical center of the image sensor are added to the optical axis center offset to obtain the actual optical center coordinates. The actual optical center coordinates are then used to perform a coordinate translation operation on the original row and column positions of each pixel in the RAW format image data, so that all pixel positions are expressed with the actual optical center coordinates as the new coordinate origin. This operation will eliminate the spatial reference inconsistency caused by optical assembly deviations and obtain a normalized coordinate matrix.
[0031] Based on the arrangement pattern of the Bayer array in the original RAW format image data, a Bayer phase coding matrix with the same dimension as the normalized coordinate matrix is generated.
[0032] The specific process includes, based on the arrangement pattern of the Bayer array in RAW format image data and the standard periodic arrangement structure of the color filter array on the image sensor, where each pixel position corresponds to one of the red, green or blue filters, and green pixels are arranged alternately in the horizontal and vertical directions to form a checkerboard pattern, while red and blue pixels occupy the remaining alternating positions. According to this fixed spatial arrangement pattern, on a two-dimensional grid with the same number of rows and columns as the normalized coordinate matrix, each pixel position is assigned a unique encoding value that identifies the color channel and local phase relationship in the Bayer array. This encoding value directly reflects the phase characteristics of the position in the Bayer array, thereby generating a Bayer phase encoding matrix with the same dimensions as the normalized coordinate matrix.
[0033] It should be noted that the Bayer array arrangement pattern refers to the rule in which the red, green, and blue filters on the image sensor are arranged according to a specific periodic pattern. They are usually arranged in a 2×2 basic unit, with the green filter occupying two diagonal positions and the red and blue filters occupying the other two diagonal positions, forming a fixed arrangement of RGGB, GRBG, GBRG, or BGGR. The Bayer phase coding matrix refers to a matrix of the same size as the image, which is formed by assigning a unique phase identifier value to each pixel position according to the Bayer array arrangement pattern in the RAW format image data, corresponding to its relative position and color channel type within the 2×2 Bayer period.
[0034] The normalized coordinate matrix and the Bayer phase coding matrix are stacked and fused in the channel dimension to obtain a two-dimensional pixel coordinate matrix.
[0035] The specific process involves stacking and fusing the normalized coordinate matrix and the Bayer phase coding matrix in the channel dimension. The normalized coordinate matrix contains the two-dimensional spatial position information of each pixel relative to the actual optical center, and the Bayer phase coding matrix contains the phase identification information of each pixel in the Bayer array. The two have the same number of rows and columns. After being stitched together in the channel dimension, a multi-channel structure containing spatial coordinates and phase attributes is formed, which is the two-dimensional pixel coordinate matrix.
[0036] S2. Perform sinusoidal position encoding on the two-dimensional pixel coordinate matrix to obtain an encoded feature map that represents the spatial positional relationship and positional change pattern of pixels.
[0037] The two-dimensional pixel coordinate matrix is decoupled and separated along the channel dimension to obtain normalized horizontal coordinate data, normalized vertical coordinate data, and Bayer phase identifier data.
[0038] The specific process includes decoupling and separating the two-dimensional pixel coordinate matrix in the channel dimension. The two-dimensional pixel coordinate matrix contains three channels. The first channel stores the horizontal coordinate value of each pixel relative to the actual optical center, the second channel stores the vertical coordinate value of each pixel relative to the actual optical center, and the third channel stores the phase identifier value of each pixel in the Bayer array. These three channels have the same number of rows and columns. By separating them one by one in channel order, all horizontal coordinate elements are extracted from the first channel to form normalized horizontal coordinate data, all vertical coordinate elements are extracted from the second channel to form normalized vertical coordinate data, and all phase identifier elements are extracted from the third channel to form Bayer phase identifier data.
[0039] It should be noted that Bayer phase label data refers to the unique category label corresponding to each pixel in the Bayer array based on its specific position (such as red, green 1, green 2 or blue) within a 2×2 periodic unit, including four types: red channel phase label, first green channel phase label, second green channel phase label and blue channel phase label.
[0040] Based on the normalized horizontal and vertical coordinate data, the radial distance matrix of each pixel relative to the optical center is obtained.
[0041] The specific process includes squaring the normalized x-coordinate and y-coordinate values of each pixel position based on the normalized x-coordinate and y-coordinate data, adding the results together and taking the square root to obtain the Euclidean distance from the pixel to the optical center. All pixels are processed in this way to form a radial distance matrix consistent with the image space dimension. The radial distance matrix is the radial distance matrix of each pixel relative to the optical center.
[0042] Gaussian weighted log-frequency integral coding is performed on the radial distance matrix, normalized abscissa data, normalized ordinate data, and Bayer phase identifier data to obtain the coded feature values, expressed as follows: ; in, Indicates the first OK The encoded feature value of column pixels, Represents the pixel row index variable. Represents the pixel column index variable. Represents the standard deviation constant of the frequency band. Pi is a constant. Represents the frequency integral variable. Indicates the first OK Normalized radial distance values of column pixels Indicates the first OK Normalized value of the spatial location radius of column pixels. Indicates the first OK Bayer phase-coded values of column pixels, Natural exponential function.
[0043] It should be noted that, It is obtained by normalizing the Euclidean distance of the pixel relative to the optical center and the half-length of the image diagonal; It is the value obtained by mapping the Euclidean distance of the pixel relative to the optical center onto a dimensionless scale based on half the diagonal of the image. It is a unique phase identifier assigned to a pixel based on the Bayer array arrangement pattern of RAW format image data, according to the color channel type and periodic position of the pixel in the image sensor color filter array.
[0044] The specific process includes using the normalized radial distance value of each pixel location as the input variable in the logarithmic frequency domain. Combining the normalized horizontal and vertical coordinate data to form the spatial location radial normalized value and the Bayer phase identifier information, the frequency variable is weighted by a Gaussian function. An integral kernel is constructed based on the natural exponential function, and a sine function is used to express the periodic modulation relationship between the spatial location and the Bayer phase identifier in the frequency dimension. The frequency variable is weighted and integrated over the entire continuous interval to generate coded feature values that reflect the spatial distribution characteristics of pixels and the Bayer phase characteristics, thus obtaining the coded feature value corresponding to each pixel location.
[0045] The encoded feature values of all pixels are combined to form an encoded feature map that represents the spatial positional relationship and positional change pattern of pixels.
[0046] The specific process includes placing the encoded feature value of each pixel at the same index in a new matrix as the pixel's row and column position in the image, based on the pixel's row and column index. Specifically, for each pixel, the encoded feature value is assigned to the corresponding position in a new matrix of the same size as the original image, based on the pixel's row and column indices. After traversing all pixels, a complete encoded feature map is formed.
[0047] S3. Perform pixel-aligned fusion of the encoded feature map and the original RAW format image data to obtain the position-constrained fusion feature. Input the position-constrained fusion feature into the pixel-level spatial color response analysis network to extract the spatial non-uniform color response features in the original RAW format image data and obtain the correction gain coefficient matrix corresponding to each pixel.
[0048] Bayer phase unrolling and pixel rearrangement are performed on the original RAW format image data to obtain phase-aligned image data corresponding to the original pixel topological positions.
[0049] The specific process includes, based on the Bayer array arrangement rules of the RAW format image data, performing deinterleaving operation on each pixel according to the color channel type and phase position in the Bayer array, extracting and interpolating the sampling points of each color channel (red, green, and blue) onto the complete pixel grid, and spatially aligning and rearranging the pixel values of each color channel according to the original pixel topological position, so that each output pixel contains complete three-channel information and maintains a spatial correspondence consistent with the original pixel topological position in the RAW format image data, thus obtaining phase-aligned image data corresponding to the original pixel topological position.
[0050] Phase-aligned image data and coded feature maps are matched one-to-one according to pixel position and fused at the channel level to obtain initial fused features with enhanced position conditions.
[0051] The specific process includes: matching the phase-aligned image data and the encoded feature map one-to-one according to pixel position and performing channel-level registration and fusion. The phase-aligned image data contains three-channel color information for each pixel position, and the encoded feature map contains the encoded feature value for each pixel position. The two have the same row and column dimensions. The encoded feature map is used as an additional channel and is concatenated with the three color channels of the phase-aligned image data in the channel dimension to form a four-channel fusion structure. The color information of each pixel position in the fusion structure is strictly aligned with the spatial position encoded feature to obtain the initial fusion feature with enhanced position conditions.
[0052] The initial fusion features enhanced by location conditions are input into the conditional modulation branch to generate spatial modulation parameters corresponding to each pixel position. The initial fusion features are then subjected to pixel-by-pixel adaptive modulation using the spatial modulation parameters to obtain the location-constrained fusion features.
[0053] The specific process includes inputting the initial fusion features with enhanced positional conditions into the conditional modulation branch. The conditional modulation branch generates corresponding spatial modulation parameters based on the spatial position information and color information contained in each pixel position of the initial fusion features with enhanced positional conditions. The spatial modulation parameters reflect the difference in response weights of each pixel position in terms of spatial distribution and phase characteristics. The spatial modulation parameters are used to perform pixel-by-pixel adaptive modulation on each pixel value in the initial fusion features with enhanced positional conditions. The modulation method is to perform channel-by-channel multiplication operation between the spatial modulation parameters and the initial fusion features with enhanced positional conditions at the same pixel position, thereby enhancing or suppressing the feature response at a specific position to obtain the position-constrained fusion features.
[0054] It should be noted that the conditional modulation branch refers to the processing structure in the pixel-level spatial color response analysis network used to generate spatial modulation parameters based on the initial fusion features enhanced by positional conditions and to perform pixel-by-pixel adaptive modulation on the initial fusion features. It originates from the overall architecture of the pixel-level spatial color response analysis network. The positional constraint fusion feature refers to the feature representation that combines spatial positional coding and color response characteristics, obtained by performing pixel-by-pixel adaptive modulation on the initial fusion features enhanced by positional conditions through the conditional modulation branch. The spatial modulation parameters refer to the set of parameters used to describe the local contrast, frequency response, or texture enhancement characteristics of an image in the spatial domain. They typically include local gain coefficients, spatial frequency weights, neighborhood window size, and direction-selective filter parameters.
[0055] The position-constrained fusion features are input into the dynamic convolution analysis branch, and combined with the original RAW local statistical information of the corresponding pixel neighborhood, a position-related dynamic convolution kernel is generated.
[0056] The specific process includes inputting the position constraint fusion features into the dynamic convolution analysis branch. The dynamic convolution analysis branch, based on the feature representation of each pixel position in the position constraint fusion features, combines the local statistical information of the RAW format image data of the corresponding pixel neighborhood. The local statistical information includes the mean and variance of the pixel values within the local window centered on the pixel. The position constraint fusion features and the local statistical information are transformed into a set of convolution weights through a mapping function. This set of convolution weights constitutes a dynamic convolution kernel corresponding to each pixel position. The parameters of the dynamic convolution kernel adaptively change with the spatial context of the pixel position, generating a position-dependent dynamic convolution kernel.
[0057] It should be noted that the dynamic convolutional analysis branch refers to the processing structure in the pixel-level spatial color response analysis network that receives position-constrained fusion features and combines them with local statistical information of RAW format image data to generate position-related dynamic convolutional kernels. It originates from the overall architecture of the pixel-level spatial color response analysis network. The pixel-level spatial color response analysis network refers to the processing structure used to refine the modeling and correction of the non-uniformity of color response of each pixel in RAW format image data caused by optical and sensor characteristics. It is based on sensor metadata, optical center normalized coordinates, Bayer phase coding, radial distance features, coded feature maps, phase-aligned image data, conditional modulation branch, and dynamic convolutional analysis branch.
[0058] Local response analysis is performed on the position-constrained fusion features to obtain continuous spatial response features.
[0059] The specific process includes: performing local response analysis on the position constraint fusion features; taking the position constraint fusion features within the neighborhood of each pixel as input; obtaining the local mean and local gradient of the feature values within the neighborhood to characterize the spatial variation trend and intensity distribution characteristics of the response around the pixel; using these statistics as the local response representation of the pixel to form continuous spatial response features; extracting the feature distribution pattern of the local region using a sliding window method; using the local mean and gradient changes to characterize the continuity and smoothness of the spatial response; interpolating and fitting the response characteristics of each local region in the spatial coordinate domain; and using radial basis functions or bilinear kernels to smoothly reconstruct the neighborhood response statistics, mapping them into a continuous function form to obtain continuous spatial response features.
[0060] A pixel heterogeneous association graph is constructed based on continuous spatial response features. The pixel heterogeneous association graph is then used to perform graph message propagation and uniform aggregation of the neighborhood response information of each pixel to obtain spatially non-uniform color response features.
[0061] The specific process includes constructing a pixel heterogeneous association graph based on continuous spatial response features. The pixel heterogeneous association graph uses each pixel as a node and establishes edge connections based on the response differences and spatial distances between adjacent pixels according to the continuous spatial response features. The edge weights reflect the similarity of response characteristics and spatial proximity between pixels. The pixel heterogeneous association graph is used to propagate graph messages for the neighborhood response information of each pixel. Each pixel node receives the response features transmitted by its neighboring nodes and aggregates them according to the edge weights. Through multiple rounds of iteration, the neighborhood response information is aggregated in a consistent manner to obtain spatially non-uniform color response features.
[0062] Based on the spatial non-uniform color response characteristics, the response deviation of each pixel is estimated pixel by pixel, generating a correction gain coefficient matrix with the same size as the original RAW format image data.
[0063] The specific process includes estimating the degree of response deviation of each pixel on a pixel-by-pixel basis according to the spatial non-uniform color response characteristics. The spatial non-uniform color response characteristics describe the color response inconsistency of each pixel on the image plane caused by optical center offset, radial position change and Bayer phase difference. For each pixel, based on the response deviation amount corresponding to the spatial non-uniform color response characteristics, the deviation amount is input into a preset gain mapping function for non-linear transformation to obtain the correction gain value used to compensate for the deviation. The correction gain values of all pixels are organized according to the same row and column dimensions as the RAW format image data to generate a correction gain coefficient matrix with the same size as the RAW format image data.
[0064] It should be noted that the correction gain coefficient matrix is used to compensate for the color and brightness deviations of each pixel in the RAW format image data caused by differences in optical paths and non-uniformity of sensor response. Its effect is to make the corrected image present a consistent color response characteristic in space. The preset gain mapping function is preset based on the inverse relationship between the spatial response deviation of the sensor measured under standard light source and the ideal response. It is preset by obtaining the response deviation of each pixel through offline calibration, fitting its reciprocal curve and storing it as a lookup table or analytical expression.
[0065] S4. The original RAW format image data is subjected to pixel-by-pixel response amplitude modulation using the correction gain coefficient matrix to obtain a spatially homogenized intermediate image that eliminates spatial response differences.
[0066] The original RAW format image data is linearized and verified, and the correction gain coefficient matrix is adjusted to the same dimension to obtain the linear light intensity matrix and the aligned gain coefficient matrix.
[0067] The specific process includes linearizing the RAW format image data by subtracting the black level offset and mapping the nonlinear original pixel values to values linearly related to the incident light intensity based on the inverse function of the sensor response curve. This eliminates the influence of the image sensor's nonlinear response and black level offset, converting the pixel values into values linearly related to the incident light intensity to obtain a linear light intensity matrix. At the same time, the correction gain coefficient matrix is adjusted to have the same row and column dimensions as the linear light intensity matrix through interpolation or cropping to ensure that the two are strictly aligned in space, resulting in an aligned gain coefficient matrix.
[0068] Log-Normal adaptive modulation integral is performed on the linear light intensity matrix and the aligned gain coefficient matrix to obtain the modulated pixel light intensity value, expressed as: ; in, Indicates the first OK The modulated pixel intensity value of the column pixel. Indicates the first OK The linear light intensity value of the column pixels. Indicates the first OK Gain coefficient of column pixels, This represents the integral variable of the gain distribution.
[0069] It should be noted that, It is a value that is linearly related to the incident light intensity, obtained by subtracting the black level and correcting the nonlinear response of the original response value of the pixel in the RAW format image data. It is a correction factor generated to compensate for color response inconsistency after estimating the degree of response deviation of the pixel based on the spatial non-uniform color response characteristics.
[0070] The specific process includes combining the linear light intensity value of each pixel with the gain coefficient at the corresponding position, mapping the gain coefficient to the logarithmic space through natural logarithmic transformation, using the integral variable of the gain distribution as the integral variable, modeling the distribution of the gain coefficient in the logarithmic domain using the Log-Normal probability density function, and modulating the linear light intensity value and the integral result of the probability density function on the gain distribution pixel by pixel to obtain the modulated pixel light intensity value.
[0071] Dynamic range constraint processing is applied to the modulated pixel light intensity values to obtain a constrained light intensity matrix.
[0072] The specific process includes limiting the modulated pixel light intensity value of each pixel to between a preset minimum light intensity threshold and a maximum light intensity threshold. Light intensity values exceeding the upper limit are truncated to the maximum light intensity threshold, and light intensity values below the lower limit are truncated to the minimum light intensity threshold. All pixels are processed in this way to form a limited light intensity matrix.
[0073] It should be noted that the minimum light intensity threshold is preset based on the noise floor level of the image sensor and the effective signal initial response intensity, and is usually set slightly higher than the residual noise level after black level compensation, with an exemplary value range of 10 to 50 digital values; the maximum light intensity threshold is preset based on the saturation output level of the image sensor and the need to avoid highlight overflow, and is usually set close to but not exceeding the maximum representable value of RAW format image data, with an exemplary value range of 60,000 to 65,000 digital values (taking 16-bit depth as an example).
[0074] By recombining the limiting light intensity matrix and combining it with the global tone mapping curve, a spatially homogenized intermediate image is obtained that eliminates spatial response differences.
[0075] The specific process includes recombining the limiting light intensity matrix to restore the Bayer array topology consistent with the RAW format image data, and performing nonlinear mapping on the light intensity value of each pixel in the recombined limiting light intensity matrix in combination with the global tone mapping curve. The global tone mapping curve is constructed based on the brightness distribution characteristics of the overall image and is used to compress the dynamic range and enhance visual perception consistency. The result after mapping forms a spatially homogenized intermediate image, which eliminates spatial color and brightness deviations caused by differences in optical paths and non-uniformity of sensor response.
[0076] Figure 4 This is a line graph comparing radial color difference variations of different methods under wide dynamic range conditions. It characterizes the differences in the ability of each method to suppress spatially non-uniform color response deviations under different dynamic range intensity ratios. Several curves represent different methods: Control Group 1 (traditional global uniform correction): The input data is corrected using uniform parameters, without considering local differences, structural correlations, and nonlinear distribution characteristics, reflecting the basic processing effect of the traditional method; Control Group 2 (removal of Gaussian weighted logarithmic frequency integral encoding): Gaussian weighted logarithmic frequency integral encoding is removed from the overall process, and conventional frequency features are directly used for post-processing. The following steps are performed to verify the effect of the encoding operation on improving feature representation and anti-interference capabilities: Control group three (removing graph message propagation and uniform aggregation): Graph message propagation and uniform aggregation are not performed in the overall process; processing is completed only based on the features of each unit itself. This is used to verify the effect of structural association modeling on improving the stability and overall consistency of the results. Control group four (removing the spectral manifold projection integration mechanism): The spectral manifold projection integration mechanism is removed in the overall process; analysis is performed only using conventional feature mapping methods. This is used to verify the effect of this mechanism on improving the ability to represent complex distributions and the accuracy of differentiation, as well as the complete method of this invention. As the dynamic range intensity ratio increases, the mean radial color difference of each method generally shows an upward trend, indicating that wide dynamic range scenes will significantly amplify the local color deviation caused by optical center offset, radial position change and pixel response inconsistency. However, the curve corresponding to the complete method of this invention is always at the lowest level, indicating that through the synergistic effect of Gaussian weighted logarithmic frequency integral encoding operation, position constraint fusion and pixel-level spatial color response analysis network, it is possible to more effectively complete the fine modeling of pixel spatial position and response non-uniformity, and reduce the color error that spreads from the optical center to the edge. This verifies the beneficial effect of this invention in eliminating local color deviation and improving spatial consistency perception in wide dynamic range scenes.
[0077] S5. Call the standard virtual camera spectral response curve to establish the color space conversion relationship between the current camera and the standard virtual camera, and combine the color channel response distribution characteristics of the spatially homogenized intermediate image to obtain the color space mapping parameter set.
[0078] Retrieve the three-channel spectral response curves of the standard virtual camera and the current camera from the pre-stored spectral fingerprint database to obtain a set of spectral response vectors.
[0079] The specific process includes retrieving the three-channel spectral response curves of the standard virtual camera and the current camera from the pre-stored spectral fingerprint database. The three-channel spectral response curve of the standard virtual camera represents the response characteristics of the red, green and blue channels to different wavelengths of light in the ideal color space (the ideal sRGB or Rec.709 primary color response curve obtained by linear transformation of the CIE 1931 XYZ color matching function). The three-channel spectral response curve of the current camera reflects the response characteristics of the combination of red, green and blue filters and image sensors in the actual imaging device to different wavelengths of light. After aligning these two sets of three-channel spectral response curves according to the wavelength dimension, they are expanded into vector form and combined to form a set of spectral response vectors.
[0080] It should be noted that the pre-stored spectral fingerprint database is constructed based on the theoretical color response specifications of standard virtual cameras and the three-channel spectral response data obtained by the current cameras through spectral calibration equipment before they leave the factory.
[0081] Based on the set of spectral response vectors, the color space transformation tensor elements are derived channel by channel through the spectral manifold projection integration mechanism.
[0082] The specific process includes: the spectral response vector set contains the discretized spectral response vectors of the standard virtual camera and the current camera in the red, green and blue channels; the spectral manifold projection integration mechanism maps the two sets of spectral response vectors onto a continuous spectral manifold; the product of the spectral response function of a certain channel of the standard virtual camera and the spectral response functions of each channel of the current camera is integrated in the visible light wavelength range; the integration result represents the spectral contribution weight of each channel of the current camera to the standard channel; this operation is performed sequentially on the red, green and blue channels of the standard virtual camera to form a three-by-three weight matrix, which is the color space transformation relation tensor element.
[0083] It should be noted that the spectral manifold projection integral mechanism is a method of performing inner product operations on two sets of spectral response functions in the continuous visible light wavelength domain. It reconstructs the discrete spectral response vectors of the standard virtual camera and the current camera into continuous functions by interpolation, and integrates their product in the common wavelength range to quantify the spectral coupling relationship between different color channels.
[0084] The color space conversion tensor elements are encapsulated into a parameterized mapping structure according to the channel correspondence to obtain the color space conversion relationship between the current camera and the standard virtual camera.
[0085] The specific process includes arranging the color space transformation tensor elements according to the correspondence between the red, green, and blue channels of the standard virtual camera and the red, green, and blue channels of the current camera to form a three-row, three-column parametric mapping structure. The parametric mapping structure encapsulates the spectral projection integral results between each channel in matrix form, which is used to perform a linear transformation on the color signal output by the current camera to obtain the color space transformation relationship between the current camera and the standard virtual camera.
[0086] Histogram statistics and probability density estimation are performed on each color channel of the spatially homogenized intermediate image to obtain the channel response distribution density function.
[0087] The specific process includes performing histogram statistics and probability density estimation on each color channel of the spatially homogenized intermediate image, counting the frequency of occurrence of the light intensity values of all pixels in the red, green and blue channels and normalizing them into histograms, and then smoothing the histograms of each channel by using the kernel density estimation method to obtain the continuous form of the red channel response distribution density function, the green channel response distribution density function and the blue channel response distribution density function, which together constitute the channel response distribution density function.
[0088] It should be noted that kernel density estimation method refers to nonparametric probability density estimation method, which obtains a continuous density estimate of the overall data distribution by placing a smooth kernel function (such as Gaussian kernel) at each data point and superimposing the contributions of all kernel functions.
[0089] Based on the relationship between the channel response distribution density function and the color space conversion, the color space mapping parameter values are calculated channel by channel using distribution-weighted spectral coupling integral operations. The expression is as follows: ; in, Indicates the source color space channel Convert to target color space channel The color space mapping parameter values, This represents the target color space channel index variable. This represents the source color space channel index variable. Indicates the first Channel in normalized light intensity integral variable The response distribution density function value at that location, Represents the normalized integral variable of light intensity. Indicates the source color space channel Convert to target color space channel The color space conversion relationship element values, This represents the mean parameter of the response. This represents the standard deviation parameter of the response.
[0090] It should be noted that the response mean parameter refers to the arithmetic mean of the light intensity values of all pixels in a certain color channel of the spatially homogenized intermediate image, which is obtained by summing the light intensity values of all pixels in that channel and then normalizing the result with the total number of pixels; the response standard deviation parameter refers to the arithmetic mean of the light intensity values of all pixels in a certain color channel of the spatially homogenized intermediate image, which is obtained by summing the light intensity values of all pixels in that channel and then normalizing the result with the total number of pixels.
[0091] The specific process includes calculating the color space mapping parameter values channel by channel using a distribution-weighted spectral coupling integral operation based on the channel response distribution density function and the color space conversion relationship. The response distribution density function of the source color space channel is integrated over a normalized light intensity integral variable. During the integration process, the element values of the color space conversion relationship are used as weighting factors, and a Gaussian weighting function is constructed by combining the response mean parameter and the response standard deviation parameter to adjust the integration process. The color space mapping parameter values from the source color space channel to the target color space channel are obtained through this integral operation.
[0092] It should be noted that the distribution-weighted spectral coupling integral operation refers to multiplying the response distribution density function of the source color space channel with the spectral response function of the target color space channel within the visible light wavelength range, and integrating the product result using the corresponding elements in the color space transformation relationship as weights, thereby quantifying the spectral coupling strength between the two channels considering the actual response distribution.
[0093] The color space mapping parameter values are encapsulated in channel index order to obtain the color space mapping parameter set.
[0094] The specific process includes arranging and organizing the color space mapping parameter values in the order of red channel, green channel, and blue channel into a structured set, forming a color space mapping parameter set containing nine elements. This color space mapping parameter set has the same three-to-three channel correspondence structure as the color space conversion relationship, and is used for subsequent color space transformation of the spatially homogenized intermediate image.
[0095] S6. Perform global color transformation on the spatially homogenized intermediate image using the color space mapping parameter set, and convert it to the preset standard reference color space to obtain a virtual space mapping image. Perform gamma correction and color gamut cropping on the virtual space mapping image in sequence to obtain a color consistency calibration image.
[0096] The color space mapping parameter set is structured and analyzed to obtain the chromaticity homography parameter matrix, the luminance mapping parameter set, the gray axis constraint parameter set, and the channel coupling compensation parameter set.
[0097] The specific process includes: performing structured analysis on the color space mapping parameter set; extracting the diagonal elements into a luminance mapping parameter set based on the position and physical meaning of each element in the 3x3 matrix; dividing the off-diagonal elements into a channel coupling compensation parameter set according to the cross relationship between rows and columns; separating the chromaticity homography parameter matrix representing the geometric transformation of the chromaticity plane from the overall matrix through singular value decomposition or extreme decomposition; and deriving the gray axis constraint parameter set using the ideal response consistency constraint of the red, green and blue channels in the neutral gray region, thus obtaining the chromaticity homography parameter matrix, luminance mapping parameter set, gray axis constraint parameter set and channel coupling compensation parameter set.
[0098] Based on the chromaticity homography parameter matrix, the luminance mapping parameter set, the gray axis constraint parameter set, and the channel coupling compensation parameter set, the spatially homogenized intermediate image is decomposed into chromaticity and luminance components to obtain the color representation to be transformed.
[0099] The specific process includes: decomposing the spatially homogenized intermediate image into chromaticity and luminance components based on the chromaticity homography parameter matrix, luminance mapping parameter group, gray axis constraint parameter group, and channel coupling compensation parameter group; using the luminance mapping parameter group to perform weighted summation on each color channel of the spatially homogenized intermediate image to obtain the luminance component; obtaining the chromaticity residual component by separating the common component corresponding to the luminance component from each color channel of the spatially homogenized intermediate image; then performing a linear transformation on the chromaticity residual component using the chromaticity homography parameter matrix to correct the chromaticity geometric shift; simultaneously, using the gray axis constraint parameter group to suppress the chromaticity deviation in the neutral region; and using the channel coupling compensation parameter group to correct the chromaticity distortion caused by cross-channel crosstalk; and combining the corrected chromaticity component and luminance component to form the color representation to be transformed.
[0100] Based on the color representation to be transformed, a joint transformation is performed using the chromaticity homography parameter matrix, the luminance mapping parameter group, and the gray axis constraint parameter group. Then, each color channel is reconstructed in a preset standard reference color space to obtain the initial mapped image.
[0101] The specific process includes: based on the color representation to be transformed, geometric correction is performed on the chromaticity components in the color representation to be transformed using the chromaticity homography parameter matrix. Specifically, the chromaticity components are regarded as coordinate vectors on a two-dimensional chromaticity plane, and affine or projective transformation is achieved by multiplying by a 3×3 chromaticity homography parameter matrix to the left, so as to correct the chromaticity plane distortion caused by the sensor spectral response deviation; channel weighted adjustment is performed on the luminance components in the color representation to be transformed using the luminance mapping parameter group. Specifically, the luminance components are multiplied by the three scalar coefficients of the corresponding red, green, and blue channels in the luminance mapping parameter group to generate the basic luminance contribution of each of the three channels; the chromaticity offset in the neutral gray axis direction is constrained by the gray axis constraint parameter group to maintain white balance consistency, which forces the chromaticity components to approach zero in the neutral region while preserving the luminance structure; the luminance contributions of the three channels after the above processing are superimposed with the corrected chromaticity components, and the linear pixel values of each color channel are reconstructed according to the red, green, and blue primary color coordinate system defined by the preset standard reference color space to form the initial mapped image.
[0102] It should be noted that the preset standard reference color space is preset by common color standards in the printing and imaging fields such as ISO12646 or ISO15076. It is preset by writing the primary color coordinates, white point parameters and gamma characteristics of the standard color space into the color processing flow during the configuration stage.
[0103] Based on the initial mapping image, global channel compensation is performed using the channel coupling compensation parameter set to obtain the virtual space mapping image.
[0104] The specific process includes: based on the initial mapping image, using the channel coupling compensation parameter set to perform global channel compensation for the crosstalk effect between each color channel in the initial mapping image. The channel coupling compensation parameter set characterizes the non-ideal response coupling relationship between the red, green and blue channels caused by the spectral overlap of the sensor filter and circuit crosstalk. The value of each pixel in the initial mapping image on the three channels is linearly combined with the channel coupling compensation parameter set to correct the chromaticity deviation caused by cross-channel interference. The compensated three-channel pixel values are then output to form a virtual spatial mapping image.
[0105] The virtual space-mapped image is processed by channel traversal, the linear light intensity value of each pixel is extracted and the row and column index positions are recorded to obtain the image data set to be processed.
[0106] The specific process includes performing channel traversal processing on the virtual space-mapped image, sequentially accessing each pixel position in the red, green, and blue channels, extracting the linear light intensity value of the pixel in the corresponding color channel, and simultaneously recording the row and column index of the pixel in the image. The linear light intensity value of each pixel and its row and column index positions are combined into a structured data unit, and all structured data units are collected to form the image data set to be processed.
[0107] Based on the image dataset to be processed and the preset standard gamma value and color gamut boundary threshold, the corrected pixel value is calculated pixel by pixel, as expressed by: ; in, Indicates the first OK The corrected pixel values of the column pixels. Indicates the color gamut boundary threshold. Indicates the first OK The light intensity value of the pixel to be processed in the column of pixels. Represents the integral variable of light intensity. This indicates the standard gamma value.
[0108] It should be noted that the color gamut boundary threshold is an upper limit constraint set according to the maximum representable light intensity value of the red, green and blue channels in the standard reference color space. It is usually taken from the peak white point intensity defined in the color space, and the exemplary value range is a digital value of 65000 to 65535 (taking 16-bit linear light intensity representation as an example). The standard gamma value is preset according to the photoelectric conversion function specification adopted by the target display device or the standard reference color space. It is usually set to 2.2 or a piecewise approximation form according to the gamma characteristics defined in standards such as sRGB and Rec.709 during the configuration stage.
[0109] The specific process includes: calculating the corrected pixel value pixel by pixel based on the image data set to be processed and the preset standard gamma value and color gamut boundary threshold; using the light intensity value of each pixel to be processed as the upper limit of integration; performing a power function transformation on the light intensity integration variable with the standard gamma value as the exponent; calculating the integral result of negative gamma power from zero to the light intensity value of the pixel to be processed; simultaneously calculating the integral result of negative gamma power from zero to the color gamut boundary threshold; multiplying the former by the reciprocal of the latter and then multiplying by the color gamut boundary threshold to obtain the corrected pixel value.
[0110] The corrected pixel values of all pixels are reassembled in the original image row and column order and then quantized to obtain a color consistency calibration image.
[0111] The specific process includes filling the corrected pixel values of all pixels into a matrix of the same size as the virtual space mapping image in the original row and column order of the virtual space mapping image to form a reconstructed continuous light intensity image. Then, the reconstructed continuous light intensity image is subjected to bit depth matching quantization processing to map the corrected pixel values in floating-point form to the integer representation range corresponding to the target output bit depth, thereby obtaining a color consistency calibration image.
[0112] like Figure 5This is a comparison chart of the overall color difference of different methods under different light source conditions. The bar chart is used to compare the overall color difference performance of each method under different light source conditions. The horizontal axis represents different light source conditions, and the vertical axis represents the overall color difference. The multiple groups of bars correspond to control group 1 (traditional global unified correction), control group 2 (removing Gaussian weighted logarithmic frequency integral coding operation), control group 3 (removing graph message propagation and uniform aggregation), control group 4 (removing spectral manifold projection integral mechanism), and the complete method of this invention. As shown in the figure, under different lighting conditions such as standard white light, cool white light, fluorescent light source, warm light source, and mixed light source, the comprehensive color difference corresponding to the complete method of the present invention remains the lowest. Moreover, the advantages are more obvious in complex spectral environments such as warm light source and mixed light source. This indicates that the present invention can effectively reduce the nonlinear spectral response differences between different cameras and different lighting spectra by calling the standard virtual camera spectral response curve, establishing color space conversion relationship, obtaining color space mapping parameter set and performing subsequent global color transformation, gamma correction and color gamut clipping processing, thereby improving the comparability of color features of multi-source images. This verifies the beneficial effects of the present invention in complex spectral environments, which have high color calibration accuracy and more realistic color gamut restoration effect.
[0113] In summary, this invention achieves refined modeling of pixel spatial location and response nonuniformity through Gaussian weighted logarithmic frequency integral encoding, eliminating local color deviations in wide dynamic range scenes and improving spatial consistency perception in computer vision tasks; it also utilizes spectral manifold projection integral operations to calculate the color space transformation relation tensor, achieving deep coupling mapping of nonlinear spectral response differences, ensuring the comparability of color features of multi-source images in computer vision, and achieving high color calibration accuracy and realistic color gamut reproduction in complex spectral environments.
[0114] 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 machine vision-based method for calibrating camera color consistency, characterized in that, include: Acquire raw RAW format image data of the current scene, and construct a two-dimensional pixel coordinate matrix based on the pixel distribution of the raw RAW format image data; Sinusoidal position encoding is performed on the two-dimensional pixel coordinate matrix to obtain an encoded feature map that represents the spatial positional relationship and positional change pattern of pixels; The encoded feature map is pixel-aligned and fused with the original RAW format image data to obtain the position constraint fusion feature. The position constraint fusion feature is then input into the pixel-level spatial color response analysis network to extract the spatial non-uniform color response features in the original RAW format image data, and obtain the correction gain coefficient matrix corresponding to each pixel. The original RAW format image data is subjected to pixel-by-pixel response amplitude modulation using a correction gain coefficient matrix to obtain a spatially homogenized intermediate image that eliminates spatial response differences. By calling the standard virtual camera spectral response curve, the color space conversion relationship between the current camera and the standard virtual camera is established, and the color space mapping parameter set is obtained by combining the response distribution characteristics of each color channel of the spatially homogenized intermediate image. A global color transformation is performed on the spatially homogenized intermediate image using a color space mapping parameter set, and then converted to a preset standard reference color space to obtain a virtual space mapping image. The virtual space mapping image is then subjected to gamma correction and color gamut cropping to obtain a color consistency calibration image.
2. The machine vision-based camera color consistency calibration method as described in claim 1, characterized in that, The specific steps for constructing the two-dimensional pixel coordinate matrix are as follows: Acquire raw RAW format image data of the current scene and read sensor metadata that records the optical axis center offset; The actual optical center coordinates are obtained based on sensor metadata, and the pixel positions of the original RAW format image data are normalized using the actual optical center coordinates to obtain a normalized coordinate matrix. Based on the arrangement of the Bayer array in the original RAW format image data, a Bayer phase coding matrix with the same dimensions as the normalized coordinate matrix is generated; The normalized coordinate matrix and the Bayer phase coding matrix are stacked and fused in the channel dimension to obtain a two-dimensional pixel coordinate matrix.
3. The machine vision-based camera color consistency calibration method as described in claim 2, characterized in that, The specific steps for obtaining the encoded feature map representing the spatial positional relationship and positional change pattern of pixels are as follows: The two-dimensional pixel coordinate matrix is decoupled and separated in the channel dimension to obtain normalized horizontal coordinate data, normalized vertical coordinate data, and Bayer phase identifier data; Based on the normalized horizontal and vertical coordinate data, the radial distance matrix of each pixel relative to the optical center is obtained. Gaussian weighted logarithmic frequency integral coding was performed on the radial distance matrix, normalized abscissa data, normalized ordinate data, and Bayer phase identifier data to obtain the coding feature values; The encoded feature values of all pixels are combined to form an encoded feature map that represents the spatial positional relationship and positional change pattern of pixels.
4. The machine vision-based camera color consistency calibration method as described in claim 1, characterized in that, The specific steps for obtaining the position-constrained fusion features are as follows: Bayer phase unrolling and pixel rearrangement are performed on the original RAW format image data to obtain phase-aligned image data corresponding to the original pixel topological positions. Phase-aligned image data and coded feature maps are matched one-to-one according to pixel position and fused at the channel level to obtain initial fused features with enhanced position conditions; The initial fusion features enhanced by location conditions are input into the conditional modulation branch to generate spatial modulation parameters corresponding to each pixel position. The initial fusion features are then subjected to pixel-by-pixel adaptive modulation using the spatial modulation parameters to obtain the location-constrained fusion features.
5. The machine vision-based camera color consistency calibration method as described in claim 1 or 4, characterized in that, The specific steps for obtaining the correction gain coefficient matrix corresponding to each pixel are as follows: The position-constrained fusion features are input into the dynamic convolutional analysis branch, and combined with the original RAW local statistical information of the corresponding pixel neighborhood, a position-related dynamic convolutional kernel is generated. Local response analysis is performed on the position-constrained fusion features to obtain continuous spatial response features; A pixel heterogeneous association graph is constructed based on continuous spatial response features, and the neighborhood response information of each pixel is propagated and uniformly aggregated using the pixel heterogeneous association graph to obtain spatially non-uniform color response features. Based on the spatial non-uniform color response characteristics, the response deviation of each pixel is estimated pixel by pixel, generating a correction gain coefficient matrix with the same size as the original RAW format image data.
6. The machine vision-based camera color consistency calibration method as described in claim 1, characterized in that, The specific steps for obtaining the spatially homogenized intermediate image to eliminate spatial response differences are as follows: The original RAW format image data is linearized and the correction gain coefficient matrix is adjusted to the same dimension to obtain the linear light intensity matrix and the aligned gain coefficient matrix. Log-Normal adaptive modulation integral calculation is performed on the linear light intensity matrix and the aligned gain coefficient matrix to obtain the modulated pixel light intensity value; The modulated pixel light intensity values are subjected to dynamic range constraint processing to obtain the restricted light intensity matrix; By recombining the limiting light intensity matrix and combining it with the global tone mapping curve, a spatially homogenized intermediate image is obtained that eliminates spatial response differences.
7. The machine vision-based camera color consistency calibration method as described in claim 1 or 6, characterized in that, The specific steps for establishing the color space conversion relationship between the current camera and the standard virtual camera are as follows: Retrieve the three-channel spectral response curves of the standard virtual camera and the current camera from the pre-stored spectral fingerprint database to obtain a set of spectral response vectors; Based on the set of spectral response vectors, the color space transformation tensor elements are derived channel by channel through the spectral manifold projection integration mechanism. The color space conversion tensor elements are encapsulated into a parameterized mapping structure according to the channel correspondence to obtain the color space conversion relationship between the current camera and the standard virtual camera.
8. The machine vision-based camera color consistency calibration method as described in claim 1, characterized in that, The specific steps for obtaining the color space mapping parameter set are as follows: Histogram statistics and probability density estimation are performed on each color channel of the spatially homogenized intermediate image to obtain the channel response distribution density function; Based on the relationship between the channel response distribution density function and the color space conversion, the color space mapping parameter values are calculated channel by channel using distribution-weighted spectral coupling integral operation. The color space mapping parameter values are encapsulated in channel index order to obtain the color space mapping parameter set.
9. The machine vision-based camera color consistency calibration method as described in claim 1, characterized in that, The specific steps for obtaining the virtual space mapping image are as follows: The color space mapping parameter set is structured and analyzed to obtain the chromaticity homography parameter matrix, the brightness mapping parameter set, the gray axis constraint parameter set, and the channel coupling compensation parameter set; Based on the chromaticity homography parameter matrix, the luminance mapping parameter group, the gray axis constraint parameter group, and the channel coupling compensation parameter group, the spatially homogenized intermediate image is decomposed into chromaticity and luminance components to obtain the color representation to be transformed. Based on the color representation to be transformed, a joint transformation is performed using the chromaticity homography parameter matrix, the brightness mapping parameter group, and the gray axis constraint parameter group. Then, each color channel is reconstructed in a preset standard reference color space to obtain the initial mapped image. Based on the initial mapping image, global channel compensation is performed using the channel coupling compensation parameter set to obtain the virtual space mapping image.
10. The machine vision-based camera color consistency calibration method as described in claim 1 or 9, characterized in that, The specific steps for obtaining the color consistency calibration image are as follows: The virtual space-mapped image is processed by channel traversal, the linear light intensity value of each pixel is extracted and the row and column index positions are recorded to obtain the image data set to be processed; Based on the image data set to be processed and the preset standard gamma value and color gamut boundary threshold, the corrected pixel value is calculated pixel by pixel; The corrected pixel values of all pixels are reassembled in the original image row and column order and then quantized to obtain a color consistency calibration image.
