Camera module automatic testing method based on image recognition
By constructing a nominal parameter set and structured light dot matrix projection, the inherent imaging parameters of the camera module are obtained, the image is corrected and a consistency evaluation is performed, which solves the problems of cross-station consistency evaluation and periodic degradation of imaging performance, and realizes accurate imaging characteristic restoration and lifespan prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 昆山瑞弘测控自动化设备有限公司
- Filing Date
- 2026-04-22
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies cannot achieve stable consistency evaluation across workstations, nor can they quantify the periodic degradation of imaging performance and predict its lifetime. This results in significant fluctuations in imaging results with changes in workstation, a lack of cross-workstation consistency, and an inability to accurately describe the cumulative effects of optical center drift, dot spread changes, color response shifts, and noise evolution on imaging performance.
The original nominal parameter set is constructed by collecting nominal physical parameters, the center coordinates of the dot matrix spot are obtained by structured light dot matrix projection, the observable field is calculated, the inherent imaging mechanism is inverted, the inherent imaging parameter set is obtained, the image set is corrected and a clean noise field is generated, the consistency evaluation is performed, the imaging consistency score and aging intensity sequence are calculated, and finally the expected failure time of the camera module is predicted.
It achieves accurate reproduction of the real imaging characteristics of the camera module in the work environment, improves the stability and reliability of clarity, color and noise evaluation, and can obtain imaging lifetime prediction results without destructive experiments.
Smart Images

Figure CN122160501A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image evaluation technology, and in particular to an automatic testing method for camera modules based on image recognition. Background Technology
[0002] With the continuous upgrading of mobile terminals, intelligent driving systems, security monitoring equipment, and high-end manufacturing equipment, the imaging quality of camera modules has become a key factor in the overall performance stability of these devices. The field of automated testing for camera modules has gradually evolved from traditional static target detection and single-resolution evaluation to a multi-dimensional imaging performance analysis system centered on image recognition. In recent years, the continuous maturation of technologies such as structured light measurement, machine vision recognition, imaging model inversion, and noise characteristic modeling has made it possible to quantify indicators such as module distortion, color response, point spread characteristics, and brightness uniformity.
[0003] However, existing methods still have two limitations: First, existing methods mostly rely on single-frame images or traditional targets, which can only obtain local or single-dimensional features. It is difficult to extract multiple types of observation information such as distortion, point spread, brightness, and noise under interference such as changes in the optical path at the workstation and installation deviations. Furthermore, it is impossible to uniformly deduce the inherent point spread function, inherent color response, and inherent noise response from the observation information, resulting in significant fluctuations in results with changes at the workstation and a lack of consistency across workstations. Second, existing technologies usually only provide quality judgments for single-cycle images and have not constructed a periodic difference system based on the inherent imaging parameter set and imaging consistency score. This makes it impossible to describe the cumulative impact of optical center drift, point spread changes, color response shifts, and noise evolution on imaging performance, and even more impossible to infer the future imaging degradation trend of the module. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides an automatic testing method for camera modules based on image recognition to solve the problems of existing technologies that cannot achieve stable consistency evaluation across workstations and cannot quantify the periodic degradation of imaging performance and predict its lifespan.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: This invention provides an automatic testing method for camera modules based on image recognition, which includes: collecting nominal physical parameters, constructing an original nominal parameter set, calculating the light spot diffusion range through the original nominal parameter set, and obtaining a priori imaging parameter set; The dot array image is acquired by structured light dot array projection, the dot array is identified and the center is located according to the prior imaging parameter set, the center coordinates of the dot array spot are obtained, and the observable field is calculated by the center coordinates of the dot array spot. The inherent imaging mechanism of the camera module is inverted by using the observable field and the prior imaging parameter set to obtain the inherent imaging parameter set; The optical path brightness deviation field and the workstation noise deviation field are calculated based on the inherent imaging parameter set. The original test image is then corrected using the optical path brightness deviation field and the workstation noise deviation field to obtain the corrected image set and the clean noise field. The consistency between the calibrated image set and the clean noise field is evaluated to obtain an imaging consistency score. By using the inherent imaging parameter sets and imaging consistency scores of different periods, the comprehensive parameter drift intensity is calculated to obtain the aging intensity sequence; The expected failure time of the camera module is obtained by calculating the lifetime score based on the imaging consistency score and the aging intensity sequence.
[0007] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the steps of collecting nominal physical parameters, constructing an original nominal parameter set, calculating the light spot diffusion range using the original nominal parameter set, and obtaining a priori imaging parameter set are as follows. Collect pixel size, nominal focal length, nominal optical center position, nominal field of view and nominal color response curve, encapsulate them and obtain the original nominal parameter set; The light spot diffusion range is calculated by using the original nominal parameter set, the a priori point diffusion function is obtained, and the two-dimensional brightness distribution is simulated based on the a priori point diffusion function and the nominal color response curve to obtain the nominal imaging response function. The theoretical field of view is calculated based on the pixel size. The theoretical field of view is compared with the nominal field of view in the original nominal parameter set. The original nominal parameter set is then re-obtained. The original nominal parameter set, the prior point spread function, and the nominal imaging response function are combined to obtain the prior imaging parameter set.
[0008] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the steps of acquiring dot matrix images through structured light dot matrix projection, identifying and centering the dot matrix based on a priori imaging parameter set, and obtaining the center coordinates of the dot matrix light spots are as follows. By controlling the structured light projection array spot, and based on the optical center position and prior point diffusion function in the prior imaging parameter set, local extremum search and brightness centroid extraction are performed on the array spot to obtain the center coordinates of the array spot.
[0009] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the specific steps for calculating the observable field using the center coordinates of the dot matrix light spots are as follows: The radial offset is calculated by the center coordinates of the lattice spot to obtain the distortion observation field. The neighborhood window is truncated based on the center coordinates of the lattice spot and the energy distribution characteristics are calculated to obtain the point diffusion observation field. The brightness deviation index is calculated by the peak brightness of the lattice spot and the average brightness of the neighborhood to obtain the brightness observation field. The background region is divided from the raster image, and brightness statistics are performed in the background region to obtain the noise observation field. The distortion observation field, point diffusion observation field, brightness observation field and noise observation field are encapsulated to obtain the observable field.
[0010] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the specific steps for obtaining the inherent imaging parameter set by inverting the inherent imaging mechanism of the camera module through the observable field and the prior imaging parameter set are as follows. The inherent optical center position is obtained by performing a distortion error search on the optical center position through the observable field; The image radius of the farthest effective dot matrix spot is calculated based on the inherent optical center position to obtain the inherent field of view. The prior point spread function is corrected by the point spread observation field to obtain the inherent point spread function. The inherent color response and inherent noise response are generated according to the brightness observation field and the noise observation field, respectively. The inherent optical center position, inherent field of view, inherent point spread function, inherent color response, and inherent noise response are encapsulated to obtain the inherent imaging parameter set.
[0011] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the steps include: calculating the optical path brightness deviation field and the workstation noise deviation field based on the inherent imaging parameter set; correcting the original test image using the optical path brightness deviation field and the workstation noise deviation field; and obtaining a corrected image set and a clean noise field. The specific steps are as follows: Acquire multiple frames of flat field images and multiple frames of dark field images, and calculate the average and brightness variance pixel by pixel to obtain the flat field average image, dark field average image, and dark field noise intensity distribution. By comparing and analyzing the flat-field average image and dark-field noise intensity distribution with the inherent color response and inherent noise response, the optical path brightness deviation field and the workstation noise deviation field are obtained. The original test image is uniformly corrected based on the optical path brightness deviation field to obtain a corrected image set; The pure noise field is obtained by calculating the difference between the corrected image set and the corresponding dark field noise intensity distribution and the workstation noise deviation field.
[0012] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the specific steps for evaluating the consistency between the corrected image set and the clean noise field to obtain an imaging consistency score are as follows: Calculate sharpness consistency score, color consistency score and defect impact score based on the corrected image set; The noise mean square deviation is calculated by comparing the noise intensity at each pixel location in the clean noise field with the brightness variance at the corresponding location in the corrected image set, and a brightness noise consistency score is obtained. An imaging consistency score is obtained by performing product-based synergistic fusion of sharpness consistency score, color consistency score, brightness noise consistency score, and defect impact score.
[0013] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the specific steps for calculating the sharpness consistency score, color consistency score, and defect impact score based on the corrected image set are as follows: By selecting the position of the structured light array spot from the corrected image set and cropping the brightness window, the peak brightness, half width at half maximum (WWHM), and local sharpness information obtained from the spot gradient within the brightness window are calculated to obtain a sharpness consistency score. A color consistency score is obtained by extracting local color brightness for each color channel in the calibrated image set and comparing it with the theoretical brightness in the intrinsic color response. By identifying bad pixels, vignetting, light spot distortion, and intermittent flickering areas in the corrected image set, and calculating the area ratio and brightness abnormality of the defective areas, a defect impact score is obtained.
[0014] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the step of calculating the comprehensive parameter drift intensity and obtaining the aging intensity sequence by using the inherent imaging parameter sets and imaging consistency scores of different periods is as follows: The intensity of the integrated parameter drift is calculated by using the inherent imaging parameter sets of different periods, and the intensity of the imaging consistency degradation is obtained by comparing the imaging consistency scores of each period. The aging intensity is calculated by combining the drift intensity of the comprehensive parameters and the degradation intensity of imaging consistency. The aging intensity of each period is then combined to obtain the aging intensity sequence.
[0015] As a preferred embodiment of the automatic testing method for camera modules based on image recognition described in this invention, the specific steps for calculating the lifetime score based on the imaging consistency score and the aging intensity sequence to obtain the expected failure time of the camera module are as follows: The aging intensity sequence is fitted by nonlinear least squares fitting to obtain the fitted aging intensity. The lifetime score is calculated by the initial imaging consistency score and the fitted aging intensity to obtain the lifetime score sequence. A minimum acceptable imaging consistency threshold is set, and the failure prediction time is obtained by comparing the lifetime score sequence with the minimum acceptable imaging consistency threshold.
[0016] The beneficial effects of this invention are as follows: by extracting four types of observation fields—distortion, point spread, brightness, and noise—based on a structured light array and performing joint inversion, the true imaging characteristics of the camera module are accurately restored in the workstation environment; by using the optical path brightness deviation field and the workstation noise deviation field to perform unified image correction and generate a clean noise field, the stability and reliability of the clarity, color, and noise evaluation are significantly improved; by combining the inherent imaging parameter changes with the imaging consistency score to form an aging intensity sequence and predict the failure time, imaging lifetime prediction results can be obtained without destructive experiments. 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 an automated testing method for camera modules based on image recognition.
[0019] Figure 2 A flowchart for constructing the observable field.
[0020] Figure 3 A flowchart for calculating the imaging consistency score.
[0021] Figure 4 This is a flowchart for predicting imaging lifetime. Detailed Implementation
[0022] 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.
[0023] 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.
[0024] 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.
[0025] Reference Figures 1-4 This is one embodiment of the present invention, which provides an automatic testing method for camera modules based on image recognition, including the following steps: S1. Collect nominal physical parameters, construct the original nominal parameter set, calculate the light spot diffusion range through the original nominal parameter set, and obtain the prior imaging parameter set.
[0026] The camera module under test is placed in the limiting slot of the test fixture at the work station. The fixture adopts an automatic clamping structure. After the module is fixed, the QR code scanning head built into the test fixture reads the ID code on the module shell or flexible circuit board, and collects the pixel size, nominal focal length, nominal optical center position, nominal field of view and nominal color response curve, and encapsulates them as the original nominal parameter set.
[0027] A priori point spread function is constructed. Specifically, the optical center position of the original nominal parameter set is used as the center coordinate of the priori point spread function. The lateral and longitudinal spread range of the light spot is calculated based on the pixel size and nominal focal length. Combined with the optical attenuation characteristics, a radially distributed light spot with "the highest brightness at the center, gradually decreasing outwards, and the total energy remaining constant" is generated as the core structure of the priori point spread function.
[0028] A nominal imaging response function is constructed. Specifically, under the flat-field illumination of the structured light module, a test light source with uniform spatial brightness is generated as a uniform illumination field. The diffusion effect of the light spot on the sensor is simulated according to the prior point spread function, with the brightness being stronger at the center and gradually decreasing outwards. The response intensity of different bands is adjusted according to the nominal color response curve, and the color response curve is mapped onto the imaging brightness. A two-dimensional brightness distribution is generated by combining the pixel size and imaging range. The nominal imaging response function ultimately forms a set of brightness and color responses that the camera should present under ideal nominal conditions. When the sum of pixel values of the prior point spread function is less than 1, the diffusion width of the light spot is reduced to make the energy more concentrated. When the sum of pixel values of the prior point spread function is greater than 1, the diffusion width of the light spot is appropriately increased to make the energy spread over a larger area.
[0029] The maximum effective imaging radius of the sensor is obtained by converting pixel size and pixel count, and the theoretical field of view is calculated based on the imaging geometry. It is then determined whether the deviation between the theoretical field of view and the nominal field of view is less than the viewing angle deviation threshold. If it is less than the viewing angle deviation threshold, it is marked as consistent with the field of view; otherwise, it is marked as abnormal with the field of view. If the field of view is abnormal, the test fixture is controlled to perform a reset action to re-clamp and reposition the installation posture of the camera module, and the module code and the original nominal parameter set are reread to recalculate the theoretical field of view and perform the field of view consistency check again.
[0030] It should be noted that the viewing angle deviation threshold is determined by randomly selecting no less than 500 camera modules that have been verified to have qualified optical performance from the production line, calculating the deviation value between the theoretical field of view and the nominal field of view for each module, forming a deviation sample set, sorting the deviation sample set, and directly taking the values in the top 5% of the deviation samples as the viewing angle deviation threshold.
[0031] The original nominal parameter set, the prior point spread function, and the nominal imaging response function are combined to obtain the prior imaging parameter set.
[0032] S2. Acquire dot matrix images through structured light dot matrix projection, identify and center the dot matrix based on the prior imaging parameter set, obtain the center coordinates of the dot matrix light spots, and calculate the observable field through the center coordinates of the dot matrix light spots.
[0033] By controlling structured light to project a known array of light spots onto the imaging area of the camera module, the light spots are arranged in a regular matrix in space. The actual spatial coordinates of each light spot during projection are fixed reference points that have been pre-calibrated. Based on the optical center position and the prior point spread function in the set of prior imaging parameters, the center of each light spot is located by a combination of local extremum search and brightness centroid extraction. Local extremum search is used to lock the brightness peak region of the light spot. Brightness centroid extraction uses the pixel brightness distribution in the neighborhood of the light spot to calculate the center coordinates, so that the positioning result is consistent with the energy distribution of the prior point spread function.
[0034] After completing the center localization of the dot matrix spot, using the optical center position in the prior imaging parameter set as a reference, the actual radial distance from the center of the dot matrix spot to the optical center is calculated based on the center coordinates of the dot matrix spot on the image plane. The theoretical radial distance from the fixed reference point to the optical center is calculated based on the fixed reference point saved by the structure cursor at regular intervals. The difference between the actual radial distance and the theoretical radial distance is used as the radial offset of the dot matrix spot, and the radial offset is used as the distortion observation value of the dot matrix spot. The distortion observation values of all dot matrix spots are calculated to obtain the distortion observation field composed of the distortion observation values of each point.
[0035] After obtaining the center of each light spot, a fixed-size neighborhood window is extracted with the center of the light spot as the center. Feature extraction is performed on the pixel brightness distribution within the neighborhood window. Specifically, the sum of the brightness of all pixels within the neighborhood window is calculated. Then, the sum of the brightness of pixels in the inner area with the center of the light spot as the center and a radius of a preset number of pixels is calculated. The ratio of the sum of the inner area brightness to the sum of the overall brightness is used as the center energy concentration. The neighborhood window is divided into multiple concentric rings along the radial direction, and the average brightness value of each concentric ring is calculated. The ratio of the brightness difference between two adjacent concentric rings to the corresponding radius difference is used as the edge decay rate. The brightness distribution difference between the two symmetrical regions to the left and right of the center of the light spot is calculated, as well as the brightness distribution difference between the two symmetrical regions above and below the center of the light spot. The left-right difference and the top-bottom difference are combined as the light spot symmetry index. The center energy concentration, edge decay rate, and light spot symmetry index of all light spots are used as the point diffusion observation field.
[0036] For each spot, calculate the peak brightness and neighborhood average brightness. Based on the nominal imaging response function in the prior imaging parameter set, find the theoretical peak brightness and theoretical average brightness corresponding to the current spot. The difference between the actual peak brightness and the theoretical peak brightness is taken as the peak brightness deviation. The difference between the actual average brightness and the theoretical average brightness is taken as the average brightness deviation. Calculate the absolute values of the peak brightness deviation and the average brightness deviation for each spot and use them as brightness observation indicators. Arrange the brightness deviation indicators of all spots in order of spot coordinates to form a brightness observation field.
[0037] Select a background region far from the light spot from the raster image. Divide the background region into multiple fixed-size background windows. Read the brightness values of all pixels in each background window and calculate the average brightness, brightness variance, and brightness range. Using the nominal imaging response function in the prior imaging parameter set, obtain the reference background brightness under unstructured light illumination conditions. Compare the difference between the average brightness of each background window and the reference background brightness. Compare the difference between the brightness variance and brightness range and the theoretical brightness fluctuation range of the nominal imaging response function in the dark region. Record the difference as the noise deviation index of each background window. Arrange all noise deviation indices according to the spatial order of the background windows to form a noise observation field.
[0038] The distortion observation field, point spread observation field, brightness observation field, and noise observation field are encapsulated to obtain the observable field.
[0039] S3. The inherent imaging mechanism of the camera module is inverted by using the observable field and the prior imaging parameter set to obtain the inherent imaging parameter set.
[0040] The image coordinates and corresponding radial offset of each spot in the distorted observation field are read from the observable field, and the nominal optical center position, nominal focal length, and nominal field of view are read from the prior imaging parameter set. A set of candidate optical center position coordinate grids is constructed on the image plane, and each candidate optical center position corresponds to a set of assumed optical center coordinates. For each candidate optical center position, the radial distance of all spots relative to the candidate optical center position is recalculated, and the difference between these radial distances and the theoretical radial distance in the distorted observation field is calculated point by point. The sum of the squares of all differences is calculated to obtain the total distortion error corresponding to the candidate optical center position. All candidate optical center positions are traversed, and the candidate optical center position with the smallest total distortion error is selected as the intrinsic optical center position. The intrinsic optical center position is recorded in the intrinsic imaging parameter set.
[0041] After obtaining the position of the intrinsic optical center, the position of the intrinsic optical center is used as the radial calculation reference. The effective lattice spot farthest from the position of the intrinsic optical center is selected from the distorted observation field. The image radius of the effective lattice spot is calculated, and the corresponding effective field of view is calculated by combining the nominal focal length in the prior imaging parameter set. The effective field of view is written into the intrinsic imaging parameter set as the intrinsic field of view.
[0042] The brightness distribution around each dot matrix spot is read from the observable field. Multiple point spread observation subsets are generated at various locations according to a fixed window size. Normalization is performed on each subset to obtain multiple sets of normalized observation point spread functions. Prior point spread functions are read from the prior imaging parameter set. Each set of normalized observation point spread functions is pixel-wise differiated from the prior point spread function to obtain the point spread residual distribution at each location. The average point spread residual distribution across all locations is calculated to obtain the average point spread residual distribution across the entire field of view. The prior point spread function is then corrected once using a preset correction coefficient to obtain the intrinsic point spread function, expressed as: ; in, Indicates pixel coordinates The intrinsic point spread function at that location, Indicates pixel coordinates The prior point spread function at that location, Indicates pixel coordinates From the first Normalized observation point spread function generated from point spread observation data at each lattice location; Indicates the number of lattice positions. This represents the residual correction factor.
[0043] It should be noted that the residual correction factor This method involves acquiring multiple sets of dot matrix images at different focal lengths, temperature environments, and optical path conditions. For each set of images, the residual distribution between the normalized observation point spread function and the prior point spread function is calculated. Statistical analysis is then performed on all residual distributions to determine the method that minimizes the overall dot spread error after residual correction under various test conditions. and the statistics obtained The value is used as the residual correction factor.
[0044] The actual peak brightness and actual average brightness of each dot matrix spot in the brightness observation field under different color channels are read from the observable field, and the nominal imaging response function and nominal color response curve are read from the prior imaging parameter set. For each color channel, the actual peak brightness is compared with the theoretical brightness at the corresponding position in the nominal imaging response function, and the ratio coefficient between the actual brightness and the theoretical brightness is calculated. The ratio coefficient is statistically analyzed at multiple dot matrix positions, and the mean value is obtained. The mean value is used as the global response adjustment factor of the color channel. Based on the global response adjustment factor of each color channel, the amplitude of the nominal color response curve is adjusted to generate the intrinsic color response curve. The intrinsic color response curve is written into the intrinsic imaging parameter set.
[0045] The average brightness, variance of brightness, and range of brightness for each background window in the noise observation field are read from the observable field, and the theoretical brightness range corresponding to the nominal imaging response function in the dark region is read from the prior imaging parameter set. The average brightness of each background window is compared with the theoretical brightness of the dark region to determine whether the background window is in a true dark background region. For windows determined to be dark backgrounds, the variance of brightness is regarded as the noise intensity estimate of the window. Spatial interpolation is performed on the noise intensity estimates of all dark background windows to generate a noise intensity distribution map covering the entire imaging area. The noise intensity distribution map is written into the intrinsic imaging parameter set as the intrinsic noise response.
[0046] The inherent optical center position, inherent field of view, inherent point spread function, inherent color response, and inherent noise response are encapsulated to obtain the inherent imaging parameter set.
[0047] S4. Calculate the optical path brightness deviation field and the workstation noise deviation field based on the inherent imaging parameter set. Correct all original images using the optical path brightness deviation field and the workstation noise deviation field to obtain the corrected image set and the clean noise field.
[0048] Based on the inherent field of view and the inherent optical center position, the structured light and the light source box are controlled to enter a uniform illumination mode, so that the camera module receives incident light with the most uniform spatial distribution within the entire effective field of view. Multiple frames of flat field images are continuously acquired, and the average of each pixel in the multiple frames of flat field images is calculated to obtain the flat field average image after channel separation. Based on the dark noise characteristics in the inherent noise response, the light source is turned off and external stray light is blocked. Multiple frames of dark field images are continuously acquired under the same exposure time as the flat field acquisition stage. The average of each pixel in the multiple frames of dark field images is calculated to generate the dark field average image. The brightness variance of each pixel in the multiple frames of dark field images is calculated to form the dark field noise intensity distribution.
[0049] Based on the inherent color response and inherent noise response recorded in the inherent imaging parameter set, a comparative analysis of flat-field and dark-field data is performed. Specifically, for each color channel, the overall average brightness of the flat-field average image in the color channel is first calculated. Then, the difference between the flat-field brightness at each pixel position and the overall average brightness is calculated to obtain the brightness deviation value of the pixel in the color channel. The brightness deviation values of all pixels are combined according to their spatial positions to form an optical path brightness deviation field. In the dark-field variance distribution, the noise intensity is read pixel by pixel and compared pixel by pixel with the inherent noise response recorded in the inherent imaging parameter set. The position noise additive amount at each pixel position is calculated through the difference. The noise additive amounts at all pixel positions are combined to form a position noise deviation field. After the optical path brightness deviation field and the position noise deviation field are constructed, the original test images are uniformly corrected to obtain a corrected image set, expressed as: ; in, Indicates pixel coordinates Color channel Corrected image brightness value, Indicates pixel coordinates Color channel The original image brightness value, This represents the dark field average image in pixel coordinates. The average brightness value of the dark field at that location. This indicates the optical path brightness deviation field at pixel coordinates. Color channel The optical path brightness deviation value is as follows. It represents a tiny positive number.
[0050] It should be noted that, During the calibration phase, the minimum absolute deviation value of the optical path brightness deviation field is statistically analyzed, and a positive number less than the minimum absolute deviation value is selected as a small positive number to ensure that the denominator of the correction formula will not be zero when the optical path brightness deviation value is close to zero.
[0051] The station noise deviation field is subtracted from the dark field noise intensity to obtain the residual noise intensity. The residual noise intensities of all pixel positions are then combined into a clean noise field according to the pixel coordinates.
[0052] S5. Evaluate the consistency between the corrected image set and the clean noise field to obtain an imaging consistency score.
[0053] The positions of all structured light spot arrays are selected from the corrected image set, and a brightness window of a fixed size is cropped in the local area of each spot. In each brightness window, the peak brightness, half width at half maximum (WWHM), and local sharpness information obtained from the spot gradient are calculated as local sharpness information. The local sharpness information is compared with the theoretical diffusion width of the inherent point spread function at the corresponding position to calculate the local sharpness deviation. The average of all local sharpness deviations is taken to obtain the sharpness consistency score.
[0054] In the calibration image set, local color brightness is extracted for each color channel, and the theoretical brightness value of the corresponding color channel in the intrinsic color response is read. The color deviation at each pixel location is calculated, and the root mean square operation is performed on the color deviation of all pixels in the calibration image set to obtain the color mean square deviation. The color mean square deviation is then converted into a color consistency score, expressed as: ; in, Indicates color consistency score, Indicates the mean square deviation of color. This represents the color mean square deviation threshold.
[0055] It should be noted that, It was obtained by statistically analyzing the color mean square deviation distribution of multiple batches of qualified samples and taking the percentile value.
[0056] Based on the noise intensity at each pixel location in the clean noise field, the luminance variance of each image in the corrected image set is calculated. The luminance noise deviation field is obtained by calculating the absolute value of the pixel-by-pixel difference between the luminance variance and the clean noise field. In the luminance noise deviation field, the root mean square (RMS) operation is performed on the noise deviation of all pixels to obtain the noise mean square deviation. This noise mean square deviation is then mapped to a luminance noise consistency score, expressed as: ; in, Indicates the brightness-to-noise consistency score. Indicates the mean square deviation of noise. This represents the mean square deviation threshold of the luminance noise.
[0057] It should be noted that, The process involves collecting samples from multiple batches of camera modules that have been deemed to have acceptable noise performance, calculating the noise mean square deviation for each sample to form a sample set, sorting the sample set, and taking the noise mean square deviation corresponding to the top percentile (e.g., the 95th percentile) after sorting as the brightness noise mean square deviation threshold.
[0058] Defects such as bad pixels, vignetting, light spot distortion, and intermittent flickering areas are identified from the corrected image set. The area ratio of each defective area in the imaging area is calculated. The brightness abnormality amplitude is obtained by subtracting the brightness of all pixels in the defective area from the reference brightness of the adjacent normal area outside the defective area and taking the absolute value. The product of the area ratio and the brightness abnormality amplitude is used as the defect residual intensity. The overall mean of the defect residual intensity is calculated according to the pixel coordinates to obtain the defect impact score.
[0059] The imaging consistency score is calculated using a product-based collaborative fusion relationship, expressed as: ; in, Indicates the imaging consistency score. This indicates the impact of defects on the score.
[0060] S6. Calculate the differential parameter set and obtain the aging intensity sequence by using the inherent imaging parameter set and imaging consistency score of different periods.
[0061] Using the inherent imaging parameter set of the initial period as the reference set, a difference parameter set between the reference set and the initial period is constructed for each period. Specifically, the inherent point spread function, inherent color response, inherent noise response, inherent optical center position and inherent field of view of different periods are read, and the difference with the reference set is calculated on the same parameter dimension to obtain the difference parameter set.
[0062] The various difference components in the difference parameter set are normalized to drift intensities in the range of 0 to 1. Specifically, for the intrinsic point spread function (IPF) difference, the absolute difference between the IPF of subsequent periods and the initial IPF is calculated pixel by pixel on the two-dimensional coordinate grid defined by the IPF, and the global average is taken as the point spread drift index. For the intrinsic color response difference, the average absolute difference between the intrinsic color response curve of subsequent periods and the initial intrinsic color response curve is calculated for each color channel, and the average absolute difference of the three color channels is averaged as the color response drift index. For the intrinsic noise response difference, the intrinsic noise response of subsequent periods and the initial intrinsic noise response are calculated pixel by pixel on the pixel grid defined by the clean noise field. The absolute difference between the coordinates of the optical center and the color response is calculated, and the global average is taken as the noise response drift index. For the inherent optical center position difference, the Euclidean distance between the coordinates of the inherent optical center in subsequent cycles and the initial inherent optical center coordinates is calculated, and the Euclidean distance is normalized using the sensor diagonal length to obtain the optical center drift index. For the inherent field of view difference, the absolute difference between the inherent field of view in subsequent cycles and the initial inherent field of view is calculated, and the initial inherent field of view is normalized to obtain the field of view drift index. The point spread drift index, color response drift index, noise response drift index, field of view drift index, and optical center drift index are arithmetically averaged to obtain the comprehensive parameter drift intensity. The imaging consistency degradation intensity is calculated for each cycle, and the expression is: ; in, Indicates period The intensity of image consistency degradation, This represents the imaging consistency score for the initial period. Indicates period Imaging consistency score.
[0063] The aging intensity is calculated by combining the drift intensity and the imaging consistency degradation intensity, and the expression is: ; in, Indicates aging strength. This indicates the drift intensity of the comprehensive parameters.
[0064] The aging intensity of each cycle is combined to obtain an aging intensity sequence.
[0065] S7. Calculate the lifetime score based on the imaging consistency score and aging intensity sequence to obtain the expected failure time of the camera module.
[0066] The aging intensity sequence is fitted using nonlinear least squares to obtain the fitted aging intensity, expressed as: ; in, Indicates relative time Fitted aging strength, Indicates the maximum degree of aging. This indicates an aging-accelerating factor.
[0067] It should be noted that, using the least squares criterion, the relative time of each detection cycle and the corresponding aging intensity are taken as sample points, and the solution is obtained simultaneously through least squares fitting. and This minimizes the sum of squared errors between the actual aging intensity and the corresponding fitted aging intensity for all sample points. After the fitting converges, the result obtained from the fitting is... As an aging acceleration factor As the maximum aging rate.
[0068] A lifetime score reflecting the degradation trend of imaging performance is generated based on the initial imaging consistency score, expressed as: ; in, Indicates relative time Lifespan rating below.
[0069] Set a minimum acceptable imaging consistency threshold. When the lifetime score drops to the minimum acceptable imaging consistency threshold, record the current moment as the failure prediction time.
[0070] It should be noted that the minimum acceptable imaging consistency threshold is determined by selecting multiple batches of camera modules that have undergone specified aging conditions but are still in an acceptable or critically usable state as determined by manual or system methods. For each module, the current imaging consistency score is calculated, and the ratio is calculated with the corresponding initial imaging consistency score to obtain the imaging consistency distribution of the critical samples. The proportion distribution is sorted, and the ratio of the lower percentile (e.g., the 10th percentile) is taken as the proportion coefficient. The product of the proportion coefficient and the imaging consistency score of the initial period is used as the minimum acceptable imaging consistency threshold.
[0071] In summary, this invention achieves accurate restoration of the true imaging characteristics of a camera module in a workstation environment by extracting four types of observation fields—distortion, point spread, brightness, and noise—based on a structured light array and performing joint inversion. By utilizing the optical path brightness deviation field and the workstation noise deviation field to perform unified image correction and generate a clean noise field, the stability and reliability of sharpness, color, and noise evaluation are significantly improved. By combining inherent imaging parameter changes with imaging consistency scores to form an aging intensity sequence and predict failure time, imaging lifetime prediction results can be obtained without destructive experiments.
[0072] 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. An automatic testing method for camera modules based on image recognition, characterized in that: include, Collect nominal physical parameters, construct an original nominal parameter set, and calculate the light spot diffusion range through the original nominal parameter set to obtain the prior imaging parameter set; The dot array image is acquired by structured light dot array projection, the dot array is identified and the center is located according to the prior imaging parameter set, the center coordinates of the dot array spot are obtained, and the observable field is calculated by the center coordinates of the dot array spot. The inherent imaging mechanism of the camera module is inverted by using the observable field and the prior imaging parameter set to obtain the inherent imaging parameter set; The optical path brightness deviation field and the workstation noise deviation field are calculated based on the inherent imaging parameter set. The original test image is then corrected using the optical path brightness deviation field and the workstation noise deviation field to obtain the corrected image set and the clean noise field. The consistency between the calibrated image set and the clean noise field is evaluated to obtain an imaging consistency score. By using the inherent imaging parameter sets and imaging consistency scores of different periods, the comprehensive parameter drift intensity is calculated to obtain the aging intensity sequence; The expected failure time of the camera module is obtained by calculating the lifetime score based on the imaging consistency score and the aging intensity sequence.
2. The automatic testing method for camera modules based on image recognition as described in claim 1, characterized in that: The steps involve collecting nominal physical parameters, constructing an original nominal parameter set, calculating the light spot diffusion range using the original nominal parameter set, and obtaining a priori imaging parameter set. Collect pixel size, nominal focal length, nominal optical center position, nominal field of view and nominal color response curve, encapsulate them and obtain the original nominal parameter set; The light spot diffusion range is calculated by using the original nominal parameter set, the a priori point diffusion function is obtained, and the two-dimensional brightness distribution is simulated based on the a priori point diffusion function and the nominal color response curve to obtain the nominal imaging response function. The theoretical field of view is calculated based on the pixel size. The theoretical field of view is compared with the nominal field of view in the original nominal parameter set. The original nominal parameter set is then re-obtained. The original nominal parameter set, the prior point spread function, and the nominal imaging response function are combined to obtain the prior imaging parameter set.
3. The automatic testing method for camera modules based on image recognition as described in claim 2, characterized in that: The process involves acquiring a dot matrix image through structured light dot matrix projection, identifying and centering the dots based on a prior imaging parameter set, and obtaining the center coordinates of the dot matrix light spots. The specific steps are as follows: By controlling the structured light projection array spot, and based on the optical center position and prior point diffusion function in the prior imaging parameter set, local extremum search and brightness centroid extraction are performed on the array spot to obtain the center coordinates of the array spot.
4. The automatic testing method for camera modules based on image recognition as described in claim 3, characterized in that: The specific steps for calculating the observable field using the center coordinates of the dot matrix light spots are as follows: The radial offset is calculated by the center coordinates of the lattice spot to obtain the distortion observation field. The neighborhood window is truncated based on the center coordinates of the lattice spot and the energy distribution characteristics are calculated to obtain the point diffusion observation field. The brightness deviation index is calculated by the peak brightness of the lattice spot and the average brightness of the neighborhood to obtain the brightness observation field. The background region is divided from the raster image, and brightness statistics are performed in the background region to obtain the noise observation field. The distortion observation field, point diffusion observation field, brightness observation field and noise observation field are encapsulated to obtain the observable field.
5. The automatic testing method for camera modules based on image recognition as described in claim 4, characterized in that: The specific steps for inverting the inherent imaging mechanism of the camera module using the observable field and prior imaging parameter set to obtain the inherent imaging parameter set are as follows: The inherent optical center position is obtained by performing a distortion error search on the optical center position through the observable field; The image radius of the farthest effective dot matrix spot is calculated based on the inherent optical center position to obtain the inherent field of view. The prior point spread function is corrected by the point spread observation field to obtain the inherent point spread function. The inherent color response and inherent noise response are generated according to the brightness observation field and the noise observation field, respectively. The inherent optical center position, inherent field of view, inherent point spread function, inherent color response, and inherent noise response are encapsulated to obtain the inherent imaging parameter set.
6. The automatic testing method for camera modules based on image recognition as described in claim 5, characterized in that: The process involves calculating the optical path brightness deviation field and the workstation noise deviation field based on the inherent imaging parameter set, then correcting the original test image using these fields to obtain a corrected image set and a clean noise field. The specific steps are as follows: Acquire multiple frames of flat field images and multiple frames of dark field images, and calculate the average and brightness variance pixel by pixel to obtain the flat field average image, dark field average image, and dark field noise intensity distribution. By comparing and analyzing the flat field average image and dark field noise intensity distribution with the inherent color response and inherent noise response, the optical path brightness deviation field and the workstation noise deviation field are obtained. The original test image is uniformly corrected based on the optical path brightness deviation field to obtain a corrected image set; The pure noise field is obtained by calculating the difference between the corrected image set and the corresponding dark field noise intensity distribution and the workstation noise deviation field.
7. The automatic testing method for camera modules based on image recognition as described in claim 6, characterized in that: The specific steps for evaluating the consistency between the corrected image set and the clean noise field to obtain an imaging consistency score are as follows: Calculate sharpness consistency score, color consistency score and defect impact score based on the corrected image set; The noise mean square deviation is calculated by comparing the noise intensity at each pixel location in the clean noise field with the brightness variance at the corresponding location in the corrected image set, and a brightness noise consistency score is obtained. An imaging consistency score is obtained by performing product-based synergistic fusion of sharpness consistency score, color consistency score, brightness noise consistency score, and defect impact score.
8. The automatic testing method for camera modules based on image recognition as described in claim 7, characterized in that: The specific steps for calculating the sharpness consistency score, color consistency score, and defect impact score based on the corrected image set are as follows: By selecting the position of the structured light array spot from the corrected image set and cropping the brightness window, the peak brightness, half width at half maximum (WWHM), and local sharpness information obtained from the spot gradient within the brightness window are calculated to obtain a sharpness consistency score. A color consistency score is obtained by extracting local color brightness for each color channel in the calibrated image set and comparing it with the theoretical brightness in the intrinsic color response. By identifying bad pixels, vignetting, light spot distortion, and intermittent flickering areas in the corrected image set, and calculating the area ratio and brightness abnormality of the defective areas, a defect impact score is obtained.
9. The automatic testing method for camera modules based on image recognition as described in claim 8, characterized in that: The process involves calculating the comprehensive parameter drift intensity and obtaining the aging intensity sequence by using inherent imaging parameter sets and imaging consistency scores from different periods. The specific steps are as follows: The intensity of the integrated parameter drift is calculated by using the inherent imaging parameter sets of different periods, and the intensity of the imaging consistency degradation is obtained by comparing the imaging consistency scores of each period. The aging intensity is calculated by combining the drift intensity of the comprehensive parameters and the degradation intensity of imaging consistency. The aging intensity of each period is then combined to obtain the aging intensity sequence.
10. The automatic testing method for camera modules based on image recognition as described in claim 9, characterized in that: The specific steps for calculating the lifetime score based on the imaging consistency score and aging intensity sequence to obtain the expected failure time of the camera module are as follows: The aging intensity sequence is fitted by nonlinear least squares fitting to obtain the fitted aging intensity. The lifetime score is calculated by the initial imaging consistency score and the fitted aging intensity to obtain the lifetime score sequence. A minimum acceptable imaging consistency threshold is set, and the failure prediction time is obtained by comparing the lifetime score sequence with the minimum acceptable imaging consistency threshold.