Defect detection method and apparatus for silicone product, and terminal device and medium
By combining edge detection and spectral features, the contours and spectral features of silicone products are extracted, and the pre-trained model is called to achieve efficient identification of defects in silicone products, solving the problem of low recognition efficiency in the existing technology and improving detection accuracy. and efficiency.
Patent Information
- Application Number
- PCT/CN2023/081209
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2024-09-19
AI Technical Summary
The existing technology has low identification efficiency in defect detection of silicone products, resulting in repeated recycling and redundant detection steps for a large number of products, making it impossible to accurately identify internal defects.
An edge detector is used to extract the contours in the product image, combined with the characteristics of the spectral image block, a pre-trained defect detection model is called, and the defect type is determined through three-dimensional modeling and wavelength screening to improve detection accuracy and efficiency.
It greatly reduces labor costs and repeated inspection steps, improves identification efficiency and inspection quality, can accurately identify internal and external defects of silicone products, and reduces invalid inspections.
Smart Images

Figure CN2023081209_19092024_PF_FP_ABST
Abstract
Description
A method, device, terminal equipment and medium for detecting defects in silicone products Technical Field
[0001] The present invention relates to the field of silicone product defect detection, and in particular to a silicone product defect detection method, device, terminal equipment and computer-readable storage medium. Background Art
[0002] Silicone products are widely used in everyday life. Various electronic products, such as wearable devices and watches, utilize silicone gaskets and other silicone products. The production process for silicone products includes design, mold creation, color mixing, approval, mold placement, and quality inspection. However, due to the specific production process, defects such as burrs, missing rubber, and clogged pores may occur during production. These defects can impact product quality and, in severe cases, even lead to safety issues.
[0003] Currently, existing technologies mainly use machine vision-based methods to detect appearance defects in silicone products. Specifically, the contours in the silicone product image are collected to determine whether the surface area of the product is within a set range, and then the products are screened based on the comparison results of the product surface area and the preset range. Then, by checking whether the shooting angle of the product is within the set range, the products are further screened. If both meet the requirements, the specific presence and type of defects of the product are identified. However, the purpose of this secondary screening method is to ensure that there is only one product on the imaging surface, that the product has good integrity and is at a preset shooting angle. When the product image does not meet the above conditions, it will be recycled and re-inspected. This method will cause a large number of products to be repeatedly recycled and then repeatedly identified. A product may be recycled or identified multiple times, resulting in low overall recognition efficiency.
[0004] Therefore, the market urgently needs a detection method that can accurately identify defects in silicone products to solve the technical problem of low defect recognition efficiency.
[0005] Summary of the Invention
[0006] The present invention provides a method, apparatus, terminal device and computer-readable storage medium for detecting defects in silicone products, so as to solve the technical problem of how to improve the overall efficiency of the defect identification process.
[0007] In order to solve the above technical problems, an embodiment of the present invention provides a method for detecting defects in silicone products, comprising:
[0008] Receiving a first trigger signal, responding to the first trigger signal and collecting a product image and a spectral image of the silicone product to be tested and obtaining a corresponding product number;
[0009] Detecting edge key points of the product image using an edge detector, and extracting contours in the product image based on relative positions between the edge key points;
[0010] Determining the contour corresponding to the silicone product to be tested according to the contour extraction result, and then cutting out the image block corresponding to the silicone product to be tested according to the contour corresponding to the silicone product to be tested;
[0011] The spectral image is cropped according to the image block to obtain a corresponding spectral image block, and spectral features are extracted from the spectral image block; the corresponding product type is matched according to the product number, and a pre-trained defect detection model corresponding to the product type is called; the spectral features are input into the defect detection model, and based on the output of the defect detection model, it is determined whether there are defects in the interior and appearance of the silicone product to be tested; wherein the defect detection model is called from a preset database, and the preset database contains several defect detection models, each defect detection model corresponding to a product type.
[0012] As a preferred solution, the edge detector is used to detect edge key points of the product image, and the contour of the product image is extracted according to the relative positions between the edge key points, specifically:
[0013] Detecting corner points in the product image using a point-chord cumulative distance detector; detecting extreme points in the product image using an ellipse model detector; wherein the edge key points include corner points and extreme points;
[0014] According to preset rules, extreme points are selected, and adjacent edge key points are fitted for all corner points and the selected extreme points to extract the contour of the product image.
[0015] As a preferred solution, the training process of the defect detection model includes:
[0016] Acquire a data set; the data set includes spectral data of a non-defective silicone product and a defective silicone product of a product type;
[0017] The preset basic classification model is iteratively trained using the data set. When the deviation between the predicted value and the actual value of the basic classification model is less than a first preset threshold, or when the change in the deviation is less than a second preset threshold, the basic classification model is judged to have converged, and the pre-trained defect detection model is obtained.
[0018] As a preferred solution, the determination of whether there are defects in the interior and appearance of the silicone product to be tested based on the output of the defect detection model is specifically as follows:
[0019] Determining, based on the output of the defect detection model, whether the silicone product to be tested is a non-defective product, an internally defective product, an externally defective product, or a product to be recycled; wherein the product to be recycled has both external and internal defects;
[0020] After determining whether there are defects in the interior and appearance of the silicone product to be tested, the method further includes: when it is determined that the silicone product to be tested contains defects, three-dimensional modeling of the silicone product to be tested is performed based on the spectral image block and the spectral characteristics, a corresponding three-dimensional model is constructed, and the defect anomaly of the silicone product to be tested is marked in the three-dimensional model through the spectral characteristics, and the defect type of the silicone product to be tested is determined according to the defect anomaly and in combination with the spectral characteristics and wavelength.
[0021] As a preferred solution, the defect type of the silicone product to be tested is determined based on the defect anomaly and in combination with the spectral characteristics and wavelength, specifically:
[0022] Locating the position of the defect in the three-dimensional model according to the defect anomaly;
[0023] According to the position in the three-dimensional model, the spectral characteristics are screened by setting the band, and the defect type of the silicone product to be tested is determined according to the best response band in the screening result.
[0024] Accordingly, an embodiment of the present invention further provides a device for detecting defects in silicone products, comprising an acquisition module, a contour extraction module, a cutting module, and a detection module; wherein,
[0025] The acquisition module is configured to receive a first trigger signal, respond to the first trigger signal, acquire a product image and a spectral image of the silicone product to be tested, and obtain a corresponding product number;
[0026] The contour extraction module is configured to detect edge key points of the product image using an edge detector, and extract the contour of the product image based on the relative positions of the edge key points;
[0027] The cropping module is used to determine the contour corresponding to the silicone product to be tested according to the contour extraction result, and then crop the image block corresponding to the silicone product to be tested according to the contour corresponding to the silicone product to be tested;
[0028] The detection module is used to crop the spectral image according to the image block to obtain a corresponding spectral image block, and extract spectral features from the spectral image block; match the corresponding product type according to the product number, and call a pre-trained defect detection model corresponding to the product type; input the spectral features into the defect detection model, and determine whether there are defects in the interior and appearance of the silicone product to be tested based on the output of the defect detection model; wherein the defect detection model is called from a preset database, and the preset database contains several defect detection models, each defect detection model corresponding to a product type.
[0029] As a preferred solution, the contour extraction module detects edge key points of the product image using an edge detector, and extracts the contour in the product image based on the relative positions between the edge key points, specifically:
[0030] The contour extraction module detects corner points in the product image through a point-chord cumulative distance detector; and detects extreme points in the product image through an ellipse model detector; wherein the edge key points include corner points and extreme points;
[0031] According to preset rules, extreme points are selected, and adjacent edge key points are fitted for all corner points and the selected extreme points to extract the contour of the product image.
[0032] As a preferred solution, the training process of the defect detection model includes:
[0033] Acquire a data set; the data set includes spectral data of a non-defective silicone product and a defective silicone product of a product type;
[0034] The preset basic classification model is iteratively trained using the data set. When the deviation between the predicted value and the actual value of the basic classification model is less than a first preset threshold, or when the change in the deviation is less than a second preset threshold, the basic classification model is judged to have converged, and the pre-trained defect detection model is obtained.
[0035] As a preferred solution, the detection module determines whether there are defects in the interior and appearance of the silicone product to be tested based on the output of the defect detection model, specifically:
[0036] The detection module determines whether the silicone product to be tested is a non-defective product, an internally defective product, an externally defective product, or a product to be recycled based on the output of the defect detection model; wherein the product to be recycled has both external and internal defects;
[0037] After determining whether there are defects in the interior and appearance of the silicone product to be tested, the method further includes: when it is determined that the silicone product to be tested contains defects, three-dimensional modeling of the silicone product to be tested is performed based on the spectral image block and the spectral characteristics, a corresponding three-dimensional model is constructed, and the defect anomaly of the silicone product to be tested is marked in the three-dimensional model through the spectral characteristics, and the defect type of the silicone product to be tested is determined according to the defect anomaly and in combination with the spectral characteristics and wavelength.
[0038] As a preferred solution, the detection module determines the defect type of the silicone product to be tested based on the defect anomaly and in combination with the spectral characteristics and wavelength, specifically:
[0039] The detection module locates the position of the defect in the three-dimensional model according to the defect anomaly;
[0040] According to the position in the three-dimensional model, the spectral characteristics are screened by setting the band, and the defect type of the silicone product to be tested is determined according to the best response band in the screening result.
[0041] Correspondingly, an embodiment of the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the method for detecting defects in silicone products is implemented.
[0042] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for detecting defects in silicone products.
[0043] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0044] Embodiments of the present invention provide a method, apparatus, terminal device, and computer-readable storage medium for detecting defects in silicone products. The method includes: receiving a first trigger signal, responding to the first trigger signal, acquiring a product image and a spectral image of the silicone product to be tested, and obtaining a corresponding product number; detecting edge key points of the product image using an edge detector, and extracting a contour in the product image based on the relative positions of the edge key points; determining a contour corresponding to the silicone product to be tested based on the contour extraction result, and then cropping an image block corresponding to the silicone product to be tested based on the contour corresponding to the silicone product to be tested; cropping the spectral image based on the image block to obtain a corresponding spectral image block, and extracting spectral features from the spectral image block; matching a corresponding product type based on the product number, and calling a pre-trained defect detection model corresponding to the product type; inputting the spectral features into the defect detection model, and determining whether the interior and exterior of the silicone product to be tested have defects based on the output of the defect detection model; wherein the defect detection model is called from a preset database, the preset database containing multiple defect detection models, each corresponding to a product type. The embodiment of the present invention detects edge key points, extracts the contours in the image for cropping, and further combines the spectral features corresponding to the corresponding spectral image blocks. Compared with the technical solution of comparing surface areas in the prior art, while ensuring that the image block contains only one product, it can also have a higher accuracy rate and no need to repeat the steps of product recycling, image acquisition and detection, thereby greatly reducing labor costs; and, according to the product number, the corresponding product type is matched, and then the defect detection model corresponding to the product type is called to realize defect detection, and the defect type can be further subdivided based on the difference in product type, which is more targeted; furthermore, through the detection method based on spectral features, in addition to identifying the appearance features of silicone products, their internal features can also be identified, which can effectively improve the detection quality; in addition, by cropping the corresponding spectral image blocks according to the image blocks, the amount of data input to the detection model can be reduced, the amount of calculation can be reduced, the operation speed can be increased, and invalid detection can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] FIG1 is a flow chart of an embodiment of a method for detecting defects in silicone products provided by the present invention.
[0046] FIG2 is a schematic structural diagram of an embodiment of a device for detecting defects in silicone products provided by the present invention. DETAILED DESCRIPTION
[0047] 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0048] Embodiment one:
[0049] According to relevant technical records, the existing technology mainly uses machine vision-based methods to detect appearance defects of silicone products. This technical solution determines whether the surface area of the product is within a set range by collecting the contours in the image of the silicone product, and then screens the product based on the comparison result of the product surface area and the preset range. Then, by checking whether the shooting angle of the product is within the set range, the product is further screened. When both meet the requirements, the specific existence of defects and the type of defects of the product are identified. However, the purpose of this secondary screening method is to ensure that there is only one product on the imaging surface, and that the product has good integrity and is at a preset shooting angle. When the product image does not meet the above conditions, it will be recycled and re-inspected. This method will cause a large number of products to be recycled and then repeatedly identified. A product may be recycled or identified multiple times, resulting in low overall recognition efficiency.
[0050] Furthermore, the existing technology passes the screened product images through a pre-trained appearance detection model to output the identified defects and corresponding bounding boxes. This appearance detection model usually performs detection on pre-processed images taken by a camera and can only identify defects on the appearance, but cannot identify internal defects.
[0051] In view of one or more of the above technical problems, please refer to FIG1 , which is a method for detecting defects in silicone products provided by an embodiment of the present invention, including steps S1 to S4, wherein:
[0052] Step S1: receiving a first trigger signal, responding to the first trigger signal and collecting a product image and a spectral image of the silicone product to be tested and obtaining a corresponding product number.
[0053] In this embodiment, the first trigger signal can be input via a computer. For example, a user can input the command "Detect defects in silicone products with product numbers 1 to 1000" into the computer via a mouse or keyboard. The computer, acting as a host computer, controls a camera and other equipment to capture product images and spectral images of the silicone products to be tested. Furthermore, the computer queries a database to obtain the product numbers of the silicone products to be tested. For example, each silicone product can be numbered 1, 2, 3, 4, 5, 6, 7, ..., 1000, and so on. It should be noted that these product numbers can be used to categorize silicone products. For example, numbers 1 to 100 represent silicone gaskets, 101 to 200 represent silicone buttons, and so on.
[0054] Step S2: detecting edge key points of the product image using an edge detector, and extracting the contour of the product image according to the relative positions between the edge key points.
[0055] In this embodiment, the edge detector is divided into a chord-to-point distance accumulation (CPDA) detector and an ellipse model detector. Edge key points are divided into corner points and extreme points. Corner points are obtained by the chord-to-point distance accumulation detector, while extreme points are obtained by the ellipse model detector. The ellipse model detector uses an ellipse approximation method, which takes global characteristics into account when calculating curve vertices. The curvature of the points on the curve segment and its neighboring points in a certain area is summed and averaged, and the maximum extreme value is found as the curve vertex.
[0056] As a preferred embodiment, the edge detector is used to detect edge key points of the product image, and the contour of the product image is extracted according to the relative positions between the edge key points, specifically:
[0057] Detecting corner points in the product image using a point-chord cumulative distance detector; detecting extreme points in the product image using an ellipse model detector; wherein the edge key points include corner points and extreme points;
[0058] According to preset rules, extreme points are selected, and adjacent edge key points are fitted for all corner points and the selected extreme points to extract the contour of the product image.
[0059] Taking into account the diversity of silicone products in actual applications, some products have very few corners or even no corners. For example, the sealing ring is completely round, and it may be impossible to describe the product contour only by sharp corners. Therefore, by combining the point-chord cumulative distance detector and the ellipse model detector, the edge key points can be quickly and accurately extracted, which can ensure the integrity of the product contour and effectively support its contour structure.
[0060] Step S3: determining the contour corresponding to the silicone product to be tested according to the contour extraction result, and then cutting out the image block corresponding to the silicone product to be tested according to the contour corresponding to the silicone product to be tested.
[0061] In this embodiment, the contour extraction result or the collected product image (original image) of the silicone product to be tested may contain the contours of multiple silicone products. Therefore, it is necessary to further determine the contour corresponding to the silicone product to be tested. As a preferred implementation of this embodiment, the contour can be determined by the distance or relative position relationship between the edge of the image and the product. As another preferred implementation of this embodiment, in some application scenarios, the silicone product to be tested appears complete in the image, while other products may appear partial. In this case, the largest product can be selected by detecting the surface area of the product to be tested to determine the silicone product to be tested.
[0062] After determining the contour corresponding to the silicone product to be tested, the corresponding image block is cropped out, which can reduce invalid information in the image and avoid the influence of noise in the subsequent processing process on the detection result.
[0063] Step S4: cropping the spectral image according to the image block to obtain a corresponding spectral image block, and extracting spectral features from the spectral image block; matching the corresponding product type according to the product number, and calling a pre-trained defect detection model corresponding to the product type; inputting the spectral features into the defect detection model, and determining whether there are defects in the interior and appearance of the silicone product to be tested based on the output of the defect detection model; wherein the defect detection model is called from a preset database, and the preset database contains several defect detection models, each defect detection model corresponding to a product type.
[0064] In this embodiment, the spectral image is cropped accordingly according to the image block to reduce invalid spectral image information and obtain the corresponding spectral image block. Then, the spectral feature is obtained through preprocessing. The specific preprocessing process includes but is not limited to cutting and correcting the spectral image.
[0065] Furthermore, the product type corresponding to the product number is matched, and a pre-trained defect detection model corresponding to the product type is called (considering that different silicone products use different processes in actual application scenarios and may therefore have different types of defects, each defect detection model corresponds to a product type); the spectral features are input into the defect detection model, and based on the output of the defect detection model, it is determined whether there are defects in the interior and appearance of the silicone product to be tested. The training process of the defect detection model includes:
[0066] Acquire a data set; the data set includes spectral data of defect-free silicone products and defective silicone products of a product type (defective silicone products include internally defective products, externally defective products, and products to be recycled); iteratively train a preset basic classification model using the data set, and when the deviation between the predicted value and the actual value of the basic classification model is less than a first preset threshold, or when the change in the deviation is less than a second preset threshold, determine that the basic classification model has converged, and obtain the pre-trained defect detection model.
[0067] As a preferred embodiment, based on the output of the defect detection model, it is determined whether there are defects in the interior and appearance of the silicone product to be tested, specifically:
[0068] The output of the defect detection model is used to determine whether the silicone product to be tested is a non-defective product, an internally defective product, an appearance-defective product, or a product to be recycled; wherein, if the product to be recycled has both appearance defects and internal defects, this means that the degree of defect of the product is relatively serious.
[0069] After determining whether there are defects in the interior and appearance of the silicone product to be tested, the method further includes: when it is determined that the silicone product to be tested contains defects (that is, it is determined that the silicone product to be tested is an internally defective product, an externally defective product, or a product to be recycled), three-dimensional modeling of the silicone product to be tested is performed based on the spectral image block and the spectral characteristics, a corresponding three-dimensional model is constructed, and the defect anomaly of the silicone product to be tested is marked in the three-dimensional model through the spectral characteristics (that is, the specific location of the defect anomaly in the three-dimensional model is marked), and the defect type of the silicone product to be tested is determined according to the defect anomaly and in combination with the spectral characteristics and wavelength.
[0070] The method of determining the defect type of the silicone product to be tested based on the defect anomaly and in combination with the spectral characteristics and wavelength is specifically as follows:
[0071] The position of the defect in the three-dimensional model is located according to the defect anomaly; according to the position in the three-dimensional model, the spectral characteristics are screened by setting the band, and the defect type of the silicone product to be tested is determined according to the best response band in the screening result. After determining its best response band, the specific defect type, such as burrs, lack of rubber or pore blockage, can be further determined by the existing spectrum-related defect detection model. The step of determining the best response band is equivalent to further screening and denoising the spectral characteristics to highlight the effective information. In implementing the embodiment of the present application, the defect detection model is first used to determine whether the silicone product to be tested is a non-defective product, an internal defect product, an appearance defect product or a product to be recycled, and then the three-dimensional model is constructed, and the spectral feature data is further processed to lock the specific position and specific type of the defect. Compared with the prior art, for example, the appearance detection model based on the YOLOv3 algorithm, the visualization of the defects is achieved, and defects that are not limited to the appearance (i.e., including the interior of the product) can also be determined.
[0072] 2 , an embodiment of the present invention further provides a device for detecting defects in silicone products, comprising an acquisition module 101 , a contour extraction module 102 , a cutting module 103 and a detection module 104 ; wherein,
[0073] The acquisition module 101 is configured to receive a first trigger signal, respond to the first trigger signal, acquire a product image and a spectral image of the silicone product to be tested, and obtain a corresponding product number;
[0074] The contour extraction module 102 is configured to detect edge key points of the product image using an edge detector, and extract the contour of the product image based on the relative positions of the edge key points;
[0075] The cropping module 103 is configured to determine the contour corresponding to the silicone product to be tested based on the contour extraction result, and then crop an image block corresponding to the silicone product to be tested based on the contour corresponding to the silicone product to be tested;
[0076] The detection module 104 is configured to crop the spectral image according to the image block to obtain a corresponding spectral image block and extract spectral features from the spectral image block; match the corresponding product type according to the product number and call a pre-trained defect detection model corresponding to the product type; input the spectral features into the defect detection model and determine whether there are defects in the interior and appearance of the silicone product to be tested based on the output of the defect detection model; wherein the defect detection model is called from a preset database, which contains a plurality of defect detection models, each of which corresponds to a product type.
[0077] As a preferred solution, the contour extraction module 102 detects edge key points of the product image using an edge detector, and extracts the contour of the product image based on the relative positions between the edge key points, specifically:
[0078] The contour extraction module 102 detects corner points in the product image through a point-chord cumulative distance detector; and detects extreme points in the product image through an ellipse model detector; wherein the edge key points include corner points and extreme points;
[0079] According to preset rules, extreme points are selected, and adjacent edge key points are fitted for all corner points and the selected extreme points to extract the contour of the product image.
[0080] As a preferred solution, the training process of the defect detection model includes:
[0081] Acquire a data set; the data set includes spectral data of a non-defective silicone product and a defective silicone product of a product type;
[0082] The preset basic classification model is iteratively trained using the data set. When the deviation between the predicted value and the actual value of the basic classification model is less than a first preset threshold, or when the change in the deviation is less than a second preset threshold, the basic classification model is judged to have converged, and the pre-trained defect detection model is obtained.
[0083] As a preferred solution, the detection module 104 determines whether there are defects in the interior and appearance of the silicone product to be tested based on the output of the defect detection model, specifically:
[0084] The detection module 104 determines whether the silicone product to be tested is a non-defective product, an internally defective product, an externally defective product, or a product to be recycled based on the output of the defect detection model; wherein the product to be recycled has both external and internal defects;
[0085] After determining whether there are defects in the interior and appearance of the silicone product to be tested, the method further includes: when it is determined that the silicone product to be tested contains defects, three-dimensional modeling of the silicone product to be tested is performed based on the spectral image block and the spectral characteristics, a corresponding three-dimensional model is constructed, and the defect anomaly of the silicone product to be tested is marked in the three-dimensional model through the spectral characteristics, and the defect type of the silicone product to be tested is determined according to the defect anomaly and in combination with the spectral characteristics and wavelength.
[0086] As a preferred solution, the detection module 104 determines the defect type of the silicone product to be tested based on the defect anomaly and in combination with the spectral characteristics and wavelength, specifically:
[0087] The detection module 104 locates the position of the defect in the three-dimensional model according to the defect anomaly;
[0088] According to the position in the three-dimensional model, the spectral characteristics are screened by setting the band, and the defect type of the silicone product to be tested is determined according to the best response band in the screening result.
[0089] Correspondingly, an embodiment of the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the method for detecting defects in silicone products is implemented.
[0090] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal, connecting various parts of the entire terminal using various interfaces and lines.
[0091] The memory can be used to store the computer program, and the processor realizes various functions of the terminal by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0092] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for detecting defects in silicone products.
[0093] Wherein, if the module integrated in the device for detecting defects in silicone products is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0094] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0095] Embodiments of the present invention provide a method, apparatus, terminal device, and computer-readable storage medium for detecting defects in silicone products. The method includes: receiving a first trigger signal, responding to the first trigger signal, acquiring a product image and a spectral image of the silicone product to be tested, and obtaining a corresponding product number; detecting edge key points of the product image using an edge detector, and extracting a contour in the product image based on the relative positions of the edge key points; determining a contour corresponding to the silicone product to be tested based on the contour extraction result, and then cropping an image block corresponding to the silicone product to be tested based on the contour corresponding to the silicone product to be tested; cropping the spectral image based on the image block to obtain a corresponding spectral image block, and extracting spectral features from the spectral image block; matching a corresponding product type based on the product number, and calling a pre-trained defect detection model corresponding to the product type; inputting the spectral features into the defect detection model, and determining whether the interior and exterior of the silicone product to be tested have defects based on the output of the defect detection model; wherein the defect detection model is called from a preset database, the preset database containing multiple defect detection models, each corresponding to a product type. The embodiment of the present invention detects edge key points, extracts the contours in the image for cropping, and further combines the spectral features corresponding to the corresponding spectral image blocks. Compared with the technical solution of comparing surface areas in the prior art, while ensuring that the image block contains only one product, it can also have a higher accuracy rate and no need to repeat the steps of product recycling, image acquisition and detection, thereby greatly reducing labor costs; and, according to the product number, the corresponding product type is matched, and then the defect detection model corresponding to the product type is called to realize defect detection, and the defect type can be further subdivided based on the difference in product type, which is more targeted; furthermore, through the detection method based on spectral features, in addition to identifying the appearance features of silicone products, their internal features can also be identified, which can effectively improve the detection quality; in addition, by cropping the corresponding spectral image blocks according to the image blocks, the amount of data input to the detection model can be reduced, the amount of calculation can be reduced, the operation speed can be increased, and invalid detection can be avoided.
[0096] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for detecting defects in silicone products, characterized in that: include: Receiving a first trigger signal, responding to the first trigger signal and collecting a product image and a spectral image of the silicone product to be tested and obtaining a corresponding product number; Detecting edge key points of the product image by using an edge detector, and extracting contours in the product image according to relative positions between the edge key points; Determine the contour corresponding to the silicone product to be tested according to the contour extraction result, and then cut out the image block corresponding to the silicone product to be tested according to the contour corresponding to the silicone product to be tested; The spectral image is cropped according to the image block to obtain a corresponding spectral image block, and spectral features are extracted from the spectral image block; the corresponding product type is matched according to the product number, and a pre-trained defect detection model corresponding to the product type is called; the spectral features are input into the defect detection model, and based on the output of the defect detection model, it is determined whether there are defects in the interior and appearance of the silicone product to be tested; wherein the defect detection model is called from a preset database, and the preset database contains a plurality of defect detection models, each defect detection model corresponding to a product type.
2. A method for detecting defects in silicone products according to claim 1, characterized in that: The detecting of edge key points of the product image by an edge detector and extracting the contour in the product image according to the relative positions between the edge key points is specifically as follows: Detecting corner points in the product image by using a point-chord cumulative distance detector; detecting extreme points in the product image by using an ellipse model detector; wherein the edge key points include corner points and extreme points; The extreme points are selected according to preset rules, and the adjacent edge key points are fitted for all corner points and the selected extreme points to extract the contour in the product image.
3. A method for detecting defects in silicone products according to claim 1, characterized in that: The training process of the defect detection model includes: Acquire a data set; the data set includes spectral data of a non-defective silicone product and a defective silicone product of a product type; The preset basic classification model is iteratively trained using the data set. When the deviation between the predicted value and the actual value of the basic classification model is less than a first preset threshold, or when the change in the deviation is less than a second preset threshold, the basic classification model is judged to have converged, and the pre-trained defect detection model is obtained.
4. A method for detecting defects in silicone products as claimed in claim 3, characterized in that: The determining whether there are defects inside and outside the silicone product to be tested based on the output of the defect detection model is specifically as follows: Through the output of the defect detection model, it is determined whether the silicone product to be tested is a non-defective product, an internal defective product, an appearance defective product or a product to be recycled; wherein the product to be recycled has both appearance defects and internal defects; After determining whether there are defects in the interior and appearance of the silicone product to be tested, the method further includes: when it is determined that the silicone product to be tested contains defects, three-dimensional modeling of the silicone product to be tested is performed based on the spectral image block and the spectral feature, a corresponding three-dimensional model is constructed, and the defect anomaly of the silicone product to be tested is marked in the three-dimensional model through the spectral feature, and the defect type of the silicone product to be tested is determined according to the defect anomaly and in combination with the spectral feature and the wavelength.
5. A method for detecting defects in silicone products as claimed in claim 4, characterized in that: The method of determining the defect type of the silicone product to be tested according to the defect anomaly body and in combination with the spectral characteristics and wavelength is specifically as follows: Locating the position of the defect in the three-dimensional model according to the defect anomaly; According to the position in the three-dimensional model, the spectral characteristics are screened by setting the band, and the defect type of the silicone product to be tested is determined according to the best response band in the screening result.
6. A device for detecting defects in silicone products, characterized in that: It includes an acquisition module, a contour extraction module, a clipping module and a detection module; among which, The acquisition module is used to receive a first trigger signal, respond to the first trigger signal, collect a product image and a spectrum image of the silicone product to be tested, and obtain a corresponding product number; The contour extraction module is used to detect edge key points of the product image through an edge detector, and extract the contour in the product image according to the relative positions between the edge key points; The cropping module is used to determine the contour corresponding to the silicone product to be tested according to the contour extraction result, and then crop the image block corresponding to the silicone product to be tested according to the contour corresponding to the silicone product to be tested; The detection module is used to crop the spectral image according to the image block to obtain the corresponding spectral image block, and extract spectral features from the spectral image block; match the corresponding product type according to the product number, and call a pre-trained defect detection model corresponding to the product type; input the spectral features into the defect detection model, and determine whether there are defects in the interior and appearance of the silicone product to be tested based on the output of the defect detection model; wherein the defect detection model is called from a preset database, and the preset database contains a plurality of defect detection models, each defect detection model corresponding to a product type.
7. A silicone product defect detection device as claimed in claim 6, characterized in that: The contour extraction module detects edge key points of the product image through an edge detector, and extracts the contour in the product image according to the relative positions between the edge key points, specifically: Detecting corner points in the product image by using a point-chord cumulative distance detector; detecting extreme points in the product image by using an ellipse model detector; wherein the edge key points include corner points and extreme points; The extreme points are selected according to preset rules, and the adjacent edge key points are fitted for all corner points and the selected extreme points to extract the contour in the product image.
8. A silicone product defect detection device as claimed in claim 6, characterized in that: The detection module determines whether there are defects inside and outside the silicone product to be tested based on the output of the defect detection model, specifically: The detection module determines whether the silicone product to be tested is a non-defective product, an internal defective product, an appearance defective product or a product to be recycled through the output of the defect detection model; wherein the product to be recycled has both appearance defects and internal defects; After determining whether there are defects in the interior and appearance of the silicone product to be tested, the method further includes: when it is determined that the silicone product to be tested contains defects, three-dimensional modeling of the silicone product to be tested is performed based on the spectral image block and the spectral feature, a corresponding three-dimensional model is constructed, and the defect anomaly of the silicone product to be tested is marked in the three-dimensional model through the spectral feature, and the defect type of the silicone product to be tested is determined according to the defect anomaly and in combination with the spectral feature and the wavelength.
9. A terminal device, characterized in that: It comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the method for detecting defects of silicone products as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for detecting defects of silicone products according to any one of claims 1 to 5.
Citation Information
Patent Citations
Defect analysis and diagnosis system, method and device based on artificial intelligence
CN112862770A
Electrical product appearance defect detection method based on network collaboration
CN113838015A
Automatic detection method and system for silica gel material for intelligent wearing and medium
CN114419034A
Vision inspection system using distance learning of product defect image
WO2022065621A1
Cited By
Material defect detection method and device and storage medium
CN119643580A
Method and device for detecting printed matter
CN120088185A
Micro-channel aluminum flat tube classification detection method and system based on deep learning
CN120543950A
Visual inspection system for precise sheet metal parts
CN121207993A
Visual inspection system for precision sheet metal parts
CN121207993B
