Method and device for detecting surface defects of high-reflective bright trim strip
By acquiring the reflected light path image of the bright trim strip, performing preprocessing and edge detection, and combining Hough transform and straightness judgment, the accuracy and reliability issues of surface defect detection for highly reflective metal bright trim strips are solved, and efficient defect identification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NINGBO INST OF MATERIALS TECH & ENG CHINESE ACAD OF SCI
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-16
Smart Images

Figure CN122222935A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of machine vision and industrial inspection, and relates to a method and device for detecting surface defects of highly reflective glossy trim strips. Background Technology
[0002] Detection of surface defects in bright metal trim is a key industrial application of machine vision, but the high reflectivity of metals presents a core challenge: the formation of highlight areas in the image can obscure defects, cause overexposure distortion, and introduce noise. Traditional algorithms struggle to distinguish between defects and noise, leading to decreased detection accuracy. Even using polarizers or polarized cameras cannot eliminate all lighting effects, leaving blind spots in the detection process.
[0003] Manual inspection relies on experience, is prone to missed or false positives due to high reflectivity, and is slow, with accuracy decreasing further as personnel become fatigued, making it difficult to meet industrial needs. While machine vision can compensate for this, existing algorithms for highly reflective parts are time-consuming and have low accuracy, and different defects require different logic, making fully automated inspection difficult to achieve.
[0004] The improvement in the pass rate in the industrial sector has reduced defects, but increased the difficulty of classification. Traditional deep learning requires a large number of samples, but samples of defects in highly reflective metal parts are scarce, highlighting the lack of data. Although small-sample learning has been explored, it is still in the optimization stage, and the actual effect remains to be verified. Summary of the Invention
[0005] The purpose of this invention is to address the aforementioned problems in existing technologies by proposing a method for detecting surface defects in highly reflective glossy trim strips.
[0006] The objective of this invention can be achieved through the following technical solution: a method for detecting surface defects of highly reflective bright trim strips, comprising: acquiring a reflected light path image of the bright trim strip, and preprocessing the reflected light path image; Edge detection is performed on the preprocessed reflected light path image to determine edge information; The edge information is detected using Hough transform, and the presence of defects at the position of the bright decorative strip corresponding to the reflected light line image is determined based on straightness and line break length.
[0007] As an optional embodiment of the present invention, the preprocessing of the reflected light path image includes: The reflected light image is binarized to convert the grayscale reflected light path image into a binary image. The binary image is subjected to erosion processing.
[0008] As an optional embodiment of the present invention, edge detection is performed on the preprocessed reflected light path image to determine edge information, including: After filtering the reflected light path image, the gradient magnitude and gradient direction of each pixel in the reflected light path image are calculated using a discrete differential operator for detecting horizontal edges. Non-maximum suppression is performed based on the gradient magnitude and gradient direction of each pixel to shrink edges wider than a single pixel, thereby obtaining a set of candidate edges with a single pixel width. A dual threshold algorithm is used to determine the edge information for the candidate edge set.
[0009] As an optional embodiment of the present invention, non-maximum suppression is performed based on the gradient magnitude and gradient direction of each pixel to obtain a candidate edge set with a single pixel width, including: Along the gradient direction of each pixel, the gradient magnitudes of pixels within a preset range before and after the current pixel are compared to obtain the pixel with the maximum gradient magnitude. In response that the pixel with the maximum gradient magnitude is not the current pixel, the current pixel is suppressed to be a non-edge point; The pixels with the largest gradient magnitude are retained to obtain a set of candidate edges with a width of one pixel.
[0010] As an optional embodiment of the present invention, a dual-threshold algorithm is used to determine the edge information of the candidate edge set, including: Calculate the gradient magnitude of each pixel to obtain a gradient magnitude histogram; A first threshold and a second threshold are preset according to the gradient magnitude histogram, wherein the first threshold is greater than the second threshold; A pixel within the candidate edge set whose gradient magnitude is greater than or equal to the first threshold is identified as a strong edge. Pixels whose gradient magnitude within the candidate edge set is between the first threshold and the second threshold are identified as weak edges. Pixels within the candidate edge set whose gradient magnitude is less than or equal to the second threshold are determined to be non-edges; The strong edges and the weak edges connected to the strong edges are retained to obtain edge information.
[0011] As an optional embodiment of the present invention, the edge information is detected using Hough transform, and the presence of defects at the position of the bright decorative strip corresponding to the reflected light line image is determined based on straightness and line break length, including: The straightness and line break length corresponding to the edge information in the reflected light path image are detected by Hough transform. In response to the straightness being equal to a preset straightness threshold and the maximum line break length being less than a preset break length threshold, it is determined that there is no defect at the position of the bright decorative strip corresponding to the reflected light line image; In response to the straightness not being equal to the preset straightness threshold, or the maximum line break length being greater than or equal to the preset break length threshold, it is determined that there is a defect in the position of the bright decorative strip corresponding to the reflected light line image.
[0012] The present invention also proposes a high-reflectivity glossy trim detection device, comprising: Conveyor belt, used to carry and transport the bright decorative strips to be inspected; A clamping mechanism is used to clamp the bright decorative strip to be tested; A line scan light source provides illumination to the bright trim strip to be detected; A line scan camera is used to photograph the surface of the bright decorative strip to be detected, which is illuminated by the light source. A cylinder is used to lift the bright decorative strip to be detected to a position that can be detected by the line scan light source and the line scan camera; A translation mechanism is used to horizontally move the line scan light source and adjust the intensity of the light illuminating the bright trim strip to be detected.
[0013] As an optional embodiment of the present invention, the clamping mechanism is further provided with a sensor. When the sensor detects the signal of the bright trim strip to be detected, the clamping mechanism clamps the bright trim strip to be detected and lifts it to a preset optimal detection position by the cylinder. The clamping mechanism is also equipped with a rotating mechanism for rotating the bright decorative strip to be tested at a uniform speed.
[0014] The present invention also provides a system for detecting surface defects in high-reflectivity glossy trim strips, comprising: An image acquisition and processing module is used to acquire an image of the reflected light path of the bright trim strip and to preprocess the reflected light path image. The edge detection module is used to perform edge detection on the preprocessed reflected light path image to determine edge information; The defect detection module is used to detect the edge information using Hough transform, and to determine whether there is a defect at the position of the bright decorative strip corresponding to the reflected light line image based on the straightness and the length of the line interruption.
[0015] The present invention also provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to implement the above-described method for detecting surface defects of highly reflective glossy trims when executing executable instructions.
[0016] Compared to existing technologies, this invention effectively amplifies optical anomalies caused by defects by specifically acquiring and preprocessing images of reflected light paths, providing a high-quality input source for subsequent analysis. Furthermore, edge detection precisely locates the contour features of reflected light rays, transforming minute defects into quantifiable geometric information. Finally, Hough transform is used to extract line features, and judgments are made based on two precise quantitative parameters: straightness and line break length. This enables sensitive identification of minute bends and breaks that are imperceptible to the human eye, thus transforming subjective visual assessment into objective data discrimination, fundamentally ensuring high precision and reliability in the detection process. Attached Figure Description
[0017] Figure 1 This is a flowchart of a method for detecting surface defects in highly reflective glossy trim strips according to an embodiment of the present invention; Figure 2 This is a diagram illustrating the composition of the high-reflectivity glossy trim detection device according to an embodiment of the present invention; Figure 3 This is a system block diagram for detecting surface defects in highly reflective glossy trim strips according to an embodiment of the present invention; In the diagram: 1. Conveyor belt; 2. Bright decorative strip; 3. Line scan light source; 4. Line scan camera; 5. Cylinder; 6. Clamping mechanism; 7. Translation mechanism. Detailed Implementation
[0018] The following are specific embodiments of the present invention, which are described in conjunction with the accompanying drawings. However, the present invention is not limited to these embodiments.
[0019] Example 1 Based on the technical problems highlighted in the background, this embodiment proposes a method for detecting surface defects in highly reflective glossy trim strips, such as... Figure 1 As shown, it includes: S1, Obtain the reflected light path image of the bright trim strip, and preprocess the reflected light path image; S2, perform edge detection on the preprocessed reflected light path image to determine edge information; S3, use Hough transform to detect the edge information, and determine whether there is a defect at the position of the bright decorative strip corresponding to the reflected light line image based on straightness and line interruption length.
[0020] Since a line scan light source illuminating the surface of the glossy trim strip forms a complete reflected light path, and unevenness or defects on the surface (such as scratches, pits, and dots) can cause interruptions or deformations in this reflected light path, this embodiment uses image acquisition of the reflected light path on the glossy trim strip surface to detect its integrity and thus determine the surface defects. After preprocessing the reflected light path image, the Canny edge detection algorithm is applied to determine the edge information of the reflected light path image. Then, Hough transform is used to detect the straightness and line break length of the reflected light path image, comprehensively determining whether there are defects in the glossy trim strip corresponding to the reflected light path image.
[0021] Preferably, the preprocessing of the reflected light path image includes: The reflected light image is binarized to convert the grayscale reflected light path image into a binary image. The binary image is subjected to erosion processing.
[0022] The purpose of preprocessing is to ensure the clarity and continuity of the emitted light path. Binarization is used to convert the reflected light image from a grayscale image to a binary image, enhancing the contrast of the reflected light path in the image. Erosion is used to remove small defects or noise to ensure the continuity and integrity of the reflected light path.
[0023] Preferably, edge detection is performed on the preprocessed reflected light path image to determine edge information, including: After filtering the reflected light path image, the gradient magnitude and gradient direction of each pixel in the reflected light path image are calculated using a discrete differential operator for detecting horizontal edges. Non-maximum suppression is performed based on the gradient magnitude and gradient direction of each pixel to shrink edges wider than a single pixel, thereby obtaining a set of candidate edges with a single pixel width. A dual threshold algorithm is used to determine the edge information for the candidate edge set.
[0024] The reflected light path image is smoothed using a Gaussian filter to remove noise. Then, the Sobel operator (discrete differential operator) is used to calculate the gradient magnitude and direction of each pixel in the reflected light path image. Unlike the existing Canny algorithm, this embodiment focuses on vertical edge detection; therefore, a vertical convolution kernel of the Sobel operator is used to detect horizontal edges. The gradient direction is calculated perpendicular to the edge direction, so the output edge is perpendicular to the calculated vertical gradient direction (i.e., the gradient along the vertical direction of the image). The Sobel operator used in this embodiment is as follows: The vertical gradient matrix [1, 0, -1] is used to detect vertical edges in the image, such as vertical lines. The horizontal gradient matrix [1, 2, 1] is used to detect horizontal edges in the image, such as horizontal lines. The gradient of the image (the intensity and direction of grayscale changes) is calculated using a weighted difference method to identify edges. The two matrices correspond to the gradient calculations in the horizontal and vertical directions, respectively. Finally, the results in both directions are combined to obtain complete edge information in the image (including edge intensity and direction). It should be noted that the specific values within the matrices are designed using a combination of differentiation and smoothing, which can both capture edge changes and suppress noise. The values themselves can be scaled as a whole without affecting the direction determination.
[0025] After obtaining the gradient magnitude and direction of each pixel using the Sobel operator, non-maximum suppression (NMS) is applied. The goal is to shrink wide edges into single-pixel-wide lines. After gradient calculation, "continuous regions with high gradient values" appear in the image; for example, the edge of a bright trim might appear as a bright band 2-3 pixels wide. NMS works by retaining only the pixels with the largest local gradient magnitude along the gradient direction, i.e., perpendicular to the edge, and discarding adjacent non-maximum pixels. This "slims down" the wide edge into a set of candidate edges that is 1 pixel wide. This set contains real edge pixels and a small number of weak pixels with residual noise. Since NMS cannot distinguish between "weak pixels of real edges" and "weak pixels caused by noise," for example, slight scratches (noise) on the surface of a bright trim might still be retained as weak candidate pixels after NMS, while some local areas of real edges (such as areas with uneven lighting) might have low gradient magnitudes and also appear as weak candidate pixels. Therefore, a dual threshold algorithm is further adopted. Based on its key rule of "if a weak pixel is connected to a strong edge pixel, it is retained (considered as an extension of the real edge); otherwise, it is discarded (considered as noise)," isolated weak pixels (noise) are discarded, while weak pixels connected to strong edge pixels are retained (to complete the broken parts of the real edge).
[0026] Preferably, non-maximum suppression is performed based on the gradient magnitude and gradient direction of each pixel to obtain a candidate edge set with a single pixel width, including: Along the gradient direction of each pixel, the gradient magnitudes of pixels within a preset range before and after the current pixel are compared to obtain the pixel with the maximum gradient magnitude. In response that the pixel with the maximum gradient magnitude is not the current pixel, the current pixel is suppressed to be a non-edge point; The pixels with the largest gradient magnitude are retained to obtain a set of candidate edges with a width of one pixel.
[0027] Specifically, the core of non-maximum suppression is to compare the gradient magnitude of the current pixel with the pixels on its left and right sides along the gradient direction. The comparison is limited to three local points along the gradient direction, and the pixel with the largest gradient magnitude in that direction is retained. If the gradient magnitude of the current pixel is not the maximum value in that direction, it is suppressed as a non-edge point. The retained pixels are then used to obtain a candidate edge set with a width of one pixel.
[0028] Preferably, a dual-threshold algorithm is used to determine edge information for the candidate edge set, including: Calculate the gradient magnitude of each pixel to obtain a gradient magnitude histogram; A first threshold and a second threshold are preset according to the gradient magnitude histogram, wherein the first threshold is greater than the second threshold; A pixel within the candidate edge set whose gradient magnitude is greater than or equal to the first threshold is identified as a strong edge. Pixels whose gradient magnitude within the candidate edge set is between the first threshold and the second threshold are identified as weak edges. Pixels within the candidate edge set whose gradient magnitude is less than or equal to the second threshold are determined to be non-edges; The strong edges and the weak edges connected to the strong edges are retained to obtain edge information.
[0029] Since the dual-threshold algorithm requires setting two thresholds, the first threshold corresponds to the high threshold, and the second threshold corresponds to the low threshold, this embodiment obtains a gradient magnitude histogram by statistically analyzing the gradient magnitude of each pixel. The high threshold is taken as approximately 90% of the gradient magnitude histogram, and the low threshold is taken as 30% to 50% of the high threshold. Alternatively, an automatic thresholding algorithm can be used to adaptively generate the high and low thresholds based on the gradient magnitude histogram. The gradient magnitude is then divided into strong edges, weak edges, and non-edges using the high and low thresholds.
[0030] Specifically, pixels with gradient magnitudes higher than or equal to the high threshold are considered strong edges, pixels with gradient magnitudes between the high and low thresholds are considered weak edges, and pixels with gradient magnitudes lower than or equal to the high threshold are considered non-edges. Once determined, starting from the strong edges, weak edges connected to them are retained, while other weak edges are discarded.
[0031] Preferably, the edge information is detected using Hough transform, and the presence of defects at the position of the bright decorative strip corresponding to the reflected light path image is determined based on straightness and line break length, including: The straightness and line break length corresponding to the edge information in the reflected light path image are detected by Hough transform. In response to the straightness being equal to a preset straightness threshold and the maximum line break length being less than a preset break length threshold, it is determined that there is no defect at the position of the bright decorative strip corresponding to the reflected light line image; In response to the straightness not being equal to the preset straightness threshold, or the maximum line break length being greater than or equal to the preset break length threshold, it is determined that there is a defect in the position of the bright decorative strip corresponding to the reflected light line image.
[0032] After the Canny edge detection algorithm is applied, the Hough transform is used to extract the straight lines of the determined edges and to detect the straightness and line break length. Low straightness indicates a curved line, and breaks indicate discontinuity. In this embodiment, the preset straightness threshold is 1. Straightness describes the geometric consistency of the reflected light path, i.e., whether the edge point lies on an approximate straight line. If the detection result shows a straightness of 1, it indicates that the edge point lies on an approximate straight line, and the line break length is then determined. The line break length is used to determine the continuity of the reflected light path, i.e., whether there are obvious gaps or breaks. The preset break length threshold can be set according to actual conditions. Specifically, if the straightness is 1 and the line break length is less than the preset break length threshold, the bright strip position corresponding to the reflected light path image has no defects and the detection is qualified. If the straightness is not 1, or the maximum break length in the straight line is greater than or equal to the preset break length threshold, the bright strip position corresponding to the reflected light path image has defects.
[0033] This method significantly improves the detection accuracy of surface defects in highly reflective glossy trims through a series of targeted steps. First, by specifically acquiring and preprocessing images of reflected light paths, the optical anomalies caused by defects are effectively amplified, providing a high-quality input source for subsequent analysis. Then, edge detection precisely locates the contour features of reflected light rays, transforming subtle defects into quantifiable geometric information. Finally, Hough transform is used to extract line features, and judgments are made based on two precise quantitative parameters: straightness and line break length. This allows for the sensitive identification of minute bends and breaks that are imperceptible to the human eye, thus transforming subjective visual assessment into objective data discrimination, fundamentally ensuring high accuracy and reliability in the detection process.
[0034] Example 2 This embodiment proposes a highly reflective glossy trim detection device for acquiring the reflected light path image described in Embodiment 1, such as... Figure 2 As shown, it includes: Conveyor belt 1 is used to carry and transport the bright decorative strips 2 to be inspected; Clamping mechanism 6 is used to clamp the bright decorative strip 2 to be tested; Line scan light source 3 provides a light source to illuminate the bright decorative strip to be detected; Line scan camera 4 is used to photograph the surface of the bright decorative strip to be detected that is illuminated by the light source; Cylinder 5 is used to lift the bright decorative strip to be detected to a position that can be detected by the line scan light source 3 and the line scan camera 4; Translation mechanism 7 is used to horizontally move the line scan light source 3 and adjust the light intensity illuminating the bright decorative strip to be detected.
[0035] The line scan camera 4 scans the surface of the bright decorative strip to be detected and transmits the reflected light line image to the host computer through the network port. The host computer processes the image according to the method described in Example 1.
[0036] Preferably, the clamping mechanism 6 is further provided with a sensor. When the sensor detects the signal of the bright trim strip to be detected, the clamping mechanism 6 clamps the bright trim strip to be detected and lifts it to a preset optimal detection position by the cylinder 5. The clamping mechanism 6 is also provided with a rotating mechanism for rotating the bright decorative strip to be tested at a uniform speed.
[0037] The conveyor belt 1 is the carrier for conveying the bright decorative strip 2. Along its conveying path, there are components such as photoelectric sensor, clamping mechanism 6, line scan light source 3, and line scan camera 4. The translation mechanism 7 is associated with the line scan light source 3 to adjust the light.
[0038] When the bright decorative strip 2 moves with the conveyor belt 1 to the position of the clamping mechanism 6, the photoelectric sensor senses its position, sends a signal to the host computer, and stops the conveyor belt 1.
[0039] The gripping station is also equipped with two top columns, and a clamping mechanism 6 is installed between the top columns, which is connected to the cylinder 5. After the clamping mechanism 6 clamps the bright trim strip 2, the cylinder 5 drives the clamping mechanism 6 to move vertically to lift the bright trim strip 2; at the same time, the clamping mechanism 6 is equipped with a rotating mechanism, which is driven by a motor to achieve 360-degree rotation.
[0040] The line scan light source 3 and line scan camera 4 are positioned at the detection position after the bright trim strip 2 is lifted by the clamping mechanism 6. The translation mechanism 7 is used to adjust the light intensity of the line scan light source 3, etc., to achieve the best detection effect. It should be noted that the optimal detection position can be set by the host computer and recorded in the process formula. Alternatively, the cylinder 5 can be lifted to a preset position under the control of the host computer, and a step-by-step scan can be performed within the range above and below the preset position. Images are collected and indicators such as contrast, sharpness, and saturation ratio are calculated, and the position with the highest comprehensive score is selected as the optimal detection position. There is a coupling relationship between the rotation speed of the rotating mechanism, the camera line rate and exposure time of the line scan camera 4, and the brightness of the line scan light source 3. For example, if the rotation speed is too fast, it may cause the sampling interval of the line scan camera 4 to increase or the image to become blurry. Therefore, it is necessary to increase the camera line rate or shorten the exposure time accordingly. If the exposure time is shortened, it is necessary to increase the brightness of the light source or use pulse synchronous illumination.
[0041] The clamping mechanism 6 in this device can stably clamp the bright trim strip 2, and the cylinder 5 can smoothly lift the bright trim strip 2 to the detection position, ensuring that the bright trim strip 2 does not shake or shift during the detection process, thus improving the stability of the detection. The rotating mechanism on the clamping mechanism 6 can rotate 360 degrees, allowing the bright trim strip 2 to be detected from all directions, avoiding blind spots, and ensuring that defects in all parts of the bright trim strip 2 can be detected, greatly improving the comprehensiveness of the detection. The translation mechanism 7 can adjust the light intensity, and the cooperation between the line scan light source 3 and the line scan camera 4 can obtain the best detection effect according to the characteristics of the bright trim strip 2 and the detection requirements, improving the clarity and accuracy of the detection, thereby improving the detection quality.
[0042] Example 3 Based on the principles described in Embodiment 1, this embodiment proposes a system 100 for detecting surface defects in highly reflective glossy trim strips, such as... Figure 3 As shown, it includes: Image acquisition and processing module 110 is used to acquire the reflected light path image of the bright trim strip and preprocess the reflected light path image; Edge detection module 120 is used to perform edge detection on the preprocessed reflected light path image to determine edge information; The defect detection module 130 is used to detect the edge information using Hough transform, and to determine whether there is a defect at the position of the bright decorative strip corresponding to the reflected light line image based on the straightness and the length of the line interruption.
[0043] Example 4 Furthermore, an electronic device is proposed, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to implement, when executing executable instructions, a method for detecting surface defects of highly reflective glossy trim strips as described in Embodiment 1.
[0044] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0045] Furthermore, it should be noted that the use of terms such as "first," "second," and "a" in this invention is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified. The terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two elements or the interaction between two elements, unless otherwise explicitly specified. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0046] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0047] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A method for detecting surface defects in high-reflectivity glossy trim strips, characterized in that, include: Obtain an image of the reflected light path of the bright trim strip, and preprocess the reflected light path image; Edge detection is performed on the preprocessed reflected light path image to determine edge information; The edge information is detected using Hough transform, and the presence of defects at the position of the bright decorative strip corresponding to the reflected light line image is determined based on straightness and line break length.
2. The method for detecting surface defects of high-reflectivity glossy trim according to claim 1, characterized in that, Preprocessing of the reflected light path image includes: The reflected light image is binarized to convert the grayscale reflected light path image into a binary image. The binary image is subjected to erosion processing.
3. The method for detecting surface defects of high-reflectivity glossy trim according to claim 1, characterized in that, Edge detection is performed on the preprocessed reflected light path image to determine edge information, including: After filtering the reflected light path image, the gradient magnitude and gradient direction of each pixel in the reflected light path image are calculated using a discrete differential operator for detecting horizontal edges. Non-maximum suppression is performed based on the gradient magnitude and gradient direction of each pixel to shrink edges wider than a single pixel, thereby obtaining a set of candidate edges with a single pixel width. A dual threshold algorithm is used to determine the edge information for the candidate edge set.
4. The method for detecting surface defects of high-reflectivity glossy trim according to claim 3, characterized in that, Non-maximum suppression is performed based on the gradient magnitude and gradient direction of each pixel to obtain a set of candidate edges with a single pixel width, including: Along the gradient direction of each pixel, the gradient magnitudes of pixels within a preset range before and after the current pixel are compared to obtain the pixel with the maximum gradient magnitude. In response that the pixel with the maximum gradient magnitude is not the current pixel, the current pixel is suppressed to be a non-edge point; The pixels with the largest gradient magnitude are retained to obtain a set of candidate edges with a width of one pixel.
5. The method for detecting surface defects of high-reflectivity glossy trim according to claim 3, characterized in that, A dual-threshold algorithm is used to determine edge information for the candidate edge set, including: Calculate the gradient magnitude of each pixel to obtain a gradient magnitude histogram; A first threshold and a second threshold are preset according to the gradient magnitude histogram, wherein the first threshold is greater than the second threshold; A pixel within the candidate edge set whose gradient magnitude is greater than or equal to the first threshold is identified as a strong edge. Pixels whose gradient magnitude within the candidate edge set is between the first threshold and the second threshold are identified as weak edges. Pixels within the candidate edge set whose gradient magnitude is less than or equal to the second threshold are determined to be non-edges; The strong edges and the weak edges connected to the strong edges are retained to obtain edge information.
6. The method for detecting surface defects of high-reflectivity glossy trim according to claim 1, characterized in that, The edge information is detected using Hough transform, and the presence of defects at the position of the bright decorative strip corresponding to the reflected light path image is determined based on straightness and line break length, including: The straightness and line break length corresponding to the edge information in the reflected light path image are detected by Hough transform. In response to the straightness being equal to a preset straightness threshold and the maximum line break length being less than a preset break length threshold, it is determined that there is no defect at the position of the bright decorative strip corresponding to the reflected light line image; In response to the straightness not being equal to the preset straightness threshold, or the maximum line break length being greater than or equal to the preset break length threshold, it is determined that there is a defect in the position of the bright decorative strip corresponding to the reflected light line image.
7. A device for detecting highly reflective glossy decorative strips, characterized in that, For obtaining the reflected light path image according to any one of claims 1-6, comprising: Conveyor belt, used to carry and transport the bright decorative strips to be inspected; A clamping mechanism is used to clamp the bright decorative strip to be tested; A line scan light source provides illumination to the bright trim strip to be detected; A line scan camera is used to photograph the surface of the bright decorative strip to be detected, which is illuminated by the light source. A cylinder is used to lift the bright decorative strip to be detected to a position that can be detected by the line scan light source and the line scan camera; A translation mechanism is used to horizontally move the line scan light source and adjust the intensity of the light illuminating the bright trim strip to be detected.
8. The high-reflectivity glossy trim detection device according to claim 7, characterized in that, The clamping mechanism is also equipped with a sensor. When the sensor detects the signal of the bright trim strip to be detected, the clamping mechanism clamps the bright trim strip to be detected and lifts it to a preset optimal detection position by the cylinder. The clamping mechanism is also equipped with a rotating mechanism for rotating the bright decorative strip to be tested at a uniform speed.
9. A system for detecting surface defects in highly reflective glossy decorative strips, characterized in that, include: An image acquisition and processing module is used to acquire an image of the reflected light path of the bright trim strip and to preprocess the reflected light path image. The edge detection module is used to perform edge detection on the preprocessed reflected light path image to determine edge information; The defect detection module is used to detect the edge information using Hough transform, and to determine whether there is a defect at the position of the bright decorative strip corresponding to the reflected light line image based on the straightness and the length of the line interruption.
10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the method for detecting surface defects of highly reflective glossy trim as described in any one of claims 1-6 when executing executable instructions.