Plastic film surface defect detection method based on machine vision
By adaptively adjusting image quality and feature parameter evaluation, the problem of inconsistent accuracy in detecting surface defects of plastic films under different environments was solved, achieving high-precision and stable defect detection.
Patent Information
- Application Number
- CN202511477285.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-16
AI Technical Summary
Existing technologies use a single, fixed detection method to detect images of plastic films, resulting in inconsistent accuracy under different environments and making it impossible to verify the accuracy of the detection results based on actual environmental conditions.
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 accuracy standard is reached.
It improves the accuracy of surface defect detection in plastic films, ensures the stability and precision of detection results under different environments, and enhances the scientific nature and effectiveness of defect detection by adaptively adjusting image quality to the optimal state.
Smart Images

Figure CN120976210A_ABST
Abstract
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 defects such as holes, mosquitoes, black spots, crystal spots, scratches, and spots 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 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, the film image is often detected by a single fixed detection method, 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 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, the film image is often detected by a single fixed detection method, 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 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: 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; An image quality parameter of the surface image of the plastic film is extracted, including image resolution and image reflected light brightness; 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; The first detection image is divided into regions to obtain a plurality of first detection area images; extracting image feature parameters of each of the first to-be-detected region images 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; evaluating accuracy of the first analysis result according to color contrast of color abnormality on the first to-be-detected region image, when the accuracy is less than a preset standard accuracy, repairing image quality a second time to obtain a second to-be-detected image, and performing analysis on image feature parameters of the second to-be-detected image to obtain a second analysis result, and determining a defect region image and a defect type according to the second analysis result a second time; evaluating accuracy of the second analysis result of the second time of determining a defect region image and a defect type, when the accuracy is greater than or equal to the standard accuracy, determining that the second analysis result is a real defect region image and a real defect type.
[0007] 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 a first time; the surface image with qualified image reflection light brightness is the first to-be-detected image.
[0008] Further, the extracting of the image feature parameters of each of the first to-be-detected region images and the performing of analysis to obtain the first analysis result include: comparing the color value of any color on the first to-be-detected region image 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 to-be-detected region image is a defect region image and determining that the defect type is color abnormality.
[0009] Further, the evaluating of the accuracy of the first analysis result according to color contrast of color abnormality on the first to-be-detected region image includes: calculating a ratio of the color value of the color region to the gray value of the gray region on the first to-be-detected region image to obtain a contrast of each color region to the gray region; each color corresponds to a color contrast; comparing the color contrast with a preset standard contrast threshold of the corresponding color, when the color contrast is not within the preset standard contrast threshold of the corresponding color, evaluating that the defect type analysis result is incorrect, recording the incorrect analysis result as an accuracy score of 0, when the color contrast is within the preset standard contrast threshold of the corresponding color, evaluating that the defect type analysis result is correct, recording the correct analysis result as an accuracy score of 1; summing the accuracy scores of the correct analysis results and obtaining an accuracy evaluation result by dividing the number of the defect region images of the color abnormality defect type by the number of the defect region images, the accuracy evaluation result being between 0 and 1.
[0010] Further, comparing the accuracy evaluation result with a preset target accuracy, when the comparison result is that the accuracy evaluation result is less than the preset target accuracy, reprocessing the image quality of the secondary repair image and obtaining a second to-be-detected image, comprising: re-adjusting the image reflected light brightness of the first to-be-detected region image according to a set second adjustment step to obtain a second adjusted image reflected light brightness; obtaining a second adjusted color contrast according to a normal distribution relationship between the adjustment step of the image reflected light brightness and the color contrast, the second adjustment step being less than the first adjustment step; when the second adjusted color contrast falls within the preset standard contrast threshold of the corresponding color, obtaining a second to-be-detected region image, the second to-be-detected region image being the first to-be-detected region image after the secondary adjustment.
[0011] Further, the secondary determination of the defect region image and the defect type comprises: obtaining a second color value of a color region of the second to-be-detected region image, and comparing the second color value 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, determining that the second to-be-detected region image is a defect region image and determining that the defect type is a color abnormality.
[0012] Further, before adjusting the image reflected light brightness, the image resolution also needs to be adjusted, comprising: 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 be within a standard image resolution threshold range to obtain a surface image with qualified image resolution.
[0013] Further, the extraction of the image feature parameter of each first to-be-detected region image and the analysis to obtain a first analysis result further comprise: According to the calculation, the gray value difference and the color value difference between any pixel point and adjacent points on the first to-be-detected region image are analyzed, and 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, the first to-be-detected region image where the pixel point is located is determined as a defect region image, and the defect type is determined as a noise point.
[0014] Further, the accuracy of the first analysis result of the defect type being a noise point is evaluated according to a defect tolerance, including: The number of noise points of the first to-be-detected region image of the defect type being a noise point is counted, and the area of the distribution region of the noise points is obtained, and the ratio of the number of noise points to the area of the distribution region of the noise points is calculated to obtain a noise point distribution rate. 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, the defect region image of the defect type being a noise point is determined as a normal region image; when the distribution rate is greater than or equal to the preset standard noise point tolerance, the defect region image of the defect type being a noise point is determined as a real defect region image, and the real defect type is a noise point.
[0015] Further, the defect tolerance is the number of noise points allowed per unit area of the to-be-detected image.
[0016] 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, it is helpful to repair the image quality to obtain a quality qualified to-be-detected image; 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, it is helpful to scientifically determine the defect region and defect type of the to-be-detected region image; 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 the accuracy evaluation result, the image quality is adaptively adjusted to the optimal state, and 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.
[0017] Especially, by judging whether the image reflected light brightness is qualified to determine the adjustment of the image brightness, it is helpful to improve the image quality of the to-be-detected surface image.
[0018] Especially, by judging whether the color value is in the preset corresponding color value threshold range, the defect area and the defect type are determined by the color value.
[0019] Especially, by calculating the contrast of the color area, the accuracy of the first analysis result of the defect type is evaluated, the accuracy of the surface defect detection result is evaluated, the accuracy score is obtained by comparing each color contrast one by one, and the accuracy of the surface defect determination is improved.
[0020] Especially, when the accuracy evaluation result is less than the preset accuracy, the image quality is repaired again to obtain a second detection image, the image quality is adaptively adjusted to an optimal state, the accuracy of the surface defect detection is improved, the image reflection brightness of the first detection area image is adjusted again according to the set second adjustment step to obtain the image reflection brightness after the second adjustment and the color contrast after the second adjustment, the detection image quality is scientifically and effectively adjusted, and the accuracy of the detection area image quality adjustment is improved.
[0021] Especially, by comparing the second color value of the color area of the second detection area image with the preset corresponding color value threshold, the defect area and the defect type are determined, each color in the detection area is compared with the corresponding color value threshold, and it is determined whether the color area is a defect area, so that the surface defect determination is more accurate, and the accuracy of the defect area image determination is further improved.
[0022] Especially, by adjusting the image resolution, the image clarity is improved, and the detection image quality is improved.
[0023] Especially, by judging the defect area and the defect type as a noise point according to the gray value difference between any pixel point and the adjacent point on the image, scientific and effective noise point recognition is realized.
[0024] Especially, by evaluating the accuracy of the defect determination as a noise point according to the defect tolerance, the accuracy of the detection result of different defect types can be verified according to the actual situation, the scientific effectiveness of the defect determination is improved, and the accuracy of the defect type detected under the influence of different environments is improved. BRIEF DESCRIPTION OF DRAWINGS
[0025] Figure 1 The flowchart of the plastic film surface defect detection method based on machine vision in the embodiment of the application; Figure 2 The flowchart of the first repair image quality and the first detection image in the embodiment of the application; Figure 3A flow chart for evaluating the accuracy of the first analysis result according to color contrast in the embodiment of the present application; Figure 4 A flow chart for repairing the image quality twice and obtaining the second to-be-detected image in the embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the objects and advantages of the present application clearer, the present application will be further described below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0027] The preferred embodiments of the present application will be described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present application and are not used to limit the protection scope of the present application.
[0028] It should be noted that, in the description of the present application, the terms of direction or position relationship such as "upper", "lower", "left", "right", "inner", "outer" and the like are based on the direction or position relationship shown in the drawings, which is only for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.
[0029] In addition, it should also be noted that, in the description of the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connecting", "connection" should be understood in a broad sense, for example, it can be fixed connection, or detachable connection, or integrally connected; it can be mechanical connection, or electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0030] Please refer to Figure 1 As shown in the figure, it is a flow chart of a plastic film surface defect detection method based on machine vision in the embodiment of the present application.
[0031] The present application provides a plastic film surface defect detection method based on machine vision, comprising: S1, acquiring the image of the plastic film surface by the image acquisition device; S2, extracting the image quality parameters of the plastic film surface image, the image quality parameters including image resolution and image reflected light brightness; S3, judging the image quality parameters and obtaining a judgment result, and repairing the image quality once and obtaining the first to-be-detected image according to the judgment result; the once repairing includes adjusting the image resolution and adjusting the image reflected light brightness; S4, Divide the first image to be detected into regions and obtain several first image regions to be detected; 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. 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. 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.
[0032] 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.
[0033] 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: 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. S32, adjusting the image reflection light brightness, comprising: comparing the image reflection light brightness of the image resolution qualified surface image 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 not qualified, adjusting the image reflection light brightness to a preset standard image reflection light brightness threshold range according to a first adjustment step to obtain an image reflection light brightness qualified surface image; the image reflection light brightness qualified surface image is the first to be detected image.
[0034] By adjusting the image resolution, it is helpful to improve the image definition, and then improve the quality of the to-be-detected image, and by judging whether the image reflection light brightness is qualified to determine the image brightness, it is helpful to improve the image quality of the to-be-detected surface image.
[0035] In the embodiment, the image resolution is denoted as R, and the preset standard image resolution threshold is [0.6R0, 1.5R0], wherein R0 is the standard image resolution, when 0.6R0≤R≤1.5R0, it is determined that the image resolution in the image quality parameter set is qualified, and when R is not in the preset standard image resolution threshold [0.6R0, 1.5R0] range, it is determined that the image resolution in the regional image quality parameter set is not qualified. By sharpening the image, the image resolution is adjusted to the standard image resolution threshold range, to obtain the first to-be-detected image with qualified image resolution.
[0036] Specifically, in step S5, the image feature parameters of each first to-be-detected regional image are extracted and analyzed to obtain a first analysis result, comprising: According to the calculated gray value difference and color value difference between any pixel point and adjacent point on the first to-be-detected regional 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 regional image where the pixel point is located is a defect region and the defect type is a noise point; in the embodiment, the defect type as a noise point is that the noise point is impurities or bubbles.
[0037] Specifically, in step S5, according to the first analysis result, the surface defect regional image and the defect type corresponding to the surface defect regional image are determined once, comprising: comparing any color value on the first to-be-detected regional image with a preset corresponding color value threshold to obtain a first comparison result, when the color value is not in the preset corresponding color value threshold range, it is determined that the first to-be-detected regional image is a defect regional image and the defect type is color abnormality.
[0038] By judging whether the color value is in the preset corresponding color value threshold range, the defect area and the defect type are determined by the color value; by judging the defect area and the defect type as a noise point through the gray value difference between any pixel point and adjacent point on the image, scientific and effective noise point identification is realized.
[0039] Specifically, as shown in the figure, Figure 3 The figure is a flow chart for evaluating the accuracy of the first analysis result according to color contrast in the embodiment of the application. In step S6, the accuracy of the first analysis result is evaluated according to the color contrast of the color anomaly on the first to-be-detected area image, including: S611, the ratio of the color value of each color region to the gray value of the gray region on the first to-be-detected area image is calculated to obtain the contrast of each color region and the gray region; each color corresponds to a color contrast; S612, the color contrast is compared with the standard contrast threshold of the corresponding preset color, when the color contrast is not in 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 the accuracy score of 0, when the color contrast is in 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 the accuracy score of 1; S613, the sum of the accuracy scores of the several correct analysis results is summed up and the ratio of the sum to the number of the several defect type images of the color anomaly is obtained as the accuracy evaluation result, the accuracy evaluation result is between 0 and 1.
[0040] The accuracy of the first analysis result of the defect type is evaluated by calculating the contrast of the color region, the accuracy of the surface defect detection result is evaluated; the accuracy score is obtained by comparing each color contrast one by one, the accuracy of the surface defect determination is improved.
[0041] Specifically, as shown in the figure, Figure 4 The figure is a flow chart for repairing the image quality twice and obtaining the second to-be-detected image in the embodiment of the application. In step S6, the accuracy evaluation result is compared with the preset target accuracy, when the comparison result is that the accuracy evaluation result is less than the preset target accuracy, the image quality is repaired twice and the second to-be-detected image is obtained, including: S621, the image reflection brightness of the first to-be-detected area image is adjusted twice according to the set second adjustment step to obtain the image reflection brightness after the second adjustment; S622, the color contrast after the second adjustment is obtained according to the normal distribution relationship between the adjustment step of the image reflection brightness and the color contrast; the second adjustment step is less than the first adjustment step; S623, when the color contrast after the secondary adjustment falls within the preset standard contrast threshold of the color, a second to-be-detected region image is obtained, and the second to-be-detected region image is the first to-be-detected region image after the secondary adjustment.
[0042] The image quality is repaired and the second to-be-detected image is obtained when the accuracy evaluation result is less than the preset standard accuracy, so that the image quality is adaptively adjusted to an optimal state, and the accuracy of surface defect detection is improved; the image reflection brightness of the first to-be-detected region image is adjusted by the second adjustment step to obtain the image reflection brightness after the secondary adjustment and then the color contrast after the secondary adjustment, so that the to-be-detected image quality is scientifically and effectively adjusted; the second adjustment step is less than or equal to the first adjustment step, and the accuracy of the to-be-detected region image quality adjustment is improved.
[0043] In this embodiment, the number of defect region images of the first determined defect type is 10, and the accuracy score of the analysis result is 8 after the accuracy evaluation. The accuracy evaluation result is 8 / 10=0.8=80%. The preset standard accuracy is 99%. The accuracy evaluation result is less than the preset standard accuracy. Obviously, the accuracy of the result of the plastic film surface detection does not meet the standard accuracy. Therefore, in order to improve the accuracy of the detection result, the image quality needs to be repaired and the second to-be-detected region image is obtained.
[0044] The brightness refers to the light and dark degree of light in the image, which can be represented by a pixel value. The higher the pixel value, the greater the brightness. For a grayscale image, the brightness value is equal to the pixel value. For a color image, the brightness is usually calculated by the weighted sum of the three channels of color value RGB (R, G, B). The formula is: color brightness value = 0.299 x R + 0.587 x G + 0.114 x B. The adjustment of brightness can make the image brighter or darker, but too high brightness may cause image overexposure, and too low brightness will make the image appear dark. The brightness contrast of each color region is determined by the reflected light brightness on the one hand and the color value of the color itself on the other hand. The ratio of the color value of each color region to the grayscale value of the grayscale image region is the color contrast. Each color corresponds to a contrast. A number of 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 n-th color contrast.
[0045] The image reflection brightness is denoted as A, and the preset standard image reflection brightness threshold is [0.8A0, 1.2A0], where A0 is the standard image reflection brightness. When 0.8A0≤A≤1.2A0, the image reflection brightness is judged to be qualified.
[0046] Specifically, the adjustment step is determined according to an interpolation method, and the adjustment step is denoted as λ = |A-A0| / d, wherein A is the image reflected light brightness, A0 is a preset standard image reflected light brightness, and d is a set constant, and the larger d is, the smaller the adjustment step is; wherein the first adjustment step is determined as λ1 = |A-A0| / d1, and the second adjustment step is determined as λ2 = |A-A0| / d2, and λ1≥λ2. In this embodiment, when the image reflected light brightness is adjusted once, the difference between the brightness value and the standard brightness value is large, and therefore a larger step can be selected for adjustment, so as to improve the adjustment efficiency; when the image reflected light brightness is adjusted twice, the difference between the brightness value and the standard brightness value is small, and is closer to the target value of the adjustment, and therefore a smaller step is required for adjustment, so as to improve the accuracy of the adjustment.
[0047] Specifically, the adjustment step of the image reflected light brightness has a normal distribution relationship with the color contrast, and is denoted as , wherein D(λ) is the color contrast corresponding to the adjustment step λ.
[0048] Specifically, the defect area image and the defect type are determined twice, including: The second color value of the color area of the second to-be-detected area image is obtained, and the second color value is compared with the 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 area image is a defect area image and the defect type is a color abnormality.
[0049] In this embodiment, the accuracy of the analysis result of the twice-determined defect area image and defect type is evaluated, and when the accuracy reaches or exceeds the target accuracy, the analysis result is determined to be a real defect area image and a real defect type.
[0050] By determining the defect area image and the defect type according to the comparison result of the comparison between the second color value of the color area of the second to-be-detected area image and the preset corresponding color value threshold, each color in the to-be-detected area is compared with the color value threshold corresponding to the color one by one, and it is determined whether the color area is a defect area one by one, so that the surface defect determination is more accurate, and the accuracy of the defect area image determination is further improved.
[0051] Specifically, the accuracy of the first analysis result of the defect type being a noise point is evaluated according to the defect tolerance, including: 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 noise points 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; The noise distribution rate is compared with the preset standard noise fault tolerance, when the distribution rate is less than the preset standard noise fault tolerance, the defect region image of the defect type of noise is determined as a normal region image; when the distribution rate is greater than or equal to the preset standard noise fault tolerance, the defect region of the defect type of noise is determined as a real defect region and the real defect type is noise.
[0052] Specifically, the defect fault tolerance is the number of noise points allowed per unit area of the image to be detected. In this embodiment, the defect fault tolerance is set to 1, which is the number of noise points allowed per square meter of the image to be detected.
[0053] By evaluating the accuracy of the defect determination as noise according to the defect fault tolerance, the accuracy of the detection results of different defect types can be verified according to the actual situation, the scientific effectiveness of the defect determination is improved, and the accuracy of the defect types detected under different environmental influences is avoided.
[0054] So far, the technical solutions of the present application have been described in combination with the preferred embodiments shown in the drawings, but those skilled in the art can easily understand that the protection scope of the present application is obviously not limited to these specific embodiments. Those skilled in the art can make equivalent changes or replacements to the related technical features without departing from the principles of the present application, and the technical solutions after the changes or replacements will fall within the protection scope of the present application.
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 area 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 area image and the true defect type.
2. The method for detecting surface defects of plastic films based on machine vision according to claim 1, characterized in that, 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.
3. The method for detecting surface defects of plastic films based on machine vision according to claim 2, 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.
4. The method for detecting surface defects of plastic films based on machine vision according to claim 3, characterized in that, The accuracy of the first analysis result is evaluated based on the color contrast of color anomalies in the first region of the image to be detected, including: 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.
5. The method for detecting surface defects of plastic films based on machine vision according to claim 4, characterized in that, The accuracy assessment result is compared with a preset target accuracy. When the comparison result shows that 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, including: 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.
6. The method for detecting surface defects of plastic films based on machine vision according to claim 5, 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.
7. The method for detecting surface defects of plastic films based on machine vision according to claim 6, 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.
8. The method for detecting surface defects of plastic films based on machine vision according to claim 7, 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.
9. The method for detecting surface defects of plastic films based on machine vision according to claim 8, 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.
10. The method for detecting surface defects of plastic films based on machine vision according to claim 9, 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
Plastic film defect detection system
CN116626071A
Film surface defect detection method and system
CN119224001A
Surface defect detection method and device based on machine vision
CN119600026A