A flexible film defect detection method and device based on machine vision
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG CHANGHAI PACKAGE GRP
- Filing Date
- 2026-04-22
- Publication Date
- 2026-08-04
AI Technical Summary
[0005]为了缓解柔性薄膜人工检测效率低的问题,本发明提供一种基于机器视觉的柔性薄膜缺陷检测方法及检测装置
解决了传统人工目视检测效率低、易疲劳漏检的问题,同时克服了高速生产线上套印、污点、异物等不同缺陷难以自动识别与分类处理的缺陷,提升了柔性薄膜的检测效率和检测精度;
Smart Images

Figure CN122505902A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flexible film inspection technology, and in particular to a machine vision-based method and device for detecting defects in flexible films. Background Technology
[0002] Flexible films are thin films with significant flexibility, folding and torsion capabilities. They can maintain structural or functional stability after deformation and are not easily brittle. Their thickness is usually in the range of micrometers to tens of micrometers, which is different from rigid sheets or brittle films.
[0003] Currently, flexible film production lines generally go through processes such as feeding and unwinding (material conveying is achieved through unwinding rollers and tension control mechanisms), processing (including equipment such as printing machines, coating machines, and laminating machines to complete forming and surface treatment), and winding and unwinding (finished product collection is completed through winding rollers). These processes are coordinated by a control system, and high-speed linear speeds can reach tens to hundreds of meters per minute or even faster.
[0004] Regarding the aforementioned technologies, high-speed printing presses may produce stains and misregistration, while high-speed production lines may contain foreign objects such as insects, metal wires, and hair. Traditional inspection methods for these production lines rely on manual visual inspection to check and remove defective products. However, manual inspection is inefficient and prone to fatigue, leading to a high rate of missed inspections, and there is still room for improvement. Summary of the Invention
[0005] To alleviate the problem of low efficiency in manual inspection of flexible films, this invention provides a method and device for defect detection of flexible films based on machine vision.
[0006] In a first aspect, the present invention provides a method for detecting defects in flexible thin films based on machine vision, employing the following technical solution: A machine vision-based method for detecting defects in flexible thin films, comprising: Step S1: Acquire an image of the flexible thin film illuminated by a strip light source; Step S2: Compare the flexible film image with the preset pattern features to obtain the abnormal region and the area of the abnormal region; Step S3: If the area of the abnormal region is greater than the preset area threshold, output the preset overprint processing signal; Step S4: If the area of the abnormal region is smaller than the preset area threshold, control the active roller to rotate according to the preset instantaneous rotation mode and capture the abnormal image group; Step S5: Analyze the abnormal image group to obtain the jitter characteristics of the abnormal region; Step S6: If the jitter characteristic matches the preset instantaneous rotation characteristic, output the preset stain processing signal; Step S7: If the shaking characteristics are inconsistent with the preset instantaneous rotation characteristics, control the adsorption device to adsorb the abnormal area.
[0007] By adopting the above technical solution, the acquired flexible film image is compared with the preset pattern features to obtain the abnormal area and its area. The area threshold is used to distinguish between overprinting defects and small stains and foreign objects. For small area abnormalities, the active roller is further controlled to drive the film to move in an instantaneous rotation mode and capture abnormal image groups. The jitter features of the abnormal area are extracted and compared with the instantaneous rotation features to distinguish between surface stains and removable foreign objects. Overprinting processing signals, stain processing signals or control adsorption devices to perform adsorption and removal are output respectively. This solves the problems of low efficiency and easy fatigue and missed detection in traditional manual visual inspection. At the same time, it overcomes the shortcomings of automatic identification and classification of different defects such as overprinting, stains and foreign objects on high-speed production lines, and improves the detection efficiency and detection accuracy of flexible films.
[0008] Optionally, it also includes a method for analyzing abnormal image groups, the method comprising: Step S50: Perform image analysis on the abnormal image group to extract the abnormal locations corresponding to the abnormal regions within the abnormal image group; Step S51: If the abnormal position does not change within the abnormal image group, output the preset lens dirt signal and perform image processing on the flexible film image to obtain a dirt-free image. Step S52: If the abnormal location changes within the abnormal image group, calculate the displacement distance of the abnormal area based on the abnormal location, and perform morphological analysis on the abnormal area to obtain the amount of morphological change. Step S53: Combine the displacement distance and the amount of morphological change to form the shaking feature.
[0009] By adopting the above technical solution, abnormal image groups are analyzed to extract the location information of abnormal areas and determine whether the abnormal position is fixed. This distinguishes between defects in the flexible film itself and dirt on the lens of a high-speed industrial camera. The images are then processed to obtain dirt-free images. When the abnormal position changes, a jitter feature is constructed by calculating the displacement distance and morphological change of the abnormal area. This solves the problem of lens dirt being easily misjudged as film defects, resulting in a high false alarm rate, and improves the accuracy of flexible film defect detection.
[0010] Optionally, methods for controlling the adsorption device to adsorb anomalous areas include: Step S70: Locate the final anomaly location from the anomaly locations; Step S71: Calculate the rotation direction and rotation distance of the roller that will turn the abnormal position to the adsorbable position based on the final abnormal position and the preset adsorbable position; Step S72: Control the active roller to rotate according to the roller rotation direction and rotation distance to move the abnormal position to a position that can be adsorbed; Step S73: Obtain the abnormal image corresponding to the abnormal region; Step S74: Extract the abnormal image to determine the actual location of the abnormality; Step S75: If the actual abnormal location is inconsistent with the adsorbable location, calculate the rotation direction and rotation distance of the roller based on the actual abnormal location and the adsorbable location, and execute steps S72 to S74. Step S76: If the actual abnormal location is consistent with the adsorbable location, control the adsorption device to adsorb the foreign matter corresponding to the abnormal location.
[0011] By adopting the above technical solution, the final abnormal position is located, the active roller is calculated and controlled to accurately deliver the abnormal area to the adsorbable position, and the adsorbable position is re-inspected in real time. The position of the abnormal area is repeatedly corrected until it matches the adsorbable position before the adsorption operation is performed. This method solves the problem that adsorption cannot be performed when the abnormal position is not in the adsorbable position, and improves the accuracy of adjusting the abnormal area from the abnormal position to the adsorbable position.
[0012] Optionally, methods for image processing of flexible film images to obtain contamination-free images include: Step S510: Perform image analysis on the flexible film image to determine the contaminated area corresponding to the high-speed industrial camera; Step S511: Count the number of dirty areas and define the number of dirty areas as the number of dirt areas; Step S512: Measure the width and length of the area according to the preset shooting area; Step S513: Determine the cut length based on the region length; Step S514: If the number of dirt items is equal to 1, measure the maximum length based on the dirt area; Step S515: Calculate the length difference based on the region length and the maximum length; Step S516: When the length difference is less than the cuttable length, output a lens dirt signal; Step S517: When the length difference is greater than the cut-out length, determine the area to be removed from the dirty area within the shooting area based on the maximum length and area width, and remove the dirty area within the shooting area to obtain a dirty-free area. Step S518: Use the image corresponding to the clean area as the clean image.
[0013] By adopting the above technical solution, the method of identifying dirty areas on the lens and counting the amount of dirt, measuring the length and width of the shooting area and setting the cut-out length, judging the length and evaluating the effective area of a single dirty area, directly removing the dirty area when the effective area is sufficient to obtain a dirt-free image, and outputting a lens dirt signal when the dirty area is too large, solves the problem that lens dirt may be mistaken for a thin film defect, leading to misjudgment, and achieves the effect of automatically repairing the image without stopping the machine.
[0014] Optionally, it also includes a treatment method if the number of contaminants is greater than 1, the method comprising: Step S5140: Determine the length projection range of the dirty area in the transmission direction based on the dirty area and the shooting area; Step S5141: Combine the dirty areas with overlapping length projection ranges to form at least one overall dirty area, and calculate the overall length range based on the overall dirty area; Step S5142: Based on the overall dirty area and the dirty area, find the dirty area that does not belong to the overall dirty area, define the remaining dirty area as an independent dirty area, and define the length projection range corresponding to the independent dirty area as an independent length range. Step S5143: Calculate the actual length of dirt based on the overall length range and the individual length range; Step S5144: Calculate the total length difference based on the area length and the actual length of dirt; Step S5145: When the total length difference is less than the cuttable length, output a lens dirt signal; Step S5146: When the total length difference is greater than the cut-out length, determine the overall removal area of the dirty area within the shooting area based on the overall length range and area width, and determine the independent removal area of the dirty area within the shooting area based on the independent length range and area width. Remove the overall removal area and the independent removal area within the shooting area to obtain the area to be spliced. Step S5147: Acquire the previous frame thin film image and the next frame thin film image; Step S5148: Extract the valid images corresponding to the overall removal region and the independent removal region from the previous frame thin film image and the subsequent frame thin film image, respectively; Step S5149: Fill the effective image into the overall rejection area and the individual rejection area to obtain the stitched flexible film image.
[0015] By adopting the above technical solution, for situations where multiple lenses are dirty, the system merges overlapping dirty areas and calculates the total length of the dirt to determine whether the defect detection can continue by removing the dirty areas and stitching the images together. When the conditions are met, the system uses stitching the images of the preceding and following frames to fill the gaps. If the dirt is too large, the system prompts the user to clean the lens. This solves the problem that when multiple parts of the lens are dirty, it is impossible to achieve a dirt-free image simply by removing the dirty areas. It achieves the effect of obtaining a dirt-free image by removing the dirty areas and stitching the images of the preceding and following frames when multiple parts of the lens are dirty.
[0016] Optional, also includes: Step S5100: Based on the area of the abnormal region and the displacement distance, find the corresponding foreign object attachment characteristics in the preset foreign object database; Step S5101: Based on the foreign object adhesion characteristics, find the corresponding optimal suction force in the preset foreign object suction force library; Step S5102: Control the adsorption device to adsorb the abnormal area according to the optimal suction force; Step S5103: If the abnormal area still exists, control the active roller to rotate in an instantaneous rotation mode and capture a group of real-time abnormal images; Step S5104: Analyze the real-time anomaly image group to obtain the final anomaly area and actual displacement distance of the anomaly region; Step S5105: Based on the final abnormal area and actual displacement distance, find the corresponding foreign object attachment characteristics in the foreign object database; Step S5106: Based on the foreign object adhesion characteristics, find the corresponding final suction power in the foreign object suction power library; Step S5107: Control the adsorption device to adsorb the abnormal area according to the final suction force.
[0017] By adopting the above technical solution, the foreign object attachment characteristics are obtained by querying the foreign object database based on the area of the abnormal region and the displacement distance. Then, the optimal suction force is determined by matching the foreign object suction force database for adsorption. If the foreign object is not removed, the problem of foreign object not being removed by a single adsorption is solved by re-acquiring the image, updating the abnormal features, and adjusting the suction force for a second adsorption. This improves the success rate of foreign object adsorption.
[0018] Optionally, it also includes a handling method if the abnormal region still exists, the method including: Step S51070: Control the active roller to continuously rotate in an instantaneous rotation mode and capture a group of dynamic abnormal images; Step S51071: Analyze the dynamic abnormal image group to obtain the current jitter characteristics of the abnormal region; Step S51072: If the current jitter characteristic is consistent with the instantaneous rotation characteristic, output a stain processing signal; Step S51073: If the current shaking characteristics are inconsistent with the instantaneous rotation characteristics, control the adsorption device to adsorb the abnormal area.
[0019] By adopting the above technical solution, for abnormal areas that cannot be removed after multiple adsorption attempts, the active roller is controlled to rotate continuously and instantaneously, and dynamic image groups are collected. The jitter characteristics are analyzed and compared with preset instantaneous rotation characteristics to re-distinguish whether the area is a stubborn stain that cannot be adsorbed or a foreign object that can still be removed. A stain warning signal is output or adsorption is performed again, respectively. This solves the problem of not being able to determine whether the foreign object is temporarily adsorbed on the film or the stain causes repeated adsorption after the foreign object adsorption fails, and realizes secondary classification processing after adsorption failure.
[0020] Optional, also includes: Step S10: Obtain the active vibration amplitude of the active roller; Step S11: If the active vibration amplitude is greater than the preset vibration threshold, output the preset foreign object signal and prepare to control the active roller to rotate in an instantaneous rotation mode; Step S12: Obtain the driven vibration amplitude of the driven roller; Step S13: If the amplitude of the driven vibration is greater than the preset vibration threshold, output a preset foreign object not cleared signal and control the active roller to reverse in a preset reversing manner until the abnormal area returns to the preset adsorption position. Step S14: Control the adsorption device to adsorb the abnormal area.
[0021] By adopting the above technical solution, the vibration amplitude of the active roller and the driven roller is collected. Abnormal vibration of the active roller is used to identify foreign objects on the film surface in advance. Abnormal vibration of the driven roller is used to determine whether the foreign objects have been successfully removed. If the foreign objects are not removed, the active roller is controlled to reverse and the abnormal area is moved back to the adsorption position for re-adsorption. This solves the problem that foreign objects may be missed by image detection, realizes early warning of foreign objects, and reduces the risk of missed detection and secondary residue.
[0022] Optionally, it also includes a method for processing the output lens contamination signal, the method comprising: Step S5160: Perform edge detection based on the flexible film image to obtain the flexible film region; Step S5161: Calculate the location of the contamination within the flexible film area based on the flexible film area and the contamination area. Step S5162: Calculate the rotation direction and rotation distance of the high-speed industrial camera based on the location of the dirt; Step S5163: Control the high-speed industrial camera to rotate according to the rotation direction and rotation distance, so that the dirty area is moved out of the flexible film area.
[0023] By adopting the above technical solution, edge detection is performed on flexible film images to determine the film area and the location of dirt, the required rotation direction and distance of the camera are calculated, and the rotation of the high-speed industrial camera is controlled to move the dirty area out of the imaging range. This solves the problem that lens dirt cannot be removed by image adjustment, and achieves the effect of lens adaptive adjustment when the lens is dirty, thereby improving the continuity of the production line and the inspection efficiency.
[0024] Secondly, the present invention provides a machine vision-based flexible thin film defect detection device, which adopts the following technical solution: A machine vision-based flexible film defect detection device, controlled by a machine vision-based flexible film defect detection method as described above, includes: The base serves as the foundation; An aluminum alloy bracket, located above the base, is used for the overall fixation and support of the testing device; A strip light source, positioned above the center of the base, is used to illuminate the flexible film with light to highlight its defects. An active roller, located on one side of an aluminum alloy bracket, is used to drive the flexible film transport. The driven roller is located on one side of the aluminum alloy bracket, opposite to the active roller, and is used to work with the active roller to tension the flexible film. A timing belt connects the driving roller and the driven roller, and is used by the driving roller to drive the driven roller to rotate. An adsorption device, mounted on an aluminum alloy support and positioned between the driving and driven rollers, is used to adsorb foreign matter from the surface of a flexible film; and A high-speed industrial camera, mounted on an aluminum alloy bracket, is used to capture images of flexible films illuminated by a strip light source.
[0025] By adopting the above technical solution, the base and aluminum alloy bracket provide a stable installation foundation, and the strip light source highlights defects while a high-speed industrial camera captures thin film images in real time; the flexible film is stably transported by the active roller, driven roller and synchronous belt, and the identified foreign objects are removed online by the adsorption device; the system achieves automatic defect detection and the differentiation and removal of stains and foreign objects, thus improving detection accuracy and detection speed.
[0026] In summary, the present invention has at least one of the following beneficial technical effects: It solves the problems of low efficiency and easy fatigue and missed detection in traditional manual visual inspection, and overcomes the difficulty in automatically identifying and classifying different defects such as overprinting, stains and foreign objects on high-speed production lines, thus improving the inspection efficiency and accuracy of flexible films. It solves the problem that when there are multiple dirty areas on the lens, it is impossible to achieve a clean image simply by removing the dirty areas. It achieves the effect of obtaining a clean image by removing the dirty areas and stitching together the images of the previous and next frames when there are multiple dirty areas. This solves the problem of potential omissions of foreign objects in image detection, enables early warning of foreign objects, and reduces the risk of missed detection and secondary residue. Attached Figure Description
[0027] Figure 1 This is a flowchart of a machine vision-based flexible film defect detection method in an embodiment of this application; Figure 2 This is a schematic diagram of a machine vision-based flexible thin film defect detection device in an embodiment of this application.
[0028] The parts referred to by the numbers in the above attached diagrams are as follows: 1. Base; 2. Aluminum alloy bracket; 3. Strip light source; 4. Driven roller; 5. Driven roller; 6. Synchronous belt; 7. Adsorption device; 8. High-speed industrial camera. Detailed Implementation
[0029] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0030] This invention discloses a machine vision-based method for detecting defects in flexible thin films. (Refer to...) Figure 1 A machine vision-based method for detecting defects in flexible thin films includes: Step S1: Obtain an image of the flexible thin film irradiated by the strip light source 3.
[0031] A flexible thin film image is a digital image that contains information about the surface texture, pattern, and potential defect areas of the flexible thin film. The flexible thin film image is obtained by photographing the flexible thin film in either a transport or stationary state using a high-speed industrial camera 8 after it has been illuminated by a bar light source 3.
[0032] Reference Figure 2A machine vision-based flexible film defect detection device includes a base 1, an aluminum alloy bracket 2, a strip light source 3, an active roller 4, a driven roller 5, a synchronous belt 6, an adsorption device 7, and a high-speed industrial camera 8. The base 1 serves as the foundation of the entire device. The aluminum alloy bracket 2 is mounted above the base 1 for overall fixation and support of the detection device. The strip light source 3 is mounted above the center of the base 1 to illuminate the flexible film and highlight its defects. The active roller 4 is mounted on one side of the aluminum alloy bracket 2 to drive the flexible film's movement. The driven roller 5 is mounted on one side of the aluminum alloy bracket 2, opposite the active roller 4, and works with the active roller 4 to tension the flexible film. The synchronous belt 6 connects the active roller 4 and the driven roller 5, allowing the active roller 4 to drive the driven roller 5 to rotate. The adsorption device 7 is mounted on the aluminum alloy bracket 2, located between the active roller 4 and the driven roller 5, and is used to adsorb foreign objects from the surface of the flexible film. A high-speed industrial camera 8 is mounted above an aluminum alloy bracket 2 and is used to capture images of the flexible film after it has been irradiated by a strip light source 3.
[0033] Step S2: Compare the flexible film image with the preset pattern features to obtain the abnormal region and the area of the abnormal region.
[0034] Pattern features refer to the standard image features that a flexible film should possess in a defect-free state, including but not limited to standard texture features, grayscale distribution features, contour features, and color features. Pattern features are obtained by those skilled in the art through multiple acquisitions and feature extractions of defect-free, qualified flexible film samples.
[0035] An abnormal region refers to a continuous image area in a flexible film image that differs significantly from the preset pattern features in grayscale, texture, contour, or color, and does not conform to the standard features. Abnormal regions are identified by performing differential or edge feature comparisons between the flexible film image and the preset pattern features, marking areas with differences exceeding a preset difference threshold. The difference threshold is determined by those skilled in the art through image comparison experiments on multiple sets of defect-free standard flexible film samples and known defective flexible film samples, statistically analyzing the maximum normal difference value in the defect-free state and the minimum defect difference value in the defective state, and using the median value greater than the maximum normal difference value and less than the minimum defect difference value as the preset difference threshold.
[0036] The area of an abnormal region refers to the number of pixels occupied by the abnormal region in the flexible film image, or the actual physical area obtained after converting pixels to actual physical size. The area of the abnormal region is obtained by performing pixel statistics or contour enclosing area calculation on the marked abnormal regions.
[0037] Step S3: If the area of the abnormal region is greater than the preset area threshold, output the preset overprint processing signal.
[0038] Area threshold refers to the critical area value used to determine whether an anomaly is an overprint defect or a minor foreign object or stain. The area threshold is pre-calibrated by a person skilled in the art through statistical analysis of a large number of defect samples, combined with process requirements.
[0039] An overprint processing signal is a signal used to alert workers that overprinting exists on the flexible film and requires processing. The overprint processing signal is preset by those skilled in the art, and is output in the form of sound and light when the area of the abnormal region exceeds a preset area threshold.
[0040] If the area of the abnormal region is larger than the preset area threshold, it indicates that there may be overprinting, and staff need to be notified to handle it. At this time, an overprinting processing signal will be output.
[0041] Step S4: If the area of the abnormal region is smaller than the preset area threshold, control the active roller 4 to rotate in the preset instantaneous rotation mode and capture the abnormal image group.
[0042] The instantaneous rotation method refers to a short-duration, small-amplitude jogging or reciprocating micro-motion of the active roller 4, causing a controllable micro-displacement of the flexible film. The instantaneous rotation method is achieved by controlling the active roller 4 through a motor, with the rotation angle, rotation speed, rotation direction, and rotation time preset by those skilled in the art. The preset rotation angle, rotation speed, rotation direction, and rotation time are determined after multiple experimental calibrations, taking into account the material thickness of the flexible film, the defect detection accuracy, the camera frame rate, and the limitations of the equipment's mechanical structure, in order to avoid damaging the shape of the flexible film, affecting its normal transmission, and effectively distinguishing foreign objects from surface contaminants.
[0043] An abnormal image set refers to a collection of multiple images containing the same abnormal area, continuously acquired during or after the active roller 4 rotates in a preset instantaneous rotation mode. The abnormal image set is formed by a high-speed industrial camera 8 continuously capturing multiple images at a frame rate preset by those skilled in the art, simultaneously with or after the active roller 4 performs its instantaneous rotation.
[0044] If the area of the abnormal region is smaller than the preset area threshold, it indicates that there may be stains or small foreign objects in the abnormal region. The active roller 4 needs to drive the flexible film to rotate, and the abnormal image group is captured to analyze whether the abnormality of the abnormal region is due to stains or small foreign objects.
[0045] Step S5: Analyze the abnormal image group to obtain the jitter characteristics of the abnormal region.
[0046] Jitter features refer to the set of characteristic parameters of the displacement distance and morphological changes of an abnormal region during instantaneous rotation. Jitter features are obtained by tracking the position, calculating the displacement, and analyzing the morphology of the abnormal regions in each frame of an abnormal image group.
[0047] Step S6: If the jitter characteristic matches the preset instantaneous rotation characteristic, output the preset stain processing signal.
[0048] Instantaneous rotation characteristics refer to the standard motion characteristics exhibited by the patterned area on the flexible film under the instantaneous rotation of the active roller 4, including standard displacement distance and morphological stability. Instantaneous rotation characteristics are determined by conducting multiple instantaneous rotation experiments on a defect-free flexible film by those skilled in the art, collecting and statistically analyzing the displacement distance and morphological stability data of the patterned area on the flexible film during the instantaneous rotation process, averaging and calibrating the data from multiple experiments to form the preset instantaneous rotation characteristics.
[0049] A stain removal signal is a signal used to alert staff that the current anomaly is a stain on the surface of the flexible film, requiring stain removal. The stain removal signal is preset by those skilled in the art, and is output in the form of sound and light when the jitter characteristic matches the preset instantaneous rotation characteristic.
[0050] If the jitter characteristic is consistent with the preset instantaneous rotation characteristic, it means that the jitter characteristic of the abnormal area is consistent with the instantaneous rotation characteristic of the normal pattern area. The abnormality of the abnormal area is caused by the stain. At this time, a stain processing signal is output to prompt the staff that there is a stain and it needs to be processed.
[0051] Step S7: If the shaking characteristics are inconsistent with the preset instantaneous rotation characteristics, control the adsorption device 7 to adsorb the abnormal area.
[0052] If the shaking characteristics are inconsistent with the preset instantaneous rotation characteristics, it means that the shaking characteristics of the abnormal area are inconsistent with the instantaneous rotation characteristics of the normal pattern. When the active roller 4 drives the flexible film to roll in the instantaneous rotation mode, there are foreign objects in the abnormal area that can detach from the flexible film. At this time, the control adsorption device 7 extends downward to the top of the flexible film to adsorb the abnormal area.
[0053] This also includes a method for analyzing abnormal image groups, which includes: Step S50: Perform image analysis on the abnormal image group to extract the abnormal locations corresponding to the abnormal regions within the abnormal image group.
[0054] Anomaly location refers to the coordinate position of an abnormal region in a flexible film image. Anomaly location is determined by performing anomaly region segmentation, contour extraction, or target detection on each frame of the anomaly image group, thus identifying the pixel and physical coordinates of the abnormal region within the corresponding frame image. This is the anomaly location for that frame image.
[0055] Step S51: If the abnormal position does not change within the abnormal image group, output the preset lens dirt signal and perform image processing on the flexible film image to obtain a dirt-free image.
[0056] The lens contamination signal is a warning signal indicating that the current anomaly is not a defect in the flexible film itself, but rather that there is contamination on the lens surface of the high-speed industrial camera 8. The lens contamination signal is preset by those skilled in the art, and is output in an audio-visual format when the anomaly position in multiple frames of an abnormal image group does not change.
[0057] A contamination-free image refers to an image that, after image processing, has had contaminated areas removed or repaired, and can accurately reflect the surface condition of the flexible film. A contamination-free image is obtained by identifying and removing contaminated areas from the flexible film image, and then stitching together adjacent normal areas or valid images from consecutive frames. The methods for removal and stitching will be detailed in subsequent steps.
[0058] If the abnormal location does not change within the abnormal image group, it indicates that the abnormality may be caused by lens contamination of the high-speed industrial camera 8. The output lens contamination signal prompts the staff to remove the contaminated area from the existing flexible film image or to stitch the images of the previous and next frames to eliminate the impact of lens contamination on the flexible film image.
[0059] Step S52: If the abnormal location changes within the abnormal image group, calculate the displacement distance of the abnormal area based on the abnormal location, and perform morphological analysis on the abnormal area to obtain the amount of morphological change.
[0060] Displacement distance refers to the spatial distance over which the position of an abnormal region changes between different frames in an abnormal image group, including pixel distance or converted actual physical distance. The displacement distance is calculated based on the abnormal position coordinates of the abnormal region in consecutive frames within the abnormal image group, using Euclidean distance calculation, horizontal and vertical component calculation, or minimum bounding rectangle center offset calculation.
[0061] Morphological change refers to the quantified value of the change in morphological attributes of an abnormal region across different frames in an abnormal image group. It is used to indicate whether the abnormal region undergoes deformation, flipping, etc., due to the movement of the flexible film when the active roller 4 rotates instantaneously. The morphological change is obtained by calculating the difference, relative rate of change, or normalized change of the morphological parameters (area, perimeter, aspect ratio, roundness, etc.) of the abnormal region in different frames.
[0062] If the abnormal location changes within the abnormal image group, it indicates that the abnormality in the abnormal area is not caused by lens dirt, but may be caused by stains or small foreign objects on the flexible film. Therefore, by analyzing the abnormal image group to obtain the displacement distance and morphological change, we can specifically determine whether it is a stain or a small foreign object.
[0063] Step S53: Combine the displacement distance and the amount of morphological change to form the shaking feature.
[0064] After normalizing the displacement distance and morphological changes according to preset rules, they are combined to form jitter characteristics. The preset rules are obtained by those skilled in the art based on experimental calibration and are used to eliminate dimensional differences between different characteristic parameters, so that the characteristics can be compared uniformly.
[0065] The method for controlling the adsorption device 7 to adsorb abnormal areas includes: Step S70: Find the final abnormal location from the abnormal locations.
[0066] The final anomaly location refers to the target anomaly location determined from the anomaly locations corresponding to multiple frames in the anomaly image group, and used for subsequent localization and adsorption. The final anomaly location is selected by choosing the anomaly location corresponding to the last frame image taken after the instantaneous rotation ends.
[0067] Step S71: Calculate the rotation direction and rotation distance of the roller that will turn the abnormal position to the adsorption position based on the final abnormal position and the preset adsorption position.
[0068] The adsorption position refers to the preset standard position in which the adsorption device 7 can stably and effectively perform the adsorption action. The adsorption position is determined in advance by those skilled in the art based on the installation position of the adsorption device 7, the effective range of the adsorption head, and the flexible film transmission path through multiple adjustments and calibrations.
[0069] The rotation direction of the rollers refers to the direction required for the active roller 4 to move the flexible film, bringing the abnormal area to an adsorbable position. This includes both forward and reverse rotation. The rotation direction of the rollers is calculated based on the relative orientation between the final abnormal position and the adsorbable position.
[0070] The rotation distance refers to the angle, number of rotations, or corresponding transmission displacement of the flexible film required for the active roller 4 to precisely deliver the abnormal area to the adsorption location. The rotation distance is calculated based on the pixel distance or physical distance between the final abnormal location and the adsorption location, combined with camera calibration parameters and roller transmission ratio.
[0071] Step S72: Control the active roller 4 to rotate according to the roller rotation direction and rotation distance to move the abnormal position to the adsorption position.
[0072] Step S73: Obtain the abnormal image corresponding to the abnormal region.
[0073] An abnormal image refers to an image captured by a high-speed industrial camera 8 after the active roller 4 rotates the abnormal area to a position where it can be adsorbed. The abnormal image is obtained by capturing the corresponding abnormal area on the flexible film using the high-speed industrial camera 8 after the active roller 4 has rotated according to the calculated rotation direction and distance.
[0074] Step S74: Extract the abnormal image to determine the actual location of the abnormality.
[0075] The actual anomaly location refers to the true location of the anomaly area obtained by re-capturing the anomaly image after the roller has rotated. The actual anomaly location is determined by performing region segmentation and location localization on the anomaly image captured after rotation, thus identifying the current actual coordinates of the anomaly area.
[0076] Step S75: If the actual abnormal position is inconsistent with the adsorbable position, calculate the rotation direction and rotation distance of the roller based on the actual abnormal position and the adsorbable position, and execute steps S72 to S74.
[0077] If the actual abnormal location does not match the adsorbable location, it indicates that after a single roller rotation, the abnormal area has not accurately reached the position where the adsorption device 7 can effectively adsorb the material, and there is a positioning deviation, requiring further correction and adjustment. At this time, the roller rotation direction and rotation distance are recalculated based on the actual abnormal location and the adsorbable location, and the active roller 4 is controlled to rotate again. The abnormal image is then re-acquired to determine the current actual abnormal location until the actual abnormal location matches the adsorbable location.
[0078] Step S76: If the actual abnormal location is consistent with the adsorbable location, control the adsorption device 7 to adsorb the foreign matter corresponding to the abnormal location.
[0079] If the actual abnormal location matches the adsorbable location, it means that the abnormal area has accurately reached the position where the adsorption device 7 can effectively adsorb. Control the adsorption device 7 to extend downwards above the flexible film to adsorb the foreign matter.
[0080] Methods for image processing of flexible thin film images to obtain contamination-free images include: Step S510: Perform image analysis on the flexible film image to determine the dirty area corresponding to the high-speed industrial camera 8.
[0081] A contaminated area refers to a fixed, anomalous image region formed by dirt on the lens of the high-speed industrial camera 8 in the flexible film image, which is unrelated to the actual surface features of the flexible film. The contaminated area is identified by performing region segmentation, grayscale difference analysis, or contour detection on the flexible film image, thus determining the anomalous region corresponding to the high-speed industrial camera 8.
[0082] Step S511: Count the number of dirty areas and define the number of dirty areas as the number of dirt.
[0083] The number of contaminants refers to the total number of independent and unconnected contaminant regions detected in an image. The number of contaminants is determined by performing connectivity analysis on the identified contaminant regions and counting the number of independent connected components.
[0084] Step S512: Measure the width and length of the area according to the preset shooting area.
[0085] The imaging area refers to the effective imaging area covered by the high-speed industrial camera 8 when it acquires images of the flexible film. The imaging area is predetermined by those skilled in the art based on the resolution of the high-speed industrial camera 8, the lens field of view, and the installation position.
[0086] The area width refers to the physical size or pixel size of the shooting area perpendicular to the transmission direction of the flexible film. The area width is obtained by measuring the preset shooting area through camera calibration or pixel-to-physical size conversion.
[0087] Region length refers to the physical size or pixel size of the imaged area parallel to the transmission direction of the flexible film. The method for obtaining the region length is the same as that for obtaining the region width described above.
[0088] Step S513: Determine the cut length based on the region length.
[0089] The cut-off length refers to the maximum length threshold within the shooting area that is allowed to be removed due to contamination. The cut-off length is preset by those skilled in the art through experimental calibration based on the total length of the shooting area, the effective utilization rate of the image, and the requirements for defect detection accuracy.
[0090] Step S514: If the number of dirt items is equal to 1, measure the maximum length based on the dirt area.
[0091] The maximum length refers to the maximum extension dimension of a single contaminated region in the direction parallel to the transport direction of the flexible film, i.e., the length value of the contaminated region. The maximum length is obtained by extracting the contour of the contaminated region and fitting it with the minimum bounding rectangle, and measuring its length in the transport direction.
[0092] If the number of contaminants is equal to 1, it means there is only one contaminant area. We can directly measure the maximum length of the contaminant area to infer whether a contaminant-free image can be obtained by removing the contaminant area, and determine the specific area to be removed.
[0093] Step S515: Calculate the length difference based on the region length and the maximum length.
[0094] The length difference refers to the difference between the length of the area being photographed and the maximum length of the dirty area. The length difference is calculated by subtracting the maximum length from the area length.
[0095] Step S516: When the length difference is less than the cut-off length, output a lens dirt signal.
[0096] When the length difference is less than the truncation length, it indicates that the length occupied by the dirty area in the transmission direction is too large, and the remaining effective length that can be used for detection in the shooting area is insufficient. Dirt interference cannot be eliminated by area removal, and it can only be judged as lens dirt and a lens dirt signal is output.
[0097] Step S517: When the length difference is greater than the cut-out length, determine the area to be removed from the dirty area within the shooting area based on the maximum length and area width, and remove the dirty area within the shooting area to obtain a dirty-free area.
[0098] The rejection area refers to the invalid image area within the shooting area that corresponds to lens dirt and needs to be removed from the image. The rejection area is determined based on the maximum length of the dirty area and the width of the shooting area, defining the corresponding location range within the shooting area.
[0099] A contamination-free area refers to the effective image area that truly reflects the surface condition of the flexible film after removing the discarded areas within the imaging area. The contamination-free area is the area remaining after removing the discarded areas within the imaging area.
[0100] Step S518: Use the image corresponding to the clean area as the clean image.
[0101] A contamination-free image refers to an effective flexible film image composed of contamination-free areas, eliminating interference from lens contamination. A contamination-free image is obtained by preserving the image data corresponding to the contamination-free areas, resulting in a contamination-free image for subsequent defect detection.
[0102] This also includes a treatment method for cases where the amount of dirt is greater than 1, the method comprising: Step S5140: Determine the length projection range of the dirty area in the transmission direction based on the dirty area and the shooting area.
[0103] The transmission direction refers to the direction in which the flexible film moves under the drive of the active roller 4 and the driven roller 5. The transmission direction is predetermined by the installation position and rotation direction of the active roller 4 and the driven roller 5.
[0104] The length projection range refers to the interval from the starting position to the ending position covered by the projection of the contaminated area parallel to the transport direction of the flexible film. The length projection range is determined by extracting the contour of the contaminated area and determining its minimum and maximum coordinates in the transport direction. The minimum and maximum coordinates form the length projection range.
[0105] Step S5141: Combine the dirty areas with overlapping length projection ranges to form at least one overall dirty area, and calculate the overall length range based on the overall dirty area.
[0106] A total dirty area refers to a continuous collection of dirty areas formed by multiple dirty areas whose length projection ranges overlap in the transmission direction. The total dirty area is determined by merging overlapping dirty areas into a single total dirty area through an overlap assessment of their length projection ranges.
[0107] The overall length range refers to the total interval from the starting position to the ending position of the overall contaminated area in the transmission direction. The overall length range is formed by taking the minimum coordinate as the starting position and the maximum coordinate as the ending position based on the length projection range of all contaminated areas that make up the overall contaminated area.
[0108] Step S5142: Based on the overall dirty area and the dirty area, find the dirty area that does not belong to the overall dirty area, define the remaining dirty area as an independent dirty area, and define the length projection range corresponding to the independent dirty area as an independent length range.
[0109] An independent dirty area refers to a dirty area that does not overlap with other dirty areas in terms of length projection and exists independently. Independent dirty areas are defined by removing all dirty areas that have been incorporated into the overall dirty area; the remaining areas are the independent dirty areas.
[0110] An independent length range refers to the interval from the starting position to the ending position covered by the projection of an independent contaminated area in the transmission direction. The independent length range is formed by determining the minimum and maximum coordinates of the independent contaminated area in the transmission direction based on its outline.
[0111] Step S5143: Calculate the actual length of dirt based on the overall length range and the individual length range.
[0112] The actual dirt length refers to the total length occupied by the overall dirt area and individual dirt areas in the transmission direction. The actual dirt length is obtained by adding the length of the overall length range to the length of each individual length range.
[0113] Step S5144: Calculate the total length difference based on the area length and the actual length of dirt.
[0114] The total length difference refers to the difference between the length of the area being photographed and the actual length of the dirt. The total length difference is calculated by subtracting the actual length of the dirt from the area length.
[0115] Step S5145: When the total length difference is less than the cuttable length, output a lens dirt signal.
[0116] When the total length difference is less than the truncation length, it indicates that the length occupied by the overall dirty area and the individual dirty area in the transmission direction is too large, and the remaining effective length that can be used for detection in the shooting area is insufficient. Dirt interference cannot be eliminated by area removal, and it can only be judged as lens dirt and a lens dirt signal is output.
[0117] Step S5146: When the total length difference is greater than the cut-out length, determine the overall removal area of the dirty area within the shooting area based on the overall length range and area width, and determine the independent removal area of the dirty area within the shooting area based on the independent length range and area width. Remove the overall removal area and the independent removal area within the shooting area to obtain the area to be spliced.
[0118] The overall removal area refers to the overall dirty area within the shooting area, which is the invalid image area that needs to be removed from the image. The overall removal area is determined based on the overall length range and area width, defining the location range corresponding to the overall dirty area within the shooting area.
[0119] An independent removal area refers to a separate dirty area within the shooting area, an invalid image area that needs to be removed from the image. The independent removal area is determined within the shooting area based on its independent length range and width, corresponding to the individual dirty area.
[0120] The area to be stitched refers to the remaining valid image area after removing the overall removed area and the individually removed area from the shooting area.
[0121] Step S5147: Obtain the previous frame thin film image and the next frame thin film image.
[0122] The previous frame image refers to an adjacent flexible film image that is earlier in time than the current flexible film image and has been acquired and cached by the high-speed industrial camera 8. The previous frame image is obtained by reading the adjacent previous flexible film image from the image cache.
[0123] A subsequent frame image refers to an adjacent flexible film image acquired by the high-speed industrial camera 8, which is later in time than the current flexible film image. The subsequent frame image is obtained by controlling the high-speed industrial camera 8 to acquire the next adjacent frame of the current flexible film image.
[0124] Step S5148: Extract the valid images corresponding to the overall removal region and the independent removal region from the previous frame thin film image and the subsequent frame thin film image, respectively.
[0125] A valid image refers to an image region in both the preceding and following film images that corresponds to the location of the removed area, is free from contamination, and can be used for infill restoration. The valid image is obtained by extracting the corresponding image region from the preceding and following film images based on the position and size of the overall and individual removed areas.
[0126] Step S5149: Fill the effective image into the overall rejection area and the individual rejection area to obtain the stitched flexible film image.
[0127] The stitched flexible film image refers to the complete and usable flexible film image obtained after filling the rejected areas with the effective image, thus eliminating lens contamination interference. The stitched flexible film image is created by separately filling the overall rejected area and the individual rejected areas with the extracted effective image, and then fusing them with the area to be stitched to form a complete image.
[0128] This also includes: Step S5100: Find the corresponding foreign object attachment characteristics in the preset foreign object database based on the area of the abnormal region and the displacement distance.
[0129] The foreign matter database contains a mapping relationship between the area of abnormal regions, displacement distance, and foreign matter adhesion characteristics. The database is developed by those skilled in the art through the collection of various foreign matter samples of different weights and hardness levels. Each sample is placed on the surface of a flexible film, and the active roller 4 is controlled to rotate instantaneously while capturing corresponding abnormal image sets. The area of the abnormal region and displacement distance for each foreign matter sample are statistically obtained. Simultaneously, the weight and hardness level of the foreign matter are calibrated through actual testing. The correspondence between the area of the abnormal region, displacement distance, and foreign matter adhesion characteristics is linked and stored. Multiple sets of experimental data are fitted and optimized to ultimately establish the foreign matter database.
[0130] Foreign matter adhesion characteristics refer to the characteristic parameters obtained after quantifying and classifying the weight and texture of foreign matter on the surface of flexible films. These characteristics are obtained by matching and querying a pre-defined foreign matter database based on the area of the abnormal region and the displacement distance.
[0131] Step S5101: Based on the foreign object adhesion characteristics, find the corresponding optimal suction force in the preset foreign object suction force library.
[0132] The foreign object suction library contains a mapping relationship between the adhesion characteristics of foreign objects and the suction force of the adsorption device 7. The foreign object suction library is established by those skilled in the art through adsorption experiments on samples with different foreign object adhesion characteristics. The adsorption parameters that can effectively adsorb foreign objects without damaging the flexible film are tested and determined. Different foreign object adhesion characteristics are associated with the corresponding suitable suction parameters and stored. After multiple sets of experimental verification and optimization, a preset foreign object suction library is established.
[0133] Optimal suction power refers to the optimal suction force that allows the adsorption device 7 to stably adsorb foreign objects without damaging the flexible film, given the current adhesion characteristics of the foreign object. The optimal suction power is obtained by matching and searching a preset foreign object suction power library based on the retrieved foreign object adhesion characteristics.
[0134] Step S5102: Control the adsorption device 7 to adsorb the abnormal area according to the optimal suction force.
[0135] Step S5103: If the abnormal area still exists, control the active roller 4 to rotate in an instantaneous rotation mode and capture a real-time abnormal image group.
[0136] A real-time anomaly image set refers to a collection of multiple images containing the same anomaly area, continuously acquired during or after the active roller 4 rotates instantaneously following the initial adsorption. The real-time anomaly image set is formed by a high-speed industrial camera 8 continuously capturing multiple images at a preset frame rate during or after the active roller 4 performs its instantaneous rotation.
[0137] If the abnormal area still exists, it means that after performing one adsorption operation with the optimal suction force, the foreign matter is still attached to the flexible film and has not been successfully removed. It is necessary to re-identify the foreign matter and adjust the suction force for a second adsorption. At this time, the active roller 4 is controlled to rotate in an instantaneous manner and capture a real-time abnormal image group to re-acquire the abnormal area and displacement distance of the foreign matter, thereby updating the foreign matter adhesion characteristics and adsorption suction force.
[0138] Step S5104: Analyze the real-time abnormal image group to obtain the final abnormal area and actual displacement distance of the abnormal region.
[0139] The final anomaly area refers to the area of the abnormal region of the foreign object in its current state, obtained through analysis of a set of real-time anomaly images. The final anomaly area is calculated by performing pixel statistics or contour-bound area calculations on the anomaly regions in the real-time anomaly image set.
[0140] The actual displacement distance refers to the real displacement distance of the abnormal region during its instantaneous rotation, obtained through analysis of a real-time abnormal image set. The actual displacement distance is calculated based on the positional changes of the abnormal region between different frames in the real-time abnormal image set.
[0141] Step S5105: Find the corresponding foreign object attachment characteristics in the foreign object database based on the final abnormal area and actual displacement distance.
[0142] Step S5106: Based on the foreign object adhesion characteristics, find the corresponding final suction force in the foreign object suction force library.
[0143] Final suction power refers to the suction force used for secondary adsorption, which is re-determined based on the updated foreign object adhesion characteristics. The final suction power is obtained by re-querying the foreign object database to obtain the updated foreign object adhesion characteristics based on the final anomaly area and actual displacement distance, and then matching and querying the foreign object suction power database.
[0144] Step S5107: Control the adsorption device 7 to adsorb the abnormal area according to the final suction force.
[0145] This also includes a method for handling cases where abnormal regions still exist, which includes: Step S51070: Control the active roller 4 to continuously rotate in an instantaneous rotation mode and capture a group of dynamic abnormal images.
[0146] A dynamic anomaly image set refers to a collection of multiple images containing the same abnormal area, continuously acquired during the momentary rotation of the active roller 4. The dynamic anomaly image set is formed by a high-speed industrial camera 8 continuously capturing multiple frames at a preset frame rate during the continuous momentary rotation of the active roller 4.
[0147] Step S51071: Analyze the dynamic abnormal image group to obtain the current jitter characteristics of the abnormal region.
[0148] The current jitter feature refers to the set of characteristic parameters of the displacement distance and morphological changes of the abnormal region during the instantaneous rotation process. The current jitter feature is obtained by referring to the method for obtaining the jitter feature in step S5.
[0149] Step S51072: If the current jitter feature is consistent with the instantaneous rotation feature, output a stain processing signal.
[0150] If the current shaking characteristics are consistent with the instantaneous rotation characteristics, it indicates that the abnormal area, during the continuous instantaneous rotation, always moves synchronously with the active roller 4 and does not undergo relative displacement with the flexible film surface. Therefore, it cannot detach from the film through shaking, and the foreign object is determined to be a stubbornly attached foreign object. At this time, a stain treatment signal is output to indicate that the foreign object cannot be removed by conventional adsorption methods, and the process for handling stubborn foreign objects begins.
[0151] Step S51073: If the current shaking characteristics are inconsistent with the instantaneous rotation characteristics, control the adsorption device 7 to adsorb the abnormal area.
[0152] If the current shaking characteristics are inconsistent with the instantaneous rotation characteristics, it indicates that the abnormal area has relative motion with the surface of the flexible film during continuous instantaneous rotation, and can loosen and detach from the film, belonging to foreign objects that can be normally adsorbed. At this time, the adsorption device 7 is directly controlled to extend downwards above the flexible film to perform adsorption operation on the abnormal area.
[0153] This also includes: Step S10: Obtain the active vibration amplitude of the active roller 4.
[0154] Active vibration amplitude refers to the magnitude of vibration generated by the active roller 4 during operation. The active vibration amplitude is obtained by collecting vibration signals from a vibration sensor installed at the active roller 4 and extracting the amplitude of the signals.
[0155] Step S11: If the active vibration amplitude is greater than the preset vibration threshold, output the preset foreign object signal and prepare to control the active roller 4 to rotate in an instantaneous rotation mode.
[0156] The vibration threshold is a critical amplitude value used to determine whether a roller exhibits abnormal vibration caused by foreign objects. The vibration threshold is determined by a person skilled in the art through standard experimental testing to obtain the normal vibration amplitude without foreign objects, and then calibrated based on this.
[0157] The foreign object signal is a warning signal indicating the presence of foreign objects on the surface of the flexible film, used to trigger the instantaneous rotation of the active roller 4. The foreign object signal is preset by those skilled in the art, and when the amplitude of the active vibration exceeds the preset vibration threshold, the foreign object signal is output in the form of an internal electrical signal.
[0158] If the amplitude of the active vibration exceeds the preset vibration threshold, it indicates the presence of foreign objects on the surface of the flexible film, causing the active roller 4 to vibrate abnormally. At this time, a preset foreign object signal is output, and the active roller 4 is prepared to rotate in an instantaneous manner for subsequent identification of the foreign object.
[0159] Step S12: Obtain the driven vibration amplitude of the driven roller 5.
[0160] The driven vibration amplitude refers to the magnitude of the vibration generated by the driven roller 5 during operation. The driven vibration amplitude is obtained by collecting vibration signals from a vibration sensor installed at the driven roller 5 and extracting the amplitude of the signals.
[0161] Step S13: If the amplitude of the driven vibration is greater than the preset vibration threshold, output a preset signal that the foreign object has not been removed and control the active roller 4 to reverse in a preset manner until the abnormal area returns to the preset adsorption position.
[0162] The "Foreign Object Not Removed" signal indicates that the foreign object has not been successfully removed and is used to trigger a re-inspection prompt signal. The "Foreign Object Not Removed" signal is preset by those skilled in the art. When the amplitude of the driven vibration exceeds the preset vibration threshold, the "Foreign Object Not Removed" signal is output in the form of an internal electrical signal.
[0163] The reverse rotation method refers to the rotation control method of the active roller 4 in the opposite direction to the normal transmission direction, which is used to retract the abnormal area to an area where adsorption can be performed. The reverse rotation method is preset by those skilled in the art and is achieved by controlling the active roller 4 to rotate in the opposite direction through a drive mechanism.
[0164] The definition and acquisition method of adsorbable sites refer to the description of adsorbable sites in step S71 above.
[0165] If the amplitude of the driven vibration is greater than the preset vibration threshold, it indicates that the foreign object still exists after the adsorption treatment and has not been successfully removed, causing the driven roller 5 to vibrate abnormally. At this time, a preset signal indicating that the foreign object has not been removed is output, and the active roller 4 is controlled to reverse in a preset manner until the abnormal area returns to the preset adsorption position so that the adsorption treatment can be repeated.
[0166] Step S14: Control the adsorption device 7 to adsorb the abnormal area.
[0167] This also includes a method for processing the output lens dirt signal, which includes: Step S5160: Perform edge detection based on the flexible film image to obtain the flexible film region.
[0168] The flexible film region refers to the image region corresponding to the actual location of the flexible film, which is divided from the flexible film image. The flexible film region is determined and extracted based on the edge information obtained by edge detection of the flexible film image.
[0169] Step S5161: Calculate the location of the contamination within the flexible film area based on the flexible film area and the contamination area.
[0170] Dirt orientation refers to the relative position information of the dirty area within the flexible film region, used to determine the specific location distribution of dirt in the image. Dirt orientation is calculated by determining the geometric center and boundary coordinates of the flexible film region, as well as the geometric center coordinates of the dirty area, and then using the coordinate difference and positional relationship between these coordinates.
[0171] Step S5162: Calculate the rotation direction and rotation distance of the high-speed industrial camera 8 based on the location of the dirt.
[0172] The rotation direction refers to the direction in which the high-speed industrial camera 8 needs to rotate to move the contaminated area out of the flexible film area. The rotation direction is determined based on the position of the contaminated area relative to the center of the flexible film area, which determines the camera rotation direction required to move the contaminated area outward from the image, and thus the rotation direction of the high-speed industrial camera 8 is calculated.
[0173] The rotation distance refers to the angle or displacement required for the high-speed industrial camera 8 to completely remove the contaminated area from the flexible film area. The rotation distance is calculated based on the relative distance between the edge of the contaminated area and the edge of the flexible film area, combined with the field of view and imaging scale of the high-speed industrial camera 8.
[0174] Step S5163: Control the high-speed industrial camera 8 to rotate in the direction and distance of rotation, so that the dirty area is moved out of the flexible film area.
[0175] The high-speed industrial camera 8 is rotatable. By driving the corresponding rotation mechanism, the dirty area on the lens is moved away from the imaging area of the flexible film, thus avoiding interference from dirt on foreign object detection.
[0176] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0177] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A machine vision-based method for detecting defects in flexible thin films, characterized in that, include: Step S1: Obtain an image of the flexible thin film irradiated by the strip light source (3); Step S2: Compare the flexible film image with the preset pattern features to obtain the abnormal region and the area of the abnormal region; Step S3: If the area of the abnormal region is greater than the preset area threshold, output the preset overprint processing signal; Step S4: If the area of the abnormal region is less than the preset area threshold, control the active roller (4) to rotate according to the preset instantaneous rotation mode and capture the abnormal image group; Step S5: Analyze the abnormal image group to obtain the jitter characteristics of the abnormal region; Step S6: If the jitter characteristic matches the preset instantaneous rotation characteristic, output the preset stain processing signal; Step S7: If the shaking characteristics are inconsistent with the preset instantaneous rotation characteristics, control the adsorption device (7) to adsorb the abnormal area.
2. The method for detecting defects in flexible thin films based on machine vision according to claim 1, characterized in that, It also includes a method for analyzing abnormal image groups, which includes: Step S50: Perform image analysis on the abnormal image group to extract the abnormal locations corresponding to the abnormal regions within the abnormal image group; Step S51: If the abnormal position does not change within the abnormal image group, output the preset lens dirt signal and perform image processing on the flexible film image to obtain a dirt-free image. Step S52: If the abnormal location changes within the abnormal image group, calculate the displacement distance of the abnormal area based on the abnormal location, and perform morphological analysis on the abnormal area to obtain the amount of morphological change. Step S53: Combine the displacement distance and the amount of morphological change to form the shaking feature.
3. The method for detecting defects in flexible thin films based on machine vision according to claim 2, characterized in that, The methods for controlling the adsorption device (7) to adsorb abnormal areas include: Step S70: Locate the final anomaly location from the anomaly locations; Step S71: Calculate the rotation direction and rotation distance of the roller that will turn the abnormal position to the adsorbable position based on the final abnormal position and the preset adsorbable position; Step S72: Control the active roller (4) to rotate according to the roller rotation direction and rotation distance to turn the abnormal position to the adsorption position; Step S73: Obtain the abnormal image corresponding to the abnormal region; Step S74: Extract the abnormal image to determine the actual location of the abnormality; Step S75: If the actual abnormal location is inconsistent with the adsorbable location, calculate the rotation direction and rotation distance of the roller based on the actual abnormal location and the adsorbable location, and execute steps S72 to S74. Step S76: If the actual abnormal location is consistent with the adsorbable location, control the adsorption device (7) to adsorb the foreign matter corresponding to the abnormal location.
4. The method for detecting defects in flexible thin films based on machine vision according to claim 2, characterized in that, Methods for image processing of flexible thin film images to obtain contamination-free images include: Step S510: Perform image analysis on the flexible film image to determine the dirty area corresponding to the high-speed industrial camera (8); Step S511: Count the number of dirty areas and define the number of dirty areas as the number of dirt areas; Step S512: Measure the width and length of the area according to the preset shooting area; Step S513: Determine the cut length based on the region length; Step S514: If the number of dirt items is equal to 1, measure the maximum length based on the dirt area; Step S515: Calculate the length difference based on the region length and the maximum length; Step S516: When the length difference is less than the cuttable length, output a lens dirt signal; Step S517: When the length difference is greater than the cut-out length, determine the area to be removed from the dirty area within the shooting area based on the maximum length and area width, and remove the dirty area within the shooting area to obtain a dirty-free area. Step S518: Use the image corresponding to the clean area as the clean image.
5. The method for detecting defects in flexible thin films based on machine vision according to claim 4, characterized in that, It also includes a treatment method for cases where the amount of dirt is greater than 1, the method comprising: Step S5140: Determine the length projection range of the dirty area in the transmission direction based on the dirty area and the shooting area; Step S5141: Combine the dirty areas with overlapping length projection ranges to form at least one overall dirty area, and calculate the overall length range based on the overall dirty area; Step S5142: Based on the overall dirty area and the dirty area, find the dirty area that does not belong to the overall dirty area, define the remaining dirty area as an independent dirty area, and define the length projection range corresponding to the independent dirty area as an independent length range. Step S5143: Calculate the actual length of dirt based on the overall length range and the individual length range; Step S5144: Calculate the total length difference based on the area length and the actual length of dirt; Step S5145: When the total length difference is less than the cuttable length, output a lens dirt signal; Step S5146: When the total length difference is greater than the cut-out length, determine the overall removal area of the dirty area within the shooting area based on the overall length range and area width, and determine the independent removal area of the dirty area within the shooting area based on the independent length range and area width. Remove the overall removal area and the independent removal area within the shooting area to obtain the area to be spliced. Step S5147: Acquire the previous frame thin film image and the next frame thin film image; Step S5148: Extract the valid images corresponding to the overall removal region and the independent removal region from the previous frame thin film image and the subsequent frame thin film image, respectively; Step S5149: Fill the effective image into the overall rejection area and the individual rejection area to obtain the stitched flexible film image.
6. The method for detecting defects in flexible thin films based on machine vision according to claim 2, characterized in that, Also includes: Step S5100: Based on the area of the abnormal region and the displacement distance, find the corresponding foreign object attachment characteristics in the preset foreign object database; Step S5101: Based on the foreign object adhesion characteristics, find the corresponding optimal suction force in the preset foreign object suction force library; Step S5102: Control the adsorption device (7) to adsorb the abnormal area according to the optimal suction force; Step S5103: If the abnormal area still exists, control the active roller (4) to rotate in an instantaneous rotation mode and capture a real-time abnormal image group; Step S5104: Analyze the real-time anomaly image group to obtain the final anomaly area and actual displacement distance of the anomaly region; Step S5105: Based on the final abnormal area and actual displacement distance, find the corresponding foreign object attachment characteristics in the foreign object database; Step S5106: Based on the foreign object adhesion characteristics, find the corresponding final suction power in the foreign object suction power library; Step S5107: Control the adsorption device (7) to adsorb the abnormal area according to the final suction force.
7. The method for detecting defects in flexible thin films based on machine vision according to claim 6, characterized in that, It also includes a handling method if the abnormal region still exists, which includes: Step S51070: Control the active roller (4) to continuously rotate in an instantaneous rotation mode and capture dynamic abnormal image groups; Step S51071: Analyze the dynamic abnormal image group to obtain the current jitter characteristics of the abnormal region; Step S51072: If the current jitter characteristic is consistent with the instantaneous rotation characteristic, output a stain processing signal; Step S51073: If the current shaking characteristics are inconsistent with the instantaneous rotation characteristics, control the adsorption device (7) to adsorb the abnormal area.
8. The method for detecting defects in flexible thin films based on machine vision according to claim 1, characterized in that, Also includes: Step S10: Obtain the active vibration amplitude of the active roller (4); Step S11: If the active vibration amplitude is greater than the preset vibration threshold, output the preset foreign object signal and prepare to control the active roller (4) to rotate in the instantaneous rotation mode; Step S12: Obtain the driven vibration amplitude of the driven roller (5); Step S13: If the amplitude of the driven vibration is greater than the preset vibration threshold, output the preset foreign object not cleared signal and control the active roller (4) to reverse in the preset reversal mode until the abnormal area returns to the preset adsorption position; Step S14: Control the adsorption device (7) to adsorb the abnormal area.
9. The method for detecting defects in flexible thin films based on machine vision according to claim 4, characterized in that, It also includes a method for processing the output lens dirt signal, which includes: Step S5160: Perform edge detection based on the flexible film image to obtain the flexible film region; Step S5161: Calculate the location of the contamination within the flexible film area based on the flexible film area and the contamination area. Step S5162: Calculate the rotation direction and rotation distance of the high-speed industrial camera (8) based on the location of the dirt; Step S5163: Control the high-speed industrial camera (8) to rotate according to the rotation direction and rotation distance, so that the dirty area is moved out of the flexible film area.
10. A machine vision-based flexible film defect detection device, controlled by a machine vision-based flexible film defect detection method as described in any one of claims 1 to 9, characterized in that, include: Base (1), serving as a base; An aluminum alloy bracket (2) is placed above the base (1) for overall fixation and support of the detection device; A strip light source (3) is positioned above the center of the base (1) to illuminate the flexible film with light from the light source in order to highlight the defects of the flexible film. An active roller (4) is located on one side of the aluminum alloy bracket (2) and is used to drive the flexible film transmission. The driven roller (5) is located on one side of the aluminum alloy bracket (2) and opposite to the active roller (4), and is used to cooperate with the active roller (4) to tension the flexible film; A timing belt (6) is connected between the driving roller (4) and the driven roller (5) for the driving roller (4) to drive the driven roller (5) to rotate. The adsorption device (7) is mounted on the aluminum alloy bracket (2) and located between the active roller (4) and the driven roller (5) for adsorbing foreign objects on the surface of the flexible film. as well as A high-speed industrial camera (8) is mounted above an aluminum alloy bracket (2) and is used to capture images of the flexible film after it has been irradiated by a strip light source (3).