A laser film defect detection method, device, system and medium
By performing stripe segmentation and regional defect detection on laser film images, the problems of misjudgment and missed judgment in laser film defect detection are solved, thereby improving the accuracy and efficiency of detection.
Patent Information
- Application Number
- CN202310047190.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-31
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2043-01-31
AI Technical Summary
Laser films are prone to appearance defects during the production process, leading to misjudgment or missed detection, which reduces the accuracy of defect detection.
By performing stripe segmentation on the laser film image, bright stripe regions, dark stripe regions, and stripe transition regions are identified. Different detection strategies are then used to detect defects in each region, including morphological transformation and local threshold segmentation, to eliminate the influence of uneven illumination and preserve the original image features.
It improves the accuracy of laser film defect detection, reduces the possibility of false positives and false negatives, and achieves precise defect extraction from images with contrasting light and dark stripes.
Smart Images

Figure CN116030019B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and in particular to a method, apparatus, system and medium for detecting defects in laser film. Background Technology
[0002] Laser films are generally categorized into plain laser films, laser beam laser films, and holographic positioning effect or anti-counterfeiting laser films. During production, defects such as adhesion, mosquito marks, incomplete holographic patterns, color differences, black spots, white spots, watermarks, wrinkles, cloud-like patterns, pitting, and laser beam deformation may occur. These defects can lead to defective printed products or even mass waste, causing direct economic losses and damaging the reputation of laser film manufacturers. Therefore, appearance inspection of molded laser films is particularly important.
[0003] Because the laser effect and holographic anti-counterfeiting of laser film utilize the principles of light interference and diffraction to record the pattern of interference fringes of light waves emitted by an object, creating a "laser effect and hologram," laser film exhibits characteristics such as contrasting bright and dark interference fringes in visual imaging, inconsistent surface reflection leading to uneven distribution of bright and dark areas in the image, and susceptibility to ambient light interference, resulting in inconsistent image quality. These characteristics make laser film difficult to detect defects in image processing, easily leading to misjudgments or missed detections, thus reducing the accuracy of laser film defect detection. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the purpose of this invention is to provide a method, apparatus, system and medium for detecting defects in laser films, with the aim of improving the accuracy of laser film defect detection.
[0005] The technical solution of the present invention is as follows:
[0006] A method for detecting defects in laser film includes:
[0007] Acquire an image of the laser film to be inspected;
[0008] The laser film image is subjected to stripe segmentation processing to determine the bright stripe regions, dark stripe regions, and stripe transition regions in the laser film image;
[0009] According to the preset detection strategy, the bright stripe area, dark stripe area and stripe transition area are respectively subjected to defect detection to obtain the defect detection results of each area. The preset detection strategy is used to determine the defect detection method corresponding to each area.
[0010] Based on the defect detection results of each region, the defective areas of the laser film image are marked and displayed.
[0011] In one embodiment, the stripe segmentation processing of the laser film image to determine the bright stripe regions, dark stripe regions, and stripe transition regions in the laser film image includes:
[0012] Histogram statistics of grayscale values are performed on the laser film image to obtain the corresponding grayscale histogram;
[0013] The global segmentation threshold is obtained based on the grayscale histogram;
[0014] The grayscale value of each pixel is compared with the global segmentation threshold to determine the bright stripe region and the dark stripe region;
[0015] Morphological processing is performed on the bright and dark stripe regions to determine the stripe transition areas.
[0016] In one embodiment, the morphological processing of the bright and dark stripe regions to determine the stripe transition region includes:
[0017] The bright stripe region and the dark stripe region are expanded respectively by morphological dilation processing;
[0018] The intersection operation is performed on the expanded bright stripe region and the dark stripe region to obtain the stripe transition region.
[0019] In one embodiment, the defect detection is performed on the bright stripe area, dark stripe area, and stripe transition area according to a preset detection strategy to obtain the defect detection results for each area, including:
[0020] The bright stripe region is subjected to morphological undercap transformation, and the defect detection result of the bright stripe region is obtained based on the first difference image obtained by the transformation.
[0021] The dark stripe region is subjected to morphological top-hat transformation, and the defect detection result of the dark stripe region is obtained based on the second difference image obtained by the transformation.
[0022] The stripe transition region is subjected to local threshold segmentation to extract the defect detection results of the stripe transition region.
[0023] In one embodiment, performing morphological undercap transformation on the bright stripe region and obtaining the defect detection result of the bright stripe region based on the first difference image obtained by the transformation includes:
[0024] The bright stripe region is subjected to morphological undercap transformation based on pre-created structural elements to obtain the first difference image;
[0025] After contrast amplification and noise filtering of the first difference image, dark blemishes within the bright stripe area are extracted.
[0026] In one embodiment, performing morphological top-hat transformation on the dark stripe region and obtaining the defect detection result of the dark stripe region based on the transformed second difference image includes:
[0027] A second difference image is obtained by performing a morphological top-hat transformation on the dark stripe region based on a pre-created structuring element.
[0028] After contrast amplification and noise filtering of the second difference image, bright defects in the dark stripe area are extracted.
[0029] In one embodiment, the step of performing local threshold segmentation on the stripe transition region to extract the defect detection result of the stripe transition region includes:
[0030] The stripe transition region is traversed and detected by pre-created structural elements;
[0031] During each traversal and detection, the average gray value and standard deviation of the pixels within the current structuring element are calculated.
[0032] The local segmentation threshold is calculated based on the average gray value and the standard value.
[0033] Based on the local segmentation threshold, defects are extracted from the pixels within the current structuring element to obtain dark defects and / or bright defects within the current structuring element.
[0034] A laser film defect detection device, comprising:
[0035] The acquisition module is used to acquire images of the laser film to be inspected;
[0036] The stripe segmentation module is used to perform stripe segmentation processing on the laser film image to determine the bright stripe region, dark stripe region, and stripe transition region in the laser film image.
[0037] The defect detection module is used to perform defect detection on the bright stripe area, dark stripe area and stripe transition area according to a preset detection strategy, and obtain the defect detection results of each area. The preset detection strategy is used to determine the defect detection method corresponding to each area.
[0038] The marking and display module is used to mark and display the defective areas of the laser film image based on the defect detection results of each area.
[0039] A laser film defect detection system, the system comprising at least one processor; and,
[0040] A memory communicatively connected to the at least one processor; wherein,
[0041] The memory stores instructions that can be executed by the at least one processor, which enables the at least one processor to perform the laser film defect detection method described above.
[0042] A non-volatile computer-readable storage medium storing computer-executable instructions, which, when executed by one or more processors, cause the one or more processors to perform the aforementioned laser film defect detection method.
[0043] Beneficial effects: This invention discloses a method, apparatus, system, and medium for detecting defects in laser films. Compared with the prior art, the embodiments of this invention perform stripe segmentation on laser film images with alternating bright and dark stripes, and perform targeted defect detection on different stripe areas. This can eliminate the influence of uneven lighting on the image while preserving the feature information of the original image, reducing false or missed detections of defects, and effectively improving the accuracy of laser film defect detection. Attached Figure Description
[0044] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:
[0045] Figure 1 A flowchart of a laser film defect detection method provided in an embodiment of the present invention;
[0046] Figure 2 This is a schematic diagram of a holographic stripe on a laser film in the laser film defect detection method provided in this embodiment of the invention;
[0047] Figure 3 A schematic diagram illustrating the location of a striped region in the laser film defect detection method provided in this embodiment of the invention;
[0048] Figure 4 This is a schematic diagram of a holographic stripe defect detection method for laser film provided in an embodiment of the present invention.
[0049] Figure 5 A schematic diagram of the functional modules of the laser film defect detection device provided in an embodiment of the present invention;
[0050] Figure 6 This is a schematic diagram of the hardware structure of the laser film defect detection system provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention is further described in detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiments of the invention are described below in conjunction with the accompanying drawings.
[0052] Please see Figure 1 , Figure 1 This is a flowchart of one embodiment of the laser film defect detection method provided by the present invention. Figure 1 As shown, the method specifically includes the following steps:
[0053] S100: Obtain the image of the laser film to be inspected.
[0054] In this embodiment, the laser film image to be detected can be a plain laser film, a beam laser film, a holographic positioning effect laser film, or an anti-counterfeiting laser film, etc. The laser film image has the following characteristics: Figure 2 The image shows alternating bright and dark stripes with obvious contrast. Because the laser film image exhibits non-uniform, high-contrast stripe characteristics and defects may appear throughout the entire image area, further processing of the laser film image is required to improve detection efficiency and accuracy during defect detection.
[0055] S200. Perform stripe segmentation processing on the laser film image to determine the bright stripe region, dark stripe region, and stripe transition region in the laser film image.
[0056] In this embodiment, when extracting defect targets from an uneven laser film image, the bright and dark areas are first located, detected, and segmented based on the stripe characteristics of the image to achieve stripe segmentation processing, dividing the laser film image into bright stripe areas, dark stripe areas, and stripe transition areas. For example... Figure 2 and Figure 3 As shown, Figure 2 After stripe segmentation processing, the laser film image can be divided into sections based on the stripe distribution. Figure 3 The image is divided into three regions: bright stripe region a, stripe transition region b, and dark stripe region c. Stripe segmentation processing divides the uneven stripe image into three regions based on illumination characteristics, enabling targeted defect extraction for each region and improving the accuracy of defect detection.
[0057] In one embodiment, step S200 includes:
[0058] Histogram statistics of grayscale values are performed on the laser film image to obtain the corresponding grayscale histogram;
[0059] The global segmentation threshold is obtained based on the grayscale histogram;
[0060] The grayscale value of each pixel is compared with the global segmentation threshold to determine the bright stripe region and the dark stripe region;
[0061] Morphological processing is performed on the bright and dark stripe regions to determine the stripe transition areas.
[0062] In this embodiment, when implementing stripe localization and segmentation, the grayscale histogram of the laser film image is first statistically analyzed to obtain the corresponding grayscale histogram. Then, an automatic thresholding method, such as the OTSU maximum inter-class variance method, is used to obtain a global segmentation threshold. This global segmentation threshold is used to segment the pixels corresponding to each grayscale value. Pixels with grayscale values greater than or equal to the global segmentation threshold are identified as bright stripe regions, while pixels with grayscale values less than the global segmentation threshold are identified as dark stripe regions, thus achieving the localization, detection, and segmentation of bright and dark stripes. The OTSU automatic thresholding algorithm is simple, efficient, and more effective and accurate in segmenting dark and bright stripes in laser stripe patterns where the areas are not significantly different.
[0063] Furthermore, to eliminate the influence of drastic changes in brightness between bright and dark stripes, morphological erosion operations can be used to shrink the bright and dark stripe regions initially obtained through threshold segmentation, resulting in more accurate bright and dark stripe regions. The stripe transition region is further located through morphological processing based on the determined bright and dark stripe regions, thus achieving accurate localization and division of the three regions.
[0064] In one embodiment, the morphological processing of the bright and dark stripe regions to determine the stripe transition region includes:
[0065] The bright stripe region and the dark stripe region are expanded respectively by morphological dilation processing;
[0066] The intersection operation is performed on the expanded bright stripe region and the dark stripe region to obtain the stripe transition region.
[0067] In this embodiment, when determining the stripe transition area, after shrinking the accurate bright stripe area and dark stripe area through morphological erosion operation, the bright stripe area and dark stripe area are expanded respectively through morphological processing. Then, the stripe transition area at the intersection of the expanded bright stripe area and dark stripe area can be obtained by performing an intersection operation on the expanded bright stripe area and dark stripe area. This allows for the differentiation between the area with a sharp change in contrast and the area with a slow change in contrast, ensuring the accuracy of subsequent defect extraction.
[0068] S300. Perform defect detection on the bright stripe area, dark stripe area and stripe transition area according to the preset detection strategy to obtain the defect detection results of each area. The preset detection strategy is used to determine the defect detection method corresponding to each area.
[0069] In this embodiment, after the laser film image is divided into regions, the defects in each region are extracted in a targeted manner according to the defect detection method determined in the pre-set detection strategy. This avoids missed detections or false detections caused by using a single detection method for all regions, thereby improving the accuracy of laser film defect extraction.
[0070] In one embodiment, step S300 includes:
[0071] The bright stripe region is subjected to morphological undercap transformation, and the defect detection result of the bright stripe region is obtained based on the first difference image obtained by the transformation.
[0072] The dark stripe region is subjected to morphological top-hat transformation, and the defect detection result of the dark stripe region is obtained based on the second difference image obtained by the transformation.
[0073] The stripe transition region is subjected to local threshold segmentation to extract the defect detection results of the stripe transition region.
[0074] In this embodiment, for bright and dark stripe regions with slow contrast changes, morphological bottom-hat and top-hat transformations are used for defect extraction, respectively. Since morphological grayscale bottom-hat and top-hat transformations can overcome the effects of uneven illumination, and the top-hat transformation is suitable for detecting bright objects on a dark background, while the bottom-hat transformation is used for detecting dark objects on a bright background, these two methods can accurately detect defects in bright and dark stripe regions, rather than simply using binarization to distinguish background changes. This not only eliminates uneven illumination changes but also allows for the differentiated and effective detection of bright defects in dark areas and dark defects in bright areas. For stripe transition regions, local thresholding is used for defect extraction. Determined local thresholds within the local structure are used for defect detection, which adapts to the rapid contrast changes in these areas and avoids detection errors caused by uniform segmentation thresholds.
[0075] In one embodiment, performing morphological undercap transformation on the bright stripe region and obtaining the defect detection result of the bright stripe region based on the first difference image obtained by the transformation includes:
[0076] The bright stripe region is subjected to morphological undercap transformation based on pre-created structural elements to obtain the first difference image;
[0077] After contrast amplification and noise filtering of the first difference image, dark blemishes within the bright stripe area are extracted.
[0078] In this embodiment, when detecting defects in the bright stripe region, a suitable structural element for the bottom-hat transformation mask operation is first created based on the direction of the laser stripes (X-axis, Y-axis, XY-axis) and the size of the point or line defect. The size of the structural element should be set according to the length and width of the detected point or line defect, generally 4-200 pixels. The processing direction of the structural element includes the X-axis, Y-axis, and XY-axis directions, and the specific direction should be consistent with the direction of the laser stripes displayed on the image to ensure the accuracy of the bottom-hat transformation processing. Morphological bottom-hat transformation is performed on the bright stripe region using this structural element to obtain the first difference image. The specific image algorithm is as follows:
[0079] Closing operation:
[0080] BotHat operation: BotHat(I,S) = I·SI
[0081] Where I represents the detected image (in this embodiment, the image of the bright stripe region), S represents the structuring element, and Θ represents the morphological grayscale erosion operation. This represents a morphological grayscale dilation operation, which involves performing a closing operation between bright fringe regions and structuring elements to obtain a first difference image, thereby extracting dark imperfections against a bright background. To further improve extraction accuracy, the first difference image is also subjected to contrast amplification and noise filtering. Specifically, a set gain value is used to amplify the contrast of the first difference image, while a noise threshold is used for noise filtering, accurately segmenting imperfections such as bright spots, blemishes, and fine lines. The gain value ranges from 1 to 10, with a commonly used value of 2; the noise threshold ranges from 0 to 255 grayscale values, with a commonly used value of 20. A higher gain value results in stronger contrast amplification and a higher detection capability for weak contrast defects. Simultaneously, the noise threshold should also be appropriately increased. The specific gain and noise threshold values can be flexibly set according to actual needs; this embodiment does not impose limitations on them.
[0082] In one embodiment, performing morphological top-hat transformation on the dark stripe region and obtaining the defect detection result of the dark stripe region based on the transformed second difference image includes:
[0083] A second difference image is obtained by performing a morphological top-hat transformation on the dark stripe region based on a pre-created structuring element.
[0084] After contrast amplification and noise filtering of the second difference image, bright defects in the dark stripe area are extracted.
[0085] In this embodiment, similarly, it is also necessary to first create a suitable structuring element for the top-hat transform mask operation based on the direction of the laser stripes (X-axis direction, Y-axis direction, XY-axis direction) and the size of the point or line defects. The creation principles for the size and direction of the structuring element are the same as in the previous embodiment, and will not be repeated here. Morphological top-hat transform is then performed on the dark stripe region using this structuring element to obtain the first difference image. The specific image algorithm is as follows:
[0086] Opening operation:
[0087] TopHat operation: TopHat(I,S) = I - IοS
[0088] Where I represents the detected image (in this embodiment, the image of the dark stripe region), S represents the structuring element, and Θ represents the morphological grayscale erosion operation. The morphological grayscale dilation operation involves performing an opening operation between the bright fringe region and the structuring element to obtain the second difference image, thereby extracting bright blemishes against a dark background. Similarly, the second difference image undergoes contrast amplification and noise filtering to ensure accurate extraction of bright blemishes. Specifically, a set gain value is used to amplify the contrast of the second difference image, while a noise threshold is applied for noise filtering, accurately segmenting blemishes such as bright spots, blemishes, and fine lines. The selection range of the gain value and noise threshold is the same as in the previous embodiment and will not be repeated here. The first and second difference images can be processed using the same gain value and noise threshold, or different gain values and noise thresholds can be selected for the two difference images depending on different needs; this embodiment does not limit this. By setting the gain of the difference image to increase contrast, corresponding defects can be highlighted, detecting defects that are difficult for general detection systems to distinguish. Furthermore, by setting a noise filtering threshold, false positives for blemishes are reduced, further improving the accuracy of blemish extraction.
[0089] In one embodiment, the step of performing local threshold segmentation on the stripe transition region to extract the defect detection result of the stripe transition region includes:
[0090] The stripe transition region is traversed and detected by pre-created structural elements;
[0091] During each traversal and detection, the average gray value and standard deviation of the pixels within the current structuring element are calculated.
[0092] The local segmentation threshold is calculated based on the average gray value and the standard value.
[0093] Based on the local segmentation threshold, defects are extracted from the pixels within the current structuring element to obtain dark defects and / or bright defects within the current structuring element.
[0094] In this embodiment, since the image contrast changes significantly in the stripe transition area where bright and dark stripes overlap, a local thresholding method based on mean and standard deviation is used to extract the defect target. The segmentation threshold is calculated from the average gray value and standard deviation of each pixel within the local structural unit S. That is, a structural element needs to be created for detection processing. The creation principles for the size and orientation of the structural element are the same as in the previous embodiment and will not be repeated here. The stripe transition area is traversed and detected through the structural element mask window. During each detection, the average gray value and standard deviation of the pixels within the current structural element are calculated. Then, based on the average gray value and standard deviation, the local segmentation threshold within the current structural element window is determined. This local segmentation threshold is compared with the gray value of each pixel within the structural element window to extract bright and / or dark defects within the current structural element window. The specific algorithm process is as follows:
[0095] Local segmentation threshold: v(x,y,s)=max(gain×d(x,y,s),th)
[0096] Selection criterion for bright defects: g(x,y)≥m(x,y,s)+v(x,y,s)
[0097] Dark defect selection: g(x,y)≤m(x,y,s)-v(x,y,s)
[0098] Where: s represents the structuring element of the local mask calculation; g(x,y) represents the grayscale values of image pixel x and y; m(x,y,s) and d(x,y,s) are the mean and standard deviation of the corresponding grayscale values in the mask s-window for that pixel. The standard deviation is used as a measure of noise in the image. The standard deviation can be scaled by the scaling parameter gain to reflect the required sensitivity. A higher gain value means selecting only pixels that are very different from the surrounding environment. The parameter gain is independent of the mask s-window; values between 0 and 1.0 are reasonable choices, with an optimal value of 0.25. If the parameter is too high or too low, it may miss or mistakenly extract defective areas. The specific value can be selected according to actual needs.
[0099] Furthermore, the segmentation threshold is adjusted within the uniform region by using the noise sensitivity th value. Since the standard threshold is low in the uniform region of the image, while the influence of a single gray value is high, the th value can be set to ignore small gray value changes in the uniform environment in order to reduce the sensitivity of defect detection to noise in the uniform region. The th value is a gray value in the range of 0-255. The smaller the value, the easier it is to make false detections. If the value is too high, it will lead to missed defects. A value of 12 is recommended. The specific value can be selected according to actual needs. This embodiment does not limit this.
[0100] This embodiment employs a local mean and standard deviation threshold segmentation method for overlapping areas of bright and dark stripes with drastic contrast changes. The standard deviation is used to automatically measure image noise around the structuring element, and the sensitivity of different adjacent pixels is scaled by the scaling parameter gain value. In addition, a th value is set to reduce the noise influence in uniform areas, thereby achieving automatic and accurate defect extraction in uniform areas and gray-scale abrupt change areas, avoiding false positives and false negatives.
[0101] S400. Based on the defect detection results of each region, mark and display the defective areas of the laser film image.
[0102] In this embodiment, based on the defect detection results obtained by different detection methods in each region, namely the location of dark defects detected in the bright stripe region, bright defects detected in the dark stripe region, and bright and / or dark defects detected in the stripe transition region, the defect areas are summarized and marked and displayed on the laser film image. Specifically, the color of the pixels in the defect area can be changed to a preset color, such as red, yellow, white, or other colors that can be clearly distinguished from other pixels, so as to achieve intuitive and accurate defect extraction and display.
[0103] like Figure 4 As shown, Figure 4 Image (a) shows a flawed laser film. By extracting flaws from different areas using the flaw detection method provided in this embodiment of the invention, accurate results can be obtained. Figure 4 The results of the bright defect detection shown in (b) are as follows: Figure 4 The dark defect detection results shown in (c) enable intuitive and accurate extraction of laser film defects, effectively improving the defect detection accuracy of non-uniform stripe images.
[0104] Another embodiment of the present invention provides a laser film defect detection device, such as... Figure 5 As shown, device 1 includes:
[0105] Acquisition module 11 is used to acquire an image of the laser film to be detected;
[0106] Stripe segmentation module 12 is used to perform stripe segmentation processing on the laser film image to determine the bright stripe region, dark stripe region and stripe transition region in the laser film image;
[0107] The defect detection module 13 is used to perform defect detection on the bright stripe area, dark stripe area and stripe transition area according to a preset detection strategy, and obtain the defect detection results of each area. The preset detection strategy is used to determine the defect detection method corresponding to each area.
[0108] The marking and display module 14 is used to mark and display the defective areas of the laser film image based on the defect detection results of each area.
[0109] The module referred to in this invention is a series of computer program instruction segments that can perform specific functions. It is more suitable than a program for describing the execution process of laser film defect detection. For specific implementation methods of each module, please refer to the corresponding method embodiments above, which will not be repeated here.
[0110] Another embodiment of the present invention provides a laser film defect detection system, such as Figure 6 As shown, system 10 includes:
[0111] One or more processors 110 and memory 120, Figure 6 The following description uses a processor 110 as an example. The processor 110 and the memory 120 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.
[0112] Processor 110 is used to perform various control logics of system 10, and can be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), microcontroller, ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Furthermore, processor 110 can also be any conventional processor, microprocessor, or state machine. Processor 110 can also be implemented as a combination of computing devices, such as a combination of DSP and microprocessor, multiple microprocessors, one or more microprocessors combined with DSP and / or any other such configuration.
[0113] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions corresponding to the laser film defect detection method in the embodiments of the present invention. The processor 110 executes various functional applications and data processing of the system 10 by running the non-volatile software programs, instructions, and units stored in the memory 120, thereby implementing the laser film defect detection method in the above method embodiments.
[0114] The memory 120 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created according to the use of the system 10. Furthermore, the memory 120 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include memory remotely located relative to the processor 110, and these remote memories may be connected to the system 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0115] One or more units are stored in memory 120, and when executed by one or more processors 110, they perform the laser film defect detection method in any of the above method embodiments, for example, performing the above-described method. Figure 1 Method steps S100 to S400.
[0116] This invention provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors, for example, to perform the operations described above. Figure 1 Method steps S100 to S400.
[0117] As examples, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The memory components or memories disclosed in the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.
[0118] In summary, the laser film defect detection method, apparatus, system, and medium disclosed in this invention involve: acquiring an image of the laser film to be detected; performing stripe segmentation processing on the laser film image to determine bright stripe regions, dark stripe regions, and stripe transition regions in the laser film image; performing defect detection on the bright stripe regions, dark stripe regions, and stripe transition regions according to a preset detection strategy to obtain defect detection results for each region, where the preset detection strategy is used to determine the corresponding defect detection method for each region; and marking and displaying the defective regions of the laser film image based on the defect detection results for each region. By performing stripe segmentation on a laser film image with alternating bright and dark stripes and performing targeted defect detection on different stripe regions, the influence of uneven illumination on the image can be eliminated while preserving the feature information of the original image, reducing false positives or false negatives in defect detection, and effectively improving the accuracy of laser film defect detection.
[0119] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The computer program can be stored in a non-volatile, computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The storage medium can be a memory, magnetic disk, floppy disk, flash memory, optical storage, etc.
[0120] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A method for detecting defects in laser films, characterized in that, include: Acquire an image of the laser film to be inspected; The laser film image is subjected to stripe segmentation processing to determine the bright stripe regions, dark stripe regions, and stripe transition regions in the laser film image; According to the preset detection strategy, the bright stripe area, dark stripe area and stripe transition area are respectively subjected to defect detection to obtain the defect detection results of each area. The preset detection strategy is used to determine the defect detection method corresponding to each area. Based on the defect detection results of each region, the defective areas of the laser film image are marked and displayed; The defect detection is performed on the bright stripe area, dark stripe area, and stripe transition area according to the preset detection strategy, and the defect detection results for each area are obtained, including: The bright stripe region is subjected to morphological undercap transformation, and the defect detection result of the bright stripe region is obtained based on the first difference image obtained by the transformation. The dark stripe region is subjected to morphological top-hat transformation, and the defect detection result of the dark stripe region is obtained based on the second difference image obtained by the transformation. Local threshold segmentation is performed on the stripe transition region to extract the defect detection result of the stripe transition region; The step of performing local threshold segmentation on the stripe transition region to extract the defect detection result of the stripe transition region includes: The stripe transition region is traversed and detected by pre-created structural elements; During each traversal and detection, the average gray value and standard deviation of the pixels within the current structuring element are calculated. The local segmentation threshold is calculated based on the average gray value and the standard value. Based on the local segmentation threshold, defects are extracted from the pixels within the current structuring element to obtain dark defects and / or bright defects within the current structuring element. The specific local segmentation threshold is v(x,y,s)=max(gain×d(x,y,s),th), where s represents the structuring element of the local mask calculation, d(x,y,s) is the standard deviation of the pixel grayscale values in structuring element s, gain is the scaling parameter, and th is the noise sensitivity value.
2. The laser film defect detection method according to claim 1, characterized in that, The step of performing stripe segmentation processing on the laser film image to determine the bright stripe regions, dark stripe regions, and stripe transition regions in the laser film image includes: Histogram statistics of grayscale values are performed on the laser film image to obtain the corresponding grayscale histogram; The global segmentation threshold is obtained based on the grayscale histogram; The grayscale value of each pixel is compared with the global segmentation threshold to determine the bright stripe region and the dark stripe region; Morphological processing is performed on the bright and dark stripe regions to determine the stripe transition areas.
3. The laser film defect detection method according to claim 2, characterized in that, The morphological processing of the bright and dark stripe regions to determine the stripe transition regions includes: The bright stripe region and the dark stripe region are expanded respectively by morphological dilation processing; The intersection operation is performed on the expanded bright stripe region and the dark stripe region to obtain the stripe transition region.
4. The laser film defect detection method according to claim 1, characterized in that, The step of performing morphological undercap transformation on the bright stripe region and obtaining the defect detection result of the bright stripe region based on the first difference image obtained by the transformation includes: The bright stripe region is subjected to morphological undercap transformation based on pre-created structural elements to obtain the first difference image; After contrast amplification and noise filtering of the first difference image, dark blemishes within the bright stripe area are extracted.
5. The laser film defect detection method according to claim 1, characterized in that, The step of performing morphological top-hat transformation on the dark stripe region and obtaining the defect detection result of the dark stripe region based on the second difference image obtained by the transformation includes: A second difference image is obtained by performing a morphological top-hat transformation on the dark stripe region based on a pre-created structuring element. After contrast amplification and noise filtering of the second difference image, bright defects in the dark stripe area are extracted.
6. A laser film defect detection device, characterized in that, include: The acquisition module is used to acquire images of the laser film to be inspected; The stripe segmentation module is used to perform stripe segmentation processing on the laser film image to determine the bright stripe region, dark stripe region, and stripe transition region in the laser film image. The defect detection module is used to perform defect detection on the bright stripe area, dark stripe area and stripe transition area according to a preset detection strategy, and obtain the defect detection results of each area. The preset detection strategy is used to determine the defect detection method corresponding to each area. The marking and display module is used to mark and display the defective areas of the laser film image based on the defect detection results of each area; The defect detection is performed on the bright stripe area, dark stripe area, and stripe transition area according to the preset detection strategy, and the defect detection results for each area are obtained, including: The bright stripe region is subjected to morphological undercap transformation, and the defect detection result of the bright stripe region is obtained based on the first difference image obtained by the transformation. The dark stripe region is subjected to morphological top-hat transformation, and the defect detection result of the dark stripe region is obtained based on the second difference image obtained by the transformation. Local threshold segmentation is performed on the stripe transition region to extract the defect detection result of the stripe transition region; The step of performing local threshold segmentation on the stripe transition region to extract the defect detection result of the stripe transition region includes: The stripe transition region is traversed and detected by pre-created structural elements; During each traversal and detection, the average gray value and standard deviation of the pixels within the current structuring element are calculated. The local segmentation threshold is calculated based on the average gray value and the standard value. Based on the local segmentation threshold, defects are extracted from the pixels within the current structuring element to obtain dark defects and / or bright defects within the current structuring element. The specific local segmentation threshold is v(x,y,s)=max(gain×d(x,y,s),th), where s represents the structuring element of the local mask calculation, d(x,y,s) is the standard deviation of the pixel grayscale values in structuring element s, gain is the scaling parameter, and th is the noise sensitivity value.
7. A laser film defect detection system, characterized in that, The system includes at least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the laser film defect detection method according to any one of claims 1-5.
8. A non-volatile computer-readable storage medium, characterized in that, The non-volatile computer-readable storage medium stores computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the laser film defect detection method according to any one of claims 1-5.
Citation Information
Patent Citations
Piece goods blemish detecting method based on morphological analysis
CN103456021A
Clarity self-adaptive coiled material detection method, device and system
CN114264661A