A method for constructing a lens defect data set of a linear array camera
Patent Information
- Application Number
- CN202611363132.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-10-09
AI Technical Summary
[0002]线阵相机是工业生产线上对高精度镜片、玻璃等透明或反光材料进行表面缺陷的自动化光学检测的重要设备,通过逐行扫描获取高分辨率图像,再将图像数据通过深度学习网络模型来进行缺陷检测,但在实际工业环境中,线阵相机的成像质量极易受到机械传动系统不稳定的影响
本发明提供的数据集构建方法专门针对时间积分扫描和线光源照明特性设计,确保生成的样本符合工业物理规律,采用纵向非均匀缩放几何增强技术,通过正弦波调制模拟传送带速度抖动,并包含对应的边界框坐标自动映射机制,解决机械误差下的检测稳定性问题,在保留原始缺陷特征完整性的前提下,有效增加数据集多样性,从而显著增强深度学习缺陷检测模型的泛化能力和鲁棒性。
Smart Images

Figure CN122888352A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine vision and industrial inspection technology, and in particular to a method for constructing a dataset of defects in linear array camera lenses. Background Technology
[0002] Line scan cameras are crucial equipment in industrial production lines for automated optical inspection of surface defects in high-precision lenses, glass, and other transparent or reflective materials. They acquire high-resolution images through line-by-line scanning, and then use the image data to perform defect detection via a deep learning network model. However, in real industrial environments, the image quality of line scan cameras is highly susceptible to the instability of the mechanical transmission system. For example, even slight vibrations in the conveyor belt speed can cause non-uniform stretching or compression deformation in the longitudinal direction of the scan; simultaneously, illumination attenuation at both ends of the linear light source or installation angle deviations can lead to uneven brightness in the lateral direction of the sensor array. These instabilities in the mechanical transmission system result in scarce defect image data and insufficient scene diversity. Therefore, the quality of the defect image dataset directly affects the accuracy of the line scan camera in detecting product defects. However, existing dataset construction methods have the following drawbacks: Data scarcity and insufficient scene diversity: It is difficult to obtain real lens defect samples on a large scale, and the collected data usually lacks diversity, such as shooting only under a single light source and angle, which makes the model have poor detection robustness when facing the changing lighting and slight angle changes in the actual production line. Destructive enhancement can easily destroy high-precision information: Common geometric enhancement operations such as random rotation and cropping may destroy the precise shape and location of tiny defects. For lens defect detection tasks that require extremely high geometric accuracy, this may introduce erroneous information and reduce detection accuracy. Consistency of bounding box annotation is difficult to guarantee: When performing enhancement, it is difficult to ensure that the bounding box annotation information of the target defect is accurately synchronized with the enhanced image content at the pixel level, especially for high-resolution line scan camera images.
[0003] Due to the aforementioned technical issues, most existing defect detection methods are limited by insufficient training data and incomplete scene coverage, resulting in poor robustness and generalization ability of the trained models in complex and ever-changing environments with different lighting and shooting angles. To address this, we propose a method for constructing a defect dataset for linear array camera lenses. Summary of the Invention
[0004] The purpose of this invention is to provide a method for constructing a dataset of defects in linear array camera lenses, so as to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for constructing a dataset of defects in a linear array camera lens, comprising: Step 1: Acquire the original images of lens defects captured by the linear scan camera system and construct the dataset; Step 2: Construct a lossless enhancement module that includes a scan jitter simulation module and an illumination distribution simulation module. The original dataset is then subjected to geometric and visual enhancement by the lossless enhancement module to generate a lossless enhanced dataset. Step 3: Use the obtained lossless augmentation dataset to train a deep learning network model, and then use the trained deep learning network model to perform defect detection.
[0006] Preferably, in step 2, the scanning jitter simulation module simulates the stretching or compression of the image caused by the mechanical jitter of the conveyor belt based on a sinusoidal modulation function, thereby performing nonlinear longitudinal resampling of the image. The specific process is as follows: Let the coordinates of the original image be... The coordinates of the enhanced image are ; The periodic fluctuations in conveyor belt speed are simulated by a transformation formula, which is: ; ; In the formula, This is the jitter amplitude coefficient, with a value ranging from 0.01 to 0.05. The frequency of the jitter. It is a random phase.
[0007] Preferably, in the geometric enhancement of the original image, after the bounding box is updated synchronously, the center ordinate of the bounding box of the defect target is... and height A corresponding mapping transformation is performed to preserve the defect morphology while simulating the actual scanning deformation. The formula for the mapping transformation is as follows: ; ; In the formula, This is the jitter amplitude coefficient, with a value ranging from 0.01 to 0.05. The frequency of the jitter. It is a random phase.
[0008] Preferably, during the geometric enhancement process of the original image, the bounding boxes of target defects in the image need to be adjusted synchronously to ensure the accuracy of the annotation information. The specific process is as follows: Let the original bounding box be defined by its center coordinates. and size express; The updated bounding box coordinates are calculated using a formula. The calculation formula is as follows: ; ; ; ; In the formula, Indicates the image height. The original ordinate of the bounding box center. This is the new ordinate of the center of the bounding box.
[0009] Preferably, in step 2, the specific process by which the illumination distribution simulation module simulates the lateral gradient adjustment of light source attenuation to achieve image visual enhancement is as follows: Based on the physical attenuation characteristics of a line light source, an illumination gain mask of the same size as the original image, with no vertical invariance and a gradient distribution in the horizontal direction, is constructed. ; Calculate the enhanced pixel value ; Adjust the brightness and contrast.
[0010] Preferably, the formula for calculating the enhanced pixel value is: ; In the formula, The normalized transverse gradient function, These are the original image pixel values. This is the gradient strength factor, with a value ranging from 0.1 to 0.3. This is the global brightness offset.
[0011] Preferably, in the enhanced pixel value calculation, the normalized lateral gradient function is selected to simulate a Gaussian distribution to simulate a bright center and a dark edge, or to simulate a single-sided light source tilt. when When choosing a Gaussian distribution: ; when When choosing a linear distribution: ; In the formula, This represents the image width.
[0012] Preferably, the formula for adjusting image pixel values during brightness and contrast adjustments is: ; In the formula, Original pixel values, This is the contrast adjustment factor, with a value ranging from 0.8 to 1.2. This is the brightness adjustment factor, with a value range of -20 to 20. This represents the average pixel value of the image.
[0013] Preferably, the lossless enhancement module also includes a mechanism for automatically updating the annotation information, which specifically includes: The coordinates of the upper and lower edges of the bounding box of the target defect in the original image are mapped based on the same origin formula. Calculate the new edge position after transformation; The new center coordinates and height are derived using the new edge location.
[0014] Preferably, the formula for calculating the new edge position is: ; ; In the formula, The ordinate of the top edge of the bounding box. The ordinate of the bottom edge of the bounding box. The ordinate of the new top edge of the bounding box. The ordinate of the new lower edge of the bounding box. jitter amplitude coefficient, The frequency of the jitter. It is a random phase; in: ; ; In the formula, The ordinate of the center of the bounding box of the target defect in the original image. The height of the bounding box of the target defect in the original image; The new formulas for calculating the center coordinates and altitude are as follows: ; .
[0015] The technical effects and advantages of this invention are as follows: The dataset construction method provided by this invention is specifically designed for time integral scanning and line light source illumination characteristics, ensuring that the generated samples conform to industrial physical laws. It adopts longitudinal non-uniform scaling geometric enhancement technology, simulates conveyor belt speed jitter through sine wave modulation, and includes a corresponding automatic bounding box coordinate mapping mechanism to solve the detection stability problem under mechanical errors. While preserving the integrity of the original defect features, it effectively increases the diversity of the dataset, thereby significantly enhancing the generalization ability and robustness of the deep learning defect detection model.
[0016] The "longitudinal stretching" and "lateral gradient" proposed in this invention directly correspond to the physical characteristics of "time integration scanning" and "line light source illumination" of a line scan camera, making the generated samples closer to real industrial field fault images than general enhancement methods.
[0017] This invention trains a model by simulating scanning speed jitter, which can effectively resist image distortion caused by conveyor belt slippage and motor speed fluctuations on the production line, reducing the dependence on the precision of hardware equipment. By simulating different lighting conditions such as brightness and contrast and shooting angles, it effectively increases data diversity, which significantly enhances the robustness and generalization ability of the trained defect detection model when facing complex and ever-changing real industrial environments.
[0018] The lateral gradient enhancement of this invention allows the model to see various lighting distributions during the training phase, which significantly improves the defect detection rate of the lens edge region, which is usually the worst lit, and solves the problem that traditional global brightness adjustment cannot simulate edge vignetting.
[0019] In this invention, all transformations are preserved across the entire image, and precise mathematical formulas are used for label coordinate mapping to ensure that the labeling accuracy of tiny defects, such as scratches with a width of only a few pixels, is not lost. Attached Figure Description
[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the method of the present invention.
[0021] Figure 2 This is a schematic diagram of the linear scan camera scanning system of the present invention.
[0022] Figure 3 This is a schematic diagram showing the lens enhancement effect of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] This invention provides, for example Figures 1-3 The method for constructing a linear array camera lens defect dataset, as shown, includes: Step 1: Acquire the original images of lens defects captured by the linear scan camera system and construct the dataset; In real industrial environments, the imaging quality of line scan cameras is highly susceptible to instability in the mechanical transmission system. For example, even slight vibrations in the conveyor belt speed can cause non-uniform stretching or compression deformation of the image in the longitudinal direction of the scanning direction; simultaneously, illumination attenuation at both ends of the linear light source or installation angle deviations can lead to uneven brightness in the lateral direction of the sensor array. Furthermore, it is difficult to obtain large-scale samples of real lens defects, and the collected data often lacks diversity, such as shooting under a single light source and angle. This results in data scarcity and insufficient scene diversity when the model faces varying lighting and slight angle changes in actual production lines, leading to poor detection robustness. Therefore, the original dataset of this invention is collected from a line scan camera scanning system, such as... Figure 2 As shown, it mainly consists of a camera module, a longitudinal motion platform, and a scratch detection path. The camera is fixed at the top, and the lens to be tested is placed on the motion platform and moves along the direction indicated by the arrow. The camera performs line-by-line scanning imaging. This imaging method makes the image more affected by mechanical motion in the longitudinal direction and more affected by light distribution in the lateral direction, thus providing a physical basis for subsequent data enhancement. Step 2: Construct a non-destructive enhancement module containing a scanning jitter simulation module and an illumination distribution simulation module. The original dataset undergoes geometric and visual enhancement through this module to generate a non-destructive enhanced dataset. Since common geometric enhancement operations such as random rotation and cropping may destroy the precise shape and location of minute defects, this could introduce errors and reduce detection accuracy, especially for lens defect detection tasks requiring extremely high geometric precision. Therefore, this invention achieves non-destructive data enhancement through both geometric and visual enhancement. (The last sentence is a repetition of the previous one and can be omitted.) Instead, it may introduce erroneous information and reduce detection accuracy. Therefore, this invention achieves longitudinal non-uniform geometric enhancement through a scanning jitter simulation module and lateral gradient visual enhancement through an illumination distribution simulation module. By utilizing operations such as non-uniform longitudinal scaling based on simulated scanning jitter and lateral gradient adjustment based on simulated light source distribution, the diversity of the dataset is increased without changing the integrity of the original lens defect image information. This is different from existing general image enhancement methods and is specifically designed for the scanning imaging characteristics of line scan cameras. This effectively solves the pain points of data scarcity, insufficient scene diversity, and the possibility of lossy enhancement destroying high-precision information in existing technologies, thereby significantly enhancing the generalization ability and robustness of deep learning defect detection models.
[0025] Since linear array images are stitched together by scanning along the longitudinal direction using a one-dimensional sensor, fluctuations in the conveyor belt speed can cause the image to be stretched or compressed in the longitudinal direction (Y-axis). To adapt the model to this mechanical error and simulate the scenario of the linear array camera acquiring images at different installation angles, this invention employs a scanning jitter simulation module that uses a longitudinal non-uniform scaling strategy to simulate scanning jitter. This strategy does not change the horizontal width (X-axis) of the image, but only performs a small non-linear resampling in the longitudinal direction. The specific process is as follows: Let the coordinates of the original image be... The coordinates of the enhanced image are ; The periodic fluctuations in conveyor belt speed are simulated using a transformation formula, which is: ; ; In the formula, This is the jitter amplitude coefficient, with a value ranging from 0.01 to 0.05. The frequency of the jitter. The above formula simulates the periodic fluctuations of the conveyor belt speed, achieving nonlinear longitudinal resampling of the image. Furthermore, the bounding box is updated synchronously for the defect target, including its center y-coordinate. and height A corresponding mapping transformation is required, and the specific transformation formula is as follows: ; ; In the formula, This is the jitter amplitude coefficient, with a value ranging from 0.01 to 0.05. The frequency of the jitter. The phase is randomized; this step simulates real scanning deformation while preserving the defect morphology; however, the bounding box of the target defect in the image needs to be precisely adjusted synchronously to ensure the accuracy of the annotation information. This allows for the simulation of image stretching or compression caused by conveyor belt speed jitter using a nonlinear transformation of pixel coordinates via a sine function. This includes parameter control of jitter amplitude, frequency, and phase, and synchronous updating of the bounding box coordinates to adapt the model to mechanical transmission errors. The specific process is as follows: Let the original bounding box be defined by its center coordinates. and size express; The updated bounding box coordinates are calculated using a formula. The calculation formula is as follows: ; ; ; ; In the formula, Indicates the image height. The original ordinate of the bounding box center. The new ordinate of the bounding box center; such as Figure 3 As shown in (b), after longitudinal non-uniform scaling, the original image Figure 3 (a) A wavy, minute deformation was generated in the longitudinal direction to simulate conveyor belt jitter. This geometric enhancement increases the model's adaptability to mechanical errors; and the vertical flipping operation does not change the pixel information of the image, making the center coordinates... , and This synchronous update remains unchanged, especially coordinate transformation This ensures a high degree of consistency in the annotation information and enables the generation of different perspectives. This helps the model learn the ability to detect vertically symmetrical targets, thereby improving the robustness of detection in vertically changing scenarios, while maintaining the integrity of the geometric features of defects. Furthermore, in the illumination distribution simulation module, lossless visual enhancement of data is achieved through lateral gradient adjustment simulating the attenuation of a line light source. Since line scan cameras are typically equipped with long, strip-shaped line light sources, due to the vignetting effect of optical lenses or light source aging, images often exhibit characteristics of "bright center, dark edges" or "unilateral gradient." General global brightness adjustment cannot simulate this spatial distribution. Therefore, this invention introduces lateral gradient illumination enhancement, the specific process of which is as follows: Based on the physical attenuation characteristics of a line light source, an illumination gain mask of the same size as the original image, with no vertical invariance and a gradient distribution in the horizontal direction, is constructed. ; Calculate the enhanced pixel value The calculation formula is: ; In the formula, For the normalized transverse gradient function, a Gaussian distribution can be selected to simulate a bright center and dark edges, or a linear distribution can be selected to simulate a tilted light source on one side. when When choosing a Gaussian distribution: ; when When choosing a linear distribution: ; In the above formula, These are the original image pixel values. This is the gradient strength factor, with a value ranging from 0.1 to 0.3. For global brightness offset, Image width; e.g. Figure 3 As shown in (c), after lateral gradient adjustment, the image exhibits a distribution characteristic of bright center and dark edges, simulating the attenuation characteristics of a real line light source, thereby improving the model's robustness to edge defects. This operation enables the model to learn the characteristics of defects under different illumination uniformities, significantly improving the detection rate of edge field defects.
[0026] To address the common lighting variations in industrial inspection environments, this invention also introduces brightness and contrast adjustments as a non-destructive visual enhancement operation to improve the model's adaptability to lighting changes; the formula for adjusting image pixel values is as follows: ; In the formula, Original pixel values, This is the contrast adjustment factor. This is the brightness adjustment factor. This represents the pixel mean of the image; to ensure the enhancement is non-destructive and reasonable, the parameters of this formula are usually limited to a specific range, such as the contrast adjustment factor. The value ranges from 0.8 to 1.2, and this is the brightness adjustment factor. The value ranges from -20 to 20; by performing non-destructive geometric enhancement and non-destructive visual enhancement on the image, the integrity of the original defective pixel information is preserved while increasing the diversity of training samples, thus ensuring the high quality of the dataset.
[0027] Furthermore, existing technologies struggle to ensure pixel-level synchronization between the bounding box annotations of the target defect and the enhanced image content during enhancement, especially for high-resolution line scan camera images, making it difficult to guarantee accurate bounding box annotation in a single pass. To ensure accurate labeling in the enhanced image, coordinate mapping based on a common formula is required for the original defect's bounding box, rather than simple linear scaling. Therefore, this invention establishes an automatic annotation information update mechanism in the lossless enhancement module. This mechanism, when performing the aforementioned nonlinear geometric transformation on the image, does not use general coordinate scaling. Instead, it substitutes the upper and lower edge coordinates of the original bounding box into the dithering formula to calculate the new edge positions after the transformation, thereby deriving the new center coordinates and height. This mechanism ensures that even when the image undergoes wavy deformation, the defect's bounding box remains closely aligned with the defect target, achieving lossless enhancement. The specific calculation process is as follows: Let the center ordinate of the original defect bounding box be... The height is Then its upper edge bottom edge After enhancement, the new top edge of the bounding box and new lower edge Calculated separately as follows: ; ; In the formula, jitter amplitude coefficient, The frequency of the jitter. It is a random phase; Finally, the updated bounding box center coordinates and new heights for: ; ; In this way, the bounding box can accurately follow the deformation of the local stretching or compression of the image, ensuring pixel-level annotation accuracy.
[0028] In step 2 of this invention, a longitudinal non-uniform scaling geometric enhancement technique is adopted, which simulates the speed jitter of the conveyor belt through sinusoidal modulation and includes a corresponding automatic mapping mechanism for bounding box coordinates. This solves the problem of detection stability under mechanical error, thereby effectively increasing the diversity of the dataset while preserving the integrity of the original defect features, thus significantly enhancing the generalization ability and robustness of the deep learning defect detection model. Specifically: In the scanning jitter simulation module, the image is subjected to longitudinal non-uniform geometric enhancement, that is, based on the sinusoidal modulation function to simulate the mechanical jitter of the conveyor belt, the resulting image stretching or compression is subjected to non-linear longitudinal resampling of the image, which includes parameter control of jitter amplitude, frequency and phase, and synchronous update of bounding box coordinates to make the model adapt to mechanical transmission error; In the illumination distribution simulation module, the image is enhanced by horizontal gradient illumination. The pixel values are adjusted using a formula. Based on the physical attenuation characteristics of a line light source, a gain mask that is vertically constant and horizontally gradient distributed is constructed to enhance brightness and contrast visually, thereby enhancing the model's adaptability to changes in light. Unlike traditional circular halo enhancement, this method is specifically designed to protect the illumination distribution model caused by attenuation at both ends of the simulated linear light source or installation tilt. In the defect bounding box correction, a pixel-level defect bounding box synchronous correction technique is configured. That is, when performing the above nonlinear geometric transformation on the image, instead of using general coordinate scaling, the upper and lower edge coordinates of the original bounding box are substituted into the above dithering formula to calculate the new edge position after transformation, and then the new center coordinates and height are derived. This ensures that when the image undergoes wavy deformation, the defect annotation box can still closely fit the defect target, achieving lossless enhancement. Therefore, this invention effectively addresses the core pain points of existing technologies, such as data scarcity, insufficient scene diversity, and the potential for lossy enhancement to damage high-precision information, through geometric enhancement, visual enhancement, and pixel-level defect bounding box synchronous correction. A combined scheme of sinusoidal scanning jitter, lateral linear attenuation, and nonlinear bounding box mapping is proposed to specifically solve the problem of inconsistent data distribution caused by mechanical instability and light source aging in high-precision detection using line scan cameras. This significantly improves the model's robustness and generalization ability under complex lighting and different scanning angles.
[0029] Step 3: Use the obtained lossless augmentation dataset to train a deep learning network model, and then use the trained deep learning network model to perform defect detection.
[0030] This invention addresses the issue that existing technologies' rotation and cropping operations are based on the logic of two-dimensional area array images. It proposes that "longitudinal stretching" and "lateral gradient" directly correspond to the physical characteristics of "time integration scanning" and "line light source illumination" of a line array camera, making the generated samples closer to real industrial field fault images than general enhancement methods, thus ensuring the consistency of the physical mechanism. Furthermore, by simulating scanning speed jitter, this invention enables the trained model to effectively resist image distortion caused by conveyor belt slippage and motor speed fluctuations on the production line, reducing the dependence on the precision of hardware equipment. By simulating different lighting conditions such as brightness and contrast and shooting angles, it effectively increases data diversity, making the trained defect detection model significantly more robust and generalizable in the face of complex and ever-changing real industrial environments; thereby improving its tolerance to mechanical stability. In addition, traditional global brightness adjustment cannot simulate edge vignetting. The lateral gradient enhancement used in this invention allows the model to see various lighting distributions during the training phase, which significantly improves the defect detection rate of the lens edge region, which is usually the worst lit, thereby solving the problem of missed detection at the edge field of view. Meanwhile, compared to the problem of potential loss due to random cropping in existing technologies, all transformations in this invention preserve the entire image, and precise mathematical formulas are used for label coordinate mapping, ensuring that the labeling accuracy of tiny defects such as scratches that are 1-2 pixels wide is not lost.
[0031] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for constructing a dataset of defects in linear array camera lenses, characterized in that, include: Step 1: Acquire the original images of lens defects captured by the linear scan camera system and construct the dataset; Step 2: Construct a lossless enhancement module that includes a scan jitter simulation module and an illumination distribution simulation module. The original dataset is then subjected to geometric and visual enhancement by the lossless enhancement module to generate a lossless enhanced dataset. Step 3: Use the obtained lossless augmentation dataset to train a deep learning network model, and then use the trained deep learning network model to perform defect detection.
2. The method for constructing a linear array camera lens defect dataset according to claim 1, characterized in that, In step 2, the scanning jitter simulation module simulates the stretching or compression of the image caused by the mechanical jitter of the conveyor belt based on a sinusoidal modulation function, thereby performing nonlinear longitudinal resampling of the image. The specific process is as follows: Let the coordinates of the original image be... The coordinates of the enhanced image are ; The periodic fluctuations in conveyor belt speed are simulated by a transformation formula, which is: ; ; In the formula, This is the jitter amplitude coefficient, with a value ranging from 0.01 to 0.
05. The frequency of the jitter. It is a random phase.
3. The method for constructing a linear array camera lens defect dataset according to claim 2, characterized in that, In the geometric enhancement of the original image, after the bounding box is updated synchronously, the center ordinate of the bounding box of the defect target is... and height A corresponding mapping transformation is performed to preserve the defect morphology while simulating the actual scanning deformation. The formula for the mapping transformation is as follows: ; ; In the formula, This is the jitter amplitude coefficient, with a value ranging from 0.01 to 0.
05. The frequency of the jitter. It is a random phase.
4. The method for constructing a linear array camera lens defect dataset according to claim 3, characterized in that, During the geometric enhancement of the original image, the bounding boxes of target defects in the image need to be adjusted synchronously to ensure the accuracy of the annotation information. The specific process is as follows: Let the original bounding box be defined by its center coordinates. and size express; The updated bounding box coordinates are calculated using a formula. The calculation formula is as follows: ; ; ; ; In the formula, Indicates the image height. The original ordinate of the bounding box center. The new ordinate of the bounding box center.
5. The method for constructing a linear array camera lens defect dataset according to claim 1, characterized in that, In step 2, the specific process by which the illumination distribution simulation module simulates the lateral gradient adjustment of light source attenuation to achieve image visual enhancement is as follows: Based on the physical attenuation characteristics of a line light source, an illumination gain mask of the same size as the original image, with no vertical invariance and a gradient distribution in the horizontal direction, is constructed. ; Calculate the enhanced pixel value ; Adjust the brightness and contrast.
6. The method for constructing a linear array camera lens defect dataset according to claim 5, characterized in that, The formula for calculating the enhanced pixel value is: ; In the formula, The normalized transverse gradient function, These are the original image pixel values. This is the gradient strength factor, with a value ranging from 0.1 to 0.
3. This is the global brightness offset.
7. The method for constructing a linear array camera lens defect dataset according to claim 6, characterized in that, In the enhanced pixel value calculation, the normalized horizontal gradient function is either selected from a Gaussian distribution to simulate a bright center and a dark edge, or selected from a linear distribution to simulate a tilted single-sided light source. when When choosing a Gaussian distribution: ; when When choosing a linear distribution: ; In the formula, This represents the image width.
8. The method for constructing a linear array camera lens defect dataset according to claim 5, characterized in that, The formula for adjusting image pixel values during brightness and contrast adjustments is as follows: ; In the formula, Original pixel values, This is the contrast adjustment factor, with a value ranging from 0.8 to 1.
2. This is the brightness adjustment factor, with a value range of -20 to 20. This represents the average pixel value of the image.
9. The method for constructing a linear array camera lens defect dataset according to claim 1, characterized in that, The lossless enhancement module also includes a mechanism for automatically updating annotation information, which specifically is as follows: The coordinates of the upper and lower edges of the bounding box of the target defect in the original image are mapped based on the same origin formula. Calculate the new edge position after transformation; The new center coordinates and height are derived using the new edge location.
10. The method for constructing a linear array camera lens defect dataset according to claim 9, characterized in that, The formula for calculating the new edge position is: ; ; In the formula, The ordinate of the top edge of the bounding box. The ordinate of the bottom edge of the bounding box. The ordinate of the new top edge of the bounding box. The ordinate of the new lower edge of the bounding box. jitter amplitude coefficient The frequency of the jitter. It is a random phase; in: ; ; In the formula, The ordinate of the center of the bounding box of the target defect in the original image. The height of the bounding box of the target defect in the original image; The new formulas for calculating the center coordinates and altitude are as follows: ; 。