Surface defect detection method, device, system and medium

Through the method of combining true color line array camera with multi-partition light source, the problem of high cost and low efficiency in the prior art is solved, and the simultaneous acquisition of color information and concave and convex information is realized, the data processing process is simplified and the detection efficiency is improved.

CN120009191BActive Publication Date: 2025-08-15HEFEI I TEK OPTOELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510504664.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-08-15
Estimated Expiration
2045-04-22

AI Technical Summary

Technical Problem

The prior art requires additional detection stations and light sources when acquiring product surface color defects and shape defects at the same time, resulting in high cost and low detection efficiency.

Method used

The real color line array camera is used to combine with multi-partition light sources to control the lighting cycle of the light source and the splitting and fusion of image information, and simultaneously obtaining color information and concave and convex information.

Benefits of technology

Without adding light sources and detection stations, detection efficiency is significantly improved, cost is reduced, and data processing flow is simplified, ensuring image quality and accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120009191B_ABST
    Figure CN120009191B_ABST
Patent Text Reader

Abstract

The present invention discloses a surface defect detection method, device, system, and medium. The detection method includes: controlling each light source to light up and cycle in sequence, using a true color line array camera to shoot a moving object to be tested, so as to obtain the original image information collected by each channel of the true color line array camera; splitting the original image information collected by each channel so that the image information corresponding to the same light source is summarized in sequence, thereby obtaining sub-images corresponding to all light sources in each channel; fusing the sub-images corresponding to all light sources in each channel, calculating the average value of all image data corresponding to the same position in each sub-image in the current channel as the fused data at the corresponding position, thereby obtaining color information of the surface of the object to be tested; extracting the sub-images corresponding to all light sources in any channel, and calculating a photometric stereogram based on the angular information of each light source to obtain concave-convex information. The present invention can improve detection efficiency while reducing costs, and realizes the simultaneous acquisition of color information and concave-convex information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of 2.5D defect detection, and in particular relates to a surface defect detection method, device, system and medium. Background Art

[0002] In recent years, photometric stereo technology has made significant progress in defect detection. Using multi-angle lighting and computational imaging to generate surface concavity and convexity information, it is widely used in surface defect detection scenarios. However, traditional photometric stereo imaging systems use black and white cameras and are unable to capture color defects on product surfaces. When both color and shape defects exist on the surface of the object being tested, additional inspection stations are required, which is costly.

[0003] In order to reduce costs and achieve the simultaneous acquisition of color information and convex and concave information, a common solution is to add additional R, G, and B light sources on the basis of the photometric stereo multi-partition light source, and use a black and white camera to capture three images under the R, G, and B light sources for color image synthesis. This can also achieve the acquisition of color information, but due to the increase in the number of light sources, the detection efficiency will be significantly reduced.

[0004] Therefore, in order to reduce costs and simply and efficiently realize the simultaneous generation of surface color information and concave-convex information of an object to be tested, the present invention provides a surface defect detection method, device, system and medium. Summary of the Invention

[0005] The purpose of the present invention is to overcome the above problems existing in the prior art and provide a surface defect detection method, device, system and medium, which adopts a true color line array camera with a multi-zone light source and combines the average fusion of images to realize the simultaneous generation of surface color information and concave-convex information.

[0006] In order to achieve the above technical objectives and the above technical effects, the present invention is implemented through the following technical solutions:

[0007] A surface defect detection method collects image information formed on the surface of an object to be tested by light sources at at least three different angles to simultaneously obtain color information and concave-convex information of the surface of the object to be tested. The detection method includes:

[0008] Control each light source to light up and cycle in sequence, and use a true color line array camera to shoot the moving object to be tested to obtain the original image information collected by each channel of the true color line array camera;

[0009] Split the original image information collected by each channel so that the image information corresponding to the same light source can be summarized in order, thereby obtaining the sub-images corresponding to all light sources under each channel;

[0010] Fuse the sub-images corresponding to all light sources under each channel, calculate the average value of all image data corresponding to the same position of each sub-image under the current channel, and use it as the fusion data of the corresponding position to obtain the color information of the surface of the object to be measured;

[0011] The sub-images corresponding to all light sources under any channel are extracted, and the photometric stereogram is calculated based on the angular information of each light source to obtain the concave-convex information of the surface of the object to be measured.

[0012] Furthermore, before photographing the moving object to be measured using the true color line array camera, each light source is calibrated using a calibration sphere to obtain angle information of each light source.

[0013] Furthermore, calibrating each light source includes:

[0014] Control the true color line array camera to shoot the moving calibration sphere to obtain the calibration sphere image information collected by each channel of the true color line array camera;

[0015] Split the calibration sphere image information collected by any channel so that the calibration sphere image information corresponding to the same light source can be summarized in sequence, thereby obtaining the sub-images corresponding to all light sources under the current channel;

[0016] Extract the sub-images corresponding to all light sources in the current channel and calculate the angle information of each light source to complete the calibration of each light source.

[0017] Furthermore, the line frequency of the true color line array camera and the moving speed of the object to be measured satisfy the following relationship: Where f is the line frequency of the true color line array camera, V is the moving speed of the object to be measured, M is the magnification, N is the number of light sources, and P is the pixel size.

[0018] Furthermore, the starting end of the original image information corresponds to the data collected by the first pixel row when the last pixel row of the true-color line array camera is first collected, and the ending end of the original image information corresponds to the last data collected by the last pixel row of the true-color line array camera, wherein the first pixel row is the pixel row that first collects image data, and the last pixel row is the pixel row that last collects image data.

[0019] Furthermore, the starting end is determined by discarding invalid data at the beginning of each channel, and the ending end is determined by discarding invalid data at the end of each channel;

[0020] in,

[0021] The initial invalid data satisfies the formula: D1=(a+1)(k-1);

[0022] End invalid data to satisfy the formula: D2=(a+1)(nk);

[0023] D1 is the number of rows of data corresponding to the starting invalid data, D2 is the number of rows of data corresponding to the ending invalid data, a is the ratio of the pixel pitch to the pixel width of the true color line array camera, n is the total number of pixel rows of the true color line array camera, and k is the sequence number of the current pixel row of the true color line array camera.

[0024] Furthermore, calculating the photometric stereogram includes: calculating a normal vector of the surface of the object to be measured according to the angle information of each light source to obtain depth information of the surface of the object to be measured, and outputting a corresponding photometric stereogram.

[0025] The present invention also provides a surface defect detection device, comprising:

[0026] At least three light sources at different angles, used to illuminate the surface of the object to be measured from different directions;

[0027] True color line array camera, used to collect image information formed by each light source on the surface of the object to be measured;

[0028] The detection module is used to execute the above detection method.

[0029] The present invention also provides a surface defect detection system, comprising:

[0030] The lighting control module is used to control each light source to light up and cycle in sequence, and use the true color line array camera to shoot the moving object to be tested to obtain the original image information collected by each channel of the true color line array camera;

[0031] The sub-image splitting module is used to split the original image information collected by each channel so that the image data corresponding to the same light source can be summarized in sequence, thereby obtaining the sub-images corresponding to all light sources in each channel;

[0032] The color image calculation module is used to fuse the sub-images corresponding to all light sources under each channel, calculate the average value of all image data corresponding to the same position of each sub-image under the current channel, and use it as the fusion data of the corresponding position to obtain the color information of the surface of the object to be measured;

[0033] The photometric stereo module is used to extract the sub-images corresponding to all light sources under any channel and calculate the photometric stereo image based on the angle information of each light source to obtain the concave-convex information of the surface of the object to be measured.

[0034] The present invention also provides a computer-readable storage medium, comprising a computer program, wherein the computer program implements the above detection method when executed by a processor.

[0035] The beneficial effects of the present invention are:

[0036] (1) The present invention provides a multi-partition light source basis for the calculation of subsequent photometric stereograms by controlling each light source to light up and cycle in sequence, thereby ensuring the normal operation of the photometric stereo method. By using a true-color line array camera to shoot the moving object to be tested, the traditional black-and-white camera is replaced. At this time, there is no need to set up additional detection stations or add new RGB light sources, which reduces costs and significantly improves detection efficiency. For the original image information collected by each channel of the true-color line array camera, the sub-images corresponding to all light sources under each channel are obtained by splitting, and at the same time, a basis is provided for the subsequent acquisition of color information and concave-convex information. There is no need to independently obtain the corresponding data source, which fundamentally reduces the amount of data processing. Since each light source comes from a different angle, the RGB data directly obtained by the true-color line array camera will inevitably have dispersion or unevenness problems. Therefore, by fusing the sub-images corresponding to all light sources under each channel, the process The method fully utilizes the data basis obtained by sub-image splitting, does not need to introduce new data processing steps, simplifies the data processing process, and improves data processing efficiency. By calculating the average value of all image data corresponding to the same position of each sub-image under the current channel, it further utilizes the position distribution relationship of each light source and the correspondence between each light source and the sub-image. No matter what arrangement order the RGB pixel rows of the true-color line array camera adopts, or what lighting order the light sources adopt, it will not affect the result of the above average value. After averaging, there is no longer the problem that image data at the same position comes from light sources at different angles, nor is there the problem of unevenness caused by a single light source. Therefore, it effectively solves the technical theoretical defects in obtaining color information. Finally, the photometric stereo image is calculated based on the angular information of each light source, and the sub-image data in the previous process is reused. Ultimately, the simultaneous acquisition of color information and concave-convex information is achieved simply and efficiently while reducing costs.

[0037] (2) The present invention controls the motion relationship between the line frequency of the true color line array camera and the moving speed of the object to be measured, and proportionally integrates the number of light sources into the above relationship. Therefore, even if the number of light sources is changed, the original image information can be split into sub-images corresponding to the light sources, and the state of the object to be measured can be maintained normally, avoiding stretching or compression, thereby effectively ensuring the image quality.

[0038] (3) By limiting the starting and ending ends of the original image information, the present invention avoids the introduction of invalid image data during subsequent sub-image splitting, achieves data alignment, and further ensures the accuracy of the detection results.

[0039] (4) The present invention theoretically guarantees the precise correspondence of the same position when the subsequent sub-graphs are split by defining the formula for the starting invalid data and the ending invalid data, so that data collection and discarding can be carried out in real time, greatly improving the detection efficiency of the entire detection method. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0041] Figure 1 It is a flow chart of the detection method of the present invention;

[0042] Figure 2 This is a schematic diagram of the imaging principle of a three-line true color camera based on three light sources with a pixel spacing equal to one pixel width in the present invention;

[0043] Figure 3 It is a schematic diagram of the principle of subgraph splitting in the present invention;

[0044] Figure 4 This is a schematic diagram of the imaging principle of a three-line true color camera based on four light sources with a pixel spacing equal to one pixel width in the present invention;

[0045] Figure 5 This is a schematic diagram of the imaging principle of a six-line true color camera based on three light sources and a pixel pitch equal to one pixel width in the present invention;

[0046] Figure 6 This is a schematic diagram of the imaging principle of a three-line true color camera based on three light sources with a pixel spacing equal to two pixel widths in the present invention;

[0047] Figure 7 This is a schematic diagram of the imaging principle of a three-line true color camera based on four light sources with a pixel pitch equal to two pixel widths in the present invention;

[0048] Figure 8 It is a structural schematic diagram of the detection device in the present invention;

[0049] Figure 9 It is a structural block diagram of the detection system in the present invention. DETAILED DESCRIPTION

[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 making creative efforts are within the scope of protection of the present invention.

[0051] like Figure 1As shown, this embodiment first provides a surface defect detection method, which collects image information formed on the surface of the object to be tested by light sources at at least three different angles, so as to simultaneously obtain the color information and concave-convex information of the surface of the object to be tested. In existing photometric stereo technology, the concave-convex information of the surface of the object to be tested is often obtained by combining a black and white camera with light sources at at least three different angles. If it is necessary to obtain the color defect information of the surface of the object to be tested at the same time, a new detection station can be introduced to perform color measurement, but the cost is high. New R, G, and B light sources can also be added, but the detection efficiency decreases. Therefore, in order to neither introduce a new light source to improve the detection efficiency nor add a new detection station to reduce the cost, the present invention replaces the traditional black and white camera with a true color linear array camera to simultaneously detect the color information and concave-convex information of the surface of the object to be tested. The detection method includes:

[0052] Each light source is controlled to light up and cycle in sequence, and a true color line array camera is used to shoot the moving object to be tested to obtain the original image information collected by each channel of the true color line array camera.

[0053] A true color line scan camera is at least a three-line color line scan camera, that is, at least one row of R channel, one row of G channel, and one row of B channel. The order of the channels is usually R channel → G channel → B channel. For example, when there are 6 lines, the order of the channels is RRGGBB, and when there are 9 lines, the order of the channels is RRRGGGBBB.

[0054] like Figure 2 The figure shows the imaging calculation principle of a three-line true color camera based on three light sources with a pixel pitch equal to one pixel width. The original image information collected by each RGB channel is displayed above the arrows, where S1, S2, and S3 represent three different light sources, t is the unit time, and the arrangement order of each RGB channel is opposite to the movement order of the object under test. For example, since the pixel pitch is equal to one pixel width, at the tth moment, the light source S1 is on, the R channel collects the image at position 1 of the object under test, which is expressed as 1S1, the G channel collects the image at position 3 of the object under test, which is expressed as 3S1, and the B channel collects the image at position 5 of the object under test, which is expressed as 5S1. The same applies to other moments.

[0055] The original image information collected by each channel is split so that the image information corresponding to the same light source can be summarized in sequence, thereby obtaining sub-images corresponding to all light sources under each channel.

[0056] like Figure 2As shown, the schematic diagram of the alignment of the RGB channel data is shown below the arrow. The black box indicates the data that needs to be focused on. Assuming that the position 5 of the object to be measured is the starting position, that is, 5t-7t is a light source lighting cycle, and 8t-10t is the next light source lighting cycle. The image data of each light source lighting cycle corresponds to 3 different light sources. Therefore, the image information corresponding to the same light source in each light source lighting cycle is summarized in sequence to obtain the sub-images corresponding to all light sources under each channel. For example, taking the R channel as an example, 5S2, 8S2, 11S2, etc. extract an image data every 2 data and summarize them to form the sub-image corresponding to the light source S2. The corresponding sub-images of light sources S1 and S3 can be obtained in the same way. Finally, 3 sub-images can be obtained under each RGB channel.

[0057] The sub-images corresponding to all light sources under each channel are fused, and the average value of all image data corresponding to the same position of each sub-image under the current channel is calculated as the fused data of the corresponding position, thereby obtaining the color information of the surface of the object to be measured.

[0058] from Figure 2 It can be seen that after completing the data alignment, taking position 5 as an example, the three RGB channels correspond to 5S2, 5S3, and 5S1 respectively, that is, the three data come from different light sources, and the angles of different light sources are different. Therefore, if it is used directly at this time, obvious dispersion will appear in the actual color image, affecting the measurement effect. In order to solve this problem, taking the R channel as an example, 5S2, 6S3, and 7S1 correspond to the first position grayscale value under the R channel, recorded as R(1), then:

[0059] R(1)=(5S2+6S3+7S1) / 3

[0060] Similarly, the gray value of the first position under the G channel is G(1)=(5S3+6S1+7S2) / 3, and the gray value of the first position under the B channel is B(1)=(5S1+6S2+7S3) / 3. Figure 3 As shown in FIG, it is a schematic diagram of the sub-image splitting principle of the present invention. The three sub-images are I1, I2, and I3. After the three sub-images of each channel are averagely fused, an average fused color image can be obtained.

[0061] The sub-images corresponding to all light sources under any channel are extracted, and the photometric stereogram is calculated based on the angular information of each light source to obtain the concave-convex information of the surface of the object to be measured.

[0062] In order to calculate the photometric stereogram, as a specific implementation method, the following steps are specifically included: calculating the surface normal vector of the object to be measured according to the angle information of each light source to obtain the depth information of the surface of the object to be measured, and outputting the corresponding photometric stereogram.

[0063] According to the existing technology, m i =Li ρR, where m i is the grayscale value of the i-th sub-image, L i is the angle information of the i-th light source, ρ is the surface reflectivity, and R is the surface normal vector. The surface normal vector information can be calculated from this. After obtaining the surface normal vector information, the corresponding photometric stereo image can be obtained according to the stereo surface reconstruction method in the prior art, which will not be repeated here.

[0064] To accurately obtain the angle information of each light source, before using a true-color line array camera to photograph the moving object under test, each light source is calibrated using a calibration sphere. The calibration sphere serves as a calibration target for the direction of each light source. By establishing a photometric stereo system with N light sources to collect image information of the calibration sphere at different lighting angles, the position of the highlight points in the image is identified and combined with the calibration formula to calculate the angle information of the light source, that is, the lighting direction.

[0065] As a specific embodiment of the present invention, calibrating each light source specifically includes:

[0066] Control the true color line array camera to shoot the moving calibration sphere to obtain the calibration sphere image information collected by each channel of the true color line array camera;

[0067] Split the calibration sphere image information collected by any channel so that the calibration sphere image information corresponding to the same light source can be summarized in sequence, thereby obtaining the sub-images corresponding to all light sources under the current channel;

[0068] Extract the sub-images corresponding to all light sources in the current channel and calculate the angle information of each light source to complete the calibration of each light source.

[0069] After extracting the sub-images corresponding to all light sources in the current channel, determine the coordinate position of the highlight point and calculate the normal vector U of the highlight point. The angle information L of the light source, the normal vector U of the highlight point, and the reflected light vector V of the highlight point satisfy the following formula:

[0070] L=2(U·V)UV

[0071] At this time, the reflected light vector V is the observation direction of the true color line array camera. The normal vector U of the highlight point can be obtained by combining the calibration sphere parameters and the highlight point position, thereby calculating the angle information L of each light source.

[0072] To avoid image stretching or compression, the line frequency of the true color line scan camera and the moving speed of the object to be measured are controlled by the number of light sources N to ensure that the following relationship is satisfied: Where f is the line frequency of the true color line array camera, V is the moving speed of the object to be measured, M is the magnification, N is the number of light sources, and P is the pixel size.

[0073] At this time, since the number of light sources N is introduced as a product in the above relationship, the final average fused color image can be adaptively adjusted as the number of light sources N changes, effectively ensuring the image quality.

[0074] Figure 2 A schematic diagram of the imaging calculation principle of a three-line true color camera based on three light sources and a pixel pitch equal to one pixel width is given. The following specific embodiments are given by changing the number of light sources, the number of pixel rows in the camera, and the pixel spacing of the camera:

[0075] like Figure 4 The figure shows the imaging principle of the three-line true color camera based on four light sources with a pixel spacing equal to one pixel width in the present invention. Figure 2 Compared with the increase of one light source, it can be seen that after completing the data alignment, taking the R channel as an example, 5S1, 9S1, etc. extract one image data every 3 data and summarize them to form a sub-image corresponding to the light source S1. The corresponding sub-images of light sources S2, S3, and S4 can be obtained in the same way. Finally, 4 sub-images can be obtained under each RGB channel; the first position grayscale value under the R channel is R(1)=(5S1+6S2+7S3+8S4) / 4, the first position grayscale value under the G channel is G(1)=(5S3+6S4+7S1+8S2) / 4, and the first position grayscale value under the B channel is B(1)=(5S1+6S2+7S3+8S4) / 4, among which 5S1, 6S2, 7S3, and 8S4 in the R(1) formula are all taken from Figure 4 The relevant data corresponding to the R channel in the formula B(1) are all taken from Figure 4 The relevant data corresponding to the B channel in the figure can be obtained by the same logic as above. The image data of all positions under each channel can be obtained by the same logic.

[0076] like Figure 5 The figure shows the imaging principle of the six-line true color camera based on the three light sources and the pixel spacing is equal to the width of one pixel in the present invention. Figure 2 Compared with the camera's pixel row number becoming six lines, it can be seen that after completing the data alignment, taking the R channel as an example, refer to Figure 5As shown by the dotted line in the middle, the grayscale value at position 11 under the R channel is obtained by averaging 11S2 and 11S3, the grayscale value at position 12 under the R channel is obtained by averaging 12S3 and 12S1, and the grayscale value at position 13 under the R channel is obtained by averaging 13S1 and 13S2. Then, an image data is extracted every 2 data points and summarized as the sub-images corresponding to the light sources S1, S2, and S3 respectively. Finally, 3 sub-images can be obtained under each RGB channel. The first position under the R channel Grayscale value R(1)=(11S2+11S3+12S3+12S1+13S1+13S2) / 6, grayscale value of the first position under G channel G(1)=(11S1+11S2+12S2+12S3+13S3+13S1) / 6, grayscale value of the first position under B channel B(1)=(11S3+11S1+12S1+12S2+13S2+13S3) / 6. Similarly, image data of all positions under each channel can be obtained.

[0077] like Figure 6 The figure shows the imaging principle of a three-line true color camera based on three light sources with a pixel spacing equal to two pixel widths. Figure 2 Compared with the camera's pixel interval becoming two pixel widths, it can be seen that after completing the data alignment, taking the R channel as an example, 7S1, 10S1, etc. extract one image data every two data and summarize them to form a sub-image corresponding to light source S1. The corresponding sub-images for light sources S2 and S3 can be obtained in the same way. Finally, three sub-images can be obtained under each RGB channel. At this time, taking position 7 as an example, although the three RGB channels correspond to 7S1, 7S1, and 7S1 respectively, that is, the three sets of data come from the same light source, the data of positions 8 and 9 correspond to light sources at different angles compared to position 7. Therefore, if they are used directly, the uniformity of the final image acquisition will be affected. For this, the average fusion method can still be used for calculation: the grayscale value of the first position under the R channel R(1)=(7S1+8S2+9S3) / 3, the grayscale value of the first position under the G channel G(1)=(7S1+8S2+9S3) / 3, and the grayscale value of the first position under the B channel B(1)=(7S1+8S2+9S3) / 3, where 7S1, 8S2, and 9S3 in the R(1) formula are all taken from Figure 6 The relevant data corresponding to the R channel in the formula G(1) are all taken from Figure 6 The relevant data corresponding to the G channel, 7S1, 8S2, and 9S3 in the formula B(1) are all taken from Figure 6 The relevant data corresponding to the B channel in the figure can be obtained by the same logic as above. The image data of all positions under each channel can be obtained by the same logic.

[0078] like Figure 7As shown in the figure, it is a schematic diagram of the imaging principle of a three-line true color camera based on four light sources with a pixel spacing equal to two pixel widths in the present invention, and Figure 2 Compared with the case where the number of light sources is increased by one and the pixel interval of the camera becomes two pixels wide, it can be seen that after completing the data alignment, taking the R channel as an example, 7S3, 11S3, etc. extract one image data every three data and summarize them to form a sub-image corresponding to the light source S3. The corresponding sub-images can be obtained similarly for light sources S1, S2, and S4. Finally, four sub-images can be obtained under each RGB channel. The grayscale value of the first position under the R channel is R(1)=(7S3+8S4+9S1+10S2) / 4, the grayscale value of the first position under the G channel is G(1)=(7S4+8S1+9S2+10S3) / 4, and the grayscale value of the first position under the B channel is B(1)=(7S1+8S2+9S3+10S4) / 4. Similarly, the image data of all positions under each channel can be obtained.

[0079] As the number of light sources, the number of pixel rows of the camera, and the pixel interval of the camera change, each embodiment needs to perform certain data discarding processing on the starting and ending ends of the original image information. Specifically, the starting end of the original image information corresponds to the data collected by the first pixel row when the last pixel row of the true-color line array camera is first collected, and the ending end of the original image information corresponds to the last data collected by the last pixel row of the true-color line array camera. Among them, the first pixel row is the pixel row whose image data is first collected, and the last pixel row is the pixel row whose image data is last collected.

[0080] As a specific embodiment of the present invention, in order to more accurately align subsequent data and ensure accurate correspondence of data positions, the starting end is determined by discarding invalid data at the beginning of each channel, and the ending end is determined by discarding invalid data at the end of each channel;

[0081] in,

[0082] The initial invalid data satisfies the formula: D1=(a+1)(k-1);

[0083] End invalid data to satisfy the formula: D2=(a+1)(nk);

[0084] D1 is the number of rows of data corresponding to the starting invalid data, D2 is the number of rows of data corresponding to the ending invalid data, a is the ratio of the pixel pitch to the pixel width of the true color line array camera, n is the total number of pixel rows of the true color line array camera, and k is the sequence number of the current pixel row of the true color line array camera.

[0085] Below Figure 5Take an example to illustrate, at this time a is 1, n is 6, the first pixel row is B2, corresponding to k is 1, the last pixel row is R1, corresponding to k is 6, at this time B2 corresponds to the discarded starting invalid data D1=(1+1)(1-1)=0; R1 corresponds to the discarded starting invalid data D1=(1+1)(6-1)=10; B2 corresponds to the discarded ending invalid data D2=(1+1)(6-1)=10; R1 corresponds to the discarded ending invalid data D2=(1+1)(6-6)=0.

[0086] like Figure 8 As shown, the second aspect of the present invention further provides a surface defect detection device, comprising:

[0087] At least three light sources at different angles, used to illuminate the surface of the object to be measured from different directions;

[0088] True color line array camera, used to collect image information formed by each light source on the surface of the object to be measured;

[0089] The detection module is used to execute the above detection method.

[0090] like Figure 9 As shown, the third aspect of the present invention further provides a surface defect detection system, comprising:

[0091] The lighting control module is used to control each light source to light up and cycle in sequence, and use the true color line array camera to shoot the moving object to be tested to obtain the original image information collected by each channel of the true color line array camera;

[0092] The sub-image splitting module is used to split the original image information collected by each channel so that the image data corresponding to the same light source can be summarized in sequence, thereby obtaining the sub-images corresponding to all light sources in each channel;

[0093] The color image calculation module is used to fuse the sub-images corresponding to all light sources under each channel, calculate the average value of all image data corresponding to the same position of each sub-image under the current channel, and use it as the fusion data of the corresponding position to obtain the color information of the surface of the object to be measured;

[0094] The photometric stereo module is used to extract the sub-images corresponding to all light sources under any channel and calculate the photometric stereo image based on the angle information of each light source to obtain the concave-convex information of the surface of the object to be measured.

[0095] The specific operation methods and principles of each module can refer to the above detection methods.

[0096] A fourth aspect of the present invention further provides a computer-readable storage medium comprising a computer program, which implements the above-mentioned detection method when executed by a processor.

[0097] In practical applications, computer-readable storage media may take the form of any combination of one or more computer-readable media. Computer-readable media may be computer-readable signal media or computer-readable storage media. Computer-readable storage media may be, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component.

[0098] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0099] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0100] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0101] Throughout this specification, references to terms such as "one embodiment," "example," and "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0102] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention, and such changes and modifications fall within the scope of the invention as claimed.

Claims

1. A surface defect detection method, which collects image information formed on the surface of an object under test by light sources at at least three different angles, so as to simultaneously obtain color information and concave-convex information of the surface of the object under test, characterized in that: Detection methods include: Control each light source to light up and cycle in sequence, and use a true color line array camera to shoot the moving object to be tested to obtain the original image information collected by each channel of the true color line array camera; Split the original image information collected by each channel so that the image information corresponding to the same light source can be summarized in order, thereby obtaining the sub-images corresponding to all light sources under each channel; Fuse the sub-images corresponding to all light sources under each channel, calculate the average value of all image data corresponding to the same position of each sub-image under the current channel, and use it as the fusion data of the corresponding position to obtain the color information of the surface of the object to be measured; Extract the sub-images corresponding to all light sources under any channel, and calculate the photometric stereogram based on the angle information of each light source to obtain the concave-convex information of the surface of the object to be measured; The starting end of the original image information corresponds to the data collected by the first pixel row when the last pixel row of the true color line array camera is first collected, and the ending end of the original image information corresponds to the last data collected by the last pixel row of the true color line array camera. The first pixel row is the pixel row that first collects image data, and the last pixel row is the pixel row that last collects image data. The starting end is determined by discarding invalid data at the beginning of each channel, and the ending end is determined by discarding invalid data at the end of each channel; Among them, the starting invalid data satisfies the formula: D1=(a+1)(k-1); the ending invalid data satisfies the formula: D2=(a+1)(nk); D1 is the number of rows of data corresponding to the starting invalid data, D2 is the number of rows of data corresponding to the ending invalid data, a is the ratio of the pixel pitch to the pixel width of the true color line array camera, n is the total number of pixel rows of the true color line array camera, and k is the sequence number of the current pixel row of the true color line array camera.

2. A surface defect detection method according to claim 1, characterized in that: Before using a true color line array camera to shoot the moving object to be measured, each light source is calibrated using a calibration sphere to obtain the angle information of each light source.

3. A surface defect detection method according to claim 2, characterized in that: Calibration of each light source includes: Control the true color line array camera to shoot the moving calibration sphere to obtain the calibration sphere image information collected by each channel of the true color line array camera; Split the calibration sphere image information collected by any channel so that the calibration sphere image information corresponding to the same light source can be summarized in sequence, thereby obtaining the sub-images corresponding to all light sources under the current channel; Extract the sub-images corresponding to all light sources in the current channel and calculate the angle information of each light source to complete the calibration of each light source.

4. A surface defect detection method according to claim 1, characterized in that: The line frequency of a true color line array camera and the moving speed of the object under test satisfy the following relationship: Where f is the line frequency of the true color line array camera, V is the moving speed of the object to be measured, M is the magnification, N is the number of light sources, and P is the pixel size.

5. A surface defect detection method according to any one of claims 1 to 4, characterized in that: Calculating the photometric stereogram includes: calculating the surface normal vector of the object to be measured according to the angle information of each light source to obtain the depth information of the surface of the object to be measured, and outputting the corresponding photometric stereogram.

6. A surface defect detection device, characterized in that: include: At least three light sources at different angles, used to illuminate the surface of the object to be measured from different directions; True color line array camera, used to collect image information formed by each light source on the surface of the object to be measured; A detection module, configured to execute the detection method according to any one of claims 1 to 5.

7. A surface defect detection system, characterized in that: include: The lighting control module is used to control each light source to light up and cycle in sequence, and use the true color line array camera to shoot the moving object to be tested to obtain the original image information collected by each channel of the true color line array camera; The sub-image splitting module is used to split the original image information collected by each channel so that the image data corresponding to the same light source can be summarized in sequence, thereby obtaining the sub-images corresponding to all light sources in each channel; The color image calculation module is used to fuse the sub-images corresponding to all light sources under each channel, calculate the average value of all image data corresponding to the same position of each sub-image under the current channel, and use it as the fusion data of the corresponding position to obtain the color information of the surface of the object to be measured; The photometric stereo module is used to extract the sub-images corresponding to all light sources under any channel and calculate the photometric stereo image based on the angle information of each light source to obtain the concave-convex information of the surface of the object to be measured; The starting end of the original image information corresponds to the data collected by the first pixel row when the last pixel row of the true color line array camera is first collected, and the ending end of the original image information corresponds to the last data collected by the last pixel row of the true color line array camera. The first pixel row is the pixel row that first collects image data, and the last pixel row is the pixel row that last collects image data. The starting end is determined by discarding invalid data at the beginning of each channel, and the ending end is determined by discarding invalid data at the end of each channel; Among them, the starting invalid data satisfies the formula: D1=(a+1)(k-1); the ending invalid data satisfies the formula: D2=(a+1)(nk); D1 is the number of rows of data corresponding to the starting invalid data, D2 is the number of rows of data corresponding to the ending invalid data, a is the ratio of the pixel pitch to the pixel width of the true color line array camera, n is the total number of pixel rows of the true color line array camera, and k is the sequence number of the current pixel row of the true color line array camera.

8. A computer-readable storage medium comprising a computer program, characterized in that When the computer program is executed by a processor, the detection method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Multi-information fused online high-temperature casting blank surface defect detection method

    CN103913465A

  • Metal surface welding slag detection system and method, electronic device and storage medium

    CN118169128A