LED chip appearance defect detection method based on image processing

By generating an interference risk spectrum through multi-angle and multi-wavelength scanning, and combining it with phase consistency index and dynamic illumination parameter adjustment, the problem of false detection and missed detection of interference fringes in the detection of LED chip appearance defects is solved, and high-precision defect identification and suppression are achieved.

CN121190430APending Publication Date: 2025-12-23XIANGNENG HUALEI OPTOELECTRONICS
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511345239.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

In the detection of surface defects in LED chips, existing technologies often produce interference fringes when the wavelength and incident angle of the light source are similar to the microstructure on the chip surface. This makes it difficult to distinguish between real defects and interference fringes, resulting in false detections and missed detections.

Method used

By acquiring the dominant frequency vector and directional distribution information of the microstructure on the chip surface through multi-angle and multi-wavelength scanning, an interference risk spectrum is generated. The interference fringe components are separated using the phase consistency index. Combined with dynamic adjustment of illumination parameters and image processing, interference fringes are suppressed and defects are enhanced.

Benefits of technology

It significantly improves the accuracy and stability of LED chip appearance defect detection, reduces the missed detection rate and false detection rate, and ensures the reliability and consistency of factory quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121190430A_ABST
    Figure CN121190430A_ABST
Patent Text Reader

Abstract

The invention discloses an LED chip appearance defect detection method based on image processing, and relates to the technical field of image processing, and the method comprises the following steps: S1, carrying out the multi-angle and multi-wavelength scanning of a defect-free reference LED chip under a stable exposure condition, extracting the dominant frequency vector and direction distribution information of the surface microstructure of the LED chip, and carrying out the detection of the appearance defect of the LED chip; an interference risk map is generated based on the dominant frequency vector and the direction distribution information. According to the method, dynamic adjustable optical imaging parameters and image processing results are deeply coupled, a closed-loop detection mechanism for adaptively inhibiting interference fringes is constructed, and accurate defect and interference distinguishing is realized through an interference risk map, a phase consistency index, discrimination subspace backstepping and optical adjustment, frequency domain notch and spatial domain detail recovery, so that the detection accuracy is improved. And in combination with confidence feedback and encryption sampling, the missing detection and false detection rate is remarkably reduced, and the detection stability and reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to an LED chip appearance defect detection method based on image processing. BACKGROUND

[0002] The LED chip appearance defect detection based on image processing refers to obtaining the appearance image of the chip surface through a high-resolution imaging device during the production or packaging process of the LED chip, analyzing and extracting features of the image by using computer vision and image processing algorithms, and automatically identifying and determining whether there are cracks, scratches, notches, pollution, bubbles, foreign matter adhesion, uneven color or size abnormalities and other defects on the chip surface. This method usually includes image acquisition, preprocessing (such as denoising, enhancement, background separation), defect feature extraction and classification determination, etc. It can realize fast, stable and batch detection without contacting the chip, has the advantages of high detection accuracy, high efficiency and good consistency compared with manual visual inspection, and is suitable for quality control and factory inspection links of LED chips.

[0003] The prior art has the following disadvantages: In the prior art, the LED chip appearance defect detection usually relies on the combination of fixed light source illumination and image processing algorithms, and the micro defects such as cracks and scratches are identified by extracting the frequency domain features of the surface structure. However, during the detection process, when the illumination wavelength and incident angle of the detection light source are close to the spatial period of the chip surface microstructure (such as electrode grid lines, lattice texture, microlens array, etc.), fine interference fringes (Moire pattern) are easily generated. Such interference fringes will form periodic texture features similar to the real defects in terms of spatial frequency, direction distribution and local contrast in the collected image, making it difficult for the frequency domain analysis algorithm based on the prior art to effectively distinguish between the two. On the one hand, the interference fringes may be misidentified as real defects by the algorithm, causing a large number of qualified chips to be incorrectly judged as defective products; on the other hand, the real micro-cracks or scratches may be misjudged as normal structures due to the overlapping of their frequency domain features with the interference fringes, resulting in missed detection. This situation not only directly interferes with the factory quality judgment standard, but also causes defective products to flow into the subsequent packaging or application links, leading to batch quality accidents.

[0004] The above information disclosed in the background section is only used to enhance the understanding of the background of the present disclosure, and therefore it can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0005] The purpose of the present application is to provide an LED chip appearance defect detection method based on image processing to solve the problems in the background.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for detecting appearance defects in LED chips based on image processing, comprising the following steps: S1, Under stable exposure conditions, perform multi-angle and multi-wavelength scanning on a defect-free reference LED chip to extract the main frequency vector and directional distribution information of the microstructure on the LED chip surface, and generate an interference risk map based on the main frequency vector and directional distribution information; S2, generate weak amplitude structured light based on the main frequency vector information in the interferometric risk spectrum, obtain the phase consistency index through multi-step phase shifting acquisition, and separate the interference fringe components related to optical superposition based on the phase consistency index; S3, based on the joint features of phase consistency index and gradient vector field, constructs a subspace for the discrimination of defects and interference, trains a direction-selective filtering kernel, reduces the response to fringe in the direction parallel to the microstructure, and enhances the response to the crack fracture point. S4. Based on the characteristic output of the discriminant subspace, the dominant frequency vector and direction parameters of the interference fringes are inversely calculated. The polarization angle, incident angle and narrowband wavelength of the illumination are dynamically adjusted according to the dominant frequency vector and direction parameters so that the interference fringe energy enters the controllable suppression frequency band. S5, under dynamically adjusted illumination conditions, narrowband notch processing targeting the main frequency vector of interference fringes is implemented in the frequency domain, and anisotropic diffusion method is used in the spatial domain to restore the weakened detail texture during the suppression process, so as to complete texture correction before defect segmentation. S6 sends the defect determination confidence result obtained after texture correction back to the illumination control and imaging acquisition parameter setting module, triggering encrypted sampling for high-risk directions to form a dynamic closed-loop detection process that continuously suppresses interference fringes and simultaneously enhances the defect detection response.

[0007] Preferably, step S1 includes: Under stable exposure conditions, a defect-free reference LED chip is fixed on a vacuum adsorption stage with a flatness of no more than two micrometers. The ambient temperature, humidity and ambient light intensity are controlled. Through the combination of a global shutter industrial camera, a telecentric lens and a multi-wavelength narrowband light source, along with dark field and flat field correction and spatial calibration, the exposure time, analog gain, light source current, polarization angle positioning, spatial conversion coefficient and reference average gray level are output. While keeping the exposure time, analog gain, light source current and polarization angle positioning constant, perform multi-angle and multi-wavelength joint acquisition to obtain bright field images and micro-tilt reference images under different combinations of azimuth angle, elevation angle, wavelength and polarization angle, and verify that the gray value range is qualified. In the region of interest, the bright field image is transformed in the frequency domain to remove the DC component and low-frequency background. The dominant frequency vector and direction angle are calculated, and the direction distribution histogram under each condition is obtained by combining the spatial conversion coefficient. Using azimuth, elevation, and wavelength as three-dimensional coordinate axes, an interferometric risk map is constructed based on the weighted result of the difference between the dominant frequency vector and the nominal period, and the angle between the azimuth and the nominal direction. High-risk units are classified and marked, and their dominant frequency vector, azimuth, and corresponding condition combinations are recorded. A high-risk index table is output for subsequent steps.

[0008] Preferably, step S2 includes: Based on the dominant frequency vector and orientation angle of the high-risk unit in the interference risk spectrum, the actual period and orientation of the sample plane are converted into the actual period and orientation of the sample plane. Then, a weak amplitude structured light stripe consistent with the dominant frequency vector is generated in the illumination channel by a digital micromirror device or a liquid crystal spatial light modulator, and the period verification and uniformity detection are completed on the sample plane. While keeping the spatial parameters of the weak-amplitude structured light constant, a piezoelectric displacement mirror or a liquid crystal phase modulator is used to perform four-step equal-amplitude phase-shifting acquisition along the stripe direction, with step angles of 0 degrees, 90 degrees, 180 degrees and 270 degrees respectively, and the optimal focal plane is locked before each acquisition step. The phase consistency index is calculated based on the periodic gray-level changes and phase stability of the multi-step phase-shifted image within the frequency band corresponding to the main frequency vector. A phase consistency index distribution map corresponding to the main frequency vector is generated, and interference from specular highlight areas is eliminated. A weighted map is constructed based on the phase consistency index. In the frequency domain, the dominant frequency component of the high-weight region is subjected to amplitude suppression, and in the spatial domain, details are restored by anisotropic diffusion. The resulting image with stripe suppression and the phase consistency index distribution map are output.

[0009] Preferably, based on the dominant frequency vector and orientation angle of the high-risk unit in the interference risk spectrum, the dominant frequency vector is converted into the actual period of the sample plane using the pixel-to-spatial scale conversion coefficient, with the period error controlled within 1%. The orientation angle is used as the fringe direction, and sinusoidal weak amplitude structured light fringes are generated in the illumination channel using a digital micromirror device or a liquid crystal spatial light modulator. The fringe contrast is set to 5% to 10%, and the images are accurately projected onto the sample plane through a telecentric projection objective. The phase change is checked by moving one micrometer along the fringe normal direction on the sample plane, and the phase change is checked to be between 20 and 40 degrees. At the same time, the spatial fluctuation of the gray level difference between the fringe peaks and valleys is detected by using a reflectivity standard plate, and it does not exceed 5%.

[0010] Preferably, step S3 includes: Using the bright-field image separated by stripes and the phase consistency index distribution map consistent with the main frequency vector as input, the gradient magnitude, gradient direction difference, direction abrupt change rate and local termination index are calculated, and combined with the phase consistency index to form a five-channel joint feature; Based on the joint features, interference fringe samples and crack endpoint samples are collected under different acquisition conditions. The mean vector and covariance matrix are calculated and linear orthogonal transformation is performed to construct a three-dimensional discrimination subspace, thereby achieving the separation of interference and defects. Guided by the discriminant subspace, anisotropic weight templates are trained for different directions and sizes. The weight ratio is adjusted to reduce the response of interference samples to less than 30% of the initial value, while increasing the response of crack endpoint samples to more than 1.5 times the initial value. The discriminant subspace and direction-selective filtering kernel are combined and applied to the full-frame image. In the interference-prone region, fringes are suppressed according to the tendency value, and in the defect-prone region, crack endpoints are enhanced according to the local termination index. The suppression map and enhancement map are output for subsequent use.

[0011] Preferably, step S4 includes: Within a unified directional coordinate system, connected regions higher than the global median plus one standard deviation are selected from the interferometric trend map. Spatial dominant frequency and directional angle are calculated, and weighted synthesis of full-amplitude dominant frequency vector and directional parameters is performed. The main frequency vector and direction parameters are mapped to the center and direction of the controllable suppression frequency band. The polarization angle is selected in combination with the microstructure reflection law. The incident azimuth and elevation angles are set according to the direction parameters. A narrow band wavelength is selected that makes the difference between the nominal frequency and the center frequency greater than 15%. While keeping the exposure and spatial calibration unchanged, load each candidate illumination combination, acquire images and calculate the energy ratio of interference fringes and the line-to-point ratio. Select the combination that satisfies the requirement of having an energy ratio of less than 0.2 and a line-to-point ratio of less than 0.3 as the optimal combination. Stability was verified by repeatedly sampling three times under the optimal combination, and the updated main frequency vector, direction parameters and suppression results were output for subsequent frequency domain notch filtering and spatial detail recovery.

[0012] Preferably, the narrowband wavelength is selected based on the difference between the projection frequency of the nominal period of the chip surface microstructure on the image plane and the main frequency vector. When the difference is greater than 15%, a wavelength with a full width at half maximum (FWHM) of no more than 10 nanometers is selected. When the difference is less than or equal to 15%, a wavelength with a smaller coherence length is selected to reduce the contrast of the interference fringes. Under the premise of meeting the directional tolerance and bandwidth requirements, the spatial discontinuity of the crack endpoint features remains unchanged.

[0013] Preferably, step S5 includes: Two-dimensional discrete Fourier transform is performed on the image acquired under dynamic lighting conditions. An elliptical narrowband notch mask is constructed based on the main frequency vector output from the previous step. A symmetrical notch region is established at the conjugate symmetrical position of the spectrum. The notch depth is set according to the fringe energy ratio and an inverse transform is performed to obtain a first-corrected image. Calculate the gradient magnitude and gradient direction of the first-corrected image, and generate anisotropic diffusion guide maps of the stripe residual area, defect sensitive area and neutral area by combining the phase consistency index; Anisotropic diffusion is performed according to the guide diagram, spreading along the main frequency vector direction in the stripe residual region, spreading along the vertical direction in the defect sensitive region, and multi-directional balanced diffusion in the neutral region, and monitoring local contrast changes after each iteration to prevent over-smoothing. The controllable suppression band energy, number of endpoints, directional dispersion and line-to-point ratio of the verification processing results are checked. If the requirements are not met, local additional notch filtering or anti-diffusion correction is performed, and an image that meets the defect segmentation requirements is output.

[0014] Preferably, when constructing an elliptical narrow-band notch mask, the radial bandwidth is set to 15% of the main frequency vector frequency value, the angular width is set to 5°, the mask edge is smoothed by cosine weighting, and notch regions are synchronously established at the conjugate symmetric position of the spectrum to ensure the consistency of frequency domain suppression of the real image, and the notch depth is set to 90%, 70% or 50% according to the energy ratio of the interference fringes.

[0015] Preferably, step S6 includes: The texture-corrected image is divided into a 1-millimeter square grid. The endpoint density, boundary sharpness, directional dispersion, and residual interference energy ratio are calculated respectively. The defect judgment confidence is obtained by weighted normalization and divided into high, medium, and low confidence regions according to the threshold. Align the regional list with the interference risk map, and formulate a dense sampling plan for high-confidence regions based on the residual interference energy ratio, including fine-stepping of the incident azimuth angle, adjustment of the polarization angle, switching of the incident elevation angle, and selection of narrowband wavelengths. Phase shift images and bright field images were acquired according to the sampling plan. Frequency domain narrowband notch and spatial domain anisotropic diffusion were repeated. The defect judgment confidence and residual interference energy ratio were updated, and the optimal parameter combination was selected using dual indicators. The optimal parameters are written back to the interference risk map and the risk level is adjusted. The closed-loop termination condition is set, and the final texture-corrected image, defect judgment confidence distribution, and updated interference risk map are output.

[0016] The technical effects and advantages provided by the present invention in the above technical solution are as follows: This invention constructs a closed-loop detection mechanism that adaptively identifies and suppresses interference fringes by deeply coupling dynamically adjustable optical imaging parameters with image processing results, thereby significantly improving the accuracy and stability of LED chip appearance defect detection. Specifically, this scheme utilizes an interference risk map established by a defect-free reference chip and a phase consistency index extracted through multi-step phase shifting to accurately distinguish between real defects and optical interference textures before defect segmentation, avoiding misjudgments and missed detections caused by overlapping frequency domain features. By inferring the dominant frequency vector and direction parameters from the discriminant subspace and combining real-time adjustments to the polarization angle, incident angle, and narrowband wavelength, the interference fringe energy is concentrated into a controllable suppression frequency band, ensuring the targeted and effective interference suppression. Furthermore, the combined processing of frequency domain narrowband notch filtering and spatial anisotropic diffusion not only effectively suppresses interference textures but also restores detailed textures while preserving defect boundary and endpoint features. Finally, through the feedback of defect judgment confidence and the encrypted sampling of high-risk directions, the detection process achieves self-optimization and continuous enhancement. Compared with existing fixed lighting and unidirectional processing detection methods, this solution can maintain high detection accuracy under different batches, different equipment conditions and different chip surface structures, significantly reducing the missed detection rate and false detection rate of LED chip appearance defects, and improving the reliability and consistency of factory quality control. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0018] Figure 1 This is a flowchart of the LED chip appearance defect detection method based on image processing according to the present invention. Detailed Implementation

[0019] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the description of this disclosure will be more complete and fully convey the concept of the exemplary embodiments to those skilled in the art.

[0020] This invention provides, for example Figure 1 The image processing-based LED chip appearance defect detection method shown includes the following steps: S1, Under stable exposure conditions, perform multi-angle and multi-wavelength scanning on a defect-free reference LED chip to extract the main frequency vector and directional distribution information of the microstructure on the LED chip surface, and generate an interference risk map based on the main frequency vector and directional distribution information; To achieve "multi-angle and multi-wavelength scanning of a defect-free reference LED chip under stable exposure conditions, extracting the dominant frequency vector and directional distribution information of the microstructure on the LED chip surface, and generating an interference risk map based on the dominant frequency vector and directional distribution information," this step revolves around stable exposure, joint acquisition of angle and wavelength, measurement of dominant frequency vector and directional distribution, and construction of the interference risk map. The results of the previous step are directly used as the input of the next step, establishing a complete spectral and spatial joint baseline, which is different from the existing practice of performing frequency domain analysis only at a single angle and fixed wavelength.

[0021] Establish stable exposure and integrated geometric-radiometric calibration. A defect-free reference LED chip is fixed on a vacuum adsorption stage with a flatness of no more than two micrometers. The stage is placed on an optical platform with vibration isolation capabilities. The ambient temperature is controlled at 23 degrees Celsius ± 1 degree Celsius, the relative humidity is controlled between 40% and 60%, and the ambient illuminance is less than ten lux. A global shutter industrial camera with a pixel size of 3.45 micrometers and a quantization bit depth of 12 bits is selected, matched with a 0.5x telecentric lens, a working distance of 110 mm, and a modulation transfer function of the lens at the target spatial frequency of no less than 0.3. The illumination adopts a combination structure of coaxial optical path and low-angle ring optical path, configured with five narrowband light sources with center wavelengths of 405 nm, 450 nm, 520 nm, 630 nm, and 850 nm, and a full width at half maximum (FWHM) of no more than 10 nm. A linear polarizer is placed in front of each light source, and three mechanical positioning scales of 0 degrees, 45 degrees, and 90 degrees are provided. Dark-field and flat-field corrections were performed using a reflectivity standard plate to achieve image uniformity better than 1%. Spatial calibration was completed using a one-dimensional grid calibration plate with a 10-micron period, establishing a conversion factor from pixel coordinates to the number of periods per millimeter. Exposure time and analog gain were adjusted at a wavelength of 450 nm until the average grayscale of the chip's emitting region equaled 60% of the dynamic range. For the remaining wavelengths, only the light source drive current was adjusted to ensure the average grayscale deviation did not exceed 1%. This step outputs the calibrated exposure time, analog gain, light source current, polarization angle positioning, spatial conversion factor, and reference average grayscale for subsequent multi-angle and multi-wavelength joint acquisition, ensuring that all subsequent acquisitions are performed under consistent radiation and geometric conditions.

[0022] While maintaining constant exposure time, analog gain, light source current, and polarization angle positioning, multi-angle and multi-wavelength joint acquisition was performed. Using the extension direction of the chip electrode gate lines as the zero-degree reference direction, azimuth scanning was performed around the chip normal, with an azimuth range of 0 to 180 degrees, in 5-degree increments. The incident elevation angle was set to four levels: 5, 15, 30, and 45 degrees. The elevation angle was achieved through mechanical calibration using a low-angle ring optical path, with fine-tuning of the focus after each switch to achieve peak contrast. Under each combination of azimuth and elevation angles, narrowband light sources of 405 nm, 450 nm, 520 nm, 630 nm, and 850 nm were sequentially activated, with polarization angles of 0, 45, and 90 degrees, respectively. To suppress local saturation caused by specular reflection, two images were acquired under each condition: the brightfield image used the exposure time determined in the first step; the reference image was formed by a slight offset of 150 microradians in the focal plane direction to create a micro-tilt reference. Both images are saved in a lossless format, and the azimuth, elevation, wavelength, and polarization angle are recorded. The maximum grayscale value is verified to be no more than 95% of the 12-bit dynamic range, and the minimum grayscale value is ensured to be no less than 2%. If the range is exceeded, a minor correction using the light source current is applied to bring it within the acceptable range. This step outputs a set of imaging data under three-dimensional conditions (angle, wavelength, polarization) and a corresponding reference image, providing complete input for the subsequent measurement of the dominant frequency vector and direction distribution.

[0023] The dominant frequency vector and orientation distribution are extracted from defect-free reference images under multi-angle and multi-wavelength conditions, and the extraction results are correlated with the spatial conversion coefficients obtained in the first step. The chip's light-emitting area and electrode gate area are selected as regions of interest (ROIs). The region boundaries are determined jointly by a grayscale threshold and morphological size constraints. The threshold is the valley between the two peaks of the image histogram, and the size constraint is that the area of ​​the minimum connected region is not less than 500 square micrometers. A cosine window is applied to each bright-field image within the ROI to reduce edge effects, and the image is then converted to the frequency domain to obtain the frequency amplitude distribution. The DC component is removed from the frequency amplitude distribution, and low-frequency backgrounds below 20 cycles per millimeter are masked, retaining frequency components with significant energy peaks. The distance from the peak to the origin of the spectrum is converted to the spatial dominant frequency using the spatial conversion coefficients from the first step. The angle between the peak and the zero-degree reference direction of the electrode gate is defined as the orientation angle. To eliminate spurious peaks caused by specular reflection, a difference mask between the bright-field image and the micro-tilt reference image is used to remove regions with strong high-brightness spots, and then the peak position is calculated within the remaining regions. The above process is repeated for each combination of azimuth, elevation, wavelength, and polarization angle to obtain the dominant frequency vector set and the azimuth angle set. The energy percentage of the azimuth angles is then statistically analyzed in five-degree increments to form a directional distribution histogram. To ensure repeatability, the acquisition under the same conditions is repeated three times. The median and percentile methods are used to give the representative value and confidence interval of the dominant frequency vector. A stable dominant frequency is defined as one whose coefficient of variation is no greater than 5% and whose peak energy percentage is no less than 30% of the total energy. This step outputs the dominant frequency vector, azimuth angle, and directional distribution histogram under each angle and wavelength condition, corresponding one-to-one with the specific acquisition conditions, providing quantitative input for the next step of constructing the interferometric risk map.

[0024] An interferometric risk map is constructed based on the dominant frequency vector and directional distribution information, and a clear quantitative classification is given. Using azimuth, elevation, and wavelength as three-dimensional coordinate axes, a risk unit is established at each coordinate point. The intensity of the risk unit is obtained by weighting two parts: the first part is the proximity between the dominant frequency vector and the nominal period of the chip's existing microstructure. The nominal period is determined jointly by mask layout data and microscopic measurement results, and expressed as periods per millimeter. The absolute value of the difference between the dominant frequency vector and the nominal frequency is taken and normalized. The second part is the consistency between the directional angle and the nominal structural direction. The nominal direction is set to zero degrees with the electrode grid line direction and corrected according to the microlens array arrangement direction. The two parts are added with equal weights to obtain the risk intensity value, and classified accordingly: when the difference between the dominant frequency vector and the nominal frequency does not exceed 5% and the angle between the directional angle and the nominal direction does not exceed five degrees, it is marked as high risk; when the difference is greater than 5% but not more than 15% and the angle is greater than five degrees but not more than fifteen degrees, it is marked as medium risk; all other conditions are marked as low risk. For high-risk elements, the values ​​of the dominant frequency vector, the direction angle, and the corresponding combinations of azimuth, elevation, wavelength, and polarization angle are recorded in the spectrum. This is visualized on a 3D coordinate system using color depth and contour lines, and an index table of high-risk elements is output. This spectrum directly serves subsequent weak-amplitude structured light phase-shifting acquisition and illumination parameter adjustment. The dominant frequency vector and direction angle provided by high-risk elements will be prioritized for suppression, thus achieving higher fringe suppression efficiency with fewer trials in subsequent processes. Through this step, a closed-loop connection is completed from stable exposure and calibration, joint acquisition, frequency-direction measurement to the risk spectrum, enabling any implementer with the above equipment and parameter conditions to reconstruct the dominant frequency vector and direction distribution in a repeatable environment and obtain consistent interference risk assessment results.

[0025] The purpose of this step is to establish a stable, quantifiable, and repeatable interference risk baseline for LED chip appearance defect detection, fundamentally improving the accuracy and robustness of subsequent defect identification. By performing multi-angle, multi-wavelength imaging scans on a defect-free reference LED chip under stable exposure conditions, the spatial dominant frequency and directional distribution information of the chip surface microstructure under different optical incident conditions can be comprehensively acquired. This process not only ensures the consistency of the acquired images in terms of brightness, contrast, and geometric scale, but also reveals the periodic characteristics and directional patterns of the chip microstructure in optical response by systematically changing the incident angle and wavelength. Subsequently, by matching and statistically analyzing these dominant frequency vectors and directional distributions, the proximity relationship between the chip surface structure period and the light source illumination conditions under specific angle and wavelength combinations can be identified, thereby predicting and quantifying which conditions are most likely to produce interference fringes similar to real defects. This data-driven risk map can not only accurately locate high-risk illumination parameter combinations, but also provide customized inputs for subsequent fringe suppression and defect enhancement algorithms, avoiding reliance on empirical manual avoidance strategies. Meanwhile, the establishment of this baseline is repeatable, allowing experimental conditions to be reproduced and consistent frequency and direction information to be obtained in different batches of inspections. This enables the defect detection system to maintain high consistency and accuracy even when faced with differences in production batches and equipment fluctuations. This function is fundamental to solving the problem of false detection and missed detection caused by moiré fringes in existing technologies, and is a prerequisite and decision-making basis for subsequent dynamic illumination adjustment, interference fringe suppression, and defect feature enhancement.

[0026] S2, generate weak amplitude structured light based on the main frequency vector information in the interferometric risk spectrum, obtain the phase consistency index through multi-step phase shifting acquisition, and separate the interference fringe components related to optical superposition based on the phase consistency index; This step is based on the previously obtained interferometric risk map, which, under stable exposure, spatial calibration, and radiometric calibration conditions, provides quantitative results for the dominant frequency vector and direction angle for each set of azimuth, incident angle, wavelength, and polarization angle, and clearly defines the classification boundaries of high-risk, medium-risk, and low-risk. This step no longer uses fixed uniform illumination or empirically avoided angles. Instead, it uses the dominant frequency vector in the interferometric risk map as the design basis to generate weak-amplitude structured light fringes on the sample plane that are perfectly aligned with high-risk units. Through physical phase shifting, a metric with spatial phase stability is obtained. Phase consistency refers to whether the optical superposition component is in phase with the fringes, thus distinguishing the interference fringes generated by optical superposition from cracks, notches, and scratches caused by material damage in the phase dimension. This process outputs an image after fringe separation and a suppression weight map that varies with acquisition conditions, for subsequent use in direction-selective filtering and dynamic illumination adjustment.

[0027] Based on the interferometric risk spectrum, the spatial parameters of the weak-amplitude structured light are determined, and fringes consistent with the dominant frequency vector are generated on the sample plane. Cells with high risk levels are selected, and the corresponding dominant frequency vector value and direction angle are read. The dominant frequency vector is converted into the actual period of the sample plane using the pixel-to-spatial scale conversion coefficient established in the first stage, with the period error limited to within 1%. A sinusoidal fringe illumination is formed in the illumination channel using a digital micromirror device or a liquid crystal spatial light modulator. The fringe direction is consistent with the direction angle in the risk spectrum, and the fringe contrast is set to 5% to 10% to ensure weak-amplitude structured light and reduce disturbance to the background reflection. The fringes are accurately imaged onto the sample plane using a telecentric projection objective, and a one-time period check is performed using a standard scribed target: moving one micrometer along the fringe normal direction on the sample plane, the fringe phase should change by no less than 20 degrees and no more than 40 degrees; if this is not met, the projection magnification is fine-tuned until it meets this range. Illumination uniformity is checked using a reflectivity standard plate, and the spatial fluctuation of the fringe peak-to-valley grayscale difference does not exceed 5%. After completing the above steps, weak amplitude structured light fringes that are strictly consistent with the main frequency vector on the sample plane are obtained, providing a stable spatial reference for subsequent phase-shifting acquisition.

[0028] Multi-step phase-shifting acquisition is performed while maintaining the spatial frequency and direction of the weak-amplitude structured light to establish a comparable phase sequence. A piezoelectric displacement mirror or liquid crystal phase modulator is used to introduce equal-amplitude phase steps along the fringe direction. In this embodiment, four phase shifts are selected, with step angles of 0 degrees, 90 degrees, 180 degrees, and 270 degrees respectively. The step error is calibrated using an interferometer and controlled to not exceed two degrees. Exposure time, analog gain, light source drive current, incident angle, and polarization angle all follow the corresponding conditions of the interferometric risk spectrum to ensure consistency with the previous baseline. Before each phase shift, the focal plane is locked at the position of maximum fringe contrast using autofocus. A full-resolution image is acquired immediately after each phase shift, in lossless 16-bit grayscale format. To suppress thermal drift and power fluctuations, the light source output current is monitored during acquisition and the fluctuation is maintained within 1% in a closed loop. Simultaneously, the incident illuminance is monitored through a photodiode in the reference optical path. If the illuminance deviation exceeds 1%, the acquisition step is repeated. The four images were saved in chronological order, and the fringe phase step angle and ambient temperature were recorded to ensure complete traceability for subsequent calculations. Ultimately, a set of fringe illumination response images differing only in phase under the same spatial period and orientation was obtained, providing a reliable sample for calculating the phase consistency index.

[0029] Phase consistency index is obtained from multi-step phase-shifting images, and a one-to-one correspondence is established between it and the dominant frequency vector. Taking each pixel position on the sample plane as the object, the grayscale value of that position is read in four different phase images, and the periodic change of grayscale with phase step is observed. If the position contains interference fringes formed by optical superposition, the grayscale will exhibit obvious periodic fluctuations with phase, with a large fluctuation amplitude and spatial continuity with the fringe direction. If the position mainly exhibits reflection anomalies caused by structural damage such as cracks or scratches, it is not sensitive to phase changes, the grayscale fluctuation amplitude is small, and it is spatially discontinuous. Based on the above physical phenomena, the difference between the maximum and minimum grayscale values ​​in the four steps is taken as the phase response amplitude, and the phase change difference between adjacent pixels in the four steps is taken as the phase stability measure. The two are multiplied and normalized to obtain the phase consistency index, with a numerical range limited to between zero and one. To avoid mistaking edge shadows or isolated noise for interference fringes, the observation band is first limited using the dominant frequency vector provided by the risk map, and the phase consistency index is evaluated only within the band consistent with the dominant frequency. Simultaneously, a second-stage micro-tilt reference image is used to exclude specular highlight regions. Finally, a phase consistency index distribution map corresponding to the dominant frequency vector is formed on the sample plane. High-value regions indicate the presence of optical superposition components that are co-frequency, co-directional, and phase-stable with the weak-amplitude structured light.

[0030] Interference fringe components are separated based on the phase consistency index, and the image after fringe suppression is output. First, a narrow frequency band is selected in the frequency domain centered on the dominant frequency vector of the original brightfield image, with a bandwidth set to 15% of the dominant frequency to ensure coverage of small frequency shifts caused by minor process variations. Then, this frequency band component is mapped back to the spatial domain, where a weight map is constructed based on the phase consistency index: pixels with an index higher than the global median plus one standard deviation are assigned high weight and identified as interference fringe components; pixels with an index lower than this threshold are assigned low weight and retained as defect-related components. Amplitude suppression is applied to high-weight pixels in the frequency domain, with the suppression depth set to 70% to 90% of the original amplitude, the specific value increasing linearly according to the pixel's phase consistency index; the original amplitude of low-weight pixels remains unchanged. After suppression, an inverse transform is performed to obtain the fringe-separated image, and in the spatial domain, anisotropic diffusion is used to perform slight detail restoration only on the suppressed region. The diffusion coefficient is updated only when the gradient in the direction perpendicular to the dominant frequency vector is less than the gradient in the parallel direction to avoid reintroducing the fringe orientation. The output includes the image after stripe suppression and the phase consistency index distribution map, and records the corresponding azimuth angle, incident angle, wavelength and polarization angle, providing reproducible input for subsequent training of the direction-selective filter kernel and optimization of dynamic illumination parameters.

[0031] The purpose of this step is to transform the dominant frequency vector and orientation angle given in the interference risk map into controllable illumination and phase measurement, so that moiré fringes can be targeted for excitation and identification during the imaging acquisition stage, and differentiated from real defects in a quantifiable way. Specifically, based on the dominant frequency vector and orientation angle of high-risk units, weak amplitude structured light of the same frequency and direction is generated on the sample plane, causing potential interference fringes to produce a response with limited amplitude but stable phase trajectory. Subsequently, at least four phase shift maps are obtained using a constant-step phase shift method to construct a measure of the phase stability of the target dominant frequency component. Pixel regions with high phase consistency index correspond to fringes formed by optical superposition, while pixel regions with low phase consistency index are closer to incoherent reflection changes caused by cracks, notches, and scratches. Based on this index, directional suppression is implemented in the frequency domain, which can quantitatively reduce the energy of fringes consistent with the dominant frequency vector while maintaining the continuity of details such as crack endpoints and step edges, thereby reducing the risk of false detection and false negative detection caused by interference from the source. This process enables a closed-loop transformation from risk prediction to controlled excitation and from phase sampling to fringe separation, and outputs a weight map and threshold with physical meaning. This provides a traceable and reproducible basis for subsequent training of directional selective filter kernels and optimization of dynamic illumination parameters, ensuring that the entire detection chain remains stable and consistent under different batches of samples and different equipment conditions.

[0032] S3, based on the joint features of phase consistency index and gradient vector field, constructs a subspace for the discrimination of defects and interference, trains a direction-selective filtering kernel, reduces the response to fringe in the direction parallel to the microstructure, and enhances the response to the crack fracture point. This step builds upon the results of the previous step, which output a bright-field image separated by fringe, a phase consistency index distribution map consistent with the dominant frequency vector, and a zero-degree reference for the electrode grid line direction. The phase consistency index spatially marks regions that are in the same frequency and direction as the weak-amplitude structured light and have stable phases; these regions are closer to the interference fringes caused by optical superposition. The bright-field image separated by fringe retains irregular structural information such as crack endpoints, scratch inflection points, and particle edges in high-frequency details. Based on these two complementary types of information, this step achieves simultaneous interference fringe suppression and crack endpoint enhancement through joint feature representation and training of the direction-selective filtering kernel, resulting in higher separation and stability for subsequent threshold segmentation and geometric measurement.

[0033] A joint feature of the phase consistency index and gradient vector field is constructed. Using a bright-field image separated by stripes as input, the gradient vector is calculated on two scales, 3x3 and 5x5, using first-order difference in a fixed neighborhood, to obtain the gradient magnitude and direction for each pixel. The gradient direction is aligned with the zero-degree reference of the electrode grid lines, unified to a polar angle expression from 0 to 180 degrees. The phase consistency index is linearly stretched in the direction consistent with the dominant frequency vector, aligning the median to 0.5. After stretching, it forms five channels together with the gradient magnitude, gradient direction difference (the angle between the gradient direction and the microstructure direction), direction abrupt change rate (the average difference in gradient direction between adjacent pixels), and local termination index (the absolute difference in grayscale between three pixels forward and three pixels backward along the gradient direction). Each channel uses a cosine window to limit the processing area within its boundary to prevent edge energy leakage. To ensure consistency across batches, all channels are percentile normalized within the region of interest, mapping the 10th percentile to zero and the 9th and 10th percentiles to one. The resulting joint feature grid, which corresponds one-to-one with each pixel, provides input for the subsequent construction of the discriminative subspace.

[0034] A discriminant subspace for defects and interferences is constructed based on joint features. Following the thresholds given in the previous step, pixels with a phase consistency index higher than the global median plus one standard deviation and a gradient direction difference less than five degrees are collected as interference fringe samples. Pixels with a phase consistency index lower than the global median minus one standard deviation and a local termination index higher than the global median plus one standard deviation are collected as crack endpoint samples. Each class contains at least 50,000 pixels, covering different azimuth angles, incident angles, and wavelength combinations. The mean vector and covariance matrix of both classes are calculated on five channels. A linear orthogonal transformation is used to reduce the inter-channel correlation to below zero, while maintaining the transformation coefficients within three effective numerical precision ranges to ensure consistent transformation across reproducible scenarios. After the transformation, the first principal direction carries the contribution of the phase consistency index, the second principal direction carries the contribution of the gradient direction difference, and the third principal direction carries the contribution of the local termination index. A three-dimensional discriminant subspace is formed by setting isodense boundary curves on the two-dimensional plane (the first and second principal directions) and superimposing a monotonic threshold on the third principal direction. This subspace achieves an interference recognition accuracy of over 95% on training samples and a recall rate of over 90% for crack endpoint recognition. Compared to traditional methods that only use grayscale thresholds or single-band energy, this approach simultaneously introduces three physically interpretable quantities: phase stability, directional consistency, and termination, significantly reducing directional misjudgments.

[0035] The direction-selective filter kernel is trained under the guidance of the discriminant subspace. An angle set is established around the perpendicular direction of zero degree, with an angle step of five degrees, covering 45 to 135 degrees. For each angle, a set of anisotropic weight templates is generated, with template sizes of 7x7, 11x11, and 15x15, the major axis pointing to the target angle and the minor axis perpendicular to it. The center of the template has a positive weight, symmetrical negative weights are set on both sides of the minor axis, and a weak positive weight is set at the far end. The initial ratio of the three is set to 5:3:1, and the total weight is zero to avoid DC bias. Using the two types of samples obtained in the second step as supervision information, the weights are iteratively adjusted at each angle and size, so that the mean response of the interference samples is reduced to below 30% of the initial value, while the mean response of the crack endpoint samples is increased to more than 1.5 times the initial value. When the improvement after three consecutive iterations is less than 2%, the adjustment is stopped and the weights are solidified. To prevent oversuppression of fine patterns, a line-to-point ratio is used as a constraint after each weight update. This ensures that the response of linear structures along the target angle decreases while the response of point-like structures at the endpoints increases. The line-to-point ratio is less than 0.3 on interference samples and greater than 1 on crack endpoint samples. This results in a set of direction-selective filtering kernels that significantly suppress fringes parallel to the microstructure and significantly enhance endpoints that intersect with fringes and exhibit breaks.

[0036] The discriminative subspace and direction-selective filtering kernel are combined to form a stable output. For the full-frame image, the class tendency value of each pixel is first calculated in the discriminative subspace. Pixels with a class tendency value greater than 0.5 are classified as interference-prone, and pixels with a class tendency value less than 0.5 are classified as defect-prone. In the interference-prone region, a filtering kernel parallel to the electrode grid lines is applied, preferably 11x11 in size, with the suppression depth linearly set between 50% and 80% according to the tendency value. In the defect-prone region, a filtering kernel perpendicular to the target crack direction is applied, preferably 7x7 in size, with the enhancement amplitude linearly set between 30% and 60% according to the local termination index. After processing, the slenderness ratio, endpoint density, and directional dispersion of the connected regions are calculated across the entire image. A decrease in the slenderness ratio indicates that the fringes are suppressed, while an increase in endpoint density and directional dispersion indicates that the crack endpoints are highlighted. The resulting enhancement and suppression maps are simultaneously written into the input queue of subsequent processes, and the angle set and size range used in this study are backfilled. At this point, the closed loop of joint feature-discriminative subspace-directional filter kernel-suppression and enhancement is completed. Interference fringes are suppressed in the direction parallel to the microstructure, and crack endpoints are highlighted in the direction perpendicular or oblique to the microstructure. The output has clear physical interpretability and repeatability.

[0037] This step utilizes the complementary information from the phase consistency index distribution map obtained in the previous step and the bright-field image separated by fringe to construct a discriminant subspace capable of simultaneously identifying interference fringes and real defects. Based on this subspace, a direction-selective filter kernel is trained to achieve the dual objectives of interference suppression and defect enhancement. The phase consistency index marks the spatial distribution of fringes caused by optical superposition, while the gradient vector field characterizes the amplitude, direction, and termination features of local structural changes. Combining these two types of features forms a physically interpretable and quantifiable multidimensional feature space, used to distinguish between interference fringes parallel to the microstructure and with stable phase, and defects such as cracks and scratches that are discontinuous in direction and have endpoint features. Within this discriminant subspace, the direction, shape, and weight distribution of the filter kernel can be deduced from the statistical distribution of interference and defect samples. The direction-selective filter kernel obtained through supervised training significantly suppresses linear textures parallel to the microstructure in application, while enhancing structures perpendicular or oblique to them and with breakpoints. This filter design differs from existing technologies that rely on global frequency domain notch filtering or non-directional smoothing. It effectively weakens the continuity and intensity of interference fringes while preserving information about the endpoints of subtle defects, significantly improving the separation between defects and interference. Ultimately, this step not only directly improves the accuracy of subsequent segmentation and measurement but also provides directional weight references for dynamic illumination adjustment and feature extraction, ensuring high stability and consistency throughout the entire detection chain under different batches and process conditions.

[0038] S4. Based on the characteristic output of the discriminant subspace, the dominant frequency vector and direction parameters of the interference fringes are inversely calculated. The polarization angle, incident angle and narrowband wavelength of the illumination are dynamically adjusted according to the dominant frequency vector and direction parameters so that the interference fringe energy enters the controllable suppression frequency band. This step uses the interference trend map as a starting point to deduce the dominant frequency vector and direction parameters of the interference fringes from the spatial period and directional distribution of the image. These vectors and parameters are then transformed into adjustable targets for illumination physical quantities. Through dynamic and coordinated adjustment of polarization angle, incident angle, and narrowband wavelength, the interference fringe energy is brought into a preset controllable suppression frequency band, while maintaining the visibility of crack endpoints and size boundaries without being weakened.

[0039] Within a unified directional coordinate system, the dominant frequency vector and directional parameters of the interference fringes are derived. Connected regions in the interference pattern with values ​​exceeding the global median plus one standard deviation are selected as the sub-regions to be analyzed. Within each sub-region, spatial periodicity statistics are performed on the bright-field image after previous processing: a cosine window is used to limit boundary effects, the frequency amplitude distribution is calculated, and the location of the energy peak is determined. The distance from the peak to the origin of the spectrum is expressed as "per millimeter of periods" and taken as the spatial dominant frequency; the angle between the peak and the zero-degree reference of the electrode grid line is taken as the directional angle, with an angular resolution of not less than one degree. The dominant frequencies and directional angles of all sub-regions are combined using a weighted average to form the full-amplitude dominant frequency vector and full-amplitude directional parameters, with the weights determined by the sub-region area and the interference pattern intensity. To ensure reproducibility, the frequency uncertainty of the dominant frequency vector is limited to no more than 5%, and the directional angle uncertainty is limited to no more than three degrees. When multiple batches of samples are repeatedly measured under the same optical conditions, if the relative deviation of the dominant frequency vector exceeds the above upper limits, the previous steps are returned to check the spatial calibration and polarization angle scale until the stability requirements are met.

[0040] A controllable suppression band is constructed based on the derived dominant frequency vector and directional parameters, and the center and width of the band are mapped to the adjustable illumination level. The center frequency of the controllable suppression band is set to be equal to the frequency value of the dominant frequency vector, and the bandwidth is set to 15% of the center frequency. The directional parameter is defined as the preferred direction of the band, with a directional tolerance of five degrees. The polarization angle is selected according to the reflection law of electromagnetic waves on the surface of anisotropic microstructures: when the directional parameter is parallel to the electrode grid lines, a polarization angle orthogonal to the directional parameter is preferred; when the directional parameter coincides with the principal axis of the microlens array, a polarization angle of 45 degrees to the principal axis is preferred to weaken the specular component and retain the diffuse reflection component. The incident angle consists of the azimuth and elevation angles: the azimuth angle is initially selected from two candidate groups: the directional parameter plus 10 degrees and the directional parameter minus 10 degrees; the elevation angle is initially selected from two ranges: 15 degrees and 30 degrees, to change the coupling between the projection period and the in-plane interference phase. Narrowband wavelengths were selected from 405 nm, 450 nm, 520 nm, 630 nm, and 850 nm to ensure that the projection frequency of the nominal period of the chip surface microstructure onto the image plane is far from the dominant frequency vector. Priority was given to wavelengths where the difference between the nominal frequency and the center frequency exceeded 15%. When all candidate wavelengths fell within 15%, the wavelength with the smaller full width at half maximum (FWHM) was selected to shorten the coherence length and reduce fringe contrast. This resulted in a candidate combination table composed of polarization angle, azimuth angle, elevation angle, and wavelength, with each combination clearly corresponding to the center and direction of the controllable suppression band.

[0041] While maintaining constant exposure time and spatial calibration, dynamic adjustment trial acquisitions were performed, and the optimal illumination combination was selected based on both frequency band energy and geometric separability. Candidate combinations were loaded one by one: each time, the polarization angle was adjusted to the target scale, the incident azimuth and elevation angles were adjusted to the target values, and the narrowband wavelength was switched; a full-resolution image was acquired for each combination. The integral energy within the controllable suppression band of the acquired image was calculated in the frequency domain, and the total high-frequency energy was calculated; the ratio of these two was defined as the interference fringe energy percentage. Simultaneously, the line-to-point ratio (the ratio of the linear connectivity length along the direction parameter to the endpoint density) was calculated in the spatial domain. When the interference fringe energy percentage was below 0.2 and the line-to-point ratio was below 0.3, the combination was considered to meet the suppression target. If multiple combinations met the conditions, the combination with the lowest interference fringe energy percentage was selected as the optimal combination. If no combination met both criteria, the direction tolerance was reduced to three degrees, the azimuth step was reduced to five degrees, and the above process was repeated until the conditions were met. Throughout the process, the exposure time, analog gain, and light source current were kept consistent with the previous baseline to avoid misinterpreting brightness changes as frequency band energy changes. This dynamic filtering establishes a direct mapping from the discriminant subspace output to the physical illumination quantity, enabling controllable suppression based on the target dominant frequency vector.

[0042] The optimal illumination combination is locked, and the updated dominant frequency vector, direction parameters, and suppression results are output to drive subsequent frequency domain notch filtering and spatial detail recovery. The optimal polarization angle, azimuth angle, elevation angle, and narrowband wavelength are used as operating parameters, and the images are repeatedly acquired three times to verify stability. If the coefficient of variation of the energy percentage of the three interference fringes does not exceed 5%, the combination is confirmed to be usable long-term. Based on the new image under the optimal combination, the dominant frequency vector and direction parameters are recalculated to confirm that they have fallen into the edge of the controllable suppression band or that the energy has significantly decreased. This result, along with the interference fringe energy percentage and line-to-point ratio, is used as the output of this step and passed to the next stage of narrowband notch filtering and anisotropic diffusion processing. Unlike existing techniques that use fixed light sources and fixed angles and passively notch filtering based on a single spectral energy, this step first uses the discriminant subspace to provide physically meaningful dominant frequency vectors and direction parameters, and then maps this information back to the physical quantities of polarization angle, incident angle, and narrowband wavelength. This achieves the maximum fringe energy drop with minimal trials, while maintaining the spatial discontinuity and directional dispersion of the crack endpoints as much as possible.

[0043] The purpose of this step is to directly transform the interference fringe features obtained in the discrimination subspace into a dynamic adjustment basis for the illumination physical parameters, thereby achieving closed-loop control from "interference detection" to "active interference suppression". By analyzing the feature distribution output of the discrimination subspace, the dominant frequency vector and direction parameters of the current interference fringes can be accurately deduced. These two quantities characterize the spatial period and orientation of the interference fringes, respectively, and are unique descriptions of the fringes in the frequency and spatial domains. Using these physical quantities, the polarization angle, incident angle, and narrowband wavelength of the light source can be specifically set, allowing the optical imaging conditions to enter a controllable suppression frequency band specifically designed to reduce fringe energy. In this process, adjusting the polarization angle changes the proportion of the reflected components of light on the microstructure, adjusting the incident angle changes the projection period of the fringes on the image plane, and adjusting the wavelength changes the interference phase and contrast. This multi-parameter collaborative optimization method differs from the passive suppression of single fixed parameters in existing technologies. It can not only significantly reduce the peak energy of the fringes but also preserve defect features such as crack endpoints and boundary contours to the maximum extent, thereby avoiding weakening the defect response while suppressing interference. Furthermore, through dynamic adjustment and verification, optimal optical conditions can be adaptively found in the testing of different batches of samples, maintaining stable interference suppression even under conditions such as aging of the production line light source, environmental changes, or fine-tuning of chip processes. This step is not only the physical implementation of the interference suppression strategy, but also a crucial step in effectively connecting the previous image analysis results with subsequent frequency domain notch filtering and spatial detail recovery.

[0044] S5, under dynamically adjusted illumination conditions, narrowband notch processing targeting the main frequency vector of interference fringes is implemented in the frequency domain, and anisotropic diffusion method is used in the spatial domain to restore the weakened detail texture during the suppression process, so as to complete texture correction before defect segmentation. In the previous step, dynamic lighting adjustment concentrated the interference fringe energy in the LED chip image into a controllable suppression frequency band while preserving the structural features of the actual defects. The goal of this step is to perform directional narrowband notch filtering on the dominant frequency vector of the interference fringes in the frequency domain to minimize the interference fringe energy. Simultaneously, anisotropic diffusion in the spatial domain is used to directionally restore the details weakened by the notch filtering, ensuring the integrity of the defect features. Unlike simple low-pass filtering or uniform blurring in existing technologies, this step employs a series of measures, including precise positioning of the dominant frequency vector, direction-selective notch filtering, and region-guided anisotropic diffusion, to achieve a balance between fringe suppression and detail preservation.

[0045] The original image acquired under dynamic lighting conditions is subjected to a two-dimensional discrete Fourier transform to obtain a spectrum. Based on the dominant frequency vector output from the previous step, the notch center position is determined, with its radial distance equal to the frequency value of the dominant frequency vector and its angle completely consistent with the direction parameter of the dominant frequency vector. An elliptical notch mask is constructed with the notch center as the center, a bandwidth of 15% of the center frequency along the frequency axis, and an angle width of 5° along the direction axis. A cosine-weighted smooth transition band is used at the mask edge to ensure continuous energy change between the suppressed and preserved regions, reducing ringing effects in the spatial domain. A symmetrical notch region is simultaneously established on the other side of the spectrum conjugate symmetry to ensure consistent frequency domain energy suppression of the real-valued image. The notch depth is set according to the percentage of fringe energy: 90% for a percentage ≥ 0.3; 70% for a percentage 0.2-0.3; and 50% for a percentage < 0.2. After multiplying the notch mask point by point with the original spectrum, a two-dimensional inverse Fourier transform is performed to obtain a corrected image. The residual energy within the notch band is then calculated to ensure that the reduction reaches the preset ratio.

[0046] To address potential local detail attenuation in a single-image correction, an anisotropic diffusion guide map is generated. First, the gradient magnitude and direction of the single-image correction are calculated, and the gradient direction is mapped to a unified coordinate system aligned with the LED chip electrode grid lines. Combining the phase consistency index obtained in the previous step, regions with a phase consistency index greater than 0.8 and gradient magnitudes lower than the global mean are marked as "stripe residue regions." These regions are suitable for diffusion along the stripe direction to eliminate residual stripe texture. Regions with gradient magnitudes higher than the global mean and exhibiting termination characteristics are marked as "defect-sensitive regions." These regions are suitable for diffusion along directions perpendicular to the stripes to repair edge stepping caused by notch filtering while preserving the clarity of defect endpoints. Unmarked regions are defined as "neutral regions," suitable for low-intensity, multi-directional balanced diffusion.

[0047] Anisotropic diffusion is performed in the spatial domain according to the guiding diagram. In the stripe residue region, the diffusion direction is consistent with the direction of the dominant frequency vector, with a step size of 0.25 pixels and 15 iterations. The diffusion intensity decreases linearly with the increase of the local gradient magnitude to avoid crossing the true edge. In the defect-sensitive region, the diffusion direction is perpendicular to the dominant frequency vector, with a step size of 0.15 pixels and 10 iterations. The intensity is limited to within twice the standard deviation of the background noise to preserve the endpoints of small cracks. In the neutral region, equal diffusion is performed 8 times in each of the two dominant directions with a step size of 0.2 pixels. To prevent over-diffusion from introducing blur, the local contrast change is calculated after each iteration, and diffusion in that region is stopped when the change exceeds 20%.

[0048] The results of frequency domain notch filtering and spatial domain diffusion are comprehensively verified. First, the energy within the controllable suppression frequency band is recalculated to ensure it is below 20% of the initial value. Then, the number of endpoints, directional dispersion, and line-to-point ratio are compared between the original image, the first-corrected image, and the final corrected image to ensure that the defect features are not only preserved after processing but also improved in terms of contrast and structural integrity. If obvious stripe residue is still found in a local area, a narrowband notch filtering is added to that area in the frequency domain, with a bandwidth not exceeding 50% of the initial notch filtering bandwidth. If excessive smoothing is found in a local area, the diffusion intensity in that area is reduced and local anti-diffusion correction is performed. The final output image has effectively suppressed the stripe background, and the defect features are clearly distinguishable, providing high-quality input for the next stage of defect segmentation.

[0049] The purpose of this step is to further suppress interference fringes and restore detailed textures from two complementary dimensions—frequency and spatial—based on the optimal imaging formed by dynamically adjusting illumination conditions. This provides a high-quality image that is free of interference textures and retains the true features of defects before defect segmentation. Specifically, the frequency-domain narrowband notch filtering stage uses the dominant frequency vector and direction parameters of the interference fringes output from the previous step to accurately locate the frequency band where the fringe energy is located. Within this frequency band, directional and bandwidth-controlled energy reduction is performed, significantly weakening the periodic structure of the fringes in the spatial domain and fundamentally eliminating its interference in the detection algorithm. The spatial-domain anisotropic diffusion stage addresses the inevitable detail loss during notch filtering. Based on the guide map generated by the gradient distribution and phase consistency index, intensity-limited diffusion operations are performed along the fringe direction or perpendicular to the fringe direction. This smooths the residual fringe area while restoring the edges of defect-sensitive areas, keeping the endpoints, fractures, and boundaries of defects such as cracks and scratches clear. This combined frequency and spatial domain processing method differs from existing technologies that rely solely on low-pass filtering or uniform ambiguity. It not only precisely suppresses interference components in specific directions and frequencies but also selectively recovers details attenuated by notch filtering, effectively improving the accuracy and robustness of subsequent defect segmentation and identification. Furthermore, by repeatedly setting parameters such as bandwidth, suppression depth, diffusion direction, and diffusion intensity during processing, this step can stably reproduce the processing effect under different batch inspections and equipment conditions. It is a crucial link in the entire detection method, ensuring both interference suppression and defect fidelity.

[0050] S6, after texture correction, the defect judgment confidence result is sent back to the illumination control and imaging acquisition parameter setting module, triggering encrypted sampling for high-risk directions to form a dynamic closed-loop detection process that continuously suppresses interference fringes and simultaneously enhances the defect detection response; The previous step output the texture-corrected image, residual interference energy ratio, endpoint density, directional dispersion, line-to-point ratio, and the corresponding working combination of dominant frequency vector, directional parameters, polarization angle, incident azimuth angle, incident elevation angle, and narrowband wavelength. The interference risk map has given the locations of high-risk cells at different azimuth angles, elevation angles, and wavelengths. The goal of this step is to transform the defect judgment confidence obtained in the texture correction stage into explicit adjustment instructions for illumination and acquisition parameters, and to perform encrypted sampling using spatial fixed-point, fine-step angle, and wavelength selection methods to continuously suppress interference fringes, while further improving the response to defects such as cracks, scratches, and notches, forming a closed loop from imaging evaluation to illumination and acquisition reconfiguration and then to re-evaluation.

[0051] The confidence level for defect determination is calculated based on the texture-corrected image, forming a data carrier that can be transmitted back. The full-frame image of the LED chip under inspection is divided into a 1-millimeter square grid, with grid boundaries falling at integer pixel positions. Within each grid, four metrics are calculated and their values ​​and units are stored: 1) Endpoint density, defined as the number of fracture endpoints and inflection points per unit area, in units of one square millimeter; 2) Boundary sharpness, defined as the grayscale transition amplitude along the local defect direction divided by the transition half-width at half-maximum, in units of one pixel grayscale; 3) Directional dispersion, defined as the standard deviation of the local edge direction within the range of 0 to 180 degrees, in degrees; 4) Residual interference energy ratio, defined as the ratio of energy within the controllable suppression frequency band to the total high-frequency energy, dimensionless. These four values ​​are weighted according to a weight ratio of 4:3:2:1 and linearly normalized to 0 to 1 to obtain the defect determination confidence level. Using 0.7 and 0.4 as two fixed thresholds, the grid is divided into high-confidence, medium-confidence, and low-confidence regions. For each region, the center coordinates, principal direction (polar angle with the electrode grid line as zero degree reference), average defect judgment confidence level, and residual interference energy ratio are recorded, and a region list is generated to drive the specific adjustment of subsequent lighting and acquisition parameters.

[0052] Align the region list with the interferometric risk map in terms of coordinates and directions, and formulate a dense sampling plan for high-risk directions. For each high-confidence region, retrieve the risk cells in the interferometric risk map whose main direction differs from the main direction of the region by no more than five degrees, read the corresponding main frequency vector and direction parameters, and establish a fine-step sequence of incident azimuth angles centered on these direction parameters; when the residual interferometric energy ratio is no greater than 0.15, set up two trial sampling points offset by two and four degrees on each side of the existing incident azimuth angle, keeping the incident elevation angle unchanged from the optimal value of the previous step, the polarization angle unchanged, and the narrowband wavelength unchanged; when the residual interferometric energy ratio is between 0.15 and 0.3, the polarization... The angular and directional parameters are adjusted by 15 degrees orthogonal. Five trial acquisition points are set at the incident azimuth angle: -4 degrees, -2 degrees, 0 degrees, +2 degrees, and +4 degrees. The incident elevation angle is switched between its original value and its original value plus 5 degrees. The narrowband wavelength is selected such that the difference between the nominal microstructure frequency and the dominant frequency vector frequency is not less than 20%. When the residual interference energy ratio is greater than 0.3, simultaneously, a 30-degree polarization angle adjustment is performed, along with seven trial acquisition points covering -3 to +3 degrees in a 1-degree step increment of the incident azimuth angle, and two switching points for the incident elevation angle increment: 5 degrees and 10 degrees. The narrowband wavelength is also shifted 40 nanometers towards the shortwave side. For each medium-confidence region, three trial acquisition points are arranged with a 2-degree step increment of the incident azimuth angle, while the remaining parameters remain unchanged from the optimal values ​​of the previous step. No encrypted sampling is arranged for low-confidence regions. The above arrangements form a detailed sampling plan, which includes the area number, center coordinates, incident azimuth sequence, incident elevation angle, polarization angle, narrowband wavelength, and shooting sequence of phase shift steps (four steps, 90-degree increments).

[0053] Encrypted data acquisition was performed according to the sampling plan, and the feedback effect was evaluated in real time to select the optimal parameter combination. For each set of parameters in the plan, four phase-shift images and one bright-field image were acquired sequentially, with the exposure time, analog gain, and source current using the previous baseline values. The frequency domain narrowband notch filtering and spatial domain anisotropic diffusion process was repeated for each set of images to obtain a new texture-corrected image. The endpoint density, boundary sharpness, directional dispersion, and residual interference energy ratio were recalculated in the corresponding region, and the defect judgment confidence was updated. A dual-criteria selection method was set: first, the defect judgment confidence was no less than 0.1 times higher than the baseline value of the region; second, the residual interference energy ratio was no less than 0.05 times lower than the baseline value of the region. For combinations that met both criteria, the one with the lowest residual interference energy ratio was selected as the candidate optimal combination; if multiple groups had the same residual interference energy ratio, the one with the highest endpoint density was selected. To verify stability, the candidate optimal combination was repeatedly acquired three times in the region, and the coefficients of variation of the defect judgment confidence and the residual interference energy ratio were calculated. When both were no greater than 5%, the combination was confirmed as the optimal parameter for the region. For areas that do not meet the standard, the group with the lowest residual interference energy ratio is retained as the temporary best, and the incident azimuth or polarization angle is fine-tuned in the next round, with the fine-tuning step size not exceeding one degree.

[0054] The optimal parameters and updated statistics are written back into the interferometric risk map and sampling plan, and a closed-loop termination condition is set. The optimal polarization angle, incident azimuth, incident elevation angle, and narrowband wavelength of each high-confidence region are mapped to specific coordinates on the interferometric risk map. At this location, the risk level is lowered by one level, and the new dominant frequency vector and direction parameters are recorded. If the residual interferometric energy ratio is still greater than 0.25 after two consecutive lowerings at the same coordinate location, an additional 5 degrees of incident elevation angle is added at that location, and the narrowband wavelength is moved 20 nanometers to each side for re-acquisition, until the residual interferometric energy ratio is no greater than 0.25 or the upper limit of two additional rounds is reached. The closed-loop termination condition is set to one of the following: there are no areas with a defect determination confidence level of no less than 0.7 across the entire range; or the residual interferometric energy ratio of all high-confidence regions is no greater than 0.15; or the number of encrypted sampling rounds reaches three. After the termination condition is met, the final texture-corrected image, the spatial distribution of defect determination confidence, the list of optimal illumination and acquisition parameters for each region, the updated interferometric risk map, and the dominant frequency vector statistics table are output.

[0055] This step serves to apply the defect assessment confidence result obtained after texture correction to the adjustment of illumination and imaging acquisition parameters, thus forming an adaptive, dynamically optimized closed-loop detection mechanism. By combining the quantitative indicator of defect assessment confidence with feature information obtained from previous steps, such as the interference risk spectrum, residual interference energy ratio, dominant frequency vector, and direction parameters, high-risk directions and regions where interference fringes may generate or interfere with detection can be accurately identified. Compared to traditional static detection schemes, this method can change the imaging conditions such as the polarization angle, incident angle, incident elevation angle, and narrowband wavelength of the light source in real time during the detection process, and implement encrypted sampling in space and angle in high-risk directions. In this way, not only can the energy of interference fringes in specific directions and frequencies be significantly suppressed, bringing them into a controllable suppression frequency band, but the defect response can also be enhanced while suppressing interference, making the edges and endpoints of defects such as cracks and scratches more prominent in the imaging. This step, through a continuous cycle of "detection-feedback-optimization-re-detection," ensures that the entire detection process has a high degree of environmental adaptability and stability. It guarantees that high-precision and high-consistency defect identification can be maintained in different production batches and under different equipment conditions, thereby effectively reducing the probability of missed detections and false detections, and improving the reliability and repeatability of LED chip factory quality control.

[0056] This invention constructs a closed-loop detection mechanism that adaptively identifies and suppresses interference fringes by deeply coupling dynamically adjustable optical imaging parameters with image processing results, thereby significantly improving the accuracy and stability of LED chip appearance defect detection. Specifically, this scheme utilizes an interference risk map established by a defect-free reference chip and a phase consistency index extracted through multi-step phase shifting to accurately distinguish between real defects and optical interference textures before defect segmentation, avoiding misjudgments and missed detections caused by overlapping frequency domain features. By inferring the dominant frequency vector and direction parameters from the discriminant subspace and combining real-time adjustments to the polarization angle, incident angle, and narrowband wavelength, the interference fringe energy is concentrated into a controllable suppression frequency band, ensuring the targeted and effective interference suppression. Furthermore, the combined processing of frequency domain narrowband notch filtering and spatial anisotropic diffusion not only effectively suppresses interference textures but also restores detailed textures while preserving defect boundary and endpoint features. Finally, through the feedback of defect judgment confidence and the encrypted sampling of high-risk directions, the detection process achieves self-optimization and continuous enhancement. Compared with existing fixed lighting and unidirectional processing detection methods, this solution can maintain high detection accuracy under different batches, different equipment conditions and different chip surface structures, significantly reducing the missed detection rate and false detection rate of LED chip appearance defects, and improving the reliability and consistency of factory quality control.

[0057] The foregoing has only described certain exemplary embodiments of the present invention by way of illustration. Undoubtedly, those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the foregoing drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.

Claims

1. A method for detecting appearance defects in LED chips based on image processing, characterized in that, Includes the following steps: S1, Under stable exposure conditions, perform multi-angle and multi-wavelength scanning on a defect-free reference LED chip to extract the main frequency vector and directional distribution information of the microstructure on the LED chip surface, and generate an interference risk map based on the main frequency vector and directional distribution information; S2, generate weak amplitude structured light based on the main frequency vector information in the interferometric risk spectrum, obtain the phase consistency index through multi-step phase shifting acquisition, and separate the interference fringe components related to optical superposition based on the phase consistency index; S3, based on the joint features of phase consistency index and gradient vector field, constructs a subspace for the discrimination of defects and interference, trains a direction-selective filtering kernel, reduces the response to fringe in the direction parallel to the microstructure, and enhances the response to the crack fracture point. S4. Based on the characteristic output of the discriminant subspace, the dominant frequency vector and direction parameters of the interference fringes are inversely calculated. The polarization angle, incident angle and narrowband wavelength of the illumination are dynamically adjusted according to the dominant frequency vector and direction parameters so that the interference fringe energy enters the controllable suppression frequency band. S5, under dynamically adjusted illumination conditions, narrowband notch processing targeting the main frequency vector of interference fringes is implemented in the frequency domain, and anisotropic diffusion method is used in the spatial domain to restore the weakened detail texture during the suppression process, so as to complete texture correction before defect segmentation. S6 sends the defect determination confidence result obtained after texture correction back to the illumination control and imaging acquisition parameter setting module, triggering encrypted sampling for high-risk directions to form a dynamic closed-loop detection process that continuously suppresses interference fringes and simultaneously enhances the defect detection response.

2. The LED chip appearance defect detection method based on image processing according to claim 1, characterized in that, Step S1 includes: Under stable exposure conditions, a defect-free reference LED chip is fixed on a vacuum adsorption stage with a flatness of no more than two micrometers. The ambient temperature, humidity and ambient light intensity are controlled. Through the combination of a global shutter industrial camera, a telecentric lens and a multi-wavelength narrowband light source, along with dark field and flat field correction and spatial calibration, the exposure time, analog gain, light source current, polarization angle positioning, spatial conversion coefficient and reference average gray level are output. While keeping the exposure time, analog gain, light source current and polarization angle positioning constant, perform multi-angle and multi-wavelength joint acquisition to obtain bright field images and micro-tilt reference images under different combinations of azimuth angle, elevation angle, wavelength and polarization angle, and verify that the gray value range is qualified. In the region of interest, the bright field image is transformed in the frequency domain to remove the DC component and low-frequency background. The dominant frequency vector and direction angle are calculated, and the direction distribution histogram under each condition is obtained by combining the spatial conversion coefficient. Using azimuth, elevation, and wavelength as three-dimensional coordinate axes, an interferometric risk map is constructed based on the weighted result of the difference between the dominant frequency vector and the nominal period, and the angle between the azimuth and the nominal direction. High-risk units are classified and marked, and their dominant frequency vector, azimuth, and corresponding condition combinations are recorded. A high-risk index table is output for subsequent steps.

3. The LED chip appearance defect detection method based on image processing according to claim 1, characterized in that, Step S2 includes: Based on the dominant frequency vector and orientation angle of the high-risk unit in the interference risk spectrum, the actual period and orientation of the sample plane are converted into the actual period and orientation of the sample plane. Then, a weak amplitude structured light stripe consistent with the dominant frequency vector is generated in the illumination channel by a digital micromirror device or a liquid crystal spatial light modulator, and the period verification and uniformity detection are completed on the sample plane. While keeping the spatial parameters of the weak-amplitude structured light constant, a piezoelectric displacement mirror or a liquid crystal phase modulator is used to perform four-step equal-amplitude phase-shifting acquisition along the stripe direction, with step angles of 0 degrees, 90 degrees, 180 degrees and 270 degrees respectively, and the optimal focal plane is locked before each acquisition step. The phase consistency index is calculated based on the periodic gray-level changes and phase stability of the multi-step phase-shifted image within the frequency band corresponding to the main frequency vector. A phase consistency index distribution map corresponding to the main frequency vector is generated, and interference from specular highlight areas is eliminated. A weighted map is constructed based on the phase consistency index. In the frequency domain, the dominant frequency component of the high-weight region is subjected to amplitude suppression, and in the spatial domain, details are restored by anisotropic diffusion. The resulting image with stripe suppression and the phase consistency index distribution map are output.

4. The LED chip appearance defect detection method based on image processing according to claim 3, characterized in that, Based on the dominant frequency vector and orientation angle of the high-risk unit in the interferometric risk spectrum, the dominant frequency vector is converted into the actual period of the sample plane using the pixel-to-spatial scale conversion coefficient. The period error is controlled within 1%. The orientation angle is used as the fringe direction. Sinusoidal weak amplitude structured light fringes are generated in the illumination channel using a digital micromirror device or a liquid crystal spatial light modulator. The fringe contrast is set to 5% to 10%. The fringes are accurately imaged onto the sample plane through a telecentric projection objective. The phase change is checked by moving one micrometer along the fringe normal direction on the sample plane. The phase change is checked to be between 20 and 40 degrees. At the same time, the spatial fluctuation of the gray value difference between the fringe peaks and valleys is detected by using a reflectivity standard plate and does not exceed 5%.

5. The method for detecting appearance defects in LED chips based on image processing according to claim 1, characterized in that, Step S3 includes: Using the bright-field image separated by stripes and the phase consistency index distribution map consistent with the main frequency vector as input, the gradient magnitude, gradient direction difference, direction abrupt change rate and local termination index are calculated, and combined with the phase consistency index to form a five-channel joint feature; Based on the joint features, interference fringe samples and crack endpoint samples are collected under different acquisition conditions. The mean vector and covariance matrix are calculated and linear orthogonal transformation is performed to construct a three-dimensional discrimination subspace, thereby achieving the separation of interference and defects. Guided by the discriminant subspace, anisotropic weight templates are trained for different directions and sizes. The weight ratio is adjusted to reduce the response of interference samples to less than 30% of the initial value, while increasing the response of crack endpoint samples to more than 1.5 times the initial value. The discriminant subspace and direction-selective filtering kernel are combined and applied to the full-frame image. In the interference-prone region, fringes are suppressed according to the tendency value, and in the defect-prone region, crack endpoints are enhanced according to the local termination index. The suppression map and enhancement map are output for subsequent use.

6. The method for detecting appearance defects in LED chips based on image processing according to claim 1, characterized in that, Step S4 includes: Within a unified directional coordinate system, connected regions higher than the global median plus one standard deviation are selected from the interferometric trend map. Spatial dominant frequency and directional angle are calculated, and weighted synthesis of full-amplitude dominant frequency vector and directional parameters is performed. The main frequency vector and direction parameters are mapped to the center and direction of the controllable suppression frequency band. The polarization angle is selected in combination with the microstructure reflection law. The incident azimuth and elevation angles are set according to the direction parameters. A narrow band wavelength is selected that makes the difference between the nominal frequency and the center frequency greater than 15%. While keeping the exposure and spatial calibration unchanged, load each candidate illumination combination, acquire images and calculate the energy ratio of interference fringes and the line-to-point ratio. Select the combination that satisfies the requirement of having an energy ratio of less than 0.2 and a line-to-point ratio of less than 0.3 as the optimal combination. Stability was verified by repeatedly sampling three times under the optimal combination, and the updated main frequency vector, direction parameters and suppression results were output for subsequent frequency domain notch filtering and spatial detail recovery.

7. The LED chip appearance defect detection method based on image processing according to claim 6, characterized in that, The selection of narrowband wavelength is primarily based on the difference between the projection frequency of the nominal period of the chip surface microstructure on the image plane and the main frequency vector. When the difference is greater than 15%, a wavelength with a full width at half maximum (FWHM) of no more than 10 nanometers is selected. When the difference is less than or equal to 15%, a wavelength with a smaller coherence length is selected to reduce the contrast of interference fringes. Under the premise of meeting the directional tolerance and bandwidth requirements, the spatial discontinuity of the crack endpoint features remains unchanged.

8. The method for detecting appearance defects in LED chips based on image processing according to claim 1, characterized in that, Step S5 includes: Two-dimensional discrete Fourier transform is performed on the image acquired under dynamic lighting conditions. An elliptical narrowband notch mask is constructed based on the main frequency vector output from the previous step. A symmetrical notch region is established at the conjugate symmetrical position of the spectrum. The notch depth is set according to the fringe energy ratio and an inverse transform is performed to obtain a first-corrected image. Calculate the gradient magnitude and gradient direction of the first-corrected image, and generate anisotropic diffusion guide maps of the stripe residual area, defect sensitive area and neutral area by combining the phase consistency index; Anisotropic diffusion is performed according to the guide diagram, spreading along the main frequency vector direction in the stripe residual region, spreading along the vertical direction in the defect sensitive region, and multi-directional balanced diffusion in the neutral region, and monitoring local contrast changes after each iteration to prevent over-smoothing. The controllable suppression band energy, number of endpoints, directional dispersion and line-to-point ratio of the verification processing results are checked. If the requirements are not met, local additional notch filtering or anti-diffusion correction is performed, and an image that meets the defect segmentation requirements is output.

9. The method for detecting appearance defects in LED chips based on image processing according to claim 8, characterized in that, When constructing an elliptical narrow-band notch mask, the radial bandwidth is set to 15% of the main frequency vector frequency value, the angular width is set to 5°, the mask edge is smoothed by cosine weighting, and notch regions are established synchronously at the conjugate symmetric position of the spectrum to ensure the consistency of frequency domain suppression of the real image. The notch depth is set to 90%, 70% or 50% according to the energy ratio of the interference fringes.

10. The LED chip appearance defect detection method based on image processing according to claim 1, characterized in that, Step S6 includes: The texture-corrected image is divided into a 1-millimeter square grid. The endpoint density, boundary sharpness, directional dispersion, and residual interference energy ratio are calculated respectively. The defect judgment confidence is obtained by weighted normalization and divided into high, medium, and low confidence regions according to the threshold. Align the regional list with the interference risk map, and formulate a dense sampling plan for high-confidence regions based on the residual interference energy ratio, including fine-stepping of the incident azimuth angle, adjustment of the polarization angle, switching of the incident elevation angle, and selection of narrowband wavelengths. Phase shift images and bright field images were acquired according to the sampling plan. Frequency domain narrowband notch and spatial domain anisotropic diffusion were repeated. The defect judgment confidence and residual interference energy ratio were updated, and the optimal parameter combination was selected using dual indicators. The optimal parameters are written back to the interference risk map and the risk level is adjusted. The closed-loop termination condition is set, and the final texture-corrected image, defect judgment confidence distribution, and updated interference risk map are output.

Citation Information

Cited By

  • Product quality detection method based on machine vision

    CN121678679A

  • Film layer overflow detection method and device based on film interference imaging

    CN121904050A

  • Defect detection system for perovskite quantum dot optical device

    CN122237903A