Plastic product defect detection method and system based on image processing

By combining production data and testing data, determining the detection method and adjusting the testing strategy, the problem of inaccurate detection of plastic products defects in the existing technology is solved, and a more efficient and humanized detection effect is achieved.

CN119090832BActive Publication Date: 2025-05-13SHENZHEN KEHONGZHAN PLASTIC MOULD CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411160589.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-05-13
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

The prior art fails to effectively combine production data and testing data in the detection of defects of plastic products, resulting in inaccurate and humanized testing.

Method used

By obtaining the image to be tested and the actual production parameter group of the current plastic product, detecting whether there is abnormal information in the production parameters and historical data, determining the detection method is standard or abnormal detection, and adjusting the detection strategy to achieve more accurate defect detection.

Benefits of technology

It realizes more accurate and user-friendly defect detection, improves detection accuracy and production quality, and provides valuable guiding information for subsequent process improvement and production line upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090832B_ABST
    Figure CN119090832B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for defect detection of plastic products based on image processing, the method comprising obtaining an image to be tested of a current plastic product and an actual production parameter group of the current plastic product; detecting whether there is abnormal information in the actual production parameter group to obtain a first detection result; detecting whether there is abnormal information in historical plastic products within a preset time period to obtain a second detection result; determining a detection method for the image to be tested based on the first detection result and the second detection result; wherein the detection method comprises a standard detection method and an abnormal detection method. The present invention effectively combines and applies production data and detection data, thereby achieving more accurate and humanized detection, improving detection accuracy and production quality, and providing valuable guiding information for subsequent process improvements and production line upgrades, reducing defects caused by various types of production line equipment or parameters in subsequent production processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image detection technology, and in particular to a method and system for detecting defects in plastic products based on image processing. Background Art

[0002] At present, the traditional method of defect detection for plastic products is to perform defect detection through a single detection method. For example, in the process of using model detection, defect detection is performed on the image only through specified detection parameters. Since this method is relatively rigid and does not take into account the correlation between defects and production parameters and historical defects, and does not effectively combine production data and detection data, it is impossible to achieve more accurate and humanized detection, and thus cannot meet user needs. Summary of the invention

[0003] In order to solve at least one of the above-mentioned technical problems, the present invention provides a method and system for detecting defects in plastic products based on image processing.

[0004] In a first aspect, the present invention provides a method for detecting defects in plastic products based on image processing, the method comprising:

[0005] Obtaining the image to be tested of the current plastic product and the actual production parameter group of the current plastic product;

[0006] Detecting whether there is abnormal information in the actual production parameter group to obtain a first detection result;

[0007] Detect whether there is abnormal information in historical plastic products within a preset time period, and obtain a second detection result;

[0008] Determine a detection method of the image to be detected according to the first detection result and the second detection result; wherein the detection method includes a standard detection method and an abnormal detection method;

[0009] When the detection mode is a standard detection mode, defect detection is performed on the image to be detected according to a preset detection strategy to obtain a defect detection result;

[0010] When the detection mode is the abnormal detection mode, defect detection is performed on the image to be tested according to a preset detection strategy to obtain a third detection result, the abnormal area of ​​the image to be tested is extracted according to the abnormal information to obtain an abnormal image group, a first tuning weight value is determined according to the first detection result and the second detection result, a second tuning weight value is determined according to the frequency of occurrence of the abnormal information within a preset time period, parameters of the preset detection strategy are adjusted according to the first tuning weight value and the second tuning weight value to obtain a tuned detection strategy, defect detection is performed on the corresponding abnormal images in the abnormal image group according to the tuned detection strategy to obtain a fourth detection result, and a defect detection result is obtained according to the third detection result and the fourth detection result.

[0011] Preferably, performing defect detection on the image to be tested according to a preset detection strategy includes:

[0012] Preprocessing the image to be tested;

[0013] Convert the preprocessed image from the spatial domain to the frequency domain to obtain a frequency domain image;

[0014] Performing filtering processing on the frequency domain image by using a preset Gaussian band-stop filter;

[0015] The filtered frequency domain image is converted back to the spatial domain to obtain a secondary processed image;

[0016] Edge detection is performed on the secondary processed image to extract the contour in the image and mark the defective area.

[0017] Preferably, adjusting the parameters of the preset detection strategy according to the first tuning weight value and the second tuning weight value includes:

[0018] Tuning the center frequency and bandwidth of the preset Gaussian band-stop filter according to the first tuning weight value and the second tuning weight value to obtain a tuned preset Gaussian band-stop filter;

[0019] The threshold of the edge detection is tuned according to the first tuning weight value and the second tuning weight value to obtain a tuned edge detection.

[0020] Preferably, determining the first tuning weight value according to the first detection result and the second detection result includes:

[0021] Determine whether the first detection result and the second detection result both contain abnormal information;

[0022] If so, compare and analyze the abnormal information corresponding to the first detection result with the abnormal information corresponding to the second detection result to determine whether there is the same abnormal information, and if so, determine that the first tuning weight value is the first weight value; if not, determine that the first tuning weight value is the second weight value; wherein the detection accuracy of the first weight value is higher than the detection accuracy of the second weight value;

[0023] If not, determine that the first tuning weight value is a second weight value.

[0024] Preferably, extracting the abnormal area of ​​the image to be tested according to the abnormal information to obtain an abnormal image group includes:

[0025] Determine corresponding defect features according to the abnormal information; wherein the defect features include defect type, defect location and defect shape;

[0026] According to the defect feature, an abnormal area actually corresponds to the image to be tested;

[0027] Performing region segmentation on the image to be tested according to the abnormal region to obtain an abnormal region image;

[0028] The abnormal region images are classified according to the defect types to obtain the abnormal image group.

[0029] Preferably, determining the detection method of the image to be detected according to the first detection result and the second detection result includes:

[0030] Determine whether at least one of the first detection result and the second detection result has abnormal information;

[0031] If so, determining that the detection method of the image to be tested is an abnormality detection method;

[0032] If not, it is determined that the detection method of the image to be detected is a standard detection method.

[0033] Preferably, obtaining the image to be tested of the current plastic product and the actual production parameter group of the current plastic product includes:

[0034] When it is detected that the plastic product enters the shooting area, an image of the area to be tested of the plastic product is acquired by an image acquisition device to obtain the image to be tested;

[0035] Divide the production process into several production stages according to the production process;

[0036] Real-time production parameters of several production sections are acquired to obtain the actual production parameter group.

[0037] Preferably, the detecting whether there is abnormal information in the actual production parameter group includes: determining whether there is a real-time production parameter in the actual production parameter group whose absolute value of the difference with the corresponding normal production parameter is greater than a preset safety threshold, and if so, determining that there is abnormal information in the actual production parameter group, and if not, determining that there is no abnormal information in the actual production parameter group;

[0038] The detecting whether there is abnormal information in the historical plastic products within the preset time period includes: determining whether there is at least one defect detection result indicating the existence of a defect in the defect detection results of the historical plastic products within the preset time period; if so, determining that there is abnormal information in the historical plastic products within the preset time period; if not, determining that there is no abnormal information in the historical plastic products within the preset time period.

[0039] Preferably, it also includes:

[0040] When the defect detection result indicates that a defect exists, generating tuning information according to the abnormal information and the defect detection result;

[0041] The corresponding production section and normal production parameters of the production section are optimized according to the tuning information.

[0042] In a second aspect, the present invention further provides a plastic product defect detection system based on image processing, the system comprising:

[0043] An acquisition module, used to acquire the image to be tested of the current plastic product and the actual production parameter group of the current plastic product;

[0044] A first detection module, used to detect whether there is abnormal information in the actual production parameter group, and obtain a first detection result;

[0045] The second detection module is used to detect whether there is abnormal information in the historical plastic products within a preset time period, and obtain a second detection result;

[0046] A determination module, used to determine a detection method of the image to be detected according to the first detection result and the second detection result; wherein the detection method includes a standard detection method and an abnormal detection method;

[0047] A first defect detection module, used for performing defect detection on the image to be detected according to a preset detection strategy to obtain a defect detection result when the detection mode is a standard detection mode;

[0048] A second defect detection module is used to perform defect detection on the image to be tested according to a preset detection strategy when the detection mode is the abnormal detection mode, to obtain a third detection result, to extract the abnormal area of ​​the image to be tested according to the abnormal information, to obtain an abnormal image group, to determine a first tuning weight value according to the first detection result and the second detection result, to determine a second tuning weight value according to the frequency of occurrence of the abnormal information within a preset time period, to adjust the parameters of the preset detection strategy according to the first tuning weight value and the second tuning weight value to obtain a tuned detection strategy, to perform defect detection on the corresponding abnormal images in the abnormal image group according to the tuned detection strategy to obtain a fourth detection result, and to obtain a defect detection result according to the third detection result and the fourth detection result.

[0049] Compared with the prior art, the present invention has the following beneficial effects:

[0050] 1) The method for detecting defects in plastic products based on image processing provided by the present invention first obtains the image to be tested of the current plastic product and the actual production parameter group of the current plastic product, then detects whether there is abnormal information in the actual production parameter group to obtain a first detection result, then detects whether there is abnormal information in historical plastic products within a preset time period to obtain a second detection result, and finally determines the detection method of the image to be tested based on the first detection result and the second detection result; wherein the detection method includes a standard detection method and an abnormal detection method; the present invention determines the detection method of the image to be tested based on the actual production parameter group of the current plastic product and the detection results of historical plastic products within a preset time period and whether there is abnormal information in the production parameters, taking into account the correlation between defects and production parameters and historical defects, and effectively combining production data and detection data for application, thereby achieving more accurate and humanized detection, improving detection accuracy and production quality, and providing valuable guiding information for subsequent process improvements and production line upgrades, reducing defects caused by various types of production line equipment or parameters in subsequent production processes.

[0051] 2) When the detection method is the standard detection method, defect detection is performed on the image to be tested according to the preset detection strategy to obtain a defect detection result; since the standard method is that there is no abnormal information in the actual production parameter group of the current plastic product and the historical plastic products within the preset time period, it means that the production operation of the current plastic product within the time period is normal and the production quality is qualified. Based on the detection efficiency and computing power resource cost considerations, the preset detection strategy is adopted to perform defect detection on the image to be tested, so as to perform fast and accurate defect detection on the current plastic product, so that the current detection method is more in line with the actual detection scenario required at present.

[0052] 3) When the detection mode is the abnormal detection mode, defect detection is performed on the image to be tested according to the preset detection strategy to obtain a third detection result, the abnormal area of ​​the image to be tested is extracted according to the abnormal information to obtain an abnormal image group, a first tuning weight value is determined according to the first detection result and the second detection result, a second tuning weight value is determined according to the frequency of occurrence of the abnormal information within a preset time period, the parameters of the preset detection strategy are adjusted according to the first tuning weight value and the second tuning weight value to obtain a tuned detection strategy, defect detection is performed on the corresponding abnormal images in the abnormal image group according to the tuned detection strategy to obtain a fourth detection result, and a defect detection result is obtained according to the third detection result and the fourth detection result. Since the abnormal mode is the actual production parameter group of the current plastic product and / or the historical plastic products within the preset time period have abnormal information, it means that the production operation of the current plastic product within the time period has abnormal conditions and the production quality is unstable. In order to ensure the stable output of subsequent product quality, it is necessary to perform a more accurate detection method on the defect conditions corresponding to the abnormal information, so that maintenance personnel can perform effective maintenance and production line improvement. Therefore, the present application first adopts a preset detection strategy to perform defect detection on the image to be tested, thereby performing fast and accurate defect detection on the current plastic product, obtaining a third detection result, and further optimizing the detection parameters of the preset detection strategy according to the abnormal information, so that the detection accuracy of the optimized detection strategy is higher than the detection accuracy of the preset detection strategy, thereby achieving more accurate detection of the defect information corresponding to the abnormal information that appears, avoiding incomplete repairs, which in turn leads to a large number of hidden dangers and defects, affecting the customer's perception and use experience, and the optimized detection strategy can be adaptively adjusted according to the actual production situation to enhance robustness; at the same time, this method can also provide valuable guiding information for subsequent equipment maintenance, parameter adjustment, process improvement and production line upgrades, reduce the defects caused by various types of production line equipment or parameters in the subsequent production process, and the quality of plastic products produced by the repaired or upgraded equipment and parameters is better and more stable. Through this adaptive feedback control of the detection parameter adjustment mechanism, the quality of plastic products is continuously improved, and ultimately the production quality is greatly improved.

[0053] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.

[0055] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0056] Figure 1 A schematic diagram of a flow chart of a plastic product defect detection method based on image processing provided by an embodiment of the present invention;

[0057] Figure 2 A schematic structural diagram of a plastic product defect detection system based on image processing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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.

[0059] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0060] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0061] In addition, in order to better illustrate the present invention, numerous specific details are provided in the following specific embodiments. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.

[0062] See also Figure 1 , Figure 1 The following is a flow chart of a method for detecting defects in plastic products based on image processing provided by an embodiment of the present invention. Figure 1 As shown, a method for detecting defects in plastic products based on image processing comprises:

[0063] S10, obtaining the image to be tested of the current plastic product and the actual production parameter group of the current plastic product;

[0064] In this embodiment, combined with the production parameters, it is possible to have a more comprehensive understanding of the variations in the production process, thereby improving the accuracy of defect detection. By real-time monitoring of the production parameters, it is possible to promptly discover anomalies in the production process and perform corresponding defect detection based on the production parameters to avoid the production of batch defective products. The relationship between defects and production parameters is analyzed to help improve the production process and reduce the incidence of defects. By automating defect detection, the cost of manual inspection can be reduced and production efficiency can be improved.

[0065] In some embodiments, obtaining the image to be tested of the current plastic product and the actual production parameter group of the current plastic product includes:

[0066] S11, when it is detected that a plastic product enters a shooting area, an image of the area to be tested of the plastic product is acquired by an image acquisition device to obtain the image to be tested;

[0067] Among them, a sensor can be set in the shooting area to detect whether the plastic product enters the shooting area. When it is detected that the plastic product enters the shooting area, the image of the test area of ​​the plastic product is obtained by the image acquisition device. The test area is the area range to be detected, which can be set as needed, such as the outer surface of one side or one end of the whole, or the outer surface or inner wall of the whole, etc. Specifically, a high-resolution camera or an industrial camera can be used to capture the image of the plastic product, and after the image is acquired, the image is pre-processed by denoising, enhancing the contrast, etc., to improve the accuracy of subsequent detection.

[0068] S12. Divide the production process into several production stages according to the production process;

[0069] S13. Acquire real-time production parameters of several production sections to obtain the actual production parameter group.

[0070] In this embodiment, the entire production process is divided into several key stages, such as raw material preparation, heating, injection molding, cooling, demolding, etc., and segmentation points are set at the beginning and end of each stage to facilitate the acquisition of production parameters of the corresponding stage. The real-time production parameters of each production segment are recorded, including but not limited to temperature, pressure, injection molding time, cooling time, etc., to ensure that the production parameters are synchronized with the time and workpiece number of the corresponding production segment, to ensure the integrity and consistency of the data, so as to obtain the actual production parameters from the production equipment corresponding to each production segment, such as temperature, pressure, injection molding time, cooling time, etc., and store these parameters in association with the corresponding image data to ensure that each image has corresponding production parameters, and obtain the actual production parameter group corresponding to the image to be tested.

[0071] S20, detecting whether there is abnormal information in the actual production parameter group, and obtaining a first detection result;

[0072] In this embodiment, by detecting whether there is abnormal information in the actual production parameter group, anomalies in the production process can be discovered in time to prevent the problem from expanding. By strictly controlling the production parameters, the stability of the production process can be ensured and the product quality can be improved. By recording and analyzing abnormal information, the weak links in the production process can be discovered, and process improvements and optimizations can be carried out. Production anomalies can be discovered and resolved in time, the scrap rate and rework costs can be reduced, and production efficiency can be improved.

[0073] In some embodiments, detecting whether there is abnormal information in the actual production parameter group includes:

[0074] S21, determining whether there is a real-time production parameter in the actual production parameter group whose absolute value of difference with the corresponding normal production parameter is greater than a preset safety threshold,

[0075] S22: If yes, determine that there is abnormal information in the actual production parameter group.

[0076] S23. If not, determine that there is no abnormal information in the actual production parameter group;

[0077] In this embodiment, the normal production parameters of each production section standard are determined according to historical data and process requirements, and the safety threshold of each parameter is set according to the deviation range allowed by the process. The real-time production parameters are compared with the standard normal production parameters, the absolute value of the difference is calculated, and it is checked whether the absolute value of the difference exceeds the preset safety threshold. If the absolute value of the difference exceeds the preset safety threshold, the parameter is marked as abnormal information so that the defect information corresponding to the abnormal information can be obtained from the historical database. Combined with the comparison results of all parameters, it is comprehensively judged whether there is abnormal information in the actual production parameter group. If an abnormality is detected, it is determined that there is abnormal information in the actual production parameter group, and an alarm is promptly issued to the production line, and the abnormal information is recorded for analysis and improvement; at the same time, by performing real-time detection and parameter comparison of each real-time production parameter in the actual production parameter group with the preset normal production parameters, it is also possible to promptly discover abnormalities in the production process and prevent the problem from expanding.

[0078] S30, detecting whether there is abnormal information in historical plastic products within a preset time period, and obtaining a second detection result;

[0079] In this embodiment, by detecting whether there is abnormal information in historical plastic products within a preset time period, quality problems existing in the recent time period can be quickly identified and dealt with in a timely manner to reduce the spread of quality problems. At the same time, by analyzing the occurrence time and frequency of defects, weak links in the production process can be found, process improvements can be made, problems can be discovered and solved in a timely manner, scrap rate and rework costs can be reduced, and production efficiency can be improved.

[0080] In some embodiments, the detecting whether there is abnormal information about historical plastic products within a preset time period includes:

[0081] S31, determining whether there is at least one defect detection result indicating that there is a defect in the defect detection results of the historical plastic products within the preset time period;

[0082] S32: If yes, determine that there is abnormal information in the historical plastic products within the preset time period.

[0083] S33: If not, determine that there is no abnormal information about the historical plastic products within the preset time period.

[0084] In this embodiment, a preset time period can be determined according to production needs, such as half an hour, one hour or half a day, so as to check whether there is abnormal information within the preset time period before the production of the current plastic product, and then determine whether the defect problem corresponding to the abnormal information has been completely solved, collect the defect detection results of all plastic products within the preset time period, including the detection time and detection results of each product, extract the items marked as "defective" in the defect detection results, filter out all the detection data (real-time production parameters) within the preset time period, check whether there is at least one item marked as "defective" in the filtered data, if there is at least one "defective" result in the detection data within the preset time period, compare the real-time production parameters corresponding to the detection result of "defective" with the standard normal production parameters, calculate the absolute value of the difference, and check whether the absolute value of the difference exceeds the preset safety threshold. If the absolute value of the difference exceeds the preset safety threshold, the parameter is marked as abnormal information, and the abnormal information is associated with the defect information detected, so that corresponding measures can be taken later.

[0085] S40, determining a detection method of the image to be detected according to the first detection result and the second detection result; wherein the detection method includes a standard detection method and an abnormal detection method;

[0086] In this embodiment, the present invention determines the detection method of the image to be tested based on the actual production parameter group of the current plastic product and the detection results of historical plastic products within a preset time period and whether there is abnormal information in the production parameters, and takes into account the correlation between defects and production parameters and historical defects, and effectively combines and applies production data and detection data, thereby achieving more accurate and humanized detection, improving detection accuracy and production quality, and providing valuable guiding information for subsequent process improvements and production line upgrades, thereby reducing defects caused by various types of production line equipment or parameters in subsequent production processes.

[0087] In some embodiments, determining the detection method of the image to be detected according to the first detection result and the second detection result includes:

[0088] S41, determining whether at least one of the first detection result and the second detection result has abnormal information;

[0089] S42: If yes, determine that the detection method of the image to be tested is an abnormality detection method;

[0090] S43: If not, determine that the detection method of the image to be detected is a standard detection method.

[0091] In this embodiment, by judging whether there is at least one abnormal information in the first detection result and the second detection result, the detection method of the image to be tested is determined to implement the corresponding processing steps for the image to be tested, thereby improving the detection flexibility and accuracy and meeting the personalized needs of users.

[0092] S50, when the detection mode is a standard detection mode, performing defect detection on the image to be detected according to a preset detection strategy to obtain a defect detection result;

[0093] In this embodiment, when the detection method is the standard detection method, defect detection is performed on the image to be tested according to a preset detection strategy to obtain a defect detection result; since the standard method is that there is no abnormal information in the actual production parameter group of the current plastic product and the historical plastic products within the preset time period, it means that the production operation of the current plastic product within the time period is normal and the production quality is qualified. Based on the detection efficiency and computing power resource cost considerations, the preset detection strategy is adopted to perform defect detection on the image to be tested, so that the current plastic product can be quickly and accurately detected, and the detection method of the image to be tested can be adaptively adjusted to be more in line with the current actual detection scenario.

[0094] In some embodiments, performing defect detection on the image to be tested according to a preset detection strategy includes:

[0095] S51, preprocessing the image to be tested, including converting the color image into a grayscale image to simplify processing

[0096] S52, converting the preprocessed image from the spatial domain to the frequency domain to obtain a frequency domain image; including using Fourier transform to convert the preprocessed grayscale image from the spatial domain to the frequency domain to obtain a frequency domain image, the formula is as follows:

[0097]

[0098] In the formula, F(u,v) represents the frequency domain image, f(x,y) represents the spatial domain image, M and N represent the width and height of the image, and u and v represent the frequency domain coordinates. represents the complex exponential function, and j represents the imaginary unit.

[0099] S53, filtering the frequency domain image by using a preset Gaussian band-stop filter; wherein the Gaussian band-stop filter is applied in the frequency domain to suppress noise in a specific frequency range; the formula is as follows:

[0100]

[0101] Where H(u,v) represents the filter function, D(u,v) represents the distance function, which represents the distance from the frequency point (u,v) to the center of the image, D0 represents the center frequency of the band-stop filter, and ΔD represents the bandwidth, which controls the width of the filter.

[0102] S54, converting the filtered frequency domain image back to the spatial domain to obtain a secondary processed image; wherein, performing an inverse Fourier transform on the filtered frequency domain image and converting it back to the spatial domain to obtain a secondary processed image; the formula is as follows:

[0103]

[0104] S55, performing edge detection on the secondary processed image, extracting contours in the image and marking defective areas, including using a Canny edge detection algorithm to perform edge detection on the secondary processed image, extracting contours and marking defective areas.

[0105] In this embodiment, frequency domain filtering is used to effectively remove noise in the image and improve the accuracy of defect detection. The Gaussian band-stop filter can suppress high-frequency noise while retaining the main features of the image, making edge detection more accurate. Through edge detection and contour extraction, the defective area in the image can be accurately located and marked, providing a reliable basis for subsequent processing and analysis.

[0106] S60. When the detection mode is the abnormal detection mode, defect detection is performed on the image to be tested according to a preset detection strategy to obtain a third detection result, the abnormal area of ​​the image to be tested is extracted according to the abnormal information to obtain an abnormal image group, a first tuning weight value is determined according to the first detection result and the second detection result, a second tuning weight value is determined according to the frequency of occurrence of the abnormal information within a preset time period, parameters of the preset detection strategy are adjusted according to the first tuning weight value and the second tuning weight value to obtain a tuned detection strategy, defect detection is performed on corresponding abnormal images in the abnormal image group according to the tuned detection strategy to obtain a fourth detection result, and a defect detection result is obtained according to the third detection result and the fourth detection result.

[0107] In some embodiments, extracting the abnormal region of the image to be tested according to the abnormal information to obtain the abnormal image group includes:

[0108] S61, determining corresponding defect features according to the abnormal information; wherein the defect features include defect type, defect location and defect shape;

[0109] S62, according to the defect feature, an abnormal area actually corresponding to the image to be tested;

[0110] S63, segmenting the image to be tested according to the abnormal area to obtain an abnormal area image;

[0111] S64. Classify the abnormal region images according to the defect types to obtain the abnormal image group.

[0112] In this embodiment, by locating the abnormal area in the image to be tested according to the defect features associated with the abnormal information, the defect area corresponding to the abnormal information can be found more accurately and the defect area corresponding to the abnormal information can be accurately detected, thereby improving the detection efficiency. The abnormal area is segmented, which helps to concentrate on processing defects and improve the accuracy of detection. Different types of defects are classified and processed according to the defect features associated with the abnormal information, thereby improving the pertinence and accuracy of detection, and the classified abnormal images are inspected in detail to ensure comprehensive identification of defects.

[0113] In some embodiments, determining the first tuning weight value according to the first detection result and the second detection result includes:

[0114] S65, determining whether both the first detection result and the second detection result show that abnormal information exists;

[0115] S66: If yes, compare and analyze the abnormal information corresponding to the first detection result with the abnormal information corresponding to the second detection result to determine whether there is the same abnormal information; if yes, determine that the first tuning weight value is the first weight value; if no, determine that the first tuning weight value is the second weight value; wherein the detection accuracy of the first weight value is higher than the detection accuracy of the second weight value;

[0116] S67: If not, determine that the first tuning weight value is a second weight value.

[0117] In this embodiment, if the first detection result and the second detection result both indicate that there is abnormal information, it means that the absolute value of the difference between the actual production parameter group of the current plastic product and the actual production parameter group of the historical plastic product with defects within the preset time period and the standard normal production parameters is greater than the preset safety threshold, and it is determined whether the abnormal actual production parameters in the actual production parameter group of the current plastic product are the same as the abnormal actual production parameters of the historical plastic products. If they are the same, it means that the abnormal information has been repeated, and the defect feature corresponding to the abnormal information is very likely to exist in the current plastic product, and the problem point corresponding to the defect feature has not been completely repaired. Therefore, in order to be able to detect the defect more accurately, it is necessary to optimize and adjust the detection parameters. At this time, the first tuning weight value is the first weight value with better accuracy, otherwise it is the second weight value.

[0118] In some embodiments, adjusting the parameters of the preset detection strategy according to the first tuning weight value and the second tuning weight value includes:

[0119] S68. Tune the center frequency and bandwidth of the preset Gaussian band-stop filter according to the first tuning weight value and the second tuning weight value to obtain a tuned preset Gaussian band-stop filter;

[0120] S69: Tune the threshold of the edge detection according to the first tuning weight value and the second tuning weight value to obtain tuned edge detection.

[0121] In this embodiment, by integrating multiple weight values ​​and dynamically adjusting the detection parameters, the accuracy of detection is improved, and the detection strategy can be adaptively adjusted according to the actual production situation to enhance robustness. The precisely tuned detection strategy can significantly improve the detection efficiency and reduce false alarms and missed alarms.

[0122] In some embodiments, S70 further includes:

[0123] When the defect detection result indicates that a defect exists, generating tuning information according to the abnormal information and the defect detection result;

[0124] The corresponding production section and normal production parameters of the production section are optimized according to the tuning information.

[0125] In this embodiment, the defects are analyzed according to the defect characteristics and abnormal information, the source of the introduction of the defects in the processing process of the plastic products is determined, the production parameters of the production section are adjusted in time and the structure or layout of the production section is optimized to prevent and control the large-scale generation of defects; at the same time, the tuning information can be stored in the control unit and automatically matched according to the adjustment of the process parameters. The tuning information is generated according to the real-time detection results to achieve dynamic adjustment of production parameters, improve the flexibility and response speed of production, reduce defects in the production process, and improve product quality by adjusting the production parameters in a targeted manner. The optimized production parameters can improve production efficiency, reduce resource waste, reduce defect rate and scrap rate, and significantly reduce production costs.

[0126] In some embodiments, the process further includes building a defect database, which specifically includes:

[0127] Obtain defect features of defects in plastic products, match the defect features with abnormal information to generate a data sequence, and build a defect database based on the data sequence;

[0128] Compare the similarity between the abnormal information and the defect data in the defect database, sort the similarities, and classify the detected abnormal information and the defect data with the highest similarity in the database as the same defect feature;

[0129] The optimization information of the defect feature in the database is extracted, and the processing flow of the plastic product is adjusted according to the extracted optimization information.

[0130] It should be noted that when the processing technology of a new product is adjusted, if the production parameters of some processing technologies are the same, they can be applied to the design process of the new product, and the standard normal production parameters of the new product can be determined according to the product demand data, and the production segment in which the standard normal production parameters of the new product are the same as the current standard normal production parameters can be obtained, and the data sequence of the production segment in the defect database can be extracted to retain its tuning information, which greatly improves the design efficiency of the processing technology of the new product and shortens the design time and design cost. In the manufacture of plastic products where process parameters are frequently adjusted, the shipment volume is large, and the use time is uncertain, this method can improve the product quality of plastic products.

[0131] See also Figure 2 , Figure 2 A schematic diagram of a plastic product defect detection system based on image processing provided by an embodiment of the present invention. A plastic product defect detection system based on image processing, the system comprising:

[0132] An acquisition module, used to acquire the image to be tested of the current plastic product and the actual production parameter group of the current plastic product;

[0133] A first detection module, used to detect whether there is abnormal information in the actual production parameter group, and obtain a first detection result;

[0134] The second detection module is used to detect whether there is abnormal information in the historical plastic products within a preset time period, and obtain a second detection result;

[0135] A determination module, used to determine a detection method of the image to be detected according to the first detection result and the second detection result; wherein the detection method includes a standard detection method and an abnormal detection method;

[0136] A first defect detection module, used for performing defect detection on the image to be detected according to a preset detection strategy to obtain a defect detection result when the detection mode is a standard detection mode;

[0137] A second defect detection module is used to perform defect detection on the image to be tested according to a preset detection strategy when the detection mode is the abnormal detection mode, to obtain a third detection result, to extract the abnormal area of ​​the image to be tested according to the abnormal information, to obtain an abnormal image group, to determine a first tuning weight value according to the first detection result and the second detection result, to determine a second tuning weight value according to the frequency of occurrence of the abnormal information within a preset time period, to adjust the parameters of the preset detection strategy according to the first tuning weight value and the second tuning weight value to obtain a tuned detection strategy, to perform defect detection on the corresponding abnormal images in the abnormal image group according to the tuned detection strategy to obtain a fourth detection result, and to obtain a defect detection result according to the third detection result and the fourth detection result.

[0138] It can be understood that the functions or modules included in the system provided in this embodiment can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.

[0139] The present invention also provides an electronic device, including a processor and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes a method as described in any possible implementation manner.

[0140] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method as described in any possible implementation manner.

[0141] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present invention have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.

[0143] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0146] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

Claims

1. A plastic product defect detection method based on image processing, characterized in that: The method comprises: Obtaining the image to be tested of the current plastic product and the actual production parameter group of the current plastic product; Detecting whether there is abnormal information in the actual production parameter group to obtain a first detection result; Detect whether there is abnormal information in historical plastic products within a preset time period, and obtain a second detection result; Determine a detection method of the image to be detected according to the first detection result and the second detection result; wherein the detection method includes a standard detection method and an abnormal detection method; When the detection mode is a standard detection mode, defect detection is performed on the image to be detected according to a preset detection strategy to obtain a defect detection result; When the detection mode is the abnormal detection mode, defect detection is performed on the image to be tested according to a preset detection strategy to obtain a third detection result, the abnormal area of ​​the image to be tested is extracted according to the abnormal information to obtain an abnormal image group, a first tuning weight value is determined according to the first detection result and the second detection result, a second tuning weight value is determined according to the frequency of occurrence of the abnormal information within a preset time period, parameters of the preset detection strategy are adjusted according to the first tuning weight value and the second tuning weight value to obtain a tuned detection strategy, defect detection is performed on the corresponding abnormal images in the abnormal image group according to the tuned detection strategy to obtain a fourth detection result, and a defect detection result is obtained according to the third detection result and the fourth detection result.

2. The method for detecting defects in plastic products based on image processing according to claim 1, characterized in that: Performing defect detection on the image to be tested according to a preset detection strategy includes: Preprocessing the image to be tested; Convert the preprocessed image from the spatial domain to the frequency domain to obtain a frequency domain image; Performing filtering processing on the frequency domain image by using a preset Gaussian band-stop filter; The filtered frequency domain image is converted back to the spatial domain to obtain a secondary processed image; Edge detection is performed on the secondary processed image to extract the contour in the image and mark the defective area.

3. The method for detecting defects in plastic products based on image processing according to claim 2, characterized in that: Adjusting the parameters of the preset detection strategy according to the first tuning weight value and the second tuning weight value includes: Tuning the center frequency and bandwidth of the preset Gaussian band-stop filter according to the first tuning weight value and the second tuning weight value to obtain a tuned preset Gaussian band-stop filter; The threshold of the edge detection is tuned according to the first tuning weight value and the second tuning weight value to obtain a tuned edge detection.

4. The method for detecting defects in plastic products based on image processing according to claim 1, characterized in that: Determining a first tuning weight value according to the first detection result and the second detection result includes: Determine whether the first detection result and the second detection result both contain abnormal information; If so, compare and analyze the abnormal information corresponding to the first detection result with the abnormal information corresponding to the second detection result to determine whether there is the same abnormal information, and if so, determine that the first tuning weight value is the first weight value; if not, determine that the first tuning weight value is the second weight value; wherein the detection accuracy of the first weight value is higher than the detection accuracy of the second weight value; If not, determine that the first tuning weight value is a second weight value.

5. The method for detecting defects in plastic products based on image processing according to claim 1, characterized in that: Extracting the abnormal area of ​​the image to be tested according to the abnormal information to obtain an abnormal image group includes: Determine corresponding defect features according to the abnormal information; wherein the defect features include defect type, defect location and defect shape; According to the defect feature, an abnormal area actually corresponds to the image to be tested; Performing region segmentation on the image to be tested according to the abnormal region to obtain an abnormal region image; The abnormal region images are classified according to the defect types to obtain the abnormal image group.

6. The method for detecting defects in plastic products based on image processing according to claim 1, characterized in that: Determining a detection method for the image to be detected according to the first detection result and the second detection result includes: Determine whether at least one of the first detection result and the second detection result has abnormal information; If so, determining that the detection method of the image to be tested is an abnormality detection method; If not, it is determined that the detection method of the image to be detected is a standard detection method.

7. The method for detecting defects in plastic products based on image processing according to claim 1, characterized in that: Obtain the image to be tested of the current plastic product and the actual production parameter group of the current plastic product, including: When it is detected that the plastic product enters the shooting area, an image of the area to be tested of the plastic product is acquired by an image acquisition device to obtain the image to be tested; Divide the production process into several production stages according to the production process; Real-time production parameters of several production sections are acquired to obtain the actual production parameter group.

8. The method for detecting defects in plastic products based on image processing according to claim 1, characterized in that: The detecting whether there is abnormal information in the actual production parameter group includes: determining whether there is a real-time production parameter in the actual production parameter group whose absolute value of difference with the corresponding normal production parameter is greater than a preset safety threshold, and if so, determining that there is abnormal information in the actual production parameter group, and if not, determining that there is no abnormal information in the actual production parameter group; The detecting whether there is abnormal information in the historical plastic products within the preset time period includes: determining whether there is at least one defect detection result indicating the existence of a defect in the defect detection results of the historical plastic products within the preset time period; if so, determining that there is abnormal information in the historical plastic products within the preset time period; if not, determining that there is no abnormal information in the historical plastic products within the preset time period.

9. The method for detecting defects in plastic products based on image processing according to any one of claims 1 to 8, characterized in that: Also includes: When the defect detection result indicates that a defect exists, generating tuning information according to the abnormal information and the defect detection result; The corresponding production section and normal production parameters of the production section are optimized according to the tuning information.

10. A plastic product defect detection system based on image processing, characterized in that: The system comprises: An acquisition module, used to acquire the image to be tested of the current plastic product and the actual production parameter group of the current plastic product; A first detection module, used to detect whether there is abnormal information in the actual production parameter group, and obtain a first detection result; The second detection module is used to detect whether there is abnormal information in the historical plastic products within a preset time period, and obtain a second detection result; A determination module, used to determine a detection method of the image to be detected according to the first detection result and the second detection result; wherein the detection method includes a standard detection method and an abnormal detection method; A first defect detection module, used for performing defect detection on the image to be detected according to a preset detection strategy to obtain a defect detection result when the detection mode is a standard detection mode; A second defect detection module is used to perform defect detection on the image to be tested according to a preset detection strategy when the detection mode is the abnormal detection mode, to obtain a third detection result, to extract the abnormal area of ​​the image to be tested according to the abnormal information, to obtain an abnormal image group, to determine a first tuning weight value according to the first detection result and the second detection result, to determine a second tuning weight value according to the frequency of occurrence of the abnormal information within a preset time period, to adjust the parameters of the preset detection strategy according to the first tuning weight value and the second tuning weight value to obtain a tuned detection strategy, to perform defect detection on the corresponding abnormal images in the abnormal image group according to the tuned detection strategy to obtain a fourth detection result, and to obtain a defect detection result according to the third detection result and the fourth detection result.

Citation Information

Patent Citations

  • Tobacco shred production line automatic batch change abnormity detection method based on visual identification

    CN115311540A

  • Method and system for detecting defects of inner wall and outer wall of oxygen-free copper pipe with square outside and round inside

    CN118376690A