A method and system for detecting surface defects of plastic products based on machine vision
Through machine vision technology, the surface defect characteristics of plastic products are extracted, the degree of impact and periodicity are calculated, and the detection time interval is recommended, which solves the problems of low detection efficiency and insufficient accuracy in the existing technology, and realizes efficient and accurate plastic products inspection and production manage.
Patent Information
- Application Number
- CN202411248445.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-06
AI Technical Summary
The prior art has low detection efficiency and insufficient accuracy in the detection of surface defects of plastic products, resulting in possible missed inspection of defective products, affecting product quality and performance.
Using machine vision-based detection methods, we can obtain images of the surface of plastic products, extract defect characteristics, calculate defect judgment values, evaluate the degree of defect impact, and judge whether it is periodic based on the generated signals. We recommend the detection time interval to improve detection accuracy and efficiency.
It realizes efficient and accurate identification and evaluation of surface defects of plastic products, reduces rework and resource waste caused by defective products, optimizes the inspection process, and improves production management efficiency.
Smart Images

Figure CN118762021B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of plastic product defect detection, and in particular to a method and system for detecting surface defects of plastic products based on machine vision. Background Art
[0002] With the rapid development of industrial manufacturing technology, plastic products, as an important part of modern industry, are increasingly widely used, from daily necessities to high-tech products, almost everywhere. However, in the production process of plastic products, due to the influence of various factors such as materials, processes, and environment, various defects often appear on the surface, such as bubbles. These defects not only affect the appearance quality of the product, but also may have a serious impact on the performance and service life of the product. Therefore, the detection of surface defects of plastic products has become an important part of quality control;
[0003] However, although there is currently a method of detecting the surface of plastic products by collecting images through machine vision, the detection of single defects during the detection process is not accurate enough, such as surface bubbles, which leads to reduced detection efficiency. At the same time, the detection process is generally carried out after the production is completed. This method may miss defective products and has low detection accuracy.
[0004] In view of this, we proposed a method and system for surface defect detection of plastic products based on machine vision. Summary of the invention
[0005] The object of the present invention is to provide a method and system for detecting surface defects of plastic products based on machine vision to solve the problems in the above background.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] A method and system for detecting surface defects of plastic products based on machine vision, comprising the following steps: Step 1: Acquire a surface image of a plastic product, acquire defect features of the image, and make a preliminary judgment on the defects of the plastic product; wherein the defect features include bubbles on the surface of the plastic product; Step 2: Based on the generated pre-defective signal, acquire bubble feature data of the detection area, calculate a defect judgment value, and evaluate the degree of defect impact; wherein the process of evaluating the degree of defect impact is: acquire a defect judgment value; compare the defect judgment value with a defect judgment threshold; if the defect judgment value is less than the defect judgment threshold, generate a low impact signal; if the defect judgment value is greater than or equal to the defect judgment threshold, generate a high impact signal; Step 3: Based on the generated defective signal and high impact signal, acquire detection samples corresponding to the generated defective signal and the high impact signal, trace back the time corresponding to these detection samples, and determine whether there is periodicity; Step 4: Based on the periodicity judgment result, acquire the recommended detection time interval value for the plastic product.
[0008] As a further solution of the present invention: the process of making a preliminary judgment on the defects of the plastic product is:
[0009] Testing plastic products produced by the same production equipment, marking them as test samples, obtaining surface images of the test samples, and marking them as test images;
[0010] Preset the detection period, obtain the bubble position in the detection image, and divide the detection image into a mesh to obtain multiple detection areas;
[0011] Extract the detection area corresponding to the bubble position, mark it as the abnormal detection area, sum up the areas of all abnormal detection areas, and get the total area of the abnormal area;
[0012] Calculate the ratio of the total area of the abnormal region to the total area of the image to obtain the proportion of the abnormal region;
[0013] Compare the abnormal area percentage with the abnormal area percentage;
[0014] If the abnormal area ratio is less than the abnormal area ratio threshold, a pre-defective signal is generated;
[0015] If the abnormal area ratio is greater than or equal to the abnormal area ratio threshold, a defective signal is generated.
[0016] As a further solution of the present invention: the process of obtaining the defect judgment value is as follows:
[0017] Obtain the percentage of abnormal integrated areas, bubble area representation values, and percentage of bubbles of other shapes;
[0018] The defect judgment value is obtained by multiplying the percentage of abnormal integrated areas, the bubble area representation value and the percentage of bubbles of other shapes.
[0019] As a further solution of the present invention: the process of obtaining the proportion of the number of abnormal integrated areas and the proportion of bubbles of other shapes is as follows:
[0020] Obtain the test sample corresponding to the generated pre-defective signal and the corresponding abnormal area, and obtain the numerical value of the abnormal area;
[0021] Integrate the adjacent abnormal areas to obtain the number of abnormal integrated areas and the total number of detection areas, calculate the ratio of the number of abnormal integrated areas to the total number of detection areas, and obtain the proportion of the number of abnormal integrated areas;
[0022] Among all the bubbles, extract the number of bubbles of other shapes (that is, the number of bubbles of shapes other than circles), compare the number of bubbles of other shapes with the total number of bubbles, and get the proportion of bubbles of other shapes.
[0023] As a further solution of the present invention: the process of obtaining the bubble area characterization value is:
[0024] Acquire characteristic data of the bubbles, wherein the characteristic data of the bubbles include area value data of the bubbles;
[0025] Compare the bubble area value data with the bubble area standard value respectively. If the bubble area value is less than the bubble area standard value, it is marked as a normal bubble. If the bubble area value is greater than or equal to the bubble area standard value, it is marked as an abnormal bubble.
[0026] Obtain the number of bubbles marked as abnormal and the number of normal bubbles, sum them up to get the total number of bubbles, calculate the ratio of the number of abnormal bubbles to the total number of bubbles, and get the proportion of abnormal bubbles;
[0027] Extract the maximum area value of the abnormal bubbles, calculate the difference between the maximum area value and the standard value of the bubble area, calculate the ratio between the absolute value of the difference and the standard value of the bubble area, and obtain the maximum deviation ratio;
[0028] Sum up all bubble values and take the average, calculate the difference between the average and the standard value of the bubble area, calculate the ratio of the absolute value of the difference to the standard value of the bubble area, and get the mean deviation ratio;
[0029] Substitute the abnormal bubble ratio, maximum deviation ratio and mean deviation ratio into the formula , the bubble area representation value MJ is calculated, where YC represents the proportion of abnormal bubbles, ZD represents the maximum deviation proportion, JZ represents the mean deviation ratio, a1, a2, and a3 are weight coefficients, and a1+a2+a3=1.
[0030] As a further solution of the present invention: the process of judging whether there is periodicity is as follows:
[0031] Obtain the number of valid values and the number of invalid values, sum them up to obtain the total number, calculate the ratio of the number of valid values to the total number, and obtain the ratio of valid values;
[0032] Compare the effective value ratio value with the effective value ratio standard value;
[0033] If the effective value ratio is greater than or equal to the effective value ratio standard value, a periodic signal is generated;
[0034] If the ratio of valid values is less than the standard ratio of valid values, a non-periodic signal is generated.
[0035] As a further solution of the present invention: the process of obtaining valid values and invalid values is:
[0036] Obtain samples to be analyzed, trace the time of samples to be analyzed, calculate the difference in production time of adjacent samples to be analyzed, and mark it as a time interval value;
[0037] All time interval values are summed up and averaged to obtain the time interval mean, and all time interval values are respectively subtracted from the time interval mean to obtain the absolute value of the difference and mark it as the time interval deviation value;
[0038] comparing the time interval deviation value to a time interval deviation threshold;
[0039] If the time interval deviation value is less than or equal to the time interval deviation threshold, a valid value is generated;
[0040] If the time interval deviation value is greater than the time interval deviation threshold, an invalid value is generated.
[0041] As a further solution of the present invention: the process of obtaining the sample to be analyzed is:
[0042] Obtain the test samples and corresponding numerical values corresponding to the defective signal and the high-impact signal, and obtain the total numerical values of the test samples;
[0043] The number of test samples corresponding to the defective signal is processed by ratio with the total number of test samples to obtain the defective ratio;
[0044] The number of test samples corresponding to the generated high-impact signal is ratioed to the total number of test samples to obtain a high-impact ratio;
[0045] Compare the defective ratio value with the high impact ratio value. If the defective ratio value is greater than the high impact ratio value, the test sample corresponding to the defective signal will be marked as the sample to be analyzed. If the defective ratio value is less than the high impact ratio value, the test sample corresponding to the high impact signal will be marked as the sample to be analyzed. If the defective ratio value is equal to the high impact ratio value, both the test sample corresponding to the defective signal and the test sample corresponding to the high impact signal will be marked as samples to be analyzed.
[0046] As a further solution of the present invention: the process of obtaining the recommended detection time interval value is:
[0047] Based on the generated periodic signal, the mean time interval is obtained, and the mean time interval is the recommended detection time interval value;
[0048] Based on the non-periodic signal generated above, the corresponding time interval value is obtained, and the minimum value among the time interval values is extracted. The minimum value among the time interval values is the recommended detection time interval value.
[0049] As a further solution of the present invention: comprising:
[0050] Image acquisition and detection module: acquire the surface image of the plastic product, obtain the defect characteristics of the image, and make a preliminary judgment on the defects of the plastic product;
[0051] Secondary detection and judgment module: Based on the generated pre-defective signal, obtain the bubble characteristic data of the detection area, calculate the defect judgment value, and evaluate the degree of defect impact;
[0052] Periodicity judgment module: based on the generated defective signal and high-impact signal, obtain the test samples corresponding to the generated defective signal and high-impact signal, trace the time corresponding to these test samples, and judge whether there is periodicity;
[0053] Recommended inspection time acquisition module: based on the periodic judgment results, obtain the recommended inspection time interval value for plastic products.
[0054] Beneficial effects of the present invention:
[0055] The present invention obtains an image of the surface of a plastic product, analyzes the image, calculates the proportion of abnormal areas, makes a preliminary judgment on the bubbles on the surface of the plastic product, generates a pre-defective signal or a defective signal, and specifically analyzes the bubbles on the surface of the plastic product based on the generated pre-defective signal, calculates a defect judgment value, and evaluates the degree of influence on the plastic product based on the defect judgment value. Therefore, when inspecting the plastic product, the defects of the bubbles on the surface of the plastic product are efficiently and accurately identified and evaluated based on the image analysis, thereby improving the inspection accuracy, and providing real-time feedback on the inspection results, thereby timely adjusting the production process or improving the product design, and reducing rework and resource waste caused by defective products.
[0056] The present invention, based on the generated defective signal and high-impact signal, firstly extracts the maximum value of the proportion of the two signals for analysis through the proportion of the two signals, traces the corresponding production time, and calculates and analyzes the production time to evaluate whether the time interval is periodic, and then calculates the recommended detection time interval value according to the judgment result, so that the detection process can be optimized according to the calculated recommended detection time interval value, the detection efficiency can be improved, and the production process can be effectively managed;
[0057] The present invention extracts preset time periods during the production process and performs real-time detection and analysis to obtain detection results and recommended detection time interval values, thereby facilitating the improvement of subsequent production management and optimization of subsequent detection processes, reducing missed detection of defective products, and improving detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The present invention will be further described below in conjunction with the accompanying drawings.
[0059] Figure 1 It is a schematic flow chart of a method for detecting surface defects of plastic products based on machine vision according to the present invention;
[0060] Figure 2 It is a schematic diagram of a defect judgment value acquisition process in a method for detecting surface defects of plastic products based on machine vision according to the present invention;
[0061] Figure 3 It is a schematic diagram of a process for obtaining a bubble area characterization value in a plastic product surface defect detection method based on machine vision of the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Example 1
[0063] See also Figure 1 - Figure 3 As shown, bubbles on the surface of plastic products may affect the appearance quality and performance of the plastic products. Therefore, it is necessary to detect the surface bubbles of plastic products during the production process. The present invention is a method for detecting surface defects of plastic products based on machine vision, comprising the following steps:
[0064] Step 1: Obtain a surface image of the plastic product, obtain defect features of the image, and make a preliminary judgment on the defects of the plastic product;
[0065] Among them, defect characteristics include bubbles on the surface of plastic products;
[0066] In some embodiments, plastic products produced by the same production equipment are inspected and marked as inspection samples, and surface images of the inspection samples are obtained by using relevant machine vision technologies and marked as inspection images;
[0067] Exemplarily, the process of obtaining a surface image by a related technology of machine vision includes image acquisition and image preprocessing of the surface of a plastic product;
[0068] Specifically, the camera devices that can be used when performing image acquisition include but are not limited to CMOS and CCD cameras;
[0069] The image preprocessing process includes:
[0070] Denoising: Due to factors such as uneven lighting and camera noise, the collected images may contain noise. Denoising can reduce the impact of noise on image quality. Commonly used denoising methods include but are not limited to median filtering and Gaussian filtering.
[0071] Enhancement: In order to improve the visibility of the surface features of plastic products in the image, the image can be enhanced. Common enhancement methods include but are not limited to contrast enhancement and sharpening. Contrast enhancement can expand the brightness difference between different areas in the image to make the features more prominent, and sharpening can enhance the edge information of the image to make the details clearer.
[0072] Correction: If there is distortion or deviation in the camera or light source, the captured image may be distorted or offset. These distortions and deviations can be eliminated through correction processing. Common correction methods include but are not limited to geometric correction and color correction. Geometric correction can restore the geometric shape in the image, and color correction can adjust the color balance and saturation of the image.
[0073] Segmentation: In order to further analyze the features or defects on the surface of plastic products, it may be necessary to segment the image. Segmentation can separate different areas or objects in the image for separate analysis and processing. Common segmentation methods include but are not limited to threshold segmentation and edge detection.
[0074] Preset the detection period, obtain the bubble position in the detection image, and divide the detection image into a mesh to obtain multiple detection areas;
[0075] The detection period is set by those skilled in the art based on experience;
[0076] Extract the detection area corresponding to the bubble position, mark it as the abnormal detection area, sum up the areas of all abnormal detection areas, and get the total area of the abnormal area;
[0077] Calculate the ratio of the total area of the abnormal region to the total area of the image to obtain the proportion of the abnormal region;
[0078] It should be explained that the abnormal area ratio reflects: the abnormal area ratio is calculated from the total area of the abnormal area, which indicates the relative size of the area where the bubbles are located in the test sample. The higher this ratio is, the more and denser the bubbles in the test sample are.
[0079] Compare the abnormal area ratio with the abnormal area ratio threshold (the abnormal area ratio threshold is set by a technician in this field based on historical experimental data);
[0080] If the abnormal area ratio is less than the abnormal area ratio threshold, it means that the area where the bubbles are located is relatively small, and the impact on the overall quality and performance of the plastic product may be small. The product may meet the quality standards and needs further judgment to generate a pre-defective signal;
[0081] If the abnormal area ratio is greater than or equal to the abnormal area ratio threshold, it means that the area where the bubbles are located is large, which may affect the overall quality and performance of the plastic product and generate a defective signal;
[0082] Step 2: Based on the generated pre-defective signal, the bubble characteristic data of the detection area is obtained, the defect judgment value is calculated, and the degree of defect impact is evaluated;
[0083] In some embodiments, a test sample corresponding to the generated pre-defective signal and a corresponding abnormal region are obtained, and a numerical value of the abnormal region is obtained;
[0084] Integrate the adjacent abnormal areas to obtain the number of abnormal integrated areas and the total number of detection areas, calculate the ratio of the number of abnormal integrated areas to the total number of detection areas, and obtain the proportion of the number of abnormal integrated areas;
[0085] It should be explained that the percentage of abnormal integrated areas reflects: the percentage of abnormal integrated areas is calculated by the value of the abnormal integrated areas and the total value of the detection areas, which indicates the distribution density of the abnormal areas where the bubbles are located. That is, the larger the percentage of abnormal integrated areas, the more dispersed the bubble positions on the surface of the plastic product, and the greater the impact on the surface of the plastic product.
[0086] Acquire characteristic data of the bubbles, wherein the characteristic data of the bubbles include area value data of the bubbles;
[0087] Compare the bubble area value data with the bubble area standard value respectively. If the bubble area value is less than the bubble area standard value, it is marked as a normal bubble. If the bubble area value is greater than or equal to the bubble area standard value, it is marked as an abnormal bubble.
[0088] Obtain the number of bubbles marked as abnormal and the number of normal bubbles, sum them up to get the total number of bubbles, calculate the ratio of the number of abnormal bubbles to the total number of bubbles, and get the proportion of abnormal bubbles;
[0089] Extract the maximum area value of the abnormal bubbles, calculate the difference between the maximum area value and the standard value of the bubble area, calculate the ratio between the absolute value of the difference and the standard value of the bubble area, and obtain the maximum deviation ratio;
[0090] Sum up all bubble values and take the average, calculate the difference between the average and the standard value of the bubble area, calculate the ratio of the absolute value of the difference to the standard value of the bubble area, and get the mean deviation ratio;
[0091] The standard value of the bubble area is set by technicians in the production line who collect and summarize the data through multiple sampling.
[0092] Substitute the abnormal bubble ratio, maximum deviation ratio and mean deviation ratio into the formula , the bubble area representation value MJ is calculated, where YC represents the abnormal bubble ratio, ZD represents the maximum deviation ratio, JZ represents the mean deviation ratio, a1, a2, and a3 are weight coefficients, and a1+a2+a3=1;
[0093] It needs to be explained that the meaning of the bubble area characterization value is as follows: the bubble area characterization value is calculated by the abnormal bubble proportion, the maximum deviation ratio and the mean deviation ratio, that is, the larger the abnormal bubble proportion, the more bubbles with an area greater than the standard value of the bubble area, and the greater the impact on the surface of the plastic product; the larger the maximum deviation ratio, the larger the maximum value of the abnormal bubble area, and the greater the impact on the surface of the plastic product; the larger the mean deviation ratio, the larger the mean value of the bubble area, the higher the average level of the bubble area, and the greater the impact on the surface of the plastic product;
[0094] Among all the bubbles, extract the number of bubbles of other shapes (that is, the number of bubbles of other shapes except the circle), compare the number of bubbles of other shapes with the total number of bubbles, and calculate the proportion of bubbles of other shapes;
[0095] It should be noted that round bubbles are more stable in plastic products than irregular bubbles. This is because when round bubbles are subjected to external forces, their shape changes may be more uniform, thereby reducing the impact on the overall structure of the plastic product. Therefore, when there are more bubbles of other shapes, the impact on the plastic product will be greater.
[0096] It should be explained that the proportion of bubbles of other shapes reflects that bubbles of other shapes are calculated by the value of bubbles of other shapes and the value of the total number of bubbles, that is, the greater the proportion of bubbles of other shapes, the greater the impact on the surface of plastic products;
[0097] The defect judgment value is obtained by multiplying the percentage of abnormal integrated areas, the bubble area representation value and the percentage of bubbles of other shapes;
[0098] Compare the defect judgment value with the defect judgment threshold (the defect judgment threshold is set by a person skilled in the art based on historical experimental data);
[0099] If the defect judgment value is less than the defect judgment threshold, it means that the bubbles generated on the surface of the plastic product have little impact on the product quality, and a low impact signal is generated;
[0100] If the defect judgment value is greater than or equal to the defect judgment threshold, it means that the bubbles on the surface of the plastic product have a greater impact on the product quality, and a high impact signal is generated;
[0101] The core technology of this embodiment is: first, an image of the surface of the plastic product is obtained, and the image is analyzed to calculate the proportion of the abnormal area, a preliminary judgment is made on the bubbles on the surface of the plastic product, and a pre-defective signal or a defective signal is generated. Based on the generated pre-defective signal, a specific analysis is made on the bubbles on the surface of the plastic product, a defect judgment value is calculated, and the degree of impact on the plastic product is evaluated based on the defect judgment value. Therefore, when inspecting plastic products, the defects of the bubbles on the surface of the plastic products can be efficiently and accurately identified and evaluated based on the image analysis, thereby improving the detection accuracy, and providing real-time feedback on the detection results, thereby timely adjusting the production process or improving the product design, thereby reducing rework and waste of resources caused by defective products. Example 2
[0102] Based on the above embodiments, the present invention is a method for detecting surface defects of plastic products based on machine vision, which further includes the following steps:
[0103] Step 3: Based on the defective signal and the high-impact signal generated above, obtain the test samples corresponding to the defective signal and the high-impact signal, trace back the time corresponding to these test samples, and determine whether there is periodicity;
[0104] In some embodiments, the detection samples and corresponding numerical values corresponding to the generation of defective signals and high-impact signals are obtained, and the total numerical values of the detection samples are obtained;
[0105] The number of test samples corresponding to the defective signal is processed by ratio with the total number of test samples to obtain the defective ratio;
[0106] The number of test samples corresponding to the generated high-impact signal is ratioed to the total number of test samples to obtain a high-impact ratio;
[0107] Compare the defective ratio value with the high impact ratio value. If the defective ratio value is greater than the high impact ratio value, mark the test sample corresponding to the defective signal as the sample to be analyzed. If the defective ratio value is less than the high impact ratio value, mark the test sample corresponding to the high impact signal as the sample to be analyzed. If the defective ratio value is equal to the high impact ratio value, mark both the test sample corresponding to the defective signal and the test sample corresponding to the high impact signal as samples to be analyzed.
[0108] It should be explained that, through the calculation of the above process, the type of signals that generate defective products and high-impact signals that account for a large proportion are analyzed, so that it is easy to timely understand the main frequent problems, improve the detection efficiency, and optimize the production process;
[0109] Obtain samples to be analyzed, trace the time of samples to be analyzed, calculate the difference in production time of adjacent samples to be analyzed, and mark it as a time interval value;
[0110] All time interval values are summed up and averaged to obtain the time interval mean, and all time interval values are respectively subtracted from the time interval mean to obtain the absolute value of the difference and mark it as the time interval deviation value;
[0111] Compare the time interval deviation value with the time interval deviation threshold (the time interval deviation threshold is set by a person skilled in the art based on historical experimental data summary);
[0112] If the time interval deviation value is less than or equal to the time interval deviation threshold, it means that the time interval value is close to the time interval mean value, and a valid value is generated;
[0113] If the time interval deviation value is greater than the time interval deviation threshold, it means that the time interval value is significantly different from the time interval mean value, and an invalid value is generated;
[0114] Obtain the number of valid values and the number of invalid values, sum them up to obtain the total number, calculate the ratio of the number of valid values to the total number, and obtain the ratio of valid values;
[0115] Compare the effective value ratio with the effective value ratio standard value, wherein the effective value ratio standard value is set by a person skilled in the art based on historical experimental data;
[0116] If the effective value ratio is greater than or equal to the effective value ratio standard value, it means that there are more effective values and a periodic signal is generated;
[0117] If the effective value ratio is less than the standard value of effective value ratio, it means that the effective value is small and the generated signal is not periodic;
[0118] Step 4: Based on the periodic judgment result, obtain the recommended detection time interval value for the plastic product;
[0119] In some embodiments, based on the periodic signal generated above, the appearance of the sample to be analyzed has a certain periodicity during the detection period, and the mean time interval is obtained, and the mean time interval is the recommended detection time interval value;
[0120] Based on the non-periodic signal generated above, the appearance of the sample to be analyzed during the detection period does not have a certain periodicity.
[0121] Obtain the corresponding time interval value, extract the minimum value among the time interval values, and the minimum value among the time interval values is the recommended detection time interval value;
[0122] It should be noted that by analyzing the preset time period and calculating the recommended time interval value, the subsequent detection process can be optimized, the detection efficiency can be improved, and the detection workload can be reduced.
[0123] The core technology of this embodiment is: based on the generated defective signal and high-impact signal, firstly, through the ratio of the two signals, the maximum ratio of the two signals is extracted for analysis, the corresponding production time is traced, and the production time is calculated and analyzed to evaluate whether the time interval is periodic, and then the recommended detection time interval value is calculated according to the judgment result, so that the detection process can be optimized according to the calculated recommended detection time interval value, the detection efficiency can be improved, and the production process can be effectively managed. Example 3
[0124] Based on the above embodiments, the present invention is a plastic product surface defect detection system based on machine vision, which specifically includes:
[0125] Image acquisition and detection module: acquire the surface image of the plastic product, obtain the defect characteristics of the image, and make a preliminary judgment on the defects of the plastic product;
[0126] Secondary detection and judgment module: Based on the generated pre-defective signal, obtain the bubble characteristic data of the detection area, calculate the defect judgment value, and evaluate the degree of defect impact;
[0127] Periodicity judgment module: based on the defective signal and high-impact signal generated above, obtain the test samples corresponding to the defective signal and the high-impact signal, trace the time corresponding to these test samples, and judge whether there is periodicity;
[0128] Recommended inspection time acquisition module: based on the periodic judgment results, obtain the recommended inspection time interval value for plastic products.
[0129] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. A method for detecting surface defects of plastic products based on machine vision, characterized in that: The following steps are involved: Step 1: Obtain a surface image of the plastic product, obtain defect features of the image, and make a preliminary judgment on the defects of the plastic product; Among them, defect characteristics include bubbles on the surface of plastic products; Testing plastic products produced by the same production equipment, marking them as test samples, obtaining surface images of the test samples, and marking them as test images; Preset the detection period, obtain the bubble position in the detection image, and divide the detection image into a mesh to obtain multiple detection areas; Extract the detection area corresponding to the bubble position, mark it as the abnormal detection area, sum up the areas of all abnormal detection areas, and get the total area of the abnormal area; Calculate the ratio of the total area of the abnormal region to the total area of the image to obtain the proportion of the abnormal region; Compare the abnormal area ratio with the abnormal area ratio threshold; If the abnormal area ratio is less than the abnormal area ratio threshold, a pre-defective signal is generated; If the abnormal area ratio is greater than or equal to the abnormal area ratio threshold, a defective signal is generated; Step 2: Based on the generated pre-defective signal, obtain the bubble characteristic data of the detection area, calculate the defect judgment value, and evaluate the degree of defect impact; The process of obtaining the defect judgment value is as follows: Obtain the percentage of abnormal integrated areas, bubble area representation values, and percentage of bubbles of other shapes; The defect judgment value is obtained by multiplying the percentage of abnormal integrated areas, the bubble area representation value and the percentage of bubbles of other shapes; The process of evaluating the impact of defects is as follows: obtaining a defect determination value; comparing the defect determination value with a defect determination threshold; If the defect judgment value is less than the defect judgment threshold, a low impact signal is generated; If the defect judgment value is greater than or equal to the defect judgment threshold, a high impact signal is generated; Step 3: Based on the generated defective signal and high-impact signal, obtain the test samples corresponding to the generated defective signal and the high-impact signal, trace back the time corresponding to these test samples, and determine whether there is periodicity; Step 4: Based on the periodic judgment results, obtain the recommended inspection time interval value for plastic products.
2. The method for detecting surface defects of plastic products based on machine vision according to claim 1, characterized in that: The process of obtaining the proportion of abnormal integrated areas and the proportion of bubbles of other shapes is as follows: Obtain the test sample corresponding to the generated pre-defective signal and the corresponding abnormal area, and obtain the numerical value of the abnormal area; Integrate the adjacent abnormal areas to obtain the number of abnormal integrated areas and the total number of detection areas, calculate the ratio of the number of abnormal integrated areas to the total number of detection areas, and obtain the proportion of the number of abnormal integrated areas; Among all the bubbles, extract the number of bubbles of other shapes, compare the number of bubbles of other shapes with the total number of bubbles, and get the proportion of bubbles of other shapes.
3. The method for detecting surface defects of plastic products based on machine vision according to claim 1, characterized in that: The process of obtaining the bubble area characterization value is as follows: Acquire characteristic data of the bubbles, wherein the characteristic data of the bubbles include area value data of the bubbles; Compare the bubble area value data with the bubble area standard value respectively. If the bubble area value is less than the bubble area standard value, it is marked as a normal bubble. If the bubble area value is greater than or equal to the bubble area standard value, it is marked as an abnormal bubble. Obtain the number of bubbles marked as abnormal and the number of normal bubbles, sum them up to get the total number of bubbles, calculate the ratio of the number of abnormal bubbles to the total number of bubbles, and get the proportion of abnormal bubbles; Extract the maximum area value of the abnormal bubbles, calculate the difference between the maximum area value and the standard value of the bubble area, take the absolute value of the difference to obtain the absolute value of the difference, calculate the ratio of the absolute value of the difference to the standard value of the bubble area, and obtain the maximum deviation ratio; All bubble area values are summed up to get the average, the average is calculated with the standard value of the bubble area, the absolute value of the difference is taken to get the absolute value of the difference, the absolute value of the difference is calculated with the standard value of the bubble area to get the mean deviation ratio; Substitute the abnormal bubble ratio, maximum deviation ratio and mean deviation ratio into the formula , the bubble area representation value MJ is calculated, where YC represents the proportion of abnormal bubbles, ZD represents the maximum deviation proportion, JZ represents the mean deviation ratio, a1, a2, and a3 are weight coefficients, and a1+a2+a3=1.
4. The method for detecting surface defects of plastic products based on machine vision according to claim 1, characterized in that: The process of determining whether it is periodic is as follows: Obtain the number of valid values and the number of invalid values, sum them up to obtain the total number, calculate the ratio of the number of valid values to the total number, and obtain the ratio of valid values; Compare the effective value ratio value with the effective value ratio standard value; If the effective value ratio is greater than or equal to the effective value ratio standard value, a periodic signal is generated; If the effective value ratio is less than the effective value ratio standard value, a non-periodic signal is generated.
5. The method for detecting surface defects of plastic products based on machine vision according to claim 4, characterized in that: The process of obtaining valid and invalid values is as follows: Obtain samples to be analyzed, trace the time of samples to be analyzed, calculate the difference in production time of adjacent samples to be analyzed, and mark it as a time interval value; All time interval values are summed up and averaged to obtain the time interval mean, all time interval values are respectively subtracted from the time interval mean, the absolute values of the differences are taken to obtain the absolute values of the differences, and the absolute values of the differences are marked as the time interval deviation values; comparing the time interval deviation value to a time interval deviation threshold; If the time interval deviation value is less than or equal to the time interval deviation threshold, a valid value is generated; If the time interval deviation value is greater than the time interval deviation threshold, an invalid value is generated.
6. The method for detecting surface defects of plastic products based on machine vision according to claim 5, characterized in that: The process of obtaining samples to be analyzed is as follows: Obtain the test samples and corresponding numerical values corresponding to the defective signal and the high-impact signal, and obtain the total numerical values of the test samples; The number of test samples corresponding to the defective signal is processed by ratio with the total number of test samples to obtain the defective ratio; The number of test samples corresponding to the generated high-impact signal is ratioed to the total number of test samples to obtain a high-impact ratio; Compare the defective ratio value with the high impact ratio value. If the defective ratio value is greater than the high impact ratio value, the test sample corresponding to the defective signal will be marked as the sample to be analyzed. If the defective ratio value is less than the high impact ratio value, the test sample corresponding to the high impact signal will be marked as the sample to be analyzed. If the defective ratio value is equal to the high impact ratio value, both the test sample corresponding to the defective signal and the test sample corresponding to the high impact signal will be marked as samples to be analyzed.
7. The method for detecting surface defects of plastic products based on machine vision according to claim 4, characterized in that: The recommended detection interval value is obtained as follows: Based on the generated periodic signal, the mean time interval is obtained, and the mean time interval is the recommended detection time interval value; Based on the non-periodic signal generated above, the corresponding time interval value is obtained, and the minimum value among the time interval values is extracted. The minimum value among the time interval values is the recommended detection time interval value.
8. A system for detecting surface defects of plastic products based on machine vision, the system implementing the method according to any one of claims 1 to 7, characterized in that: include: Image acquisition and detection module: acquire the surface image of the plastic product, obtain the defect characteristics of the image, and make a preliminary judgment on the defects of the plastic product; Secondary detection and judgment module: Based on the generated pre-defective signal, obtain the bubble characteristic data of the detection area, calculate the defect judgment value, and evaluate the degree of defect impact; Periodicity judgment module: based on the generated defective signal and high-impact signal, obtain the test samples corresponding to the generated defective signal and high-impact signal, trace the time corresponding to these test samples, and judge whether there is periodicity; Recommended inspection time acquisition module: based on the periodic judgment results, obtain the recommended inspection time interval value for plastic products.
Citation Information
Cited By
Plastic product surface defect detection method and system based on machine vision
CN121544560A
