A Machine Vision-Based Method for Detecting Surface Defects in Plastic Films

By employing image acquisition and restoration techniques, combined with the evaluation of image quality parameters and feature parameters, the problem of inconsistent accuracy in detecting surface defects of plastic films under different environments has been solved, achieving high-precision defect detection.

CN120976210BActive Publication Date: 2026-04-07GUANGZHOU MEISILE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies use a single, fixed detection method to inspect images of plastic films, which cannot verify the accuracy of the detection results based on actual environmental conditions, resulting in inconsistent accuracy under different environments.

Method used

Images of the plastic film surface are acquired using an image acquisition device, image quality parameters are extracted and repaired, image feature parameters are extracted after region division, the accuracy of the analysis results is evaluated, and secondary repairs are performed if necessary until the preset standard is met.

Benefits of technology

This improves the accuracy and precision of detecting surface defects in plastic films, ensuring the stability and consistency of test results under different environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976210B_ABST
    Figure CN120976210B_ABST
Patent Text Reader

Abstract

This invention relates to the field of visual inspection technology, and more particularly to a method for detecting surface defects in plastic films based on machine vision. The method includes: acquiring an image of the plastic film surface and extracting image quality parameters; firstly repairing the image quality; extracting and analyzing image feature parameters to firstly determine the surface defect region and defect type; evaluating the accuracy based on color contrast and secondarily repairing the image quality; and analyzing the image feature parameters of a second image to be inspected and secondarily determining the defect region and defect type; evaluating the accuracy of the second determination of the defect region and defect type and determining the true defect region and true defect type. This invention improves the accuracy of detecting surface defects in plastic films by repairing the quality of the image to be inspected and determining the surface defect region and defect type, and by adaptively repairing the quality of the image to be inspected and secondarily determining the surface defect region and defect type after evaluating the accuracy of the defect determination.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of visual inspection, in particular to a plastic film surface defect detection method based on machine vision. BACKGROUND

[0002] Plastic film surface defect detection refers to detecting and analyzing holes, mosquitoes, black spots, crystal spots, scratches, and other defects on the surface of plastic film to ensure the quality and performance of the film. Different types of defects may have different shapes, sizes, and characteristics, and the human eye often cannot accurately judge the defects in time, so various methods and technologies are needed to detect, display, and identify all surface defects on the surface of the film at high speed and high accuracy.

[0003] The patent document with publication number CN120064114A discloses dividing the object to be detected into a plurality of detection areas, marking the center detection area; determining whether the object to be detected is a first detection object or a second detection object; obtaining the defect length and defect width and presetting a first standard defect; determining whether the first detection object is qualified; determining whether the second detection object is qualified; and determining the adjustment parameter.

[0004] In the prior art, a single fixed detection method is often used to detect the film image, so that the accuracy of the detection result cannot be verified according to the actual environmental conditions during the detection process, resulting in uneven accuracy of the detection under the influence of different environments. SUMMARY

[0005] Therefore, the present application provides a plastic film surface defect detection method based on machine vision, which solves the problem that in the prior art, a single fixed detection method is often used to detect the film image, so that the accuracy of the detection result cannot be verified according to the actual environmental conditions during the detection process, resulting in uneven accuracy of the detection under the influence of different environments.

[0006] To achieve the above-mentioned purpose, the present application provides a plastic film surface defect detection method based on machine vision, which comprises:

[0007] An image acquisition device is used to acquire images of the surface of the plastic film and obtain the surface image of the plastic film;

[0008] An image quality parameter of the surface image of the plastic film is extracted, including image resolution and image reflected light brightness;

[0009] The image quality parameter is judged and a judgment result is obtained, and the image quality is repaired once according to the judgment result to obtain a first detection image; the once repair includes adjusting the image resolution and adjusting the image reflected light brightness;

[0010] dividing the first image to be detected into regions to obtain a plurality of first region images to be detected;

[0011] extracting image feature parameters of each of the first region images to be detected and performing analysis to obtain a first analysis result, and determining a surface defect region image and a defect type corresponding to the surface defect region image according to the first analysis result; the image feature parameters include a gray value of a gray region image and a color number of a color region image and a color value corresponding to any color;

[0012] evaluating the accuracy of the first analysis result according to the color contrast of the color anomaly on the first region image to be detected, when the accuracy is less than a preset standard accuracy, repairing the image quality a second time to obtain a second image to be detected, and performing analysis on the image feature parameters of the second image to be detected to obtain a second analysis result, and determining a defect region image and a defect type according to the second analysis result;

[0013] evaluating the accuracy of the second analysis result of the second determination of the defect region image and the defect type, when the accuracy is greater than or equal to the standard accuracy, then determining that the second analysis result is a real defect region image and a real defect type.

[0014] Further, the adjusting of the image reflection light brightness includes: comparing the image reflection light brightness of the surface image with qualified image resolution with a preset standard image reflection light brightness, to determine whether the image reflection light brightness is qualified, when the determination result is that the image reflection light brightness is unqualified, adjusting the image reflection light brightness according to a first adjustment step to a preset standard image reflection light brightness threshold range to obtain a surface image with qualified image reflection light brightness; the surface image with qualified image reflection light brightness is the first image to be detected.

[0015] Further, the extracting of the image feature parameters of each of the first region images to be detected and the performing of analysis to obtain the first analysis result includes:

[0016] comparing the color value of any color on the first region image to be detected with a preset corresponding color value threshold to obtain a first comparison result, when the color value is not within the preset corresponding color value threshold range, determining that the first region image to be detected is a defect region image and determining that the defect type is a color anomaly.

[0017] Further, the evaluating of the accuracy of the first analysis result according to the color contrast of the color anomaly on the first region image to be detected includes:

[0018] The ratio of the color value of each color region to the gray value of the gray region in the first to-be-detected region image is calculated to obtain a contrast of each color region and the gray region; each color corresponds to a color contrast;

[0019] The color contrast is compared with a standard contrast threshold of the corresponding preset color. When the color contrast is not within the standard contrast threshold of the preset color, it is evaluated that the defect type analysis result is incorrect. The incorrect analysis result is recorded as an accuracy score of 0. When the color contrast is within the standard contrast threshold of the preset color, it is evaluated that the defect type analysis result is correct. The correct analysis result is recorded as an accuracy score of 1.

[0020] The accuracy scores of the analysis results that are correct are summed up, and a ratio of the number of defect region images of the defect type of color anomaly is obtained to obtain an accuracy evaluation result. The accuracy evaluation result is between 0 and 1.

[0021] Further, the accuracy evaluation result is compared with a preset objective accuracy. When the comparison result is that the accuracy evaluation result is less than the preset objective accuracy, the image quality is repaired again to obtain a second to-be-detected image, including:

[0022] According to a set second adjustment step, the image reflected light brightness of the first to-be-detected region image is adjusted again to obtain an image reflected light brightness after second adjustment;

[0023] According to a normal distribution relationship between the adjustment step of the image reflected light brightness and the color contrast, a color contrast after second adjustment is obtained. The second adjustment step is less than the first adjustment step.

[0024] When the color contrast after second adjustment falls within the standard contrast threshold of the preset color, a second to-be-detected region image is obtained. The second to-be-detected region image is the first to-be-detected region image after second adjustment.

[0025] Further, the defect region image and the defect type are determined again, including:

[0026] A second color value of a color region of the second to-be-detected region image is obtained, and the second color value is compared with a preset corresponding color value threshold to obtain a second comparison result. When the second color value is not within the preset corresponding color value threshold range, it is determined that the second to-be-detected region image is a defect region image and the defect type is color anomaly.

[0027] Further, before adjusting the image reflected light brightness, the image resolution also needs to be adjusted, including: comparing the image resolution with a preset standard image resolution to determine whether the image resolution is qualified, and when the determination result is that the image resolution is unqualified, adjusting the image resolution to a standard image resolution threshold range to obtain a surface image with qualified image resolution.

[0028] Further, the extracting and analyzing the image feature parameters of each first to-be-detected area image to obtain a first analysis result also includes:

[0029] According to the calculation of the gray value difference and the color value difference between any pixel point and adjacent points on the first to-be-detected area image, when the gray value difference is greater than a preset standard gray value difference or the color value difference is greater than a preset standard color value difference, it is determined that the first to-be-detected area image where the pixel point is located is a defect area image and the defect type is a noise point.

[0030] Further, according to the defect tolerance, the accuracy of the first analysis result of the defect type being a noise point is evaluated, including:

[0031] The number of noise points of the first to-be-detected area image of the defect type being a noise point is counted, and the distribution area of the defect type being a noise point is obtained, and the ratio of the number of noise points to the distribution area of the noise points is calculated to obtain a noise point distribution rate.

[0032] The noise point distribution rate is compared with a preset standard noise point tolerance, when the distribution rate is less than the preset standard noise point tolerance, it is determined that the defect area image of the defect type being a noise point is a normal area image; when the distribution rate is greater than or equal to the preset standard noise point tolerance, it is determined that the defect area image of the defect type being a noise point is a real defect area image and the real defect type is a noise point.

[0033] Further, the defect tolerance is the number of noise points allowed per unit area of the to-be-detected image.

[0034] Compared with the prior art, the beneficial effects of the present application are that by judging the image quality parameters and obtaining the judgment result, the image quality of the to-be-detected image is repaired to be qualified; by dividing the first to-be-detected image into regions and obtaining a plurality of first to-be-detected region images, the unit area of detection is reduced, and the accuracy of defect detection is improved; by extracting the image feature parameters of each first to-be-detected region image and analyzing, the to-be-detected region image defect region and defect type are scientifically determined; by evaluating the accuracy of the first analysis result, the analysis result is tested, and the accuracy of defect detection is improved; by repairing the image quality twice and obtaining a second to-be-detected image, the to-be-detected image quality is further improved, by adjusting the image quality to the optimal state according to the accuracy evaluation result, the accuracy of surface defect detection is improved; by analyzing the image feature parameters of the second to-be-detected image, the accuracy of analyzing the image feature parameters is improved; by determining the defect region and the defect type according to the second analysis result, the accuracy of surface defect detection is improved.

[0035] Especially, by judging whether the image reflected light brightness is qualified to determine the image brightness adjustment, the image quality of the to-be-detected surface image is improved.

[0036] Especially, by judging whether the color value is within the preset corresponding color value threshold range, the defect region and the defect type are determined by the color value.

[0037] Especially, by calculating the contrast of the color region to evaluate the accuracy of the first analysis result of the defect type, the accuracy of the surface defect detection result is evaluated; by comparing each color contrast one by one to obtain the accuracy score, the accuracy of the surface defect determination is improved.

[0038] Especially, by repairing the image quality twice and obtaining a second to-be-detected image when the accuracy evaluation result is less than the preset accuracy, the image quality is adjusted to the optimal state, and the accuracy of surface defect detection is improved; by adjusting the image reflected light brightness of the first to-be-detected region image according to the set second adjustment step to obtain the second adjusted image reflected light brightness and then obtain the second adjusted color contrast, the to-be-detected image quality is scientifically and effectively adjusted; by the second adjustment step being less than or equal to the first adjustment step, the accuracy of the to-be-detected region image quality adjustment is improved.

[0039] In particular, the defect area and the defect type are determined by comparing the second color value of the color area of ​​the second area to be detected with the preset corresponding color value threshold. Each color in the area to be detected is compared with the color value threshold corresponding to that color one by one, and it is determined whether the color area is a defect area one by one. This makes the determination of surface defects more accurate and further improves the accuracy of the determination of defect area images.

[0040] In particular, adjusting the image resolution helps to improve image clarity, thereby improving the quality of the image to be detected.

[0041] In particular, by determining the defect area and defect type as noise by the difference in gray value between any pixel and its neighboring pixels in the image, a scientific and effective noise identification method has been achieved.

[0042] In particular, by assessing the accuracy of defect identification as noise based on defect tolerance, the accuracy of detection results for different defect types can be verified according to actual conditions, thereby improving the scientific validity of defect identification and avoiding inconsistent accuracy of defect types detected under different environmental influences. Attached Figure Description

[0043] Figure 1 This is a flowchart of the machine vision-based plastic film surface defect detection method in an embodiment of the present invention;

[0044] Figure 2 This is a flowchart of a process for repairing image quality and obtaining a first image to be detected in an embodiment of the present invention.

[0045] Figure 3 This is a flowchart illustrating the accuracy assessment of the first analysis result based on color contrast in an embodiment of the present invention.

[0046] Figure 4 This is a flowchart illustrating the process of secondary image quality restoration and obtaining a second image to be detected in an embodiment of the present invention. Detailed Implementation

[0047] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the present invention.

[0048] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0049] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.

[0050] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0051] Please see Figure 1 As shown, it is a flowchart of the plastic film surface defect detection method based on machine vision in an embodiment of the present invention.

[0052] This invention provides a machine vision-based method for detecting surface defects in plastic films, comprising:

[0053] S1, The image acquisition device acquires images of the plastic film surface and obtains images of the plastic film surface;

[0054] S2, extract the image quality parameters of the plastic film surface image, including image resolution and image reflected light intensity;

[0055] S3, determine the image quality parameters and obtain the determination result, and repair the image quality once based on the determination result to obtain the first image to be detected; the repair includes adjusting the image resolution and adjusting the image reflected light brightness;

[0056] S4, Divide the first image to be detected into regions and obtain several first image regions to be detected;

[0057] S5, extract the image feature parameters of each first detection area image and analyze them to obtain the first analysis result. Based on the first analysis result, determine the surface defect area image and the defect type corresponding to the surface defect area image in one go. The image feature parameters include the gray value of the gray area image and the number of colors and the color value corresponding to any color in the color area image.

[0058] S6, evaluate the accuracy of the first analysis result based on the color contrast of the color abnormality on the first detection area image. When the accuracy is less than the preset target accuracy, repair the image quality for the second time and obtain the second detection image. Analyze the image feature parameters of the second detection image and obtain the second analysis result. Determine the defect area image and defect type for the second time based on the second analysis result.

[0059] S7. Evaluate the accuracy of the second analysis result for determining the defect area image and defect type. If the accuracy is greater than or equal to the target accuracy, then determine the second analysis result as the true defect area image and the true defect type.

[0060] By judging image quality parameters and obtaining the judgment results, it is helpful to repair the image quality to obtain a qualified image to be inspected; by dividing the first image to be inspected into regions and obtaining several first inspection region images, the unit area of ​​detection is reduced, improving the accuracy of defect detection; by extracting and analyzing the image feature parameters of each first inspection region image, it is helpful to scientifically determine the defect region and defect type of the inspection region image; by evaluating the accuracy of the first analysis result, the analysis results are verified, improving the accuracy of defect detection; by second-stage image quality repair to obtain a second image to be inspected, the quality of the image to be inspected is further improved; by using the accuracy evaluation results, the image quality is adaptively adjusted to the optimal state, improving the accuracy of surface defect detection; by analyzing the image feature parameters of the second image to be inspected, the accuracy of image feature parameter analysis is improved; by second-stage determination of the defect region image and defect type based on the second analysis results, the accuracy of surface defect detection is improved.

[0061] Among them, such as Figure 2 As shown, this is a flowchart illustrating the process of restoring image quality and obtaining a first image to be detected in an embodiment of the present invention. Step S3 includes:

[0062] S31, Adjusting the image resolution, including: comparing the image resolution with a preset standard image resolution to determine whether the image resolution is qualified; when the determination result is that the image resolution is unqualified, adjusting the image resolution to within the standard image resolution threshold range to obtain a surface image with qualified image resolution.

[0063] S32, Adjusting the image reflected light brightness includes: comparing the image reflected light brightness of a surface image with acceptable image resolution with a preset standard image reflected light brightness to determine whether the image reflected light brightness is acceptable; when the determination result is that the image reflected light brightness is unacceptable, adjusting the image reflected light brightness to the preset standard image reflected light brightness threshold range according to the first adjustment step size to obtain a surface image with acceptable image reflected light brightness; the surface image with acceptable image reflected light brightness is the first image to be detected.

[0064] Adjusting the image resolution helps improve image clarity, thereby improving the quality of the image to be inspected. Determining whether the brightness of the reflected light in the image is qualified helps to improve the image quality of the surface image to be inspected.

[0065] In this embodiment, the image resolution is denoted as R, and the preset standard image resolution threshold is [0.6R0, 1.5R0], where R0 is the standard image resolution. When 0.6R0 ≤ R ≤ 1.5R0, the image resolution in the image quality parameter set is considered acceptable. When R is not within the preset standard image resolution threshold range of [0.6R0, 1.5R0], the image resolution in the region's image quality parameter set is considered unacceptable. Through image sharpening processing, the image resolution is adjusted to the standard image resolution threshold range to obtain the first image to be detected with acceptable image resolution.

[0066] Specifically, in step S5, image feature parameters of each first region to be detected are extracted, analyzed, and a first analysis result is obtained, including:

[0067] The analysis is performed based on the calculated difference in grayscale value and color value between any pixel and its neighboring pixels in the first detection area image. When the difference in grayscale value is greater than the preset standard difference in grayscale value or the difference in color value is greater than the preset standard difference in color value, the first detection area image where the pixel is located is determined to be a defect area and the defect type is determined to be noise. In this embodiment, the noise type is either impurity or bubble.

[0068] Specifically, in step S5, the surface defect area image and the defect type corresponding to the surface defect area image are determined at once based on the first analysis result, including: comparing any color value on the first area image to be detected with a preset corresponding color value threshold to obtain a first comparison result; when the color value is not within the preset corresponding color value threshold range, the first area image to be detected is determined to be a defect area image and the defect type is determined to be color anomaly.

[0069] By determining whether the color value is within the preset color value threshold range, the defect area and defect type can be identified by color value; the defect area and defect type can be determined by the difference in gray value between any pixel and its neighboring pixels, thus achieving scientific and effective noise identification.

[0070] Specifically, such as Figure 3 The diagram shown is a flowchart illustrating the accuracy assessment of the first analysis result based on color contrast in an embodiment of the present invention. Step S6, assessing the accuracy of the first analysis result based on the color contrast of color anomalies in the first detection area image, includes:

[0071] S611, calculate the ratio of the color value of the color region to the gray value of the gray region in the first detection region image to obtain the contrast between each color region and the gray region; each color corresponds to a color contrast.

[0072] S612, compare the color contrast with the standard contrast threshold of the corresponding preset color. When the color contrast is not within the standard contrast threshold of the preset color, the defect type analysis result is incorrect and the incorrect analysis result is recorded as an accuracy score of 0. When the color contrast is within the standard contrast threshold of the preset color, the defect type analysis result is correct and the correct analysis result is recorded as an accuracy score of 1.

[0073] S613, the accuracy evaluation result is the ratio obtained by summing the accuracy scores of several correct analysis results and the ratio of the number of defect area images with color abnormality as the defect type. The accuracy evaluation result is between 0 and 1.

[0074] The accuracy of the first analysis result of the defect type is evaluated by calculating the contrast of the color area, thus realizing the evaluation of the accuracy of the surface defect detection result; the accuracy score is obtained by comparing the contrast of each color one by one, which improves the accuracy of the surface defect judgment.

[0075] Specifically, such as Figure 4 The diagram shows a flowchart of secondary image quality repair and obtaining a second image to be detected in an embodiment of the present invention. In step S6, the accuracy evaluation result is compared with a preset target accuracy. When the comparison result shows that the accuracy evaluation result is less than the preset target accuracy, secondary image quality repair and obtaining a second image to be detected includes:

[0076] S621, adjust the image reflected light brightness of the first area to be detected a second time according to the set second adjustment step size to obtain the image reflected light brightness after the second adjustment;

[0077] S622, based on the normal distribution relationship between the adjustment step size of the image reflected light brightness and the color contrast, the color contrast after secondary adjustment is obtained; the second adjustment step size ≤ the first adjustment step size;

[0078] S623, when the color contrast after the second adjustment falls within the standard contrast threshold of the preset color, a second detection area image is obtained, and the second detection area image is the first detection area image after the second adjustment.

[0079] When the accuracy assessment result is less than the preset target accuracy, the image quality is repaired a second time to obtain a second image to be detected, thereby achieving adaptive adjustment of the image quality to the optimal state and improving the accuracy of surface defect detection. The image reflected light brightness of the first image to be detected is adjusted a second time according to the set second adjustment step size to obtain the image reflected light brightness after the second adjustment, and then the color contrast after the second adjustment, thus scientifically and effectively adjusting the image quality to be detected. By making the second adjustment step size less than or equal to the first adjustment step size, the accuracy of image quality adjustment of the image to be detected is improved.

[0080] In this embodiment, the number of defect area images with color abnormality identified in the first instance is 10. After accuracy evaluation, the sum of the accuracy scores of several correct analysis results is 8, so the accuracy evaluation result is 8 / 10 = 0.8 = 80%. The set target accuracy is 99%. The accuracy evaluation result is less than the set target accuracy. Obviously, the accuracy of the results of this detection of the plastic film surface has not reached the target accuracy. Therefore, in order to improve the accuracy of the detection results, it is necessary to repair the image quality a second time to obtain the second image of the area to be detected.

[0081] Brightness refers to the lightness or darkness of light in an image, and it can be represented by pixel values; the higher the pixel value, the greater the brightness. For grayscale images, the brightness value equals the pixel value; for color images, brightness is usually calculated by a weighted sum of the three RGB (R, G, B) color values, using the formula: Color brightness value = 0.299 × R + 0.587 × G + 0.114 × B. Adjusting the brightness can make an image brighter or darker, but excessive brightness may lead to overexposure, while excessively low brightness will make the image appear dull.

[0082] The brightness contrast of each color region is determined by both the brightness of reflected light and the color value of the color itself. The ratio of the color value of each color region to the gray value of the grayscale image region is the color contrast. Each color corresponds to a contrast. Several color contrasts on the image form a contrast set, denoted as {Dy1, Dy2, ..., Dyn}, where Dy1 is the first color contrast, Dy2 is the second color contrast, and Dyn is the nth color contrast.

[0083] The brightness of the reflected light in the image is denoted as A. The preset standard image brightness threshold is [0.8A0, 1.2A0], where A0 is the standard image brightness. When 0.8A0≤A≤1.2A0, the image brightness is considered to be qualified.

[0084] Specifically, the adjustment step size is determined using interpolation, denoted as λ = |A - A0| / d, where A is the image reflected light brightness, A0 is the preset standard image reflected light brightness, and d is a set constant; the larger d is, the smaller the adjustment step size. The first adjustment step size is determined to be λ1 = |A - A0| / d1, and the second adjustment step size is determined to be λ2 = |A - A0| / d2, where λ1 ≥ λ2. In this embodiment, when adjusting the image reflected light brightness for the first time, the difference between the brightness value and the standard brightness value is large, so a larger step size can be selected to improve adjustment efficiency. When adjusting the image reflected light brightness for the second time, the difference between the brightness value and the standard brightness value is small, closer to the target value, so a smaller step size is needed to improve adjustment accuracy.

[0085] Specifically, the adjustment step size of image reflected light intensity and the normal distribution relationship of color contrast are denoted as: , where D(λ) is the color contrast corresponding to the adjustment step size λ.

[0086] Specifically, the secondary determination of the defect area image and defect type includes:

[0087] The second color value of the color region of the second region image to be detected is obtained, and the second color value is compared with the preset corresponding color value threshold to obtain the second comparison result. When the second color value is not within the range of the preset corresponding color value threshold, the second region image to be detected is determined to be a defect region image and the defect type is determined to be color anomaly.

[0088] In this embodiment, the accuracy of the analysis results for secondary determination of defect area images and defect types is evaluated until the accuracy reaches or exceeds the target accuracy, at which point the analysis results are determined to be true defect area images and true defect types.

[0089] The defect area image and the defect type are determined by comparing the second color value of the color area of ​​the second detection area image with the preset corresponding color value threshold. Each color in the detection area is compared with the corresponding color value threshold one by one, and it is determined whether the color area is a defect area one by one. This makes the surface defect determination more accurate and further improves the accuracy of defect area image determination.

[0090] Specifically, the accuracy of the first analysis result, which assesses the defect type as noise, based on defect tolerance, includes:

[0091] The number of noise points in the first region image to be detected, which is of the defect type of noise, is counted, and the area of ​​the distribution region of the defect type of noise is obtained. The ratio of the number of noise points to the area of ​​the distribution region of noise points is calculated to obtain the noise distribution rate.

[0092] The noise distribution rate is compared with the preset standard noise tolerance. When the distribution rate is less than the preset standard noise tolerance, the defect area image with the defect type of noise is determined to be a normal area image. When the distribution rate is greater than or equal to the preset standard noise tolerance, the defect area with the defect type of noise is determined to be a real defect area and the real defect type is noise.

[0093] Specifically, the defect tolerance is the number of noise points allowed per unit area of ​​the image to be inspected. In this embodiment, the defect tolerance is set to 1 per square meter of the image to be inspected.

[0094] By assessing the accuracy of defect identification as noise based on defect tolerance, the accuracy of detection results for different defect types can be verified according to actual conditions, thereby improving the scientific effectiveness of defect identification and avoiding inconsistent accuracy of defect types detected under different environmental influences.

[0095] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A method for detecting surface defects in plastic films based on machine vision, characterized in that, include: The surface of the plastic film is captured and an image of the plastic film surface is obtained through an image acquisition device; Extract image quality parameters from the surface image of the plastic film, including image resolution and image reflected light intensity; The image quality parameters are determined and the determination result is obtained. Based on the determination result, the image quality is repaired once to obtain the first image to be detected. The first repair includes adjusting the image resolution and adjusting the image reflected light brightness. The first image to be detected is divided into regions, resulting in several images of the first regions to be detected. Image feature parameters are extracted from each of the first detection regions and analyzed to obtain a first analysis result. Based on the first analysis result, the surface defect region image and the defect type corresponding to the surface defect region image are determined at one time. The image feature parameters include the gray value of the gray region image and the number of colors and the color value corresponding to any color in the color region image. The accuracy of the first analysis result is evaluated based on the color contrast of the color abnormality in the first detection area image. When the accuracy is less than the preset target accuracy, the image quality is repaired a second time to obtain a second detection image. The image feature parameters of the second detection image are analyzed to obtain a second analysis result. Based on the second analysis result, the defect area image and defect type are determined a second time. The accuracy of the second analysis result, which determines the defect region image and defect type, is evaluated. If the accuracy is greater than or equal to the target accuracy, the second analysis result is determined to be the true defect region image and the true defect type. The adjustment of image reflected light brightness includes: comparing the image reflected light brightness of a surface image with acceptable image resolution with a preset standard image reflected light brightness to determine whether the image reflected light brightness is acceptable; when the determination result is that the image reflected light brightness is unacceptable, adjusting the image reflected light brightness to the preset standard image reflected light brightness threshold range according to a first adjustment step size to obtain a surface image with acceptable image reflected light brightness; the surface image with acceptable image reflected light brightness is the first image to be detected; The step of evaluating the accuracy of the first analysis result based on the color contrast of color anomalies in the first region of the image to be detected includes: The contrast ratio between each color region and the grayscale region is obtained by calculating the ratio of the color value of the color region to the grayscale value of the grayscale region in the first detection region image; each color corresponds to a color contrast ratio. The color contrast is compared with the standard contrast threshold of the corresponding preset color. When the color contrast is not within the standard contrast threshold of the preset color, the defect type analysis result is evaluated as incorrect, and the incorrect analysis result is recorded as an accuracy score of 0. When the color contrast is within the standard contrast threshold of the preset color, the defect type analysis result is evaluated as correct, and the correct analysis result is recorded as an accuracy score of 1. The accuracy evaluation result is obtained by summing the accuracy scores of the several analysis results and comparing them with the ratio of the number of defect area images with color abnormality as the defect type. The accuracy evaluation result is between 0 and 1. The step of comparing the accuracy evaluation result with a preset target accuracy, and when the comparison result shows that the accuracy evaluation result is less than the preset target accuracy, performing secondary image quality repair and obtaining a second image to be detected, includes: The image reflected light brightness of the first region to be detected is adjusted twice according to the set second adjustment step size to obtain the image reflected light brightness after the second adjustment. Based on the normal distribution relationship between the adjustment step size of the image reflected light brightness and the color contrast, the color contrast after secondary adjustment is obtained; the second adjustment step size is less than or equal to the first adjustment step size. When the color contrast after secondary adjustment falls within the preset standard contrast threshold of the color, the second detection area image is obtained, which is the first detection area image after secondary adjustment.

2. The method for detecting surface defects of plastic films based on machine vision according to claim 1, characterized in that, The step of extracting image feature parameters from each of the first regions to be detected and analyzing them to obtain a first analysis result includes: A first comparison result is obtained by comparing any color value on the first detection area image with a preset corresponding color value threshold. When the color value is not within the preset corresponding color value threshold range, the first detection area image is determined to be a defect area image and the defect type is determined to be color anomaly.

3. The method for detecting surface defects of plastic films based on machine vision according to claim 2, characterized in that, The secondary determination of the defect region image and defect type includes: The second color value of the color region of the second region image to be detected is obtained, and the second color value is compared with a preset corresponding color value threshold to obtain a second comparison result. When the second color value is not within the range of the preset corresponding color value threshold, the second region image to be detected is determined to be a defect region image and the defect type is determined to be color anomaly.

4. The method for detecting surface defects of plastic films based on machine vision according to claim 3, characterized in that, Before adjusting the brightness of the reflected light in the image, the image resolution also needs to be adjusted, including: comparing the image resolution with a preset standard image resolution to determine whether the image resolution is qualified; when the determination result is that the image resolution is unqualified, adjusting the image resolution to within the standard image resolution threshold range to obtain a surface image with qualified image resolution.

5. The method for detecting surface defects of plastic films based on machine vision according to claim 4, characterized in that, The step of extracting and analyzing the image feature parameters of each of the first regions to be detected and obtaining the first analysis result also includes: The analysis is performed based on the calculated differences in grayscale and color values ​​between any pixel and its neighboring pixels in the first detection area image. When the difference in grayscale is greater than a preset standard difference in grayscale or color value is greater than a preset standard difference in color value, the first detection area image containing the pixel is determined to be a defect area image and the defect type is determined to be noise.

6. The method for detecting surface defects of plastic films based on machine vision according to claim 5, characterized in that, The accuracy of the first analysis result, which assesses the defect type as noise, based on defect tolerance, including: The number of noise points in the first detection region image with the defect type of noise is counted and the distribution area of ​​the noise region with the defect type of noise is obtained. The ratio of the number of noise points to the distribution area of ​​noise points is calculated to obtain the noise distribution rate. The noise distribution rate is compared with a preset standard noise tolerance. When the distribution rate is less than the preset standard noise tolerance, the defect region image with the defect type of noise is determined to be a normal region image. When the distribution rate is greater than or equal to the preset standard noise tolerance, the defect region image with the defect type of noise is determined to be a real defect region image and the real defect type is noise.

7. The method for detecting surface defects of plastic films based on machine vision according to claim 6, characterized in that, The defect tolerance is the number of noise points allowed per unit area of ​​the image to be detected.

Citation Information

Patent Citations

  • Surface defect detection method based on machine vision

    CN120064114A

  • Composite film defect identification method

    CN115631173A

  • Surface defect detection method and device based on machine vision

    CN119600026A

  • Detection and judgment method and device for simple cattle assembling machine

    CN120374564A