Dual-exposure line laser image dynamic bad pixel detection and collaborative correction method and system
Patent Information
- Application Number
- CN202611081802.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]然而,线激光条纹峰值、条纹边缘、工件反射区域以及材质纹理区域同样可能表现出明显的局部灰度突变,仅依据单幅图像中的邻域灰度差异进行坏点判断,难以区分传感器产生的孤立异常像素与正常成像结构
[0015]通过获取同一检测周期内采集且满足像素级对应关系的长曝光图像和短曝光图像,分别进行坏点检测以形成长曝光候选坏点图和短曝光候选坏点图,再逐像素比较两候选坏点图中的标记;对于标记一致的像素,根据对应标记直接确定坏点判定结果,对于标记不一致的像素,根据候选坏点对应曝光图像中的去中心邻域纹理复杂度进一步确定坏点判定结果,由此生成最终坏点掩码,并基于同一最终坏点掩码分别校正长曝光图像和短曝光图像,最后对两幅校正图像进行高动态范围融合。通过将同一像素在两种曝光条件下的候选坏点标记进行联合比较,避免仅依据单幅图像作出坏点判断,并利用去中心邻域纹理复杂度对双曝光判断不一致的像素进行进一步区分,从而提高动态坏点判定的可靠性;同时,以同一最终坏点掩码限定长曝光图像和短曝光图像的校正位置,使两幅图像在对应像素位置保持一致的校正关系,并使高动态范围融合基于完成坏点校正的双曝光图像进行,从而提高双曝光图像协同校正及融合结果的稳定性。
Smart Images

Figure CN122989579A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method and system for dynamic defect detection and collaborative correction of dual-exposure line laser images. Background Technology
[0002] Line laser 3D measurement acquires laser stripe images of a workpiece surface and determines the center position of the stripes based on their grayscale distribution, thereby measuring the workpiece's contour, size, or surface morphology. In real-world industrial scenarios, workpiece surfaces may simultaneously contain low-reflection dark areas, high-reflection bright areas, specular areas, and interfaces between different materials. A single exposure condition often fails to simultaneously guarantee sufficient signal-to-noise ratio in dark areas and prevent saturation in bright areas. Therefore, existing line laser imaging systems typically acquire long-exposure and short-exposure images within the same detection cycle and perform high dynamic range fusion on the two images to expand the effective grayscale range of the line laser image.
[0003] Currently, image sensors may generate hot pixels, randomly flickering pixels, jumping pixels, or temporary readout abnormal pixels under conditions such as high temperature, long-term continuous operation, gain switching, or readout disturbances. To address these abnormal pixels, existing technologies typically perform bad pixel detection separately in long-exposure and short-exposure images. After detecting a bad pixel, the corresponding pixel is corrected using the neighborhood mean, neighborhood median, or directional interpolation. Then, the corrected long-exposure and short-exposure images are fused using high dynamic range (HDR). Another approach is to first perform HDR fusion on the long-exposure and short-exposure images, and then detect and correct abnormal pixels in the fused image. In the bad pixel detection process of a single image, the grayscale value of the current pixel is usually compared with the neighborhood extrema, neighborhood mean, or neighborhood median, and the difference in grayscale value is used to determine whether the current pixel is a bad pixel.
[0004] However, the peak values, edges, reflective areas of the workpiece, and textured areas of line laser stripes can also exhibit significant local gray-level abrupt changes. Judging defective pixels solely based on neighborhood gray-level differences in a single image makes it difficult to distinguish isolated abnormal pixels generated by the sensor from normal imaging structures. Furthermore, long-exposure and short-exposure images have different exposure responses. Performing independent defect detection and correction on the two images may produce different judgment results at different pixel locations, leading to inconsistencies between corresponding content in the two images. Therefore, improving the reliability of dynamic defect detection and collaborative correction in dual-exposure line laser images becomes a problem that needs to be solved. Summary of the Invention
[0005] This application provides a method and system for dynamic defect detection and collaborative correction of double-exposure line laser images, which can improve the reliability of dynamic defect detection and collaborative correction in double-exposure line laser images. The technical solution provided in this application is as follows: In a first aspect, this application provides a method for dynamic defect detection and collaborative correction of dual-exposure line laser images, the method comprising: Acquire long-exposure and short-exposure images that are collected within the same detection period and satisfy pixel-level correspondence; Defect detection is performed on the long exposure image and the short exposure image respectively to obtain candidate defect images for long exposure and candidate defect images for short exposure; The long-exposure candidate bad pixel image and the short-exposure candidate bad pixel image are compared pixel by pixel. When the label of the same pixel is consistent in the two candidate bad pixel images, the bad pixel judgment result is determined according to the corresponding label. When the labels are inconsistent, the bad pixel judgment result is determined according to the decentered neighborhood texture complexity of the pixel in the exposure image corresponding to the candidate bad pixel, and the final bad pixel mask is generated. Based on the final bad pixel mask, bad pixel correction is performed on the long exposure image and the short exposure image respectively to obtain a long exposure corrected image and a short exposure corrected image; The long exposure corrected image and the short exposure corrected image are fused using high dynamic range to obtain a fused image.
[0006] In one specific implementation, the defect detection for the long-exposure image and the short-exposure image respectively includes: Let any exposure image to be detected be denoted as ,in, , Indicates long exposure, Indicates short exposure; With target pixels To obtain decentralized detection neighborhoods from the center Based on the grayscale range or edge features of the decentralized detection neighborhood, the target pixel is divided into flat regions or edge regions, and a threshold multiplier is determined based on the region division results. and minimum grayscale difference threshold The detection threshold for the edge region is greater than the detection threshold for the flat region. When satisfied When this happens, the target pixel is marked as a bright spot candidate for a bad pixel; When satisfied When the target pixel is marked as a dark spot candidate bad spot.
[0007] In one specific implementation, the pixel-by-pixel comparison of the long-exposure candidate bad pixel image and the short-exposure candidate bad pixel image includes: Pixels The marker value in the long exposure candidate bad pixel map is denoted as , to the pixel The marker value in the short-exposure candidate bad pixel map is denoted as and the pixel The flag value in the final bad pixel mask is denoted as ; when and At that time, determine ; when and At that time, determine ; when and At that time, for the pixel Perform long exposure texture complexity verification; when and At that time, for the pixel Perform short-exposure texture complexity verification; in, and A value of 1 indicates a candidate bad pixel, and a value of 0 indicates a non-candidate bad pixel. A value of 1 indicates a bad pixel, and a value of 0 indicates a non-bad pixel.
[0008] In one specific implementation, the long-exposure texture complexity verification and the short-exposure texture complexity verification include: when and At that time, pixels are acquired in the long exposure image. The decentralized neighborhood is determined, and the long exposure texture complexity is determined based on the decentralized neighborhood; when the long exposure texture complexity is greater than the long exposure texture complexity threshold, a determination is made. When the long exposure texture complexity is not greater than the long exposure texture complexity threshold, it is determined that... ; when and At that time, pixels are acquired in the short exposure image. The decentralized neighborhood is determined, and the short exposure texture complexity is determined based on the decentralized neighborhood; when the short exposure texture complexity is greater than the short exposure texture complexity threshold, a determination is made. When the short exposure texture complexity is not greater than the short exposure texture complexity threshold, it is determined that... .
[0009] In a specific feasible implementation, the long exposure texture complexity and the short exposure texture complexity are determined by the following formula: ; in, Represents the pixels in the exposed image Texture complexity; ,when hour, This represents the complexity of the long-exposure texture, when hour, This indicates the complexity of the short-exposure texture; Indicates the number of pixels in the corresponding exposed image. Center and remove the pixel The resulting set of gray values from the centered neighborhood; This represents median operations; The long exposure texture complexity threshold and the short exposure texture complexity threshold are determined based on the exposure parameters of the corresponding exposed image, the image bit depth, the sensor noise characteristics, and the statistical distribution of texture complexity of the calibration image, respectively. The exposure parameters include exposure time and gain.
[0010] In one specific implementation, the bad pixel correction for the long-exposure image and the short-exposure image based on the final bad pixel mask includes: For the pixels marked as bad pixels in the final bad pixel mask, a correction neighborhood is obtained at the corresponding pixel position in the long exposure image and the short exposure image, and valid pixels marked as non-bad pixels in the final bad pixel mask are selected from the correction neighborhood. The median gray value of each effective pixel in the long exposure image and the short exposure image is used to replace the original gray value of the corresponding pixel position. For pixels marked as non-bad pixels in the final bad pixel mask, the original grayscale values of the corresponding pixel positions in the long exposure image and the short exposure image remain unchanged; When the number of effective pixels in the correction neighborhood is insufficient, the correction neighborhood is expanded, and the median gray value of the effective pixels is re-determined based on the expanded correction neighborhood.
[0011] In one specific implementation, the high dynamic range fusion of the long-exposure corrected image and the short-exposure corrected image includes: Based on the exposure time, gain, black level, or image response curve, the long exposure corrected image and the short exposure corrected image are normalized to a comparable brightness range to obtain the long exposure normalized image and the short exposure normalized image. Based on the saturation level of each pixel, dark area noise, and exposure reliability, the fusion weights corresponding to the long exposure normalized image and the short exposure normalized image are determined. Pixels are determined using the following formula. Corresponding blended grayscale values: ; in, Represents pixels The corresponding fused grayscale value; Indicates the pixels in the long exposure normalized image grayscale value; Indicates the pixels in the short-exposure normalized image grayscale value; Represents pixels The corresponding long exposure fusion weights; Represents pixels The corresponding short exposure fusion weight; This indicates a positive number used to prevent the denominator from being zero.
[0012] Secondly, this application provides a dual-exposure line laser image dynamic defect detection and collaborative correction system, which adopts the following technical solution: A dual-exposure line laser image dynamic defect detection and collaborative correction system includes: The exposure image acquisition module is used to acquire long-exposure images and short-exposure images that are collected within the same detection period and satisfy the pixel-level correspondence. The candidate bad pixel generation module is used to perform bad pixel detection on the long exposure image and the short exposure image respectively, and obtain the long exposure candidate bad pixel image and the short exposure candidate bad pixel image; The joint review and judgment module is used to compare the long exposure candidate bad pixel image and the short exposure candidate bad pixel image pixel by pixel. When the label of the same pixel is consistent in the two candidate bad pixel images, the bad pixel judgment result is determined according to the corresponding label. When the labels are inconsistent, the bad pixel judgment result is determined according to the decentered neighborhood texture complexity of the pixel in the exposure image corresponding to the candidate bad pixel, and the final bad pixel mask is generated. The dual-image collaborative correction module is used to perform bad pixel correction on the long exposure image and the short exposure image respectively based on the final bad pixel mask, to obtain a long exposure corrected image and a short exposure corrected image; The dynamic range fusion module is used to perform high dynamic range fusion on the long exposure corrected image and the short exposure corrected image to obtain a fused image.
[0013] Thirdly, this application provides an electronic device, the device including a processor and a memory; the memory stores a program, the program being loaded and executed by the processor to implement a dual-exposure line laser image dynamic bad pixel detection and collaborative correction method as described in the first aspect.
[0014] Fourthly, this application provides a computer-readable storage medium storing a program that, when executed by a processor, is used to implement a method for dynamic defect detection and collaborative correction of dual-exposure line laser images as described in the first aspect.
[0015] By acquiring long-exposure and short-exposure images collected within the same detection period that satisfy pixel-level correspondence, bad pixel detection is performed separately to form long-exposure candidate bad pixel maps and short-exposure candidate bad pixel maps. Then, the markers in the two candidate bad pixel maps are compared pixel by pixel. For pixels with the same marker, the bad pixel judgment result is directly determined according to the corresponding marker. For pixels with different markers, the bad pixel judgment result is further determined according to the decentered neighborhood texture complexity in the exposure image corresponding to the candidate bad pixel. Thus, the final bad pixel mask is generated. Based on the same final bad pixel mask, the long-exposure and short-exposure images are corrected respectively. Finally, high dynamic range fusion is performed on the two corrected images. By jointly comparing candidate bad pixel markers for the same pixel under two exposure conditions, bad pixel judgment is avoided based solely on a single image. Furthermore, the texture complexity of the decentralized neighborhood is used to further distinguish pixels with inconsistent judgments under dual exposure conditions, thereby improving the reliability of dynamic bad pixel judgment. At the same time, the correction positions of the long exposure image and the short exposure image are limited by the same final bad pixel mask, ensuring that the two images maintain a consistent correction relationship at corresponding pixel positions. Moreover, high dynamic range fusion is based on the dual exposure image after bad pixel correction, thereby improving the stability of the collaborative correction and fusion results of dual exposure images.
[0016] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the dynamic defect detection and collaborative correction method for dual-exposure line laser images in an embodiment of this application.
[0018] Figure 2 This is a schematic diagram of the overall process of the dual-exposure line laser image dynamic bad pixel detection and collaborative correction method in the embodiments of this application.
[0019] Figure 3 This is a comparison image of a long-exposure image in this application embodiment after texture complexity verification and without texture complexity verification.
[0020] Figure 4 This is a comparison image of a short-exposure image in this application embodiment after texture complexity verification and without texture complexity verification.
[0021] Figure 5This is a comparison chart of the final results corresponding to different bad pixel correction and high dynamic range fusion processes in the embodiments of this application.
[0022] Figure 6 This is a structural block diagram of the dual-exposure line laser image dynamic bad pixel detection and collaborative correction system in the embodiments of this application.
[0023] Figure 7 This is a block diagram of an electronic device for dynamic defect detection and collaborative correction of dual-exposure line laser images in an embodiment of this application. Detailed Implementation
[0024] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.
[0025] Optionally, this application uses the dual-exposure line laser image dynamic bad pixel detection and collaborative correction method provided in various embodiments in an electronic device as an example for illustration. The electronic device is a terminal or server. The terminal can be a computer, tablet computer, etc. This embodiment does not limit the type of electronic device.
[0026] Reference Figure 1 This is a flowchart illustrating a method for dynamic defect detection and collaborative correction of dual-exposure line laser images according to an embodiment of this application. The method includes at least the following steps: Step S101: Obtain long-exposure images and short-exposure images that are collected within the same detection period and satisfy pixel-level correspondence.
[0027] In step S101, a dual-exposure line laser image group formed within the same detection cycle is acquired. The dual-exposure line laser image group includes a long-exposure image L and a short-exposure image S. The long-exposure image L enhances the grayscale response of the dark and low-reflection areas of the workpiece through a longer exposure time, thereby improving the signal-to-noise ratio of the laser stripes in the dark areas. The short-exposure image S reduces the probability of grayscale saturation in high-reflection areas, specular areas, and laser stripe peaks through a shorter exposure time. The long-exposure image L and the short-exposure image S together characterize the line laser imaging scene corresponding to the current detection cycle.
[0028] Specifically, within a single detection cycle, the image sensor performs both long-exposure and short-exposure acquisitions for the same detection object and the same detection field of view, and associates the two acquisition results into the same double-exposure image group. The same detection cycle indicates that the long-exposure image L and the short-exposure image S belong to the same paired acquisition; the workpiece position, laser projection area, and imaging field of view corresponding to the two images match each other, thus avoiding pixel comparison of images from different detection scenarios as the same set of double-exposure images.
[0029] In one specific implementation, the long-exposure image L and the short-exposure image S have the same image resolution and pixel arrangement. Pixel-level correspondence means that for any pixel... Pixels in long exposure image L Pixels in short exposure image S Corresponding to the same spatial location on the object being detected, the two gray values at the same pixel coordinates differ only due to factors such as exposure response, sensor noise, or temporary pixel anomalies, rather than due to different detection locations.
[0030] In this image, both the long-exposure image L and the short-exposure image S are grayscale images containing line laser fringes. The long-exposure image L retains weaker fringe grayscale information in dark and low-reflection areas, while the short-exposure image S retains unsaturated fringe grayscale information in high-reflection areas. By establishing a one-to-one correspondence between the two images according to their pixel coordinates, grayscale observation results under two different exposure conditions can be obtained at the same spatial location, allowing the long-exposure image and the short-exposure image to retain their respective noise characteristics, dynamic range, and the salience of anomalous pixels.
[0031] After acquiring the double-exposure line laser image set, the long-exposure image L and the short-exposure image S are used as two independent input images with pixel correspondence, allowing each image to retain its own pixel grayscale response. This avoids directly substituting the pixel detection results of one exposure image for the pixel detection results of the other, while ensuring the comparability of double-exposure detection results at the same pixel location.
[0032] Step S102: Perform bad pixel detection on the long exposure image and the short exposure image respectively to obtain the long exposure candidate bad pixel image and the short exposure candidate bad pixel image.
[0033] In step S102, independent initial screening of defective pixels is performed on the long-exposure image and the short-exposure image obtained in step S101. Based on the grayscale difference between each pixel and its corresponding neighborhood, candidate defective pixels that may be formed by hot pixels, randomly flickering pixels, jumping pixels, or temporarily readout abnormal pixels are identified. The long-exposure image and the short-exposure image have different exposure responses, noise levels, and dynamic ranges. Therefore, defective pixel detection is performed on the two images separately to preserve the significant differences in the degree of dynamic defective pixels under different exposure conditions, resulting in a long-exposure candidate defective pixel map and a short-exposure candidate defective pixel map.
[0034] Specifically, bad pixel detection is performed on long-exposure images and short-exposure images respectively, including: denoting any exposure image to be detected as... ,in, , Indicates long exposure, This indicates a short exposure. Therefore, when... hour, Indicates a long exposure image; when hour, This indicates a short exposure image.
[0035] For exposed images target pixels in , with target pixel Select a detection neighborhood centered on the target pixel and remove the target pixel from the detection neighborhood. , obtain decentralized detection neighborhood The decentered detection neighborhood does not include the target pixel itself, thus avoiding the participation of abnormal gray values of the target pixel in neighborhood statistics and preventing changes to the extreme gray values or gray distribution of the neighborhood. The size of the detection neighborhood is determined based on the image resolution, laser stripe width, and sensor noise characteristics; for example, a neighborhood centered on the target pixel can be used. , Or a larger local window.
[0036] With target pixels To obtain decentralized detection neighborhoods from the center Based on the grayscale range or edge features of the decentralized detection neighborhood, the target pixel is divided into flat regions or edge regions, and the threshold multiplier is determined based on the region division results. and minimum grayscale difference threshold The detection threshold for edge regions is greater than that for flat regions.
[0037] In one specific implementation, a calibration image matching the current exposure parameters and image bit depth is pre-acquired, and sample pixels known to be normal pixels and known to be defective pixels are selected from the calibration image. Following the same region division method, each sample pixel is divided into flat region samples and edge region samples, and multiple sets of candidate threshold multiples and candidate minimum gray-level difference thresholds are set for each type of region. Defective pixel detection is performed on the corresponding region samples using each set of candidate parameters, and the false detection rate of normal pixels being judged as candidate defective pixels and the false detection rate of defective pixels not being detected are calculated.
[0038] Among the candidate parameters whose false negative rate is no greater than the preset upper limit of false negative rate, the candidate parameter with the lowest false positive rate is selected as the threshold multiple for the corresponding region. and minimum grayscale difference threshold Therefore, the threshold multiplier and minimum gray-level difference threshold for flat regions, and the threshold multiplier and minimum gray-level difference threshold for edge regions are obtained respectively. Since edge regions contain normal gray-level abrupt changes such as laser stripe edges, reflection edges, or material boundaries, the parameters for edge regions are mainly constrained by reducing the false detection rate; the parameters for flat regions are mainly constrained by maintaining the detection capability of isolated bright spots and isolated dark spots. After determining the region to which the target pixel belongs, the threshold multiplier and minimum gray-level difference threshold corresponding to that region are used to judge candidate bad pixels.
[0039] The grayscale range of the centered detection neighborhood reflects the difference between the maximum and minimum grayscale values within the neighborhood; edge features reflect grayscale changes occurring along at least one direction within the neighborhood. When the grayscale changes within the centered detection neighborhood are small and there are no obvious edges, the target pixel is classified as a flat region; when there is a large grayscale range or obvious edges within the centered detection neighborhood, the target pixel is classified as an edge region. Since the laser stripe peaks, laser stripe edges, workpiece reflection areas, and material interface areas themselves have large grayscale changes, setting a larger detection threshold for edge regions can reduce the probability of normal image structures being initially screened as candidate bad pixels; setting a relatively smaller detection threshold for flat regions can maintain the detection sensitivity for isolated bright spots and isolated dark spots.
[0040] Determine the region type and threshold factor corresponding to the target pixel. and minimum grayscale difference threshold Then, the gray value of the target pixel is compared with the maximum and minimum gray values of the centered detection neighborhood.
[0041] When the following conditions are met: When this happens, the target pixel is marked as a bright spot candidate for a bad spot.
[0042] in, Indicates the exposure image Middle target pixels grayscale value; Indicates target pixel The corresponding set of gray values in the decentralized detection neighborhood; This indicates the maximum gray value in the decentralized detection neighborhood; This represents the threshold multiple determined based on the region where the target pixel is located; This represents the minimum grayscale difference threshold. When the grayscale value of a target pixel exceeds the detection boundary corresponding to the maximum grayscale value in its neighborhood, it indicates that the target pixel exhibits an isolated bright feature relative to its surrounding pixels, and is therefore marked as a bright spot candidate for a bad pixel.
[0043] When the following conditions are met: When this happens, the target pixel is marked as a candidate for a dark spot.
[0044] in, This represents the minimum grayscale value in the centered detection neighborhood. When the grayscale value of a target pixel is lower than the detection boundary corresponding to the minimum grayscale value in the neighborhood, it indicates that the target pixel exhibits an isolated low grayscale feature relative to its surrounding pixels, and is therefore marked as a dark spot candidate for bad pixels. For target pixels that do not meet either the bright spot candidate for bad pixels condition or the dark spot candidate for bad pixels condition, they are marked as non-candidate bad pixels.
[0045] By iterating through each pixel in the long exposure image in the manner described above, a long exposure candidate bad pixel map is formed. Following the same detection process, each pixel in the short-exposure image is traversed to form a short-exposure candidate bad pixel map. For any pixel , Represents pixels Marked as candidate bad pixels in long-exposure images Represents pixels Not marked as a candidate bad pixel in long-exposure images; Represents pixels In short-exposure images, these are marked as candidate bad pixels. Represents pixels It was not marked as a candidate bad pixel in the short exposure image.
[0046] Therefore, the long exposure candidate bad pixel image and the short exposure candidate bad pixel image respectively reflect the initial abnormal state of each pixel under the corresponding exposure conditions. This not only preserves the differences between the long exposure image and the short exposure image in terms of noise characteristics and the significance of bad pixels, but also avoids directly applying the bad pixel detection results of one image to the other image.
[0047] Step S103: Compare the long exposure candidate bad pixel image and the short exposure candidate bad pixel image pixel by pixel. When the label of the same pixel is consistent in the two candidate bad pixel images, the bad pixel judgment result is determined according to the corresponding label. When the labels are inconsistent, the bad pixel judgment result is determined according to the decentered neighborhood texture complexity of the pixel in the exposure image corresponding to the candidate bad pixel, and the final bad pixel mask is generated.
[0048] In step S103, based on the long-exposure candidate bad pixel image and the short-exposure candidate bad pixel image obtained in step S102, the candidate bad pixel markers at the same pixel position are compared pixel by pixel. When the markers in the two candidate bad pixel images are consistent, it indicates that the long-exposure image and the short-exposure image obtained the same initial screening conclusion for the same pixel, and the bad pixel judgment result is directly determined based on the marker; when the markers in the two candidate bad pixel images are inconsistent, it indicates that only one exposure image detected an anomaly, and it is necessary to verify it by combining the local texture features in the exposure image that generated the candidate bad pixel marker.
[0049] Specifically, pixels The marker value in the long exposure candidate bad pixel map is denoted as... , will pixels The marker value in the short-exposure candidate bad pixel map is denoted as... and pixels The marker value in the final bad pixel mask is denoted as .
[0050] in, and A value of 1 indicates a candidate bad pixel, and a value of 0 indicates a non-candidate bad pixel. A value of 1 indicates a bad pixel, and a value of 0 indicates a non-bad pixel.
[0051] Pixel-by-pixel comparison of long-exposure candidate bad pixel images and short-exposure candidate bad pixel images, including: when and At that time, determine .
[0052] In this case, both long-exposure and short-exposure images will have pixels. An anomaly was detected. Because the two images correspond to the same spatial location on the same detected object, but have different exposure responses, pixels... The fact that the anomaly appeared as an isolated anomaly under both exposure conditions suggests that it is unlikely to be caused by normal grayscale fluctuations, exposure differences, or local noise in a single image. Therefore, the pixel... It was directly identified as a bad pixel.
[0053] when and At that time, determine .
[0054] In this case, pixels The pixel did not meet the candidate bad pixel detection criteria in either the long-exposure or short-exposure image, indicating that the pixel's grayscale distribution was compatible with its neighborhood under both exposure conditions. Therefore, the pixel was... It is directly identified as a non-dead pixel.
[0055] when and At that time, for pixels Perform long exposure texture complexity verification.
[0056] when and At that time, for pixels Perform short-exposure texture complexity verification.
[0057] When only one exposed image generates candidate bad pixel markers, the pixels are not directly marked. The image is identified as a bad pixel. Single-exposure hits may be caused by dynamic bad pixels exhibiting varying degrees of severity under different exposure conditions, or by significant local grayscale abrupt changes occurring in laser stripe peaks, stripe edges, workpiece reflection areas, or material boundaries under specific exposure conditions. Therefore, it is necessary to analyze pixels in the original exposed image corresponding to the candidate bad pixel markers. The complexity of the surrounding textures.
[0058] Long exposure texture complexity verification and short exposure texture complexity verification include: when and At that time, pixels are acquired in long exposure images. The decentralized neighborhood is used to determine the long exposure texture complexity; when the long exposure texture complexity is greater than the long exposure texture complexity threshold, the determination is made. When the long exposure texture complexity is not greater than the long exposure texture complexity threshold, determine .
[0059] when and At that time, pixels are acquired in short-exposure images. The decentralized neighborhood is used to determine the short-exposure texture complexity; when the short-exposure texture complexity is greater than the short-exposure texture complexity threshold, the short-exposure texture complexity is determined. When the short exposure texture complexity is not greater than the short exposure texture complexity threshold, determine .
[0060] Decentralized neighborhood is based on pixels Select a local neighborhood around the center and remove pixels from the local neighborhood. The resulting set of neighboring pixels. Removing the center pixel can prevent the abnormal gray values of the candidate bad pixels from participating in texture statistics, so that the texture complexity mainly reflects the actual image structure around the pixel.
[0061] When the texture complexity of the decentralized neighborhood is high, it indicates that the pixel Given the presence of continuous grayscale variations in the surrounding area, this candidate defective pixel is more likely located at the edge of laser stripes, in reflective areas, material edges, or other normal texture structures. Therefore, the pixel... This pixel is determined to be non-defective. When the texture complexity of the centered neighborhood is low, it indicates that the pixel... The surrounding grayscale distribution is relatively flat, and the candidate bad pixels lack continuous texture or edge structure support, which is more consistent with the behavior of isolated abnormal pixels in a flat area. Therefore, the pixels are... It was determined to be a bad pixel.
[0062] In one specific implementation, the long exposure texture complexity and the short exposure texture complexity are determined by the following formula: ; in, Represents the pixels in the exposed image Texture complexity; ,when hour, Indicates the texture complexity of long exposure, when hour, Indicates the texture complexity of short exposures; Indicates the number of pixels in the corresponding exposed image. Center and remove pixels The resulting set of gray values from the centered neighborhood; This indicates median operations.
[0063] In the specific calculation, first determine the set of gray values of the centered neighborhood. The median gray value of the neighborhood is calculated, then the absolute deviation between the gray value of each neighboring pixel and the median gray value of the neighborhood is calculated, and the median of all absolute deviations is obtained. Finally, the result is calculated using a coefficient. Scale adjustment is performed to obtain pixels. The corresponding texture complexity. This calculation method is not significantly affected by a single extremely high or low gray value, and can stably characterize the discreteness of the gray-level distribution within the decentralized neighborhood.
[0064] The long exposure texture complexity threshold and the short exposure texture complexity threshold are determined based on the exposure parameters of the corresponding exposed image, the image bit depth, the sensor noise characteristics, and the statistical distribution of texture complexity of the calibration image, respectively. The exposure parameters include exposure time and gain.
[0065] When determining the texture complexity threshold, calibration images matching the exposure time, gain, image bit depth, and sensor noise state of both long-exposure and short-exposure images are acquired. Labeled flat region samples and texture region samples are then selected from these calibration images. The texture complexity of the decentered neighborhood is calculated for each sample pixel, yielding the texture complexity distributions for the flat region samples and the texture complexity distributions for the texture region samples.
[0066] Multiple candidate texture complexity thresholds are set within a preset numerical range. For each candidate texture complexity threshold, the number of flat region samples being classified as texture regions (first misclassification) and the number of texture region samples being classified as flat regions (second misclassification) are counted. The candidate texture complexity threshold with the smallest sum of the first and second misclassifications is selected as the texture complexity threshold for the corresponding exposure image. The above statistical process is performed on both long-exposure and short-exposure images to obtain long-exposure texture complexity thresholds and short-exposure texture complexity thresholds, thus accommodating differences in exposure response and noise levels between the two images.
[0067] In another implementation, texture complexity is characterized using the local standard deviation, local variance, or gradient energy of the decentralized neighborhood. Regardless of the texture complexity representation method used, the processing relationship of classifying high texture complexity as non-defective and low texture complexity as defective is maintained.
[0068] After completing the direct determination or texture complexity verification of all pixels, according to the corresponding pixel... Constructing the final bad pixel mask The final bad pixel mask maintains the same resolution and pixel arrangement as the long exposure image and the short exposure image. The positions marked with a value of 1 indicate the positions where bad pixel correction needs to be performed in both exposure images, and the positions marked with a value of 0 indicate the positions where bad pixel correction does not need to be performed.
[0069] By performing texture complexity verification only on pixels with inconsistent markings in the long-exposure candidate bad pixel image and the short-exposure candidate bad pixel image, we can improve the reliability of bad pixel judgment by utilizing the consistency of double exposure, reduce misjudgments of laser stripe edges, reflection areas and material textures, and avoid repeatedly performing texture complexity calculations for all image pixels.
[0070] Step S104: Perform bad pixel correction on the long exposure image and the short exposure image based on the final bad pixel mask to obtain the long exposure corrected image and the short exposure corrected image.
[0071] In step S104, the final bad pixel mask generated in step S103 is used as the basis for bad pixel location shared by the long exposure image and the short exposure image, and the corresponding bad pixels are corrected using the neighborhood grayscale information of each of the two images. The final bad pixel mask has the same resolution and pixel arrangement as the long exposure image and the short exposure image, so each pixel position in the final bad pixel mask corresponds to the same pixel position in the two images.
[0072] Each pixel in the final bad pixel mask is evaluated sequentially. When a pixel in the final bad pixel mask... When the flag value is 0, it indicates that the pixel Pixels identified as non-dead pixels will not undergo grayscale replacement. For pixels marked as non-dead pixels in the final dead pixel mask, the original grayscale values of the corresponding pixel positions in the long-exposure and short-exposure images will remain unchanged. This avoids unnecessary modification to normal laser stripe peaks, stripe edges, reflection areas, and material textures.
[0073] When the pixels in the final bad pixel mask When the flag value is 1, it indicates that the corresponding pixel position in both the long-exposure and short-exposure images belongs to the position that needs correction. For the pixels marked as bad pixels in the final bad pixel mask, the correction neighborhood is obtained at the corresponding pixel position in the long-exposure and short-exposure images respectively, and the effective pixels marked as non-bad pixels in the final bad pixel mask are selected from the correction neighborhood.
[0074] Among them, the correction neighborhood is based on pixels. A local pixel window centered on the correction neighborhood is used. For each neighborhood location within the correction neighborhood, the corresponding marker in the final bad pixel mask is read, and only neighborhood locations with a marker value of 0 are determined as valid locations. Long-exposure and short-exposure images use the same range of valid locations, but the grayscale values at these valid locations in their respective images are read separately. Neighborhood locations with a marker value of 1 are not included in the surrogate value calculation to prevent abnormal grayscale values of adjacent bad pixels from interfering with the correction results.
[0075] In the long-exposure image, the gray values corresponding to each effective position are sorted to obtain the median gray value of the effective pixels in the long-exposure image. In the short-exposure image, the gray values corresponding to the same effective position are sorted to obtain the median gray value of the effective pixels in the short-exposure image. The original gray value of the corresponding pixel position is replaced with the median gray value of the effective pixels in the long-exposure image and the short-exposure image, respectively.
[0076] Therefore, the long-exposure image and the short-exposure image are corrected at the same pixel location based on the same final bad pixel mask, but the alternative gray values of the two images are determined by their respective neighborhood gray value distributions. This process not only unifies the correction position of the two images, but also preserves the exposure response and local brightness levels of the long-exposure image and the short-exposure image, avoiding the direct copying of pixel gray values from one image to another.
[0077] When the number of effective pixels within the correction neighborhood is insufficient, the correction neighborhood is expanded, and the median grayscale value of the effective pixels is re-determined based on the expanded correction neighborhood. In one embodiment, the correction neighborhood is expanded stepwise according to a preset expansion step size, for example, by increasing the number of effective pixels within the correction neighborhood. Corrected neighborhood expansion Correction neighborhood. After each expansion of the correction neighborhood, the neighborhood positions marked as bad pixels are excluded again according to the final bad pixel mask, until the number of effective pixels reaches a preset threshold or the correction neighborhood reaches a preset maximum range.
[0078] After correcting all bad pixel locations in the final bad pixel mask, a long exposure corrected image is obtained. and short exposure corrected image Long exposure corrected image and short exposure corrected image Maintain the original pixel-level correspondence and eliminate abnormal grayscale response caused by dynamic bad pixels at the same position, thereby reducing laser stripe breakage, peak shift and local grayscale abrupt change.
[0079] Step S105: Perform high dynamic range fusion on the long exposure correction image and the short exposure correction image to obtain a fused image.
[0080] In step S105, the long exposure corrected image and the short exposure corrected image obtained in step S104 are subjected to brightness normalization and pixel-by-pixel weighted fusion, so that the effective grayscale information obtained by the two images under different exposure conditions forms the same fused image.
[0081] Long-exposure corrected images and short-exposure corrected images have different exposure times and exposure responses, and the gray values of the same pixel location in the two images cannot be directly weighted. Therefore, based on the exposure time, gain, black level, or image response curve, the long-exposure corrected images and short-exposure corrected images are normalized to a comparable brightness domain to obtain long-exposure normalized images and short-exposure normalized images.
[0082] During normalization, the exposure time, gain, black level, or image response curves corresponding to the long-exposure correction image and the short-exposure correction image are obtained respectively, and the pixel grayscale values in the two images are converted according to their respective parameter relationships. The converted long-exposure normalized image and short-exposure normalized image use the same brightness representation scale, so that the two normalized grayscale values of the same pixel position can reflect the brightness information of the same imaging position under long-exposure and short-exposure conditions.
[0083] After brightness normalization, the grayscale information in the two normalized images is evaluated pixel by pixel to determine whether it is suitable for fusion. Based on the saturation level of each pixel, dark area noise, and exposure reliability, the fusion weights corresponding to the long-exposure normalized image and the short-exposure normalized image are determined.
[0084] Among them, saturation reflects whether the grayscale information of the current pixel is close to or reaches saturation due to overexposure; dark area noise reflects the degree of noise interference to the current pixel in a low grayscale state; and exposure reliability reflects the degree to which the current exposed image retains effective grayscale information at the corresponding pixel position. When the pixel saturation of an exposed image is high or the dark area noise is large, the fusion weight of the exposed image at the corresponding position is reduced; when the exposure reliability of an exposed image at the corresponding position is high, the fusion weight of the exposed image is increased. This ensures that grayscale information that has not undergone significant saturation and is less affected by dark area noise occupies a larger proportion in the fusion result.
[0085] Pixels are determined using the following formula. Corresponding blended grayscale values: ; in, Represents pixels The corresponding fused grayscale value; Represents pixels in a long-exposure normalized image grayscale value; Represents pixels in a short-exposure normalized image grayscale value; Represents pixels The corresponding long exposure fusion weights; Represents pixels The corresponding short exposure fusion weight; This indicates a positive number used to prevent the denominator from being zero.
[0086] For each pixel, the normalized grayscale value of the long exposure is multiplied by the long exposure fusion weight, and the normalized grayscale value of the short exposure is multiplied by the short exposure fusion weight. Then, the fused grayscale value is calculated based on the two weighted grayscale values and their corresponding fusion weights. After calculating the fused grayscale values for all pixels, the fused grayscale values are arranged according to the original positional relationships of the pixels to obtain the fused image.
[0087] Since the long-exposure correction image and the short-exposure correction image have already completed bad pixel correction based on the same final bad pixel mask before fusion, the impact of dynamic bad pixels on the fusion weight and fusion gray value can be reduced, so that the fused image takes into account the gray value information of dark areas and the gray value information of bright areas, and maintains the continuity of the line laser stripes.
[0088] In summary, combining Figure 2 This application acquires long-exposure and short-exposure images collected within the same detection period that satisfy pixel-level correspondence. It then performs bad pixel detection on both images to obtain long-exposure candidate bad pixel images and short-exposure candidate bad pixel images. The markings in the two candidate bad pixel images are compared pixel-by-pixel. When the markings match, the bad pixel judgment result is directly determined. When the markings do not match, the texture complexity of the decentralized neighborhood in the corresponding exposure image of the candidate bad pixel is used for verification, thereby generating a final bad pixel mask. The final bad pixel mask is then used as a unified correction position basis, and bad pixel correction is performed using the effective neighbor pixels of both the long-exposure and short-exposure images. Finally, the obtained long-exposure corrected image and short-exposure corrected image are fused using high dynamic range to form a fused image.
[0089] By jointly utilizing candidate defect markers at the same pixel location under both long and short exposure conditions, consistent detection results in the two images are mutually verified. A decentered neighborhood texture complexity review is introduced only for pixels with inconsistent markers. This allows for the differentiation between isolated anomalous pixels in flat areas and normal grayscale abrupt changes in laser stripe peaks, stripe edges, workpiece reflection areas, and material texture areas, based on the presence of continuous grayscale changes in surrounding pixels. This reduces the likelihood of misjudging and incorrectly correcting normal imaging structures. Simultaneously, the final defect mask uniformly defines the correction position in both the long and short exposure images, while the alternative grayscale value for each pixel is still determined by the effective neighboring pixels of the corresponding exposure image. This maintains consistency in the correction position between the two images while preserving their respective exposure responses and local grayscale distributions. Furthermore, high dynamic range fusion is performed after defect correction, further reducing the interference of anomalous pixels on the fusion weights and grayscale results, improving the continuity of line laser stripes, the stability of the center position, and the reliability of dynamic defect detection and collaborative correction.
[0090] In one specific implementation, to intuitively illustrate the pixel-by-pixel comparison process of long-exposure candidate bad pixel images and short-exposure candidate bad pixel images, and the processing method of using decentered neighborhood texture complexity for verification when a single exposure hits, an example is taken: a line laser profilometry camera performing online scanning on a workpiece that simultaneously contains a highly reflective metallic surface and a low-reflective dark surface. The camera acquires one frame of long-exposure image within the same detection cycle. and a short exposure image The ratio of long exposure time to short exposure time is 3.5, the image bit depth is 8 bits, and the local bad pixel detection window is [missing information]. Texture complexity window is Texture complexity threshold The unit of measurement is 20.4 grayscale. For ease of display, the following tables list the corresponding pixels. Surrounding Neighborhood grayscale values, where bold values represent pixels. The grayscale value. Pixels within the region of interest of the laser stripe. Generate based on the local grayscale differences in long-exposure and short-exposure images respectively. and When only one exposed image will have pixels When a candidate bad pixel is marked, the center-neighborhood texture complexity is calculated in the original exposed image that generated the candidate bad pixel marking to determine the mark value in the final bad pixel mask. .
[0091] First, let's take the case where pixel anomalies are detected in both long-exposure and short-exposure images as an example. Pixels in the long-exposure and short-exposure images The gray values of the local area and its neighboring area are shown in Table 1 and Table 2, respectively.
[0092] Table 1. Gray values of the neighborhood of the long exposure image in the double exposure hit example.
[0093] Table 2. Gray values of the neighborhood of the short exposure image in the double exposure hit examples.
[0094] Pixels The grayscale value in both the long-exposure and short-exposure images is 255, and both deviate significantly from the grayscale distribution of their respective neighborhoods. Therefore , The markers at the pixel location are consistent in both the long-exposure candidate bad pixel image and the short-exposure candidate bad pixel image, allowing for direct determination. And perform bad pixel correction at the corresponding positions in the long exposure image and the short exposure image respectively.
[0095] Secondly, let's take the case where no pixel anomalies were detected in either the long-exposure image or the short-exposure image as an example. The pixels in the two images... The gray values of the local area and its neighboring area are shown in Tables 3 and 4, respectively.
[0096] Table 3. Neighborhood gray values of long-exposure images in examples where both double exposures missed the target.
[0097] Table 4. Neighborhood gray values of short-exposure images in examples where both double exposures missed the target.
[0098] Pixels In both long-exposure and short-exposure images, the gray values adapt to the gray-level changes in their respective neighborhoods. , The markers at the pixel location are consistent in both the long-exposure candidate bad pixel image and the short-exposure candidate bad pixel image, allowing for direct determination. In both long-exposure and short-exposure images, the corresponding pixels retain their original grayscale values.
[0099] Again, let's take the case where only the long-exposure image is found to have bad pixels, and this has been confirmed upon review. The pixels in the two images... The gray values of the local area and its neighboring area are shown in Tables 5 and 6, respectively.
[0100] Table 5. Gray values of the neighborhood of long-exposure images in examples where only long-exposure images were hit and confirmed as bad pixels.
[0101] Table 6. Gray values of the neighborhood of short-exposure images in examples where only long exposures hit and are confirmed as bad pixels.
[0102] Pixels The grayscale value in the long-exposure image is 255, which differs significantly from the grayscale distribution in the long-exposure neighborhood. ; pixel The grayscale value in the short-exposure image is 12, which is consistent with the grayscale distribution in the short-exposure neighborhood. Because the markers in the two candidate bad pixel images are inconsistent, the pixels are calculated in the original long-exposure image. The decentralized neighborhood texture complexity is obtained. .because , indicating pixels The surrounding grayscale distribution is relatively flat, while the pixels It exhibits isolated anomalous characteristics, therefore it is determined And perform bad pixel correction on the pixel location in both the long-exposure and short-exposure images respectively. Because the pixels in the short-exposure image... The original gray level was close to the median gray level in the neighborhood, and the gray level change before and after correction was small.
[0103] Finally, consider the case where only the long-exposure image is hit, but after review it is confirmed to be a normal texture or reflection structure. Pixels in the two images The gray values of the local area and its neighboring area are shown in Tables 7 and 8, respectively.
[0104] Table 7. Gray values of the neighborhood of long-exposure images in examples where only long-exposure images were hit but confirmed to be non-dead pixels.
[0105] Table 8. Gray values of the neighborhood of short-exposure images in examples where only long exposures hit but are confirmed as non-dead pixels.
[0106] Pixels The grayscale value in the long-exposure image is 171, which differs significantly from some neighboring pixels. ; pixel The grayscale value in the short-exposure image is 71, and it was not marked as a candidate bad pixel, therefore Calculate pixels in the long-exposure original image. The decentralized neighborhood texture complexity is obtained. .because , indicating pixels The presence of noticeable grayscale variations in the surrounding area suggests that this candidate defective pixel is more likely formed by external textures, reflective areas, or edge structures, thus confirming... No bad pixel correction is performed on this pixel location in long exposure and short exposure images.
[0107] when and In this case, the processing method corresponds to the situation where only long-exposure images are hit, and the pixels are calculated in the short-exposure original image. Decentralized neighborhood texture complexity .when At that time, determine ;when At that time, determine .
[0108] After completing the comparison and verification of all pixels, based on the corresponding pixels... Generate the final bad pixel mask, and obtain long exposure corrected images based on the same final bad pixel mask. and short exposure corrected image Then correct the long exposure image. and short exposure corrected image High dynamic range fusion is performed to obtain a fused image.
[0109] To verify the impact of texture complexity verification on the defect detection results, and the processing effect of joint defect correction on long-exposure and short-exposure images before high dynamic range fusion, a long-exposure image and a short-exposure image were simulated and generated under the same imaging scene, with fixed defective pixels set at corresponding positions in the two images. Two sets of comparative experiments were conducted based on the simulated images: the first set kept the candidate defective pixel detection method unchanged and compared the image processing results with and without texture complexity verification; the second set used three processing flows: high dynamic range fusion followed by defective pixel correction, joint defective pixel correction of long-exposure and short-exposure images followed by high dynamic range fusion, and high dynamic range fusion without defective pixel correction, to compare the impact of different processing methods on defective pixel removal and normal texture preservation.
[0110] Figure 3 This is a comparison image of a long exposure image with and without texture complexity verification. The left image is the long exposure image after performing texture complexity verification on candidate bad pixels detected in a single exposure, and the right image is the long exposure image without texture complexity verification. Figure 3 As can be seen in the area within the red box, after performing texture complexity verification and combining the long exposure candidate bad pixel map and the short exposure candidate bad pixel map to determine the final bad pixel mask, the isolated abnormal bright spots in the long exposure image are corrected; without performing texture complexity verification, the area within the red box still retains several obvious abnormal bright spots.
[0111] Figure 4The images show a comparison of short-exposure images after and without texture complexity verification. The left image is the short-exposure image after performing texture complexity verification on the candidate bad pixels hit in a single exposure, while the right image is the short-exposure image without texture complexity verification. Figure 4 The green box in the image indicates the laser stripe texture area. After verifying the texture complexity of the decentered neighborhood in the exposed image corresponding to the candidate bad points, it is possible to identify candidate bad points formed by laser stripe texture or edge grayscale changes, reducing the situation where normal texture positions are judged as bad points and corrected, thus preserving the local texture details and edge structure in short exposure images.
[0112] Combination Figure 3 and Figure 4 It is known that the same pixel in a long-exposure image and a short-exposure image may receive different candidate defective pixel labels due to different exposure responses. By comparing the candidate defective pixel images of long exposure and short exposure on a pixel-by-pixel basis, and determining the defective pixel judgment result based on the decentered neighborhood texture complexity in the corresponding exposure image when the labels are inconsistent, it is possible to identify and correct isolated abnormal pixels in flat areas, and reduce misjudgments of laser stripe textures and edge positions.
[0113] Figure 5 This is a comparison of the final results of different bad pixel correction and high dynamic range (HDR) fusion processes. The left image shows the result of performing HDR fusion first, then bad pixel correction on the fused image. The middle image shows the result of performing joint bad pixel correction on long-exposure and short-exposure images separately, then performing HDR fusion. The right image shows the result of performing HDR fusion directly without bad pixel correction. Figure 5 As seen in the red-boxed area, when high dynamic range fusion is performed directly without bad pixel correction, bad pixels are retained in the fused image; both methods that perform bad pixel correction first can reduce abnormal bright spots within the red-boxed area. Figure 5 As shown in the green box, when performing bad pixel correction after high dynamic range fusion, normal textures in the fused image are more likely to be treated as abnormal pixels, causing local texture details to be affected. By generating the final bad pixel mask based on the long exposure candidate bad pixel map and the short exposure candidate bad pixel map, and performing bad pixel correction on the long exposure image and the short exposure image respectively before fusion, the probability of normal texture areas being corrected can be reduced while reducing abnormal pixels, so that the fused image retains a more complete local texture and edge structure.
[0114] Figure 6 This is a structural block diagram of a dual-exposure line laser image dynamic defect detection and collaborative correction system provided in one embodiment of this application. The system includes at least the following modules: The exposure image acquisition module is used to acquire long-exposure images and short-exposure images that are collected within the same detection period and satisfy the pixel-level correspondence. The candidate bad pixel generation module is used to perform bad pixel detection on long exposure images and short exposure images respectively, and obtain long exposure candidate bad pixel images and short exposure candidate bad pixel images; The joint review and judgment module is used to compare the candidate bad pixel images of long exposure and short exposure on a pixel-by-pixel basis. When the label of the same pixel is consistent in the two candidate bad pixel images, the bad pixel judgment result is determined according to the corresponding label. When the labels are inconsistent, the bad pixel judgment result is determined according to the decentered neighborhood texture complexity of the pixel in the exposure image corresponding to the candidate bad pixel, and the final bad pixel mask is generated. The dual-image collaborative correction module is used to perform bad pixel correction on the long exposure image and the short exposure image respectively based on the final bad pixel mask, so as to obtain the long exposure corrected image and the short exposure corrected image. The dynamic range fusion module is used to perform high dynamic range fusion on long exposure corrected images and short exposure corrected images to obtain a fused image.
[0115] For relevant details, please refer to the above method implementation examples.
[0116] Figure 7 This is a block diagram of an electronic device provided in one embodiment of this application. The device includes at least a processor 701 and a memory 702.
[0117] Processor 701 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 701 may be implemented in at least one hardware form selected from DSP (Digital Signal Processor), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). Processor 701 may also include a main processor and a coprocessor. The main processor, also known as a CPU, performs processing tasks such as double-exposure line laser image acquisition, bad pixel detection, bad pixel status determination, and collaborative correction. The coprocessor assists in performing some image processing tasks. In some embodiments, processor 701 may also integrate a GPU (Graphics Processing Unit), which is used for parallel processing of pixel operations and local feature calculations in the double-exposure line laser image.
[0118] The memory 702 may include one or more computer-readable storage media, which are non-transitory storage media. The memory 702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 702 is used to store at least one instruction, which is executed by the processor 701 to implement the dual-exposure line laser image dynamic bad pixel detection and collaborative correction method provided in the embodiments of this application.
[0119] Optionally, this application also provides a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the dual-exposure line laser image dynamic bad pixel detection and collaborative correction method of the above method embodiments.
[0120] Optionally, this application also provides a computer product including a computer-readable storage medium storing a program, which is loaded and executed by a processor to implement the dual-exposure line laser image dynamic bad pixel detection and collaborative correction method of the above method embodiments.
[0121] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0122] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for dynamic defect detection and collaborative correction of dual-exposure line laser images, characterized in that, The method includes: Acquire long-exposure and short-exposure images that are collected within the same detection period and satisfy pixel-level correspondence; Defect detection is performed on the long exposure image and the short exposure image respectively to obtain candidate defect images for long exposure and candidate defect images for short exposure; The long-exposure candidate bad pixel image and the short-exposure candidate bad pixel image are compared pixel by pixel. When the label of the same pixel is consistent in the two candidate bad pixel images, the bad pixel judgment result is determined according to the corresponding label. When the labels are inconsistent, the bad pixel judgment result is determined according to the decentered neighborhood texture complexity of the pixel in the exposure image corresponding to the candidate bad pixel, and the final bad pixel mask is generated. Based on the final bad pixel mask, bad pixel correction is performed on the long exposure image and the short exposure image respectively to obtain a long exposure corrected image and a short exposure corrected image; The long exposure corrected image and the short exposure corrected image are fused using high dynamic range to obtain a fused image.
2. The method for dynamic defect detection and collaborative correction of dual-exposure line laser images according to claim 1, characterized in that, The step of performing defect detection on the long-exposure image and the short-exposure image respectively includes: Let any exposure image to be detected be denoted as ,in, , Indicates long exposure, Indicates short exposure; With target pixels To obtain decentralized detection neighborhoods from the center Based on the grayscale range or edge features of the decentralized detection neighborhood, the target pixel is divided into flat regions or edge regions, and a threshold multiplier is determined based on the region division results. and minimum grayscale difference threshold The detection threshold for the edge region is greater than the detection threshold for the flat region. When satisfied When this happens, the target pixel is marked as a bright spot candidate for a bad pixel; When satisfied When the target pixel is marked as a dark spot candidate bad spot.
3. The method for dynamic defect detection and collaborative correction of dual-exposure line laser images according to claim 1, characterized in that, The pixel-by-pixel comparison of the long-exposure candidate bad pixel image and the short-exposure candidate bad pixel image includes: Pixels The marker value in the long exposure candidate bad pixel map is denoted as , to the pixel The marker value in the short-exposure candidate bad pixel map is denoted as and the pixel The flag value in the final bad pixel mask is denoted as ; when and At that time, determine ; when and At that time, determine ; when and At that time, for the pixel Perform long exposure texture complexity verification; when and At that time, for the pixel Perform short-exposure texture complexity verification; in, and A value of 1 indicates a candidate bad pixel, and a value of 0 indicates a non-candidate bad pixel. A value of 1 indicates a bad pixel, and a value of 0 indicates a non-bad pixel.
4. The method for dynamic defect detection and collaborative correction of dual-exposure line laser images according to claim 3, characterized in that, The long-exposure texture complexity verification and the short-exposure texture complexity verification include: when and At that time, pixels are acquired in the long exposure image. The decentralized neighborhood is determined, and the long exposure texture complexity is determined based on the decentralized neighborhood; when the long exposure texture complexity is greater than the long exposure texture complexity threshold, a determination is made. When the long exposure texture complexity is not greater than the long exposure texture complexity threshold, it is determined that... ; when and At that time, pixels are acquired in the short exposure image. The decentralized neighborhood is determined, and the short exposure texture complexity is determined based on the decentralized neighborhood; when the short exposure texture complexity is greater than the short exposure texture complexity threshold, a determination is made. When the short exposure texture complexity is not greater than the short exposure texture complexity threshold, it is determined that... .
5. The method for dynamic defect detection and collaborative correction of dual-exposure line laser images according to claim 4, characterized in that, The long exposure texture complexity and the short exposure texture complexity are determined by the following formula: ; in, Represents the pixels in the exposed image Texture complexity; ,when hour, This represents the complexity of the long-exposure texture. hour, This indicates the complexity of the short-exposure texture; Indicates the pixel representation in the corresponding exposed image. Center and remove the pixel The resulting set of gray values from the centered neighborhood; This represents median operations; The long exposure texture complexity threshold and the short exposure texture complexity threshold are determined based on the exposure parameters of the corresponding exposed image, the image bit depth, the sensor noise characteristics, and the statistical distribution of texture complexity of the calibration image, respectively. The exposure parameters include exposure time and gain.
6. The method for dynamic defect detection and collaborative correction of dual-exposure line laser images according to claim 1, characterized in that, The step of performing bad pixel correction on the long-exposure image and the short-exposure image based on the final bad pixel mask includes: For the pixels marked as bad pixels in the final bad pixel mask, a correction neighborhood is obtained at the corresponding pixel position in the long exposure image and the short exposure image, and valid pixels marked as non-bad pixels in the final bad pixel mask are selected from the correction neighborhood. The median gray value of each effective pixel in the long exposure image and the short exposure image is used to replace the original gray value of the corresponding pixel position. For pixels marked as non-bad pixels in the final bad pixel mask, the original grayscale values of the corresponding pixel positions in the long exposure image and the short exposure image remain unchanged; When the number of effective pixels in the correction neighborhood is insufficient, the correction neighborhood is expanded, and the median gray value of the effective pixels is re-determined based on the expanded correction neighborhood.
7. The method for dynamic defect detection and collaborative correction of dual-exposure line laser images according to claim 1, characterized in that, The high dynamic range fusion of the long exposure corrected image and the short exposure corrected image includes: Based on the exposure time, gain, black level, or image response curve, the long exposure corrected image and the short exposure corrected image are normalized to a comparable brightness range to obtain the long exposure normalized image and the short exposure normalized image. Based on the saturation level of each pixel, dark area noise, and exposure reliability, the fusion weights corresponding to the long exposure normalized image and the short exposure normalized image are determined. Pixels are determined using the following formula. Corresponding blended grayscale values: ; in, Represents pixels The corresponding fused grayscale value; Indicates the pixels in the long exposure normalized image grayscale value; Indicates the pixels in the short-exposure normalized image grayscale value; Represents pixels The corresponding long exposure fusion weights; Represents pixels The corresponding short exposure fusion weight; This indicates a positive number used to prevent the denominator from being zero.
8. A dual-exposure line laser image dynamic defect detection and collaborative correction system, characterized in that, include: The exposure image acquisition module is used to acquire long-exposure images and short-exposure images that are collected within the same detection period and satisfy the pixel-level correspondence. The candidate bad pixel generation module is used to perform bad pixel detection on the long exposure image and the short exposure image respectively, and obtain the long exposure candidate bad pixel image and the short exposure candidate bad pixel image; The joint review and judgment module is used to compare the long exposure candidate bad pixel image and the short exposure candidate bad pixel image pixel by pixel. When the same pixel is marked in the two candidate bad pixel images, the bad pixel judgment result is determined according to the corresponding mark. When the labels are inconsistent, the defective pixel judgment result is determined based on the decentered neighborhood texture complexity of the pixel in the exposed image corresponding to the candidate defective pixel, and the final defective pixel mask is generated. The dual-image collaborative correction module is used to perform bad pixel correction on the long exposure image and the short exposure image respectively based on the final bad pixel mask, to obtain a long exposure corrected image and a short exposure corrected image; The dynamic range fusion module is used to perform high dynamic range fusion on the long exposure corrected image and the short exposure corrected image to obtain a fused image.
9. An electronic device, characterized in that, The device includes a processor and a memory; the memory stores a program, which is loaded and executed by the processor to implement a method for dynamic defect detection and collaborative correction of dual-exposure line laser images as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a program that, when executed by a processor, is used to implement a method for dynamic defect detection and collaborative correction of dual-exposure line laser images as described in any one of claims 1 to 7.