Multi-angle LED detection light source switching method, device, equipment and storage medium

By extracting and planning the three-dimensional model data of the detected product, generating a light source switching strategy and compensating it, the problem of fixed light source configuration in the existing technology is solved, and detection efficiency and accuracy are improved.

CN119295677BActive Publication Date: 2025-04-18SHENZHEN KINGUNION LIGHTING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411818336.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-18
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

The existing multi-angle light source switching method uses a fixed light source configuration, which affects the reliability and consistency of the detection results, and cannot effectively adapt to the diversity and complexity of the products being tested, resulting in inefficient detection efficiency and insufficient accuracy.

Method used

By obtaining the three-dimensional model data of the detected product, extracting surface features and planning the detection path, establishing a reflection model for light coverage analysis and timing planning, generating a light source switching strategy sequence, and compensating according to the system delay parameters, and adjusting the switching strategy in real time.

Benefits of technology

It improves the switching efficiency and accuracy of multi-angle LED detection light sources, ensures high-quality optical inspection in complex environments, and enhances the reliability and consistency of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295677B_ABST
    Figure CN119295677B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, equipment and storage medium for switching light sources for multi-angle LED detection. The method comprises: obtaining three-dimensional model data of the product to be detected, performing surface feature extraction and detection path planning, and generating a detection path planning data packet containing plane mapping data, normal vector information and curvature features. According to the data packet, a reflection model of the product to be detected is established, and a light source switching strategy is generated. In the method, the system delay parameters of the light source system including the multi-angle LED detection light source are obtained, and the light source switching strategy is compensated. During detection, the light source system is switched according to the compensated light source switching strategy, and the switching strategy is adjusted in real time according to the detection results. Based on the three-dimensional model and related features of the product to be detected, the present invention performs effective light source switching strategy planning, improves the switching efficiency and accuracy of the multi-angle LED detection light source, and ensures high-quality optical detection in complex environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of defect detection, and in particular to a multi-angle LED detection light source switching method, device, equipment and storage medium. Background Art

[0002] In the field of modern manufacturing and quality inspection, optical inspection technology is widely used to improve product quality and accuracy. Especially when inspecting products with complex shapes, the selection and switching of light sources are crucial. Traditional multi-angle light source switching methods often rely on fixed light source configurations, which may lead to uneven illumination at different inspection angles, thus affecting the reliability and consistency of the inspection results. In addition, existing technologies usually lack scientific planning for light source switching strategies and cannot effectively adapt to the diversity and complexity of the inspected products, resulting in low inspection efficiency and insufficient accuracy. Summary of the invention

[0003] The main purpose of the present invention is to solve the technical problems that the existing multi-angle light source switching method uses a fixed light source configuration, which affects the reliability and consistency of the detection results and cannot effectively adapt to the diversity and complexity of the detected products;

[0004] A first aspect of the present invention provides a multi-angle LED detection light source switching method, the multi-angle LED detection light source switching method comprising:

[0005] Acquire three-dimensional model data of the product to be inspected, and perform surface feature extraction and inspection path planning processing on the three-dimensional model data to obtain an inspection path planning data packet, wherein the inspection path planning data packet includes plane mapping data, normal vector information, and curvature features;

[0006] Establishing a reflection model of the detected product according to the detection path planning data packet, and performing illumination coverage analysis and timing planning on the detected product according to the reflection model to obtain a light source switching strategy sequence;

[0007] Acquire a system delay parameter of a light source system including a multi-angle LED detection light source, and compensate the light source switching strategy sequence according to the system delay parameter;

[0008] When the detected product is being detected, the multi-angle LED detection light source of the light source system is switched through the compensated light source switching strategy sequence, and the light source switching strategy sequence is adjusted in real time according to the detection result of the detected product.

[0009] Optionally, in a first implementation of the first aspect of the present invention, the three-dimensional model data of the inspected product is acquired, and surface feature extraction and inspection path planning processing are performed on the three-dimensional model data to obtain the inspection path planning data packet, which includes:

[0010] Acquire three-dimensional model data of the product to be inspected, and perform surface subdivision processing on the three-dimensional model data to obtain a plurality of surface units;

[0011] Performing feature calculation on the surface units to obtain the normal vector direction and curvature feature of each surface unit, and performing path planning processing on each surface unit to obtain a discretized path sequence containing detection position points;

[0012] The detection position points in the discretized path sequence are subjected to three-dimensional to two-dimensional coordinate mapping processing to obtain plane mapping data, and a detection path planning data packet is generated according to the plane mapping data, normal vector information and curvature characteristics of each surface unit.

[0013] Optionally, in a second implementation of the first aspect of the present invention, establishing a reflection model of the detected product according to the detection path planning data packet, and performing illumination coverage analysis and timing planning on the detected product according to the reflection model to obtain a light source switching strategy sequence includes:

[0014] Establishing an optical characteristic model of the product to be inspected according to the normal vector information and curvature characteristics in the inspection path planning data packet, and calculating the reflection path of the incident light of the multi-angle LED inspection light source according to the optical characteristic model to obtain a reflection model;

[0015] Performing illumination coverage analysis on the reflection model to obtain the light source number of the effective illumination LED light source corresponding to the detected product and the illumination parameters corresponding to the effective illumination LED light source;

[0016] The effective lighting LED light sources are grouped according to the light source numbers and corresponding lighting parameters to obtain a light source combination scheme corresponding to the detection position point;

[0017] The light source combination scheme is time-sequentially arranged according to the plane mapping data in the detection path planning data packet to obtain a light source switching strategy sequence.

[0018] Optionally, in a third implementation of the first aspect of the present invention, the performing timing arrangement processing on the light source combination scheme according to the plane mapping data in the detection path planning data packet to obtain the light source switching strategy sequence includes:

[0019] Performing adjacent area division processing on the detection position points in the plane mapping data to obtain a set of boundary points of adjacent detection areas;

[0020] The light source combination scheme is segmented according to the boundary point set to obtain a light source switching trigger position corresponding to each detection area;

[0021] Calculating the time parameters of the light source switching trigger position to obtain the switching time interval between adjacent light sources;

[0022] The light source combination scheme is time-sequenced according to the light source switching trigger position and the switching time interval to obtain a light source switching strategy sequence.

[0023] Optionally, in a fourth implementation of the first aspect of the present invention, obtaining a system delay parameter of a light source system including a multi-angle LED detection light source, and compensating the light source switching strategy sequence according to the system delay parameter includes:

[0024] Performing a single light source response test on the LED detection light sources at various angles of the light source system to obtain the response time of the LED detection light sources at various angles;

[0025] Performing a multi-light source switching test on the light source system to obtain a switching delay time between adjacent light sources;

[0026] Performing comprehensive analysis on the response time and the switching delay time to obtain a system delay parameter of the light source system;

[0027] The switching time interval in the light source switching strategy sequence is compensated according to the system delay parameter.

[0028] Optionally, in a fifth implementation of the first aspect of the present invention, when the detected product is detected, the multi-angle LED detection light source of the light source system is switched by the compensated light source switching strategy sequence, and the light source switching strategy sequence is adjusted in real time according to the detection result of the detected product, including:

[0029] When the product under inspection is inspected, the multi-angle LED inspection light source of the light source system is switched through the compensated light source switching strategy sequence, and the inspection result of the product under inspection is obtained;

[0030] Perform defect feature analysis based on the detection results to obtain spatial distribution features and surface characteristic parameters of the defects of the detected product, and calculate the optimal illumination angle for defect detection based on the spatial distribution features and surface characteristic parameters of the defects;

[0031] Light source matching is performed on the optimal illumination angle to obtain an optimal light source combination corresponding to the optimal illumination angle, and the light source switching strategy sequence is adjusted in real time according to the optimal light source combination.

[0032] Optionally, in a sixth implementation of the first aspect of the present invention, the calculating the optimal illumination angle for defect detection according to the spatial distribution characteristics and surface characteristic parameters of the defects includes:

[0033] Performing cluster analysis on the spatial distribution characteristics of the defects to obtain a spatial position distribution map of the main defect areas of the inspected product;

[0034] Establishing a surface optical characteristic model of the main defect area according to the spatial position distribution map and the surface characteristic parameters, and performing reflection path calculation on the surface optical characteristic model to obtain light reflection intensity data at different incident angles;

[0035] A multi-angle illumination analysis is performed on the light reflection intensity data to obtain imaging contrast parameters of defects at various incident angles, and a multi-objective optimization calculation is performed on the imaging contrast parameters to obtain the optimal illumination angle for defect detection.

[0036] A second aspect of the present invention provides a multi-angle LED detection light source switching device, the multi-angle LED detection light source switching device comprising:

[0037] A model processing module, used to obtain three-dimensional model data of the product to be inspected, and perform surface feature extraction and inspection path planning processing on the three-dimensional model data to obtain an inspection path planning data packet, wherein the inspection path planning data packet includes plane mapping data, normal vector information and curvature features;

[0038] A switching strategy generation module, used to establish a reflection model of the detected product according to the detection path planning data packet, and perform illumination coverage analysis and timing planning on the detected product according to the reflection model to obtain a light source switching strategy sequence;

[0039] A compensation module, used for obtaining a system delay parameter of a light source system including a multi-angle LED detection light source, and compensating the light source switching strategy sequence according to the system delay parameter;

[0040] The switching adjustment module is used to switch the multi-angle LED detection light source of the light source system through the compensated light source switching strategy sequence when the detected product is being detected, and to adjust the light source switching strategy sequence in real time according to the detection result of the detected product.

[0041] The third aspect of the present invention provides a multi-angle LED detection light source switching device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected through lines; the at least one processor calls the instructions in the memory so that the multi-angle LED detection light source switching device performs the steps of the above-mentioned multi-angle LED detection light source switching method.

[0042] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the steps of the above-mentioned multi-angle LED detection light source switching method.

[0043] The above-mentioned multi-angle LED detection light source switching method, device, equipment and storage medium obtain the three-dimensional model data of the product to be detected, and perform surface feature extraction and detection path planning to generate a detection path planning data packet containing plane mapping data, normal vector information and curvature features. According to the data packet, a reflection model of the product to be detected is established, and a light source switching strategy is generated. In the method, the system delay parameters of the light source system including the multi-angle LED detection light source are obtained, and the light source switching strategy is compensated. During detection, the light source system is switched according to the compensated light source switching strategy, and the switching strategy is adjusted in real time according to the detection results. Based on the three-dimensional model and related features of the product to be detected, the present invention performs effective light source switching strategy planning, improves the switching efficiency and accuracy of the multi-angle LED detection light source, and ensures high-quality optical detection in complex environments.

[0044] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is a schematic diagram of a first embodiment of a multi-angle LED detection light source switching method according to an embodiment of the present invention;

[0047] Figure 2 A schematic diagram of an embodiment of a multi-angle LED detection light source switching device in an embodiment of the present invention;

[0048] Figure 3 It is a schematic diagram of an embodiment of a multi-angle LED detection light source switching device in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device end including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or device ends.

[0051] To facilitate understanding of this embodiment, a multi-angle LED detection light source switching method disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method comprises the following steps:

[0052] 101. Acquire three-dimensional model data of the product to be inspected, and perform surface feature extraction and inspection path planning processing on the three-dimensional model data to obtain an inspection path planning data packet, wherein the inspection path planning data packet includes plane mapping data, normal vector information, and curvature features;

[0053] In one embodiment of the present invention, the three-dimensional model data of the product to be inspected is acquired, and surface feature extraction and inspection path planning processing are performed on the three-dimensional model data to obtain an inspection path planning data packet, including: acquiring the three-dimensional model data of the product to be inspected, and performing surface subdivision processing on the three-dimensional model data to obtain a plurality of surface units; performing feature calculation on the surface units to obtain the normal vector direction and curvature characteristics of each surface unit, and performing path planning processing on each of the surface units to obtain a discretized path sequence containing inspection position points; performing three-dimensional to two-dimensional coordinate mapping processing on the inspection position points in the discretized path sequence to obtain plane mapping data, and generating an inspection path planning data packet based on the plane mapping data, normal vector information and curvature characteristics of each surface unit.

[0054] Specifically, the CAD design 3D model data of the inspected product is obtained. These data are usually stored in standard formats such as STEP and IGES, and contain complete geometric information and topological structure of the product. For these 3D model data, data format conversion and preprocessing are required first, and CAD data of different formats are uniformly converted into a processable triangular mesh model. During the conversion process, the geometric accuracy of the model needs to be maintained, and the size of the triangular mesh is controlled at the 0.1mm level. For areas with more complex surfaces, mesh encryption is required, while for flat areas, appropriate sparseness can be used to balance the requirements of computational efficiency and accuracy. In addition, the boundaries and feature lines of the model need to be identified and maintained, and these features are often the key inspection areas of the product. Finally, the converted triangular mesh model is topologically checked to repair possible mesh defects, such as overlapping surfaces, dangling points, etc., to ensure the integrity of the data for subsequent processing. After preprocessing, the triangular mesh is subdivided using the Loop subdivision algorithm to control the uniform size of the surface units after subdivision, which is convenient for subsequent feature calculations.

[0055] Specifically, the characteristics of each surface unit after subdivision are calculated, and the normal vector direction is calculated first. Since the surface unit is a regular grid obtained based on the design model, the normal vector can be directly calculated by analytical methods. For each surface unit, a local parametric expression is established: ,

[0056] Where (u, v) is the parametric coordinate. The tangent vector of the surface can be obtained through the parametric equation , the normal vector is calculated by the cross product: . Then the curvature characteristics of the surface unit are calculated, including Gaussian curvature and mean curvature. The calculation process is based on differential geometry theory and uses the first basic form and second basic form coefficients of the surface. Based on the calculated characteristic parameters, the improved A* search algorithm is used for path planning. Among them, the A* search algorithm is one of the more popular heuristic search algorithms and is widely used in the field of path optimization[. Its uniqueness is that it introduces global information when checking each possible node in the shortest path, estimates the distance from the current node to the end point, and uses it as a measure to evaluate the possibility of the node being on the shortest path. The cost function of the algorithm takes into account the change of the surface normal vector and the curvature distribution at the same time to ensure that the generated detection path can cover all key detection areas. The camera's field of view angle limitation also needs to be considered in the planning process to ensure that each detection position is within the effective imaging range of the camera, and finally outputs a discretized path sequence containing key detection position points.

[0057] Specifically, it is necessary to establish a mapping relationship from the three-dimensional design space to the two-dimensional detection space. First, according to the actual installation position and camera parameters of the detection system, the transformation relationship from the world coordinate system to the camera coordinate system is established. Considering that the actual posture of the product during detection may deviate from the design model, it is necessary to pre-design the reference points for posture correction. Then, the detection position points in the discretized path sequence are projected and transformed to calculate their two-dimensional coordinates on the image plane. The transformation process needs to consider the influence of the camera's intrinsic parameters and lens distortion to ensure the mapping accuracy. For each detection position point, in addition to recording its two-dimensional coordinates, the corresponding normal vector and curvature features need to be converted and saved in the coordinate system. Finally, all the information is integrated to generate a detection path planning data package, which is organized in a hierarchical structure and contains complete information such as detection path, position mapping, geometric features, etc., providing data support for the subsequent design of light source switching strategy.

[0058] 102. Establish a reflection model of the product to be inspected according to the inspection path planning data packet, and perform illumination coverage analysis and timing planning on the product to be inspected according to the reflection model to obtain a light source switching strategy sequence;

[0059] In one embodiment of the present invention, the reflection model of the inspected product is established according to the detection path planning data packet, and the illumination coverage analysis and timing planning are performed on the inspected product according to the reflection model to obtain a light source switching strategy sequence, including: establishing an optical characteristic model of the inspected product according to the normal vector information and curvature characteristics in the detection path planning data packet, and calculating the reflection path of the incident light of the multi-angle LED detection light source according to the optical characteristic model to obtain the reflection model; performing illumination coverage analysis on the reflection model to obtain the light source number of the effective lighting LED light source corresponding to the inspected product and the illumination parameters corresponding to the effective lighting LED light source; grouping the effective lighting LED light sources according to the light source numbers and the corresponding illumination parameters to obtain a light source combination scheme corresponding to the detection position point; and performing timing scheduling on the light source combination scheme according to the plane mapping data in the detection path planning data packet to obtain a light source switching strategy sequence.

[0060] Specifically, first, the optical property model of the inspected product is established based on the normal vector information and curvature characteristics in the inspection path planning data package. Based on the normal vector direction of each inspection position point in the inspection path planning data package, a local coordinate system is established, in which the z-axis direction is consistent with the normal vector. In this local coordinate system, the direction of the incident light can be expressed by the zenith angle θi and the azimuth angle φi, and the direction of the reflected light can be expressed by the zenith angle θr and the azimuth angle φr. According to the local curvature characteristics, the surface reflection characteristics are divided into two parts: diffuse reflection and specular reflection. The diffuse reflection part follows the Lambert cosine law, while the specular reflection part is described by the modified Phong model. The synthetic bidirectional reflectance distribution function (BRDF) expression is:

[0061] ;

[0062] in is the diffuse reflectance, is the specular reflection coefficient, n is the surface normal vector, h is the half-angle vector between the incident light and the viewing direction, is an index parameter related to surface roughness. The reflection parameters are adjusted by the local curvature value. Areas with larger curvature tend to produce more dispersed reflections. For each detection position point, a reflection characteristic description matrix is ​​established, and the matrix elements represent the reflection intensity at different incident angles and observation angles. For areas with large changes in curvature, the density of sampling angles needs to be increased to more accurately describe the changes in reflection characteristics. At the same time, the optical properties of the material are considered, including the refractive index and absorption coefficient of the surface. These parameters will affect the intensity distribution of the reflected light. By analyzing the optical properties of all detection positions, a complete reflection model database is constructed, which contains the reflection characteristic description of each key position on the product surface.

[0063] Specifically, the reflection model is analyzed for illumination coverage. This process needs to comprehensively consider the spatial distribution and luminous characteristics of the LED light source. For each LED light source in the detection system, its spatial radiation model is first established. The radiation intensity distribution of the LED light source can usually be described by a cosine function. Based on this model, the actual illumination effect of each LED light source on the detection position point is calculated. The distance attenuation from the light source to the detection point and the influence of the incident angle on the effective illumination intensity need to be considered in the calculation process. The minimum illumination intensity threshold Ith is set, and the light source with an illumination intensity exceeding the threshold is marked as an effective illumination light source. For each effective illumination light source, its operating parameters, including the light source power and the illumination angle, are determined by optimization calculation. The optimization goal is to minimize the saturation area of ​​the reflected light while ensuring sufficient illumination intensity. For each detection position point, a set of numbered lists of effective illumination light sources and the optimal operating parameters of each light source are finally obtained. These parameters include the power level, illumination angle, and duration of the light source. During the analysis process, the interference effect of adjacent light sources also needs to be evaluated to ensure that there is no overexposure when multiple light sources work at the same time. For special detection areas, such as deep grooves or highly reflective surfaces, special adjustments to the illumination parameters are required to ensure effective detection effects.

[0064] Specifically, grouping is performed according to the light source number and the corresponding lighting parameters. This process needs to consider the continuity of the detection path and the similarity of the lighting requirements. First, cluster analysis is performed on the location points on the detection path, and adjacent location points with similar lighting requirements are grouped together. The clustering process uses an improved K-means algorithm. The clustering features include the spatial coordinates of the location points, the direction of the normal vector, the required light intensity and angle, etc. For each cluster group, the lighting requirements of all location points in the group are comprehensively analyzed to determine the optimal light source combination of the group. When determining the light source combination, it is necessary to meet the minimum lighting requirements of all location points in the group, while considering the economic principle of light source switching. When the light source requirements of adjacent groups are quite different, a transition area needs to be set between the groups to achieve a smooth transition by gradually adjusting the light source parameters. For each light source combination, in addition to determining the specific working parameters, it is also necessary to consider the opening order and timing relationship of the light sources in the group. The grouping result finally forms a hierarchical light source combination scheme, which includes the light source combination corresponding to each detection area and detailed working parameters. This scheme not only guarantees the detection requirements, but also takes into account the feasibility of actual operation.

[0065] Specifically, the light source combination scheme is time-sequenced according to the plane mapping data in the detection path planning data package. The timing arrangement first needs to establish a time reference system to map the plane coordinates of the detection position point to the time axis. This mapping relationship depends on the motion characteristics of the detection system and the image acquisition frequency. Based on this time frame, a specific execution time window is allocated to each light source combination. The division of the time window needs to consider multiple factors: first, the response characteristics of the LED light source, including the startup time and stabilization time; second, the parameters of the image acquisition system, including the exposure time and image readout time; and finally, the time requirement for data processing. After determining the basic timing, further optimization is required. The optimization process takes into account the smoothness requirements of light source switching, and sets appropriate transition time between adjacent light source combinations to avoid sudden changes in light intensity. At the same time, the timing arrangement also needs to consider the real-time requirements of the system to ensure that light source switching does not become a bottleneck in the detection process. For some special cases, such as dynamic changes in detection speed, the timing arrangement also needs to have adaptive capabilities and be able to dynamically adjust the switching timing of the light source according to actual conditions. The final generated light source switching strategy sequence is a complete timing control scheme that specifies the working timing of each light source in detail, including the start time, parameter adjustment time, and shutdown time.

[0066] Furthermore, the light source combination scheme is time-sequentially processed according to the plane mapping data in the detection path planning data packet to obtain a light source switching strategy sequence, including: adjacent area division processing is performed on the detection position points in the plane mapping data to obtain a set of boundary points of adjacent detection areas; segmentation processing is performed on the light source combination scheme according to the boundary point set to obtain a light source switching trigger position corresponding to each detection area; time parameter calculation is performed on the light source switching trigger position to obtain a switching time interval between adjacent light sources; and time-sequential processing is performed on the light source combination scheme according to the light source switching trigger position and the switching time interval to obtain a light source switching strategy sequence.

[0067] Specifically, when performing adjacent region division processing on the detection position points in the plane mapping data, it is first necessary to analyze the distribution characteristics of the detection position points on the two-dimensional plane. , calculate its spatial relationship with surrounding points and construct a distance matrix. Based on the distance matrix, the region growing algorithm is used to divide the region and set the distance threshold As a constraint condition for region growing. During the region growing process, it is also necessary to consider the similarity of the light source combination corresponding to the detection position point and define the light source combination similarity function:

[0068] ;

[0069] in and Respectively represent the light source combinations corresponding to position points i and j. And the light source combination similarity is greater than the threshold , these two points are divided into the same area. In this way, all detection position points are divided into multiple continuous detection areas, and the boundary point set between adjacent detection areas is obtained. The edge tracking algorithm is used to extract the boundary points to ensure the continuity and integrity of the boundary. The final boundary point set B={b1,b2,...,bn} is obtained, and each boundary point contains the location coordinates and the information of the area to which it belongs.

[0070] Specifically, when segmenting the light source combination scheme according to the boundary point set, the actual motion characteristics of the detection system need to be considered. First, the boundary point set is projected onto the detection path to obtain a series of segmentation points. For each segmentation point, its precise position coordinates and corresponding motion parameters on the detection path are calculated. Considering the acceleration and deceleration characteristics of the detection system, the acceleration function a(t) and the velocity function t are defined at each segmentation point. ,in is the initial speed. According to the motion characteristics, the buffer distance before and after each segmentation point is determined. This buffer distance is used to ensure that there is enough adjustment time when the light source is switched. Based on the position and motion parameters of the segmentation points, combined with the difference in light source combinations in adjacent areas, the actual light source switching trigger position of each detection area is calculated. The selection of the trigger position needs to consider the response characteristics of the light source and the beat requirements of image acquisition to ensure that there is enough time to complete the light source switching and image acquisition at the trigger position. In order to deal with special situations at the boundary, a transition interval is set near the trigger position to achieve smooth switching of the light source combination. Finally, a complete sequence of light source switching trigger positions of all detection areas is obtained.

[0071] Specifically, when calculating the time parameters of the light source switching trigger position, the mapping relationship between the detection position and time is first established. Based on the motion equation of the detection system , calculate the time point corresponding to each trigger position . Consider the inherent characteristics of the light source, including start-up time , Stabilization time and turn-off time For the switching of adjacent light source groups, the calculation of the time interval needs to satisfy ;

[0072] Ensure that the next group of light sources has reached a stable state after the previous group of light sources is completely turned off. Also consider the parameters of the image acquisition system, including exposure time and image processing time , and integrate these time parameters into the switching timing. By solving the time constraint equations, the optimal switching time interval between each pair of adjacent light source groups is obtained. These time intervals must satisfy the hardware constraints and ensure detection efficiency.

[0073] Specifically, the light source combination scheme is finally timed according to the light source switching trigger position and switching time interval. The time sequence arrangement first constructs a global time axis and maps all trigger positions to the time axis. For each time point , define the state transfer function , describes the transition process of the system from the current state to the target state. State transition includes the light source start sequence, parameter adjustment and shutdown operation. For each light source combination, its working cycle is planned in detail, including the warm-up phase, stable working phase and shutdown phase. At the junction of adjacent light source groups, a gradual transition strategy is designed to avoid sudden changes in light intensity. This transition strategy is implemented through parameter interpolation. For the light parameter p(t) at time t, a linear interpolation method is used:

[0074] ;

[0075] Where p1 and p2 are the parameter values ​​of adjacent light source groups. After the timing arrangement is completed, a sequence containing a complete switching strategy is generated, which describes in detail the working state and switching timing of each light source during the entire detection process.

[0076] 103. Obtain a system delay parameter of a light source system including a multi-angle LED detection light source, and compensate a light source switching strategy sequence according to the system delay parameter;

[0077] In one embodiment of the present invention, the method of obtaining the system delay parameters of a light source system including a multi-angle LED detection light source and compensating the light source switching strategy sequence according to the system delay parameters includes: performing a single light source response test on the LED detection light source at each angle of the light source system to obtain the response time of the LED detection light source at each angle; performing a multi-light source switching test on the light source system to obtain the switching delay time between adjacent light sources; performing a comprehensive analysis and processing on the response time and the switching delay time to obtain the system delay parameters of the light source system; and compensating for the switching time interval in the light source switching strategy sequence according to the system delay parameters.

[0078] Specifically, a single light source response test is performed on each angle LED detection light source in the light source system. During the test, a high-speed photodetector is used to collect the transient response of the light source, and the sampling frequency is set to 1MHz to ensure the capture of transient characteristics. A standard square wave drive signal v(t) is applied to each LED light source, and the rise time and fall time of the drive signal are controlled within 1μs. The output light intensity signal i(t) of the light source is recorded by the photodetector to obtain the step response curve of the light source. The measured data is mathematically modeled, and the response process of the light source conforms to the second-order system model:

[0079] ;

[0080] ,in is the main time constant, is the sub-time constant, A is the steady-state gain, and B is the overshoot coefficient. The characteristic parameters of each light source are obtained by curve fitting, and the response time of the light source is defined as the time required for the output to reach 90% of the steady-state value. During the test, each LED light source is measured 100 times at different driving current amplitudes to eliminate the influence of random errors. For each set of measurement data, its statistical distribution characteristics are calculated, including the mean, standard deviation, and maximum deviation. In addition, it is necessary to record the response characteristics of each light source under different temperature conditions and establish a relationship model between temperature and response time. The final response time data set contains the complete time parameters of each angle LED detection light source under various working conditions.

[0081] Specifically, when performing a multi-light source switching test on a light source system, a comprehensive test plan is first designed. Using the orthogonal experimental method, an L16 (45) orthogonal table is designed to perform system tests on different light source combinations, different switching timings, and different driving parameters. In each set of tests, adjacent LED light sources are turned on and off in sequence according to a preset time interval, and the real-time output waveforms of all light sources are recorded at the same time. The test process uses a multi-channel data acquisition system to synchronously collect drive signals and light intensity signals. For a system with N light sources, the output waveform y(t) can be expressed as a linear superposition of the responses of each light source: ;

[0082] in is the impulse response function of a single light source, is the control signal, is the time delay. Based on the collected waveform data, the characteristic parameters of each switching process are extracted by wavelet analysis method, including rise delay, fall delay and stabilization time. The test also needs to evaluate the electromagnetic interference and thermal coupling effects between light sources, and record the transient response characteristics and temperature changes of the system power supply. Each group of tests is repeated 50 times to obtain the switching delay characteristics in a statistical sense. In order to comprehensively evaluate the dynamic characteristics of the multi-light source system, the test plan also includes switching tests under different combinations, including sequential switching, staggered switching and simultaneous switching modes. For each switching mode, different brightness levels and switching time intervals need to be tested to obtain the delay characteristics of the system under various working conditions. In addition, the influence of environmental factors needs to be considered, and tests should be carried out at different ambient temperatures to establish a relationship model between temperature and switching delay. By establishing a multi-dimensional test database, complete experimental data support is provided for subsequent system delay parameter analysis.

[0083] Specifically, the response time and switching delay time data are comprehensively analyzed and processed to obtain accurate system delay parameters. First, the state space model of the light source system is established, and the system state equation is:

[0084] ;

[0085] ;

[0086] in is the system state vector, is the control input vector. The parameter matrices A, B, C, and D are determined by the system identification algorithm. The model needs to reflect both the single light source characteristics and the multi-light source coupling effect. On this basis, the frequency response characteristics of the system are calculated, including the amplitude-frequency characteristics | and phase-frequency characteristics φ(ω), and calculate the group delay . All test data are statistically processed, and the multivariate analysis method is used to study the correlation between the influencing factors. The Bootstrap method is used to estimate the confidence interval and determine the reliable range of the system delay parameters. Based on the large amount of measured data, a multi-layer neural network model is established. The input layer contains variables such as light source number, driving parameters, ambient temperature, etc., and the output layer is the corresponding system delay parameters. The network is trained by the back propagation algorithm so that it can accurately predict the system delay under different working conditions. In addition, it is necessary to analyze the nonlinear characteristics of the system, including hysteresis effect, saturation effect, etc., and incorporate these factors into the calculation of the delay parameters. The main factors affecting the system delay are extracted through the principal component analysis method, and a weight model of the influencing factors is established. The final system delay parameters not only include the characteristics of the time dimension, but also include the parameter mapping relationship related to the working conditions.

[0087] Specifically, the light source switching strategy sequence is compensated according to the system delay parameters. The compensation process adopts a feedforward-feedback compensation structure. The feedforward part performs basic compensation based on the system model, and the feedback part performs fine-tuning through real-time measurement. For the original switching sequence t(k), the compensated time series satisfies: , the compensation amount Δt(k) is obtained by solving the optimization problem: , is the system tracking error. The compensation algorithm adopts the rolling time domain optimization method to ensure the local response characteristics while ensuring the global optimum. The actual trigger time of each switching point is corrected to ensure that the inherent delay of the system and the influence of environmental factors are taken into account. The compensation result needs to meet the detection beat requirements, and at the same time ensure that the minimum time interval between adjacent light source groups is not less than 3 times the system characteristic time. The compensation strategy also needs to consider the change law of the delay parameters under different working conditions, and dynamically adjust the compensation amount according to the real-time monitored parameters such as temperature and drive current. In order to ensure the accuracy of compensation, the system also needs to establish a real-time correction mechanism when performing compensation, detect the actual switching delay through the photoelectric feedback signal, and compare it with the expected value. When there is a significant difference between the actual delay detected and the expected delay, the adaptive correction algorithm is triggered to dynamically update the compensation parameters. This adaptive mechanism can effectively compensate for the delay parameter drift caused by factors such as system aging and environmental changes. For multiple light source groups in the continuous switching process, the compensation algorithm also needs to consider the mutual influence between groups, and predict and eliminate the crosstalk effect in the switching process by establishing a state transition model for the switching of light source groups. The final generated compensation sequence not only contains the precise triggering moment of each light source, but also includes complete parameter setting information and correction strategy.

[0088] 104. When the inspected product is inspected, the multi-angle LED inspection light source of the light source system is switched through the compensated light source switching strategy sequence, and the light source switching strategy sequence is adjusted in real time according to the inspection result of the inspected product.

[0089] In one embodiment of the present invention, when the inspected product is inspected, the multi-angle LED detection light source of the light source system is switched through the compensated light source switching strategy sequence, and the light source switching strategy sequence is adjusted in real time according to the inspection result of the inspected product, including: when the inspected product is inspected, the multi-angle LED detection light source of the light source system is switched through the compensated light source switching strategy sequence, and the inspection result of the inspected product is obtained; defect characteristic analysis is performed according to the inspection result to obtain the spatial distribution characteristics and surface characteristic parameters of the defects of the inspected product, and the optimal illumination angle for defect detection is calculated according to the spatial distribution characteristics and surface characteristic parameters of the defects; light source matching is performed on the optimal illumination angle to obtain the optimal light source combination corresponding to the optimal illumination angle, and the light source switching strategy sequence is adjusted in real time according to the optimal light source combination.

[0090] Specifically, when the product under test is tested, the specific implementation process of strictly implementing the compensated light source switching strategy sequence is as follows: the entire execution process is uniformly scheduled by a real-time control system, and the controller sends control signals to each LED light source through a high-speed digital I / O interface. The data structure of the control signal contains three key parts: light source identification ID, trigger timestamp and parameter array. The light source identification uses 16-bit encoding to support simultaneous control of up to 65,536 LED light sources; the trigger timestamp uses a 64-bit counter with a time resolution of 100ns; the parameter array contains detailed parameters such as the working current, pulse width and repetition frequency of the light source. These parameters have been compensated for system delays, and the compensation values ​​are read from a pre-calibrated lookup table. During the light source switching process, the real-time monitoring system synchronously collects the current and light intensity signals of each LED light source through a high-speed data acquisition card, with a sampling frequency set to 50kHz and a sampling accuracy of 16 bits. The current signal is collected by a Hall sensor with a measurement range of 0-10A and an accuracy of 0.1%; the light intensity signal is detected by a photomultiplier tube with a response time of less than 1μs. At the same time, a high-speed industrial camera is used to collect the image sequence of the inspected product. The camera uses the CameraLink interface, and the data transmission rate reaches 850MB / s. The exposure timing of the camera is strictly synchronized with the light source switching through a dedicated synchronization controller, and the jitter of the synchronization signal is less than 500ns. The image acquisition resolution is set to 4096×3072 pixels, and the grayscale resolution is 14bit to ensure the capture quality of image details. For each light source combination, the system will record complete status data, including: precise trigger time, actual response waveform of the light source, ambient temperature changes, image acquisition parameters, etc. These data are first stored in the industrial computer memory through high-speed cache, and written to the solid-state hard disk in batches every 100ms to form a complete detection record. The industrial computer uses a real-time operating system, and the interrupt response time is less than 10μs, ensuring the real-time and continuity of data acquisition.

[0091] When defect feature analysis is performed based on the acquired inspection results, the collected original image is first imported into the image processing unit. The preprocessing stage includes: dark field correction, denoising and image enhancement. Dark field correction uses the average value of 128 frames of dark field images as the benchmark; denoising uses an adaptive median filter, and the window size is dynamically adjusted according to the local noise intensity, ranging from 3×3 to 7×7; image enhancement uses an adaptive histogram equalization method, with a processing window of 256×256 pixels and an overlap rate of 50%. Image segmentation uses the improved OTSU algorithm, introduces the local variance weight factor, and the threshold calculation formula is:

[0092] ;

[0093] Where μ is the average grayscale of the image, σ is the standard deviation, k is the basic adjustment coefficient, and λ is the local weight coefficient. is the local variance. The segmented image is subjected to connected region analysis to extract the features of each suspected defect area. A three-layer feature system is designed for the feature extraction system: the first layer is the basic geometric features, including area, perimeter, roundness, etc.; the second layer is the statistical texture features, including the energy, contrast, correlation and other parameters of the grayscale co-occurrence matrix; the third layer is the local structural features, and the Gabor filter group is used to extract multi-scale and multi-directional texture information. A 512-dimensional feature vector is finally generated for each defect area. The spatial distribution analysis of all detected defects is performed using the density clustering algorithm DBSCAN, with the following parameter settings: neighborhood radius ε=5mm, minimum number of points MinPts=3. The spatial distribution characteristics of the defects are obtained through clustering results, including defect density map, directional analysis, regional aggregation and other information. The surface characteristic parameters are obtained by analyzing the reflection characteristics of the defects under different illumination angles, and a mathematical model is established: R(θ, ) = Rs(θ, ) + Rd(θ, ), where Rs represents the specular reflection component, Rd represents the diffuse reflection component, and the model parameters are obtained by fitting the experimental data using the least squares method.

[0094] Specifically, based on the spatial distribution characteristics and surface characteristic parameters of defects, a multi-objective optimization algorithm is used to calculate the optimal illumination angle for defect detection. The optimization objective function design includes three sub-objectives: maximizing the probability of defect detection, optimizing the uniformity of illumination, and minimizing the energy consumption of the system. The objective function expression is:

[0095] ;

[0096] in represents the probability of defect detection, Indicates the uniformity of illumination. represents the energy consumption of the system, and w1, w2, and w3 are weight coefficients. Constraints include: light source angle range limit θ∈[0°,75°], φ∈[0°,360°]; light source power limit Pmax≤200W; minimum illumination requirement Emin≥1000lux. The solution process adopts an improved multi-objective particle swarm algorithm, with the population size set to 100 and the maximum number of iterations set to 1000. Each particle contains information about the illumination angle and light source parameters, with a total of 4×N dimensions, where N is the number of light sources. The particle speed update adopts an adaptive inertia weight strategy: w = wmax -(wmax-wmin)·(t / T)^α, where wmax=0.9, wmin=0.4, and α is a nonlinear factor. The learning factors c1 and c2 adopt a time-varying strategy: c1 = 2.5-2t / T, c2 = 0.5+2t / T, to enhance the global convergence ability in the later stage. In order to avoid falling into the local optimum, a chaotic perturbation mechanism is introduced. When the fitness value changes by less than 0.1% for 50 consecutive generations, the global optimal position is perturbed by chaotic mapping. The algorithm convergence criterion adopts the comprehensive index of stability and distribution uniformity of the dominant solution set. Finally, a set of Pareto optimal solutions is obtained, and the best compromise solution is selected as the final illumination angle solution through the fuzzy decision method.

[0097] Finally, the calculated optimal illumination angle is matched with light sources and parameter updates are performed. The light source matching process first establishes the spatial coordinate system of the actual light source layout, and the position and direction of each LED light source are accurately calibrated. The least squares optimization method is used to map the theoretical optimal illumination angle to the actual light source, and the objective function is:

[0098] ;

[0099] in is the light intensity of the i-th light source, is the angle between the light source and the target direction, is the target light intensity. The augmented Lagrangian method is used for optimization solution. The power balance constraint of the light source is introduced in the iteration process to avoid overloading of individual light sources. For each lighting area, the optimal light source combination is determined according to the optimization results, including the configuration of the main light source and the auxiliary light source. The parameter update of the light source combination adopts a progressive strategy, decomposing the parameter change △P into n small steps, and the update amount of each step is △P / n. The value of n is determined by the amplitude of the parameter change, generally between 10-20. During the parameter update process, the lighting effect is monitored in real time, and the lighting stability is ensured by feedback control. The controller adopts an incremental PID algorithm with a control cycle of 2ms, a proportional coefficient Kp=0.8, an integral time Ti=0.1s, and a differential time Td=0.02s. The updated light source switching strategy sequence is verified by online simulation to ensure that the timing constraints and energy constraints are met. The execution time of the entire update process is controlled within 50ms, meeting the real-time requirements. All parameter update records are stored in the SQLite database with timestamps and operator information, which is convenient for subsequent system maintenance and optimization analysis.

[0100] Furthermore, the method of calculating the optimal illumination angle for defect detection based on the spatial distribution characteristics and surface characteristic parameters of the defects includes: performing cluster analysis on the spatial distribution characteristics of the defects to obtain a spatial position distribution map of the main defect areas of the inspected product; establishing a surface optical characteristic model of the main defect areas based on the spatial position distribution map and the surface characteristic parameters, and performing reflection path calculation on the surface optical characteristic model to obtain light reflection intensity data at different incident angles; performing multi-angle illumination analysis on the light reflection intensity data to obtain imaging contrast parameters of the defects at each incident angle, and performing multi-objective optimization calculation on the imaging contrast parameters to obtain the optimal illumination angle for defect detection.

[0101] Specifically, when clustering the spatial distribution characteristics of defects, it is necessary to first preprocess the defect location data obtained by detection. The preprocessing process includes coordinate system conversion and data normalization. The defect position is converted from the image coordinate system to the actual physical coordinate system of the product surface. The conversion matrix is ​​determined according to the camera calibration parameters. For each defect point Pi (xi, yi, zi), the distance matrix D between it and all other defect points is calculated, and the distance calculation uses the Euclidean distance formula. The cluster analysis uses the improved DBSCAN algorithm. The two key parameters of the algorithm are: neighborhood radius ε and minimum sample number MinPts. The neighborhood radius ε is determined by the K-distance graph method. The K nearest neighbor distances of all points are sorted, and the value of the inflection point position of the distance curve is selected; MinPts is calculated by the empirical formula: MinPts = ln(n), where n is the total number of defect points. In order to handle defects in different density areas, the algorithm uses an adaptive density threshold:

[0102] ;

[0103] in is the average density, is the density standard deviation, and β is the adjustment coefficient. During the clustering process, the morphological characteristics of each category are recorded simultaneously, including the centroid position, main axis direction, and distribution range. The final generated spatial position distribution map contains complete information such as the location, range, and density of the defect area, providing basic data for subsequent optical property analysis.

[0104] Specifically, when establishing the surface optical characteristic model of the defect area based on the spatial position distribution map and surface characteristic parameters, it is necessary to comprehensively consider the intrinsic optical properties of the material and the local changes caused by the defects. First, a basic surface reflection model is constructed, and the improved Cook-Torrance model is used to describe it:

[0105] ;

[0106] in is the incident light direction, v is the observation direction, and are diffuse and specular reflection coefficients, respectively, and They are the distribution functions of diffuse reflection and specular reflection components respectively. For the diffuse reflection component, the influence of surface roughness is considered:

[0107] ;

[0108] Where ρ is the intrinsic reflectivity of the material, is the surface roughness parameter. The specular reflection component adopts the microfacet theory, introducing the normal distribution function D(h) and the geometric attenuation factor Based on this model, the local optical characteristics of each major defect area are analyzed to calculate the reflected light intensity distribution at different incident angles. The reflection path calculation uses the Monte Carlo ray tracing method, and the number of tracing rays is set to 10. 6 , each ray records its complete propagation path and energy attenuation process. Through the statistical results of a large number of rays, the reflection intensity data at each incident angle is obtained, and the data format is a four-dimensional array , respectively represent the incident zenith angle, incident azimuth angle, reflection zenith angle and reflection azimuth angle.

[0109] Specifically, finally, multi-angle illumination analysis and optimization calculation are performed on the light reflection intensity data. The analysis process first determines the evaluation index system, including three main indicators: imaging contrast, illumination uniformity, and system complexity. For each incident angle , calculate the corresponding imaging contrast parameter ,in and are the maximum and minimum reflection intensities in the region of interest, respectively. In order to comprehensively evaluate the lighting effects at different angles, a multi-objective optimization model was established. The improved NSGA-II algorithm was used for optimization, with the population size set to 200 and the number of iterations set to 1000. Real number coding was used for individual coding, simulated binary crossover was used for crossover operation, and polynomial mutation was used for mutation. In the iterative process, adaptive crossover and mutation probabilities were introduced to enhance the search capability of the algorithm. When evaluating individual fitness, the non-dominated sorting and crowding calculation methods based on the Pareto dominance relationship were used. Finally, from the Pareto optimal solution set, the best compromise solution was selected as the optimal illumination angle solution through the fuzzy hierarchical analysis method. This solution not only ensures a high defect detection effect, but also takes into account the feasibility of system implementation.

[0110] In this embodiment, by acquiring the three-dimensional model data of the product to be inspected, and performing surface feature extraction and inspection path planning, a detection path planning data packet containing plane mapping data, normal vector information and curvature features is generated. According to the data packet, a reflection model of the product to be inspected is established, and a light source switching strategy is generated. In the method, the system delay parameters of the light source system including the multi-angle LED detection light source are obtained, and the light source switching strategy is compensated. During detection, the light source system is switched according to the compensated light source switching strategy, and the switching strategy is adjusted in real time according to the detection results. Based on the three-dimensional model and related features of the product to be inspected, the present invention performs effective light source switching strategy planning, improves the switching efficiency and accuracy of the multi-angle LED detection light source, and ensures high-quality optical detection in complex environments.

[0111] The above describes the multi-angle LED detection light source switching method in the embodiment of the present invention. The following describes the multi-angle LED detection light source switching device in the embodiment of the present invention. Figure 2 , an embodiment of a multi-angle LED detection light source switching device in an embodiment of the present invention includes:

[0112] The model processing module 201 is used to obtain the three-dimensional model data of the product to be inspected, and perform surface feature extraction and inspection path planning processing on the three-dimensional model data to obtain an inspection path planning data packet, wherein the inspection path planning data packet includes plane mapping data, normal vector information and curvature features;

[0113] A switching strategy generation module 202 is used to establish a reflection model of the detected product according to the detection path planning data packet, and perform light coverage analysis and timing planning on the detected product according to the reflection model to obtain a light source switching strategy sequence;

[0114] A compensation module 203, used to obtain a system delay parameter of a light source system including a multi-angle LED detection light source, and compensate the light source switching strategy sequence according to the system delay parameter;

[0115] The switching adjustment module 204 is used to switch the multi-angle LED detection light source of the light source system through the compensated light source switching strategy sequence when the detected product is being detected, and to adjust the light source switching strategy sequence in real time according to the detection result of the detected product.

[0116] In an embodiment of the present invention, the multi-angle LED detection light source switching device runs the above-mentioned multi-angle LED detection light source switching method, and the multi-angle LED detection light source switching device obtains the three-dimensional model data of the detected product, and performs surface feature extraction and detection path planning, and generates a detection path planning data packet containing plane mapping data, normal vector information and curvature features. According to the data packet, a reflection model of the detected product is established, and a light source switching strategy is generated. In the method, the system delay parameters of the light source system including the multi-angle LED detection light source are obtained, and the light source switching strategy is compensated. During detection, the light source system is switched according to the compensated light source switching strategy, and the switching strategy is adjusted in real time according to the detection results. Based on the three-dimensional model and related features of the detected product, the present invention performs effective light source switching strategy planning, improves the switching efficiency and accuracy of the multi-angle LED detection light source, and ensures high-quality optical detection in complex environments.

[0117] Figure 2 The multi-angle LED detection light source switching device in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The multi-angle LED detection light source switching device in the embodiment of the present invention is described in detail from the perspective of hardware processing.

[0118] Figure 33 is a schematic diagram of the structure of a multi-angle LED detection light source switching device provided by an embodiment of the present invention. The multi-angle LED detection light source switching device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage device terminals) storing application programs 333 or data 332. Among them, the memory 320 and the storage medium 330 can be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the multi-angle LED detection light source switching device 300. Furthermore, the processor 310 can be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the multi-angle LED detection light source switching device 300 to implement the steps of the multi-angle LED detection light source switching method.

[0119] The multi-angle LED detection light source switching device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that Figure 3 The structure of the multi-angle LED detection light source switching device shown does not constitute a limitation on the multi-angle LED detection light source switching device provided by the present invention, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0120] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the multi-angle LED detection light source switching method.

[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0123] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-angle LED detection light source switching method, characterized in that: The multi-angle LED detection light source switching method comprises: Acquire the three-dimensional model data of the product to be inspected, and perform surface feature extraction and inspection path planning processing on the three-dimensional model data to obtain an inspection path planning data packet, wherein the inspection path planning data packet includes plane mapping data, normal vector information and curvature features; Acquire the three-dimensional model data of the product to be inspected, and perform surface feature extraction and inspection path planning processing on the three-dimensional model data to obtain an inspection path planning data packet including: acquire the three-dimensional model data of the product to be inspected, and perform surface subdivision processing on the three-dimensional model data to obtain a plurality of surface units; perform feature calculation on the surface units to obtain the normal vector direction and curvature features of each surface unit, and perform path planning processing on each of the surface units to obtain a discretized path sequence containing inspection position points; perform three-dimensional to two-dimensional coordinate mapping processing on the inspection position points in the discretized path sequence to obtain plane mapping data, and generate an inspection path planning data packet according to the plane mapping data, normal vector information and curvature features of each surface unit; A reflection model of the detected product is established according to the detection path planning data packet, and a light coverage analysis and timing planning are performed on the detected product according to the reflection model to obtain a light source switching strategy sequence; the method of establishing a reflection model of the detected product according to the detection path planning data packet, and a light coverage analysis and timing planning are performed on the detected product according to the reflection model to obtain a light source switching strategy sequence includes: establishing an optical characteristic model of the detected product according to the normal vector information and curvature characteristics in the detection path planning data packet, and calculating the reflection path of the incident light of the multi-angle LED detection light source according to the optical characteristic model to obtain the reflection model; performing light coverage analysis on the reflection model to obtain the light source number of the effective lighting LED light source corresponding to the detected product and the lighting parameters corresponding to the effective lighting LED light source; performing a light source switch on the detected product according to the light source number and the corresponding lighting parameters. The effective lighting LED light sources are grouped to obtain a light source combination scheme corresponding to the detection position point; the light source combination scheme is time-arranged according to the plane mapping data in the detection path planning data packet to obtain a light source switching strategy sequence; the light source combination scheme is time-arranged according to the plane mapping data in the detection path planning data packet to obtain a light source switching strategy sequence, including: performing adjacent area division processing on the detection position points in the plane mapping data to obtain a boundary point set of adjacent detection areas; segmenting the light source combination scheme according to the boundary point set to obtain a light source switching trigger position corresponding to each detection area; calculating the time parameter of the light source switching trigger position to obtain the switching time interval between adjacent light sources; performing time-arrangement processing on the light source combination scheme according to the light source switching trigger position and the switching time interval to obtain a light source switching strategy sequence; Acquire a system delay parameter of a light source system including a multi-angle LED detection light source, and compensate the light source switching strategy sequence according to the system delay parameter; When the detected product is being detected, the multi-angle LED detection light source of the light source system is switched through the compensated light source switching strategy sequence, and the light source switching strategy sequence is adjusted in real time according to the detection result of the detected product.

2. The multi-angle LED detection light source switching method according to claim 1, characterized in that: The obtaining of the system delay parameter of the light source system including the multi-angle LED detection light source and compensating the light source switching strategy sequence according to the system delay parameter comprises: Performing a single light source response test on the LED detection light sources at various angles of the light source system to obtain the response time of the LED detection light sources at various angles; Performing a multi-light source switching test on the light source system to obtain a switching delay time between adjacent light sources; Performing comprehensive analysis on the response time and the switching delay time to obtain a system delay parameter of the light source system; The switching time interval in the light source switching strategy sequence is compensated according to the system delay parameter.

3. The multi-angle LED detection light source switching method according to claim 1, characterized in that: When the detected product is being detected, the multi-angle LED detection light source of the light source system is switched by using the compensated light source switching strategy sequence, and the light source switching strategy sequence is adjusted in real time according to the detection result of the detected product, including: When the product under inspection is inspected, the multi-angle LED inspection light source of the light source system is switched through the compensated light source switching strategy sequence, and the inspection result of the product under inspection is obtained; Perform defect feature analysis based on the detection results to obtain spatial distribution features and surface characteristic parameters of the defects of the detected product, and calculate the optimal illumination angle for defect detection based on the spatial distribution features and surface characteristic parameters of the defects; Light source matching is performed on the optimal illumination angle to obtain an optimal light source combination corresponding to the optimal illumination angle, and the light source switching strategy sequence is adjusted in real time according to the optimal light source combination.

4. The multi-angle LED detection light source switching method according to claim 3, characterized in that: The calculating of the optimal illumination angle for defect detection according to the spatial distribution characteristics and surface characteristic parameters of the defects comprises: Performing cluster analysis on the spatial distribution characteristics of the defects to obtain a spatial position distribution map of the main defect areas of the inspected product; Establishing a surface optical characteristic model of the main defect area according to the spatial position distribution map and the surface characteristic parameters, and performing reflection path calculation on the surface optical characteristic model to obtain light reflection intensity data at different incident angles; A multi-angle illumination analysis is performed on the light reflection intensity data to obtain imaging contrast parameters of defects at various incident angles, and a multi-objective optimization calculation is performed on the imaging contrast parameters to obtain the optimal illumination angle for defect detection.

5. A multi-angle LED detection light source switching device, characterized in that: The multi-angle LED detection light source switching device comprises: A model processing module, used to obtain three-dimensional model data of the product to be inspected, and perform surface feature extraction and detection path planning processing on the three-dimensional model data to obtain a detection path planning data packet, wherein the detection path planning data packet includes plane mapping data, normal vector information and curvature features; the three-dimensional model data of the product to be inspected is obtained, and surface feature extraction and detection path planning processing on the three-dimensional model data to obtain a detection path planning data packet includes: obtaining the three-dimensional model data of the product to be inspected, and performing surface subdivision processing on the three-dimensional model data to obtain a plurality of surface units; performing feature calculation on the surface units to obtain the normal vector direction and curvature features of each surface unit, and performing path planning processing on each of the surface units to obtain a discretized path sequence containing detection position points; performing three-dimensional to two-dimensional coordinate mapping processing on the detection position points in the discretized path sequence to obtain plane mapping data, and generating a detection path planning data packet according to the plane mapping data, normal vector information and curvature features of each surface unit; A switching strategy generation module is used to establish a reflection model of the detected product according to the detection path planning data packet, and perform illumination coverage analysis and timing planning on the detected product according to the reflection model to obtain a light source switching strategy sequence; the establishment of the reflection model of the detected product according to the detection path planning data packet, and the illumination coverage analysis and timing planning on the detected product according to the reflection model to obtain a light source switching strategy sequence includes: establishing an optical characteristic model of the detected product according to the normal vector information and curvature characteristics in the detection path planning data packet, and performing reflection path calculation on the incident light of the multi-angle LED detection light source according to the optical characteristic model to obtain a reflection model; performing illumination coverage analysis on the reflection model to obtain the light source number of the effective lighting LED light source corresponding to the detected product and the illumination parameters corresponding to the effective lighting LED light source; and calculating the light source number and the corresponding illumination parameters according to the light source number and the corresponding illumination parameters. The effective lighting LED light sources are grouped to obtain a light source combination scheme corresponding to the detection position point; the light source combination scheme is time-arranged according to the plane mapping data in the detection path planning data packet to obtain a light source switching strategy sequence; the light source combination scheme is time-arranged according to the plane mapping data in the detection path planning data packet to obtain a light source switching strategy sequence, including: performing adjacent area division processing on the detection position points in the plane mapping data to obtain a boundary point set of adjacent detection areas; segmenting the light source combination scheme according to the boundary point set to obtain a light source switching trigger position corresponding to each detection area; calculating the time parameter of the light source switching trigger position to obtain the switching time interval between adjacent light sources; performing time-arrangement processing on the light source combination scheme according to the light source switching trigger position and the switching time interval to obtain a light source switching strategy sequence; A compensation module, used for obtaining a system delay parameter of a light source system including a multi-angle LED detection light source, and compensating the light source switching strategy sequence according to the system delay parameter; The switching adjustment module is used to switch the multi-angle LED detection light source of the light source system through the compensated light source switching strategy sequence when the detected product is being detected, and to adjust the light source switching strategy sequence in real time according to the detection result of the detected product.

6. A multi-angle LED detection light source switching device, characterized in that: The multi-angle LED detection light source switching device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the multi-angle LED detection light source switching device to perform the steps of the multi-angle LED detection light source switching method as described in any one of claims 1-4.

7. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the multi-angle LED detection light source switching method as described in any one of claims 1-4 are implemented.

Citation Information

Patent Citations

  • Die-casting alloy workpiece defect detection method and system based on visual identification

    CN118130477A