Simulation platform, simulation method and detection system for glass visual detection algorithm

By introducing simulation platforms and simulation methods into glass vision detection algorithms, the problem of insufficient recognition accuracy and detection speed of glass detection algorithms in the prior art is solved, and more efficient detection of glass surface defects is achieved.

CN119512957APending Publication Date: 2025-02-25BENGBU TRIUMPH ENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411636738.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Existing glass detection algorithms rely on traditional machine vision technology and are difficult to meet the growing demand for glass detection, especially in terms of identification accuracy and detection speed.

Method used

A simulation platform for glass vision detection algorithm is proposed, including defect image generation unit, preprocessing unit, edge detection unit, contour screening and processing unit, and dimension calculation unit. Simulation testing and optimization are carried out through simulation methods and detection systems to improve detection accuracy and speed.

Benefits of technology

Through simulation testing and optimization of the simulation platform, the glass vision detection algorithm's identification accuracy and detection speed of glass surface defects is improved, the error detection and miss detection rates are reduced, and the cost and time of testing in actual production environments is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512957A_ABST
    Figure CN119512957A_ABST
Patent Text Reader

Abstract

The invention discloses a simulation platform for a glass visual inspection algorithm, and the platform comprises a defect image generation unit which is used for generating a defect image; the defect image generation unit is connected with the preprocessing unit, and the preprocessing unit is used for decoloring the defect image; the preprocessing unit is connected with the edge detection unit, and the edge detection unit is used for carrying out edge detection on the decolored defect image; the edge detection unit is connected with the contour screening and processing unit, and the contour screening and processing unit is used for screening out the contour of the target object; the contour screening and processing unit is connected with the size calculation unit, and the size calculation unit is used for extracting the size of the target object. According to the invention, the detection system applying the simulation platform can perform simulation test and optimization on a glass visual detection algorithm, so that the recognition precision and detection speed of the algorithm on glass surface defects are improved, and the false detection and omission ratio is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of glass detection, and in particular to a simulation platform, a simulation method and a detection system for a glass visual detection algorithm. Background Art

[0002] With the improvement of automation and intelligence in the manufacturing industry, the quality inspection requirements for glass products are becoming increasingly stringent, which has promoted the widespread application of glass visual inspection systems. The rapid development of technologies such as machine vision and deep learning has provided more powerful technical support for glass visual inspection algorithms. Glass visual inspection algorithms are not only used in traditional glass manufacturing, but also gradually expanded to multiple fields such as automobiles, electronics, and medical care, further expanding market demand.

[0003] The known glass inspection algorithms mainly rely on traditional machine vision algorithms, which use artificially constructed visual features to find glass defects that meet specific conditions. However, purely traditional inspection algorithms can no longer meet the growing demand for glass inspection. Summary of the invention

[0004] The purpose of the present invention is to solve the above-mentioned background technical problems and to propose a simulation platform, simulation method and detection system for glass visual detection algorithm.

[0005] The purpose of the present invention can be achieved through the following technical solutions:

[0006] A simulation platform for a glass visual inspection algorithm comprises: a defect image generation unit, the defect image generation unit is used to generate a defect image; the defect image generation unit is connected to a preprocessing unit, the preprocessing unit is used to decolorize the defect image; the preprocessing unit is connected to an edge detection unit, the edge detection unit is used to perform edge detection on the decolorized defect image; the edge detection unit is connected to a contour screening and processing unit, the contour screening and processing unit is used to screen out the contour of a target object; the contour screening and processing unit is connected to a size calculation unit, the size calculation unit is used to extract the size of the target object.

[0007] A simulation method, the simulation method using the simulation platform for glass vision detection algorithm, comprising:

[0008] S1. Generate defect images using the Emgu CV framework, output them and save them to disk;

[0009] S2, preprocessing the defect image to generate a grayscale image after decolorization;

[0010] S3, using Roberts algorithm to perform edge detection on the grayscale image, calculating the gradient of the grayscale image to find the edge position, then combining the gradient results in the horizontal and vertical directions to obtain the gradient amplitude of each pixel, performing threshold processing on the gradient amplitude map, and generating a binary image;

[0011] S4, analyzing the contour shape, size and position features in the binary image, and screening out the contour of the target object, which is recorded as a contour line;

[0012] S5. Calculate the length and width of the minimum circumscribed rectangle of the outline and use them as the size of the target object.

[0013] As a further solution of the present invention: in step S1, generating a simulated defect image includes the following steps:

[0014] S11. Create or modify images;

[0015] S12, using a random number generator to determine the location, size, and shape attributes of the defect;

[0016] S13, simulate different types of defects;

[0017] S14, adding simulated defects to the existing image;

[0018] S15, adding noise or blurring effect on simulated defects;

[0019] S16. Analyze the difference between the outer contour of the object and its convex hull to identify defects.

[0020] As a further solution of the present invention: in the step S2, the frequency of each gray value in the gray image is counted to generate a gray histogram, and the gray histogram is used to characterize the distribution of pigments in the gray image.

[0021] As a further solution of the present invention: in the step S2, when the background grayscale values ​​in the grayscale image are concentrated in one area, they are filtered out or replaced to generate a feature image.

[0022] As a further solution of the present invention: in step S2, when the defective image contains impurities, the dark impurities absorb light to form a black image, and the grayscale value of this part is reflected in the grayscale histogram, which can be used as a condition for independent judgment of the impurities.

[0023] As a further solution of the present invention: in the step S4, the screening method used to screen out the contour of the target object includes: filtering the contour and merging adjacent contours.

[0024] A detection system, suitable for a glass visual detection algorithm, comprises: an image acquisition and processing module, the image acquisition and processing module is used to acquire an original image of a glass surface, adjust the clarity of the original image, obtain defect features, and generate a result image; the image acquisition and processing module is connected to a deep learning algorithm module, the deep learning algorithm module adopts a target detection algorithm based on deep learning to identify, classify and locate defects in the result image; the deep learning algorithm module is connected to a simulation and optimization module, the simulation and optimization module is provided with a simulation platform for a glass visual detection algorithm, the simulation and optimization module is used to simulate and test and optimize the glass visual detection algorithm to adjust algorithm parameters and detection strategies; the simulation and optimization module is connected to an integration and deployment module, the integration and deployment module is used to integrate the optimized detection algorithm into a production line, and generate and provide real-time detection reports and data analysis.

[0025] Beneficial effects of the present invention:

[0026] (1) In the present invention, the detection system using the simulation platform can perform simulation testing and optimization on the glass visual detection algorithm, thereby improving the algorithm's recognition accuracy and detection speed for glass surface defects and reducing false detection and missed detection rates.

[0027] (2) In the present invention, the algorithm can be verified and debugged in a virtual environment through the simulation platform, reducing the cost and time required for testing in an actual production environment.

[0028] (3) In the present invention, the simulation platform can simulate various complex production environments and defect types, so that the algorithm can better adapt to the diverse needs in actual production and improve the detection capability. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The present invention will be further described below in conjunction with the accompanying drawings.

[0030] Figure 1 It is a structural schematic diagram of a simulation platform for glass vision detection algorithm of the present invention;

[0031] Figure 2 is a flow chart of a simulation method of the present invention;

[0032] Figure 3 It is a structural schematic diagram of a detection system of the present invention;

[0033] Figure 4 is a grayscale histogram of a defect in the present invention;

[0034] Figure 5 is a grayscale histogram of a defect in the present invention;

[0035] Figure 6is a grayscale histogram of a defect in the present invention. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.

[0037] See also Figure 1 As shown, the present invention is a simulation platform for glass visual inspection algorithms, including: a defect image generation unit, which is used to generate defect images. The defect image generation unit is connected to a preprocessing unit, which is used to perform decolorization on the defect image and unify the image into a grayscale mode, which is helpful for comparison and analysis between different images. Decolorization can highlight the defect features and make the defects more obvious in the image, further simplifying the complexity of image processing, reducing the amount of data, and helping to improve the efficiency of subsequent image analysis and processing algorithms. In addition, decolorization can also enhance the contrast between defects and the background, making defects easier to identify, especially for images with uneven lighting, decolorization can improve the visual effect, and some defects are easily masked by background colors or patterns, and decolorization can eliminate such interference.

[0038] Furthermore, the preprocessing unit is connected to the edge detection unit, and the edge detection unit is used to perform edge detection on the decolorized defective image. Image edge detection is an important part of image processing, and many processing are based on this, such as image segmentation, image marker extraction and feature shape recognition.

[0039] The edge detection unit is also connected to the contour screening and processing unit, which is used to screen out the contour of the target object. Since there may be multiple contours in the image, it is necessary to screen out the contour belonging to the target object, which can be achieved by analyzing the shape, size, position and other features of the contour.

[0040] In this embodiment, the size of the target object can be calculated by screening out the outline, so the outline screening and processing unit is connected to the size calculation unit, and the size calculation unit is used to extract the size of the target object. Specifically, the outline is the manifestation of the boundary of the object. By extracting the outline, the geometric shape information of the object can be obtained, and the area of ​​the object can be calculated. The boundary points of the outline provide accurate edge information of the object. By analyzing the boundary points, various dimensions of the object can be measured, such as the length and width of the minimum circumscribed rectangle. The size of the object can be inferred based on the shape characteristics of the outline, especially for irregularly shaped objects.

[0041] See also Figure 1-Figure 2 As shown, a simulation method uses the simulation platform for glass vision detection algorithm, and the simulation method includes:

[0042] S1. In the defect image generation unit, the Emgu CV framework is used to generate a defect image, which is output and saved to disk.

[0043] Generating a simulated defect image includes the following steps:

[0044] S11. Use the image processing functions in Emgu CV to create or modify images, including reading existing images, creating blank images, and setting pixel values.

[0045] S12. To simulate random defects in the real world, a random number generator is used to determine the location, size, and shape attributes of the defect. For example, a point can be randomly selected on the image as the center of the defect, and then the radius or size of the defect can be determined.

[0046] S13. Simulate different types of defects, such as scratches, spots, cracks or other defects as needed. These defects can be simulated by drawing shapes (such as ellipses, circles, lines, etc.) on the image and filling them with specific colors.

[0047] S14. Use image overlay or blending techniques to add simulated defects to existing images.

[0048] Specifically, merging the simulated defect image with the original image requires the use of transparency or masking to control the visibility of the defect.

[0049] S15. To increase the realism of the simulated defects, noise or blur effects can be added to the defects. Noise can simulate sensor noise or distortion during image transmission, while blur can simulate image quality degradation due to motion or focus problems.

[0050] S16. In the case of convex hull defects, the convex hull defect is the difference area between the contour and the convex hull. It is necessary to analyze the difference between the external contour of the object and its convex hull to identify the defect, which is obtained by calculating the convex hull of the contour and subtracting the original contour.

[0051] S2. In the preprocessing unit, the defect image is preprocessed to generate a grayscale image after decolorization, that is, the original RGB three-dimensional image is converted into a grayscale image. The frequency of each grayscale value in the grayscale image is counted to generate a grayscale histogram, which is used to characterize the distribution of pigments in the grayscale image.

[0052] Specifically, the grayscale histogram refers to the grayscale distribution of the image contained in the grayscale image, indicating the distribution of pigments in the grayscale image. For example, if the grayscale value ranges from 1 to 255, the distribution of this value in the graph, that is, the number of occurrences of a certain grayscale value is the vertical axis, and the distribution of the grayscale value is the horizontal axis.

[0053] See also Figure 4-Figure 6 After processing, three defect image grayscale histograms are obtained. From the three grayscale histograms, it can be seen that the number is the largest when the pixel value is about 90, which means that the pixel value of the background gray of the three images is about 90. When the grayscale is darker, it tends to black, and the value is smaller. When the value is larger, the color is lighter, that is, it tends to white. When the grayscale value is 255, it is white.

[0054] When the background grayscale values ​​in a grayscale image are concentrated in one area, they are filtered out or replaced to generate a feature image.

[0055] When the defect image contains impurities, the dark impurities absorb light to form a black image. The grayscale value of this part is reflected in the grayscale histogram and can be used as a condition for independent judgment of impurities.

[0056] S3. In the edge detection unit, the Roberts algorithm is used to perform edge detection on the grayscale image. The edge position is found by calculating the gradient of the grayscale image. The gradient results in the horizontal and vertical directions are combined to obtain the gradient amplitude of each pixel. The gradient amplitude map is thresholded to generate a binary image.

[0057] Specifically, image edge detection is an important part of image processing, and many processes are based on this premise, such as image segmentation, image marker extraction, and feature shape recognition. The basic principle of edge detection is to first detect the points on the edge of the image, and distinguish them based on the difference in pixel values ​​on both sides of the point. That is, the dividing line will only be detected when the color difference on both sides is large. In this way, several scattered points or line segments can be found. At this time, the outline cannot be fully seen, and the Roberts algorithm can be used as the edge detection algorithm to achieve this.

[0058] Roberts edge detection algorithm is as follows:

[0059] When performing edge detection on a relatively simple image, the vertical and horizontal differences of the image are used, and then the gradient operator is continuously approached. At this time, the necessary condition is that the image must be discrete. The gradient operator formula is as follows:

[0060] Vf=(f(x,y)-f(x-1,y),f(x,y)-f(x,y-1))

[0061] By calculating f for a single pixel, we get the value and then perform a threshold operation on its absolute value.

[0062] The Roberts algorithm is derived based on this as shown below.

[0063] R(ij)=√((ij)-f(i+1,j+1)2+(f(ij+1)-f(i+1,j)2

[0064] Use two 2×2 templates to implement the algorithm:

[0065]

[0066] S4. Since there may be multiple contours in the binary image, it is necessary to screen out the contour belonging to the target object in the contour screening and processing unit. The contour of the target object is screened out by analyzing the contour shape, size and position features in the binary image, and the contour is recorded as a contour line.

[0067] The screening method used to screen out the contour of the target object includes: filtering the contour and merging adjacent contours.

[0068] When processing contours, some additional operations are required, such as calculating the centroid of the contour and fitting the minimum enclosing rectangle or ellipse of the contour. These operations help to more accurately describe the shape and size of the target object.

[0069] S5. In the size calculation unit, the length and width of the minimum circumscribed rectangle of the outline are calculated and used as the size of the target object.

[0070] Specifically, the outline of the target object can be filtered out to calculate its size. For rectangular or quasi-rectangular objects (such as glass), the length and width of the minimum enclosing rectangle of the outline can be directly calculated as the size of the object. The minimum enclosing rectangle of the outline is obtained by calling the CvInvoke.MinAreaRect function in Emgu CV, and the length and width of the rectangle are obtained using the Size property of the rectangle.

[0071] For the screened glass outline, use the CvInvoke.MinAreaRect function to find the minimum area rectangle that contains the outline. This function returns a MCvRotatedRect object that contains the center, size (width and height) and rotation angle of the rectangle.

[0072] The width and height extracted from the MCvRotatedRect object represent the approximate size of the glass.

[0073] See also Figure 3As shown, a detection system is suitable for glass vision detection algorithm, and relies on industrial PC as software development and operation carrier, and the programming environment is Microsoft Visual Studio 2019.

[0074] The detection system includes: an image acquisition and processing module, which uses a camera and an optical solution to acquire the original image of the glass surface, adjust the clarity of the original image, obtain defect features, and generate a result image.

[0075] The camera may be a CCD camera, a high-speed camera, or an HDR camera. Preferably, an HDR camera is used, which can capture details under different brightness conditions and is suitable for environments with complex lighting.

[0076] The image acquisition and processing module is connected to the deep learning algorithm module, which uses a deep learning-based target detection algorithm, such as CNN (convolutional neural network), to identify, classify and locate defects in the result image. The deep learning algorithm can reduce environmental restrictions and improve the accuracy and stability of detection.

[0077] The deep learning algorithm module is connected to the simulation and optimization module, which is provided with a simulation platform for the glass vision detection algorithm. The simulation and optimization module is used to perform simulation testing and optimization on the glass vision detection algorithm to adjust the algorithm parameters and detection strategies.

[0078] The detection algorithm is simulated and optimized on the simulation platform. By adjusting the algorithm parameters and detection strategies, the detection efficiency and accuracy are improved and the false detection and missed detection rates are reduced.

[0079] The simulation and optimization module is connected to the integration and deployment module, which is used to integrate the optimized detection algorithm into the production line to achieve automated and intelligent glass surface defect detection. At the same time, it provides real-time detection reports and data analysis functions to help companies optimize production processes and improve product quality and production efficiency.

[0080] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made according to the scope of application of the present invention should still fall within the scope of the claims of the present invention.

Claims

1. A simulation platform for glass visual inspection algorithm, characterized in that: include: A defect image generating unit, wherein the defect image generating unit is used to generate a defect image; The defect image generating unit is connected to the preprocessing unit, and the preprocessing unit is used to perform decolorization processing on the defect image; The preprocessing unit is connected to the edge detection unit, and the edge detection unit is used to perform edge detection on the decolorized defective image; The edge detection unit is connected to the contour screening and processing unit, and the contour screening and processing unit is used to screen out the contour of the target object; The contour screening and processing unit is connected to a size calculation unit, and the size calculation unit is used to extract the size of the target object.

2. A simulation method, characterized in that: The simulation method uses a simulation platform for a glass vision inspection algorithm as described in claim 1, comprising: S1. Generate defect images using the Emgu CV framework, output them and save them to disk; S2, preprocessing the defect image to generate a grayscale image after decolorization; S3, using Roberts algorithm to perform edge detection on the grayscale image, calculating the gradient of the grayscale image to find the edge position, then combining the gradient results in the horizontal and vertical directions to obtain the gradient amplitude of each pixel, performing threshold processing on the gradient amplitude map, and generating a binary image; S4, analyzing the contour shape, size and position features in the binary image, and screening out the contour of the target object, which is recorded as a contour line; S5. Calculate the length and width of the minimum circumscribed rectangle of the outline and use them as the size of the target object.

3. A simulation method according to claim 2, characterized in that: In step S1, generating a simulated defect image includes the following steps: S11. Create or modify images; S12, using a random number generator to determine the location, size, and shape attributes of the defect; S13, simulate different types of defects; S14, adding simulated defects to the existing image; S15, adding noise or blurring effect on simulated defects; S16. Analyze the difference between the outer contour of the object and its convex hull to identify defects.

4. A simulation method according to claim 2, characterized in that: In the step S2, the frequency of each gray value in the gray image is counted to generate a gray histogram, and the gray histogram is used to characterize the distribution of pigments in the gray image.

5. A simulation method according to claim 4, characterized in that: In the step S2, when the background grayscale values ​​in the grayscale image are concentrated in one area, they are filtered out or replaced to generate a feature image.

6. A simulation method according to claim 4, characterized in that: In step S2, when the defect image contains impurities, the dark impurities absorb light to form a black image. The grayscale value of this part is reflected in the grayscale histogram and can be used as a condition for independent judgment of impurities.

7. A simulation method according to claim 4, characterized in that: In step S4, the screening method used to screen out the contour of the target object includes: filtering the contour and merging adjacent contours.

8. A detection system, suitable for glass visual detection algorithm, characterized in that: include: An image acquisition and processing module, which is used to acquire an original image of the glass surface, adjust the clarity of the original image, obtain defect features, and generate a result image; The image acquisition and processing module is connected to the deep learning algorithm module, and the deep learning algorithm module uses a target detection algorithm based on deep learning to identify, classify and locate defects in the result image; The deep learning algorithm module is connected to the simulation and optimization module, and the simulation and optimization module is provided with a simulation platform for a glass vision detection algorithm according to claim 1, and the simulation and optimization module is used to perform simulation testing and optimization on the glass vision detection algorithm to adjust algorithm parameters and detection strategies; The simulation and optimization module is connected to the integration and deployment module, and the integration and deployment module is used to integrate the optimized detection algorithm into the production line and generate and provide real-time detection reports and data analysis.