Method and device for detecting foreign matter in transparent medium product, storage medium, and equipment

By combining a linear laser with a linear array camera and adjusting the position of the imaging system and the linear laser, only the target foreign object detection layer is illuminated. This solves the problems of visual impairment caused by manual detection and unclear layering in automated detection of foreign objects in transparent media products, and achieves efficient and stable foreign object detection.

CN119086557BActive Publication Date: 2025-12-05ZHONGKE HUIYUAN VISUAL TECHNOLOGY (LUOYANG) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411113447.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2025-12-05
Estimated Expiration
2044-08-14

AI Technical Summary

Technical Problem

Existing methods for detecting foreign objects in transparent media products suffer from problems such as visual impairment and high misjudgment rate during manual inspection, and inability of automated inspection to determine the layer of foreign objects.

Method used

By combining a linear laser with a linear array camera, and adjusting the positions of the imaging system and the linear laser, the linear light spot is made to coincide with the linear field of view of the imaging system, illuminating only the target foreign object detection layer. The scattered light from the foreign object is received using a dark-field imaging method, thereby improving the detection accuracy and precision.

Benefits of technology

It achieves efficient and stable foreign object detection in transparent media products, improves the accuracy and precision of layered detection, and in particular, has high imaging contrast and significantly improves the foreign object detection rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119086557B_ABST
    Figure CN119086557B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of optical detection, and particularly discloses a foreign matter detection method and device for a transparent medium product, a storage medium and computer equipment. The method comprises the following steps: determining a target foreign matter detection layer from a preset foreign matter detection layer of the transparent medium product, adjusting an imaging system and a linear laser according to the target foreign matter detection layer, so that a linear light spot of the linear laser coincides with a linear field of view of the imaging system, and the coinciding area is located at the target foreign matter detection layer. The imaging system comprises a line scanning lens, and the line scanning lens is used for receiving scattered light of foreign matter. When a picture shooting instruction is received, the linear laser is controlled to send a laser beam, and the imaging system is controlled to shoot a picture of the transparent medium product in motion, so that a target image of the transparent medium product on the target foreign matter detection layer is obtained. When imaging of an image background different from the target image exists on the target image, it is determined that foreign matter exists on the target foreign matter detection layer of the transparent medium product.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of optical detection, in particular to a foreign matter detection method and device for a transparent medium product, a storage medium and a computer device. BACKGROUND

[0002] Nowadays, products made of transparent medium are increasingly applied in people's daily life. For example, automobile windshield, lens of microscope, telescope and camera, display screen of mobile phone and tablet computer, etc. In order to ensure the use performance and user experience of these transparent medium products, it is usually necessary to detect foreign matter in the transparent medium product before the transparent medium product is installed and used, so as to determine whether there is foreign matter on the surface or in the interlayer of the transparent medium product. For example, for smart interactive display type electronic products such as mobile phones and tablet computers, the part that directly interacts with the user is the display screen. If there is foreign matter in the interlayer of the display screen, it will directly affect the user's experience. Therefore, before the display screen is installed and used, the display screen needs to be detected for foreign matter.

[0003] Currently, there are two ways to detect foreign matter in a transparent medium product. One is manual detection and the other is automatic detection. However, for manual detection, quality inspection workers need to detect under strong light, which will cause great harm to the vision of the quality inspection workers, and the detection result is affected by the subjectivity of the quality inspection workers, the misjudgment rate is high, and it is also difficult for manual detection to determine which layer the foreign matter is in the transparent medium product. For automatic detection, although the existing automatic detection method can identify foreign matter from the transparent medium product, it cannot determine which layer the foreign matter is in the transparent medium product, and subsequent manual differentiation is still needed. SUMMARY

[0004] Therefore, the present application provides a foreign matter detection method and device for a transparent medium product, a storage medium and a computer device. By using a linear laser and a linear array camera together, the imaging efficiency is high and the stability is good. By using a linear laser and controlling the linear laser to only illuminate the target foreign matter detection layer, since the spot width of the linear laser can reach micrometer level, the accuracy of layered detection can be greatly improved. By setting the line scanning lens to only receive the scattered light of the foreign matter, using the dark field imaging method, the contrast of the subsequent foreign matter imaging is high, so that the detection accuracy of the foreign matter can be improved.

[0005] According to an aspect of the present application, a foreign matter detection method for a transparent medium product is provided, comprising:

[0006] The target foreign object detection layer is determined from multiple preset foreign object detection layers of the transparent medium product to be detected, and the positions of the imaging system and the linear laser are adjusted according to the target foreign object detection layer so that the linear spot of the linear laser coincides with the linear field of view of the imaging system, and the overlapping area is located in the target foreign object detection layer. The imaging system includes a line scanning lens, which is used to receive the scattered light of the foreign object.

[0007] When an image acquisition command is received, the linear laser is controlled to send a laser beam, and the imaging system is controlled to acquire an image of the transparent medium product in motion, thereby obtaining a target image of the transparent medium product on the target foreign object detection layer.

[0008] When the target image has an image background that is different from the target image, it is determined that there is a foreign object on the target foreign object detection layer of the transparent medium product.

[0009] According to another aspect of this application, a foreign matter detection device for a transparent medium product is provided, comprising:

[0010] A position adjustment module is used to determine a target foreign object detection layer from multiple preset foreign object detection layers of a transparent medium product to be detected, and to adjust the position of the imaging system and the linear laser according to the target foreign object detection layer, so that the linear spot of the linear laser coincides with the linear field of view of the imaging system, and the overlapping area is located in the target foreign object detection layer. The imaging system includes a line scanning lens, which is used to receive the scattered light from the foreign object.

[0011] The image acquisition module is used to control the linear laser to send a laser beam and control the imaging system to acquire images of the transparent medium product in motion when an image acquisition command is received, so as to obtain a target image of the transparent medium product on the target foreign object detection layer.

[0012] The foreign object detection module is used to determine that there is a foreign object on the target foreign object detection layer of the transparent medium product when there is an image background on the target image that is different from the target image.

[0013] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the foreign object detection method for the transparent medium product described above.

[0014] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the foreign object detection method for the transparent medium product described above.

[0015] By employing the above technical solution, this application provides a method and apparatus for detecting foreign objects in transparent media products, a storage medium, and a computer device. Before image acquisition of the transparent media product, the positions of the imaging system and the linear laser can be adjusted. Specifically, the adjusted linear laser spot can be made to coincide with the linear field of view of the imaging system, and the overlapping area is located on the target foreign object detection layer, ensuring that the linear laser spot only illuminates the target foreign object detection layer, while the remaining preset foreign object detection layers are not illuminated. After adjusting the positions of the imaging system and the linear laser to meet the above conditions, their positions can be fixed. Then, upon receiving an image acquisition command, the linear laser can be controlled to emit a laser beam, and the imaging system can be controlled to acquire images of the moving transparent media product. Thus, after the transparent media product has completely passed through the linear field of view of the imaging system, the target image of the transparent media product on the target foreign object detection layer can be obtained. After obtaining the target image of the transparent medium product, the image can be further analyzed to determine whether there is an image different from the background. If so, it indicates that a foreign object exists on the target foreign object detection layer of the corresponding transparent medium product. This embodiment of the application uses a linear laser in conjunction with a linear scan camera, resulting in high imaging efficiency and good stability. By using a linear laser and controlling its linear spot to illuminate only the target foreign object detection layer, the accuracy of layer detection can be greatly improved, as the spot width of the linear laser can be at the micrometer level. By setting the linear scanning lens to only receive the scattered light from the foreign object and using dark-field imaging, the subsequent foreign object imaging has high contrast, thereby improving the detection accuracy of the foreign object.

[0016] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 A flowchart illustrating a foreign matter detection method for a transparent medium product provided in an embodiment of this application is shown.

[0019] Figure 2 A schematic diagram of a linear field of view provided in an embodiment of this application is shown;

[0020] Figure 3A flowchart illustrating another method for detecting foreign matter in a transparent medium product provided in an embodiment of this application is shown.

[0021] Figure 4 This illustration shows a schematic diagram of the relative positions between an imaging system, a linear laser, and a transparent medium product according to an embodiment of this application.

[0022] Figure 5 A schematic diagram of a preset calibration fixture provided in an embodiment of this application is shown;

[0023] Figure 6 This illustration shows a structural schematic diagram of a foreign matter detection device for a transparent medium product provided in an embodiment of this application;

[0024] Figure 7 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation

[0025] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0026] This embodiment provides a method for detecting foreign objects in transparent media products, such as... Figure 1 As shown, the method includes:

[0027] Step 101: Determine the target foreign object detection layer from multiple preset foreign object detection layers of the transparent medium product to be detected, and adjust the position of the imaging system and the linear laser according to the target foreign object detection layer so that the linear light spot of the linear laser coincides with the linear field of view of the imaging system, and the overlapping area is located in the target foreign object detection layer. The imaging system includes a line scanning lens, which is used to receive the scattered light of the foreign object.

[0028] This application provides a method for detecting foreign objects in transparent media products, applicable to any product made of transparent media, such as automotive windshields, microscope, telescope, and camera lenses, and mobile phone and tablet computer display screens. Before detecting foreign objects in a transparent media product, the target foreign object detection layer must first be determined, i.e., which layer of the transparent media product needs to be detected. For transparent media products like displays, foreign objects in the display interlayer are very common in screen inspection and constitute the first major category of defects. These defects severely affect the visual perception and user experience of mobile phone screens and are considered zero-tolerance defects. Foreign objects such as wipeable lint / dust / dirt on the display surface are considered acceptable defects and do not need to be detected, but foreign objects in the display interlayer are zero-tolerance defects and must be detected. Therefore, for transparent media products like displays, the interlayer of the display can be used as the target foreign object detection layer.

[0029] This application determines the presence of foreign objects in the target foreign object detection layer of a transparent medium product through image analysis. Specifically, a linear laser is used to illuminate the target foreign object detection layer of the transparent medium product, and an imaging system is used to image the transparent medium product. To avoid foreign objects from other layers appearing in the image during the imaging process, the positions of the imaging system and the linear laser can be adjusted before image acquisition. Specifically, the adjusted linear laser spot and the linear field of view of the imaging system can be aligned, with the overlapping area located within the target foreign object detection layer. Here, the imaging system can consist of a linear scan camera and a linear scanning lens, thus forming a linear field of view. Figure 2 The diagram illustrates a linear field of view for an imaging system under one scenario. The overlapping region is located within the target foreign object detection layer. This means that the linear laser beam must illuminate only the target foreign object detection layer, while the other preset foreign object detection layers remain unilluminated. For example, consider a display screen comprising layers A, B, and C. Layer A is the upper surface layer, layer B is the interlayer, and layer C is the lower surface layer. When the target foreign object detection layer is layer B, the linear laser beam must illuminate only layer B, not layers A and C. This ensures that the image acquired by the imaging system includes only the image of the target foreign object detection layer, while foreign objects in other layers are not imaged due to lack of illumination. Furthermore, the line scanning lens in the imaging system can be configured to receive only the scattered light from the foreign object. Thus, when there is no foreign object, the entire background is dark; when a foreign object is present, the linear laser illuminates the object, causing diffuse reflection. The line scanning lens receives this diffusely reflected light, resulting in high brightness of the foreign object. This leads to high contrast and good imaging quality in the imaging system. Once the positions of the imaging system and the linear laser are adjusted to meet the above conditions, their positions can be fixed.

[0030] Step 102: When an image acquisition command is received, the linear laser is controlled to send a laser beam, and the imaging system is controlled to acquire an image of the transparent medium product in motion, thereby obtaining a target image of the transparent medium product on the target foreign object detection layer.

[0031] In this embodiment, upon receiving an image acquisition command, the linear laser can be controlled to emit a laser beam, and the imaging system can be controlled to acquire images of the moving transparent medium product. Thus, once the entire transparent medium product has passed through the linear field of view of the imaging system, a target image of the transparent medium product on the target foreign object detection layer can be obtained.

[0032] Step 103: When there is an image background on the target image that is different from the target image, it is determined that there is a foreign object on the target foreign object detection layer of the transparent medium product.

[0033] In this embodiment, after obtaining the target image of the transparent medium product, the target image can be further analyzed to determine whether there is an image on the target image that is different from the image background. If so, it indicates that there is a foreign object on the target foreign object detection layer of the corresponding transparent medium product. Here, when identifying whether there is an image that is different from the image background from the target image, methods such as depth recognition models and grayscale value calculation can be used, which are not limited here.

[0034] Furthermore, if you wish to perform foreign object detection on other preset foreign object detection layers, you can redetermine the target foreign object detection layer from among the remaining preset foreign object detection layers and repeat the above steps. Through these steps, foreign object detection can be performed on any preset foreign object detection layer.

[0035] By applying the technical solution of this embodiment, the positions of the imaging system and the linear laser can be adjusted before image acquisition of the transparent medium product. Specifically, the adjusted linear laser spot and the linear field of view of the imaging system can be aligned, with the overlapping area located in the target foreign object detection layer. This ensures that the linear laser spot only illuminates the target foreign object detection layer, while the remaining preset foreign object detection layers remain unilluminated. After adjusting the positions of the imaging system and the linear laser to meet the above conditions, their positions can be fixed. Then, upon receiving the image acquisition command, the linear laser can be controlled to emit a laser beam, and the imaging system can be controlled to acquire images of the moving transparent medium product. Thus, after the transparent medium product has completely passed through the linear field of view of the imaging system, a target image of the transparent medium product on the target foreign object detection layer can be obtained. After obtaining the target image of the transparent medium product, it can be further analyzed to determine whether there is an image on the target image that differs from the image background. If so, it indicates that a foreign object exists on the target foreign object detection layer of the corresponding transparent medium product. This application embodiment uses a linear laser in conjunction with a linear scan camera, resulting in high imaging efficiency and good stability. By using a linear laser and controlling the linear laser spot to illuminate only the target foreign object detection layer, the accuracy of layer detection can be greatly improved because the spot width of the linear laser can be at the micrometer level. By setting the linear scanning lens to receive only the scattered light from the foreign object and using the dark-field imaging method, the subsequent foreign object imaging has high contrast, thereby improving the detection accuracy of the foreign object.

[0036] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another method for foreign object detection in transparent media products is provided, such as... Figure 3 As shown, the method includes:

[0037] Step 201: Determine the target foreign object detection layer from multiple preset foreign object detection layers of the transparent medium product to be detected, and adjust the position of the imaging system and the linear laser according to the target foreign object detection layer so that the linear light spot of the linear laser coincides with the linear field of view of the imaging system, and the overlapping area is located in the target foreign object detection layer. The imaging system includes a line scanning lens, which is used to receive the scattered light of the foreign object.

[0038] Optionally, in this embodiment, the step of "adjusting the position of the imaging system and the linear laser according to the target foreign object detection layer, so that the linear spot of the linear laser coincides with the linear field of view of the imaging system, and the overlapping area is located in the target foreign object detection layer" includes: adjusting the imaging system to a focusing mode, adjusting the distance between the imaging system and the target mark in a first direction, and controlling the imaging system to image the target mark in the focusing mode until the image clarity is greater than the target clarity, and then fixing the imaging system, wherein the target mark is located in the target foreign object detection layer. The plane is defined as follows: the second direction is the direction of travel of the transparent medium product; the third direction is the direction on the plane where the target foreign object detection layer is located and perpendicular to the second direction; the first direction is the direction perpendicular to both the second direction and the third direction. The linear laser is adjusted according to the second direction, and the imaging system is controlled to image the target mark in focusing mode until the brightness value of the target mark in the image is greater than the target brightness value, at which point the linear laser is fixed. Accordingly, after "fixing the linear laser", the method further includes: adjusting the imaging system to image acquisition mode.

[0039] In this embodiment, the second direction is preset as the travel direction of the transparent medium product, i.e., the direction in which the transparent medium product moves on the production line or inspection line; the third direction is the direction perpendicular to the travel direction on the plane where the target foreign object detection layer is located; and the first direction is the direction perpendicular to both of these directions. First, the imaging system is set to focus mode. Focus mode is a special operating mode that allows the user to obtain the clearest image by adjusting the distance between the imaging system and the target object. Next, the distance between the imaging system and the target mark located on the target foreign object detection layer is adjusted along the first direction. By continuously adjusting the distance and calculating the imaging sharpness, the adjustment stops when the imaging sharpness exceeds the preset target sharpness, and the imaging system is fixed in this position. This step finds the optimal distance between the imaging system and the target mark, maximizing the imaging sharpness.

[0040] After the imaging system is fixed, the position of the linear laser is adjusted. The linear laser projects a laser line onto the target mark to enhance the imaging effect. Specifically, the linear laser is adjusted in the second direction. By calculating the brightness value of the target mark in the image and continuously adjusting the position of the linear laser until the brightness value exceeds the preset target brightness value, the movement stops, and the linear laser is fixed in this position. This step finds the optimal laser projection position, maximizing the brightness value of the target mark in the image.

[0041] It is important to note that, in order to ensure that the linear laser spot illuminates only the target foreign object detection layer, the width of the linear laser spot can be limited. This means that the width of the linear laser spot between the target foreign object detection layer and any adjacent preset foreign object detection layer is less than the distance between the target foreign object detection layer and any adjacent preset foreign object detection layer. This method allows for the selection of a suitable linear laser. Furthermore, the travel direction of the transparent medium product can be set to be perpendicular to the long side of the linear field of view of the imaging system, resulting in higher imaging efficiency.

[0042] Through the aforementioned adjustment process, this embodiment of the application ensures that the imaging system clearly captures the image of the target mark in focusing mode, which is crucial for subsequent foreign object detection and quality control. Simultaneously, the accurate positioning of the linear laser ensures that the laser line can be precisely projected onto the target mark, improving the brightness of the foreign object image and thus enhancing the accuracy of foreign object detection.

[0043] Specifically, the imaging system can be positioned above the transparent medium product to be inspected, with a linear laser incident on the transparent medium product at a certain angle. Figure 4 This illustrates a relative position between the imaging system, the linear laser, and the transparent medium product. (Example) Figure 4 As shown, the imaging system consists of a line-scanning lens 2 and a line-scanning camera 3. Illumination for the imaging system is provided by a special linear laser 1, which features narrow linewidth and high power, providing uniform illumination across a 100mm wide field of view. The linear laser 1 is positioned above the target detection area, at a 45° angle to the first direction (i.e., the Z-axis direction in the diagram). The imaging system, composed of the line-scanning lens 2 and the line-scanning camera 3, is positioned directly above the target detection area, at an 0° angle to the first direction. Assuming the target foreign object detection layer is layer B, after setting the initial positions of the imaging system and the linear laser, the position of the imaging system can be adjusted along the first direction, aligning it with the center of the imaging position and ensuring a clear focus on the target mark in layer B. At this point, the position of the imaging system is fixed. Next, the position of the linear laser 1 is adjusted along the second direction (i.e., the X-axis direction in the diagram) until the target mark in layer B becomes brighter. At this point, the overlapping area between the linear field of view of the imaging system and the linear spot of the linear laser is located in layer B. When there are no foreign objects in layer B, the entire target image is a uniform dark field with very low grayscale values. If there are foreign objects in layer B, they undergo diffuse reflection, and some of the reflected light is captured by the line scan lens 2 and imaged in the line scan camera 3. The foreign object then appears as a high-grayscale image, clearly visible. Meanwhile, foreign objects in other layers, such as layers A or C, cannot be illuminated and therefore will not be imaged in the target image, achieving the goal of layered imaging of foreign objects. Similarly, when the overlapping area of ​​the linear laser and the linear field of view is located in layer A or C, foreign objects in other layers will not be imaged. Finally, the image acquisition and processing system 6, composed of an acquisition card and a computer, analyzes the target image.

[0044] Step 202: When an image acquisition command is received, the linear laser is controlled to send a laser beam, and the imaging system is controlled to acquire an image of the transparent medium product in motion, thereby obtaining a target image of the transparent medium product on the target foreign object detection layer.

[0045] Step 203: Perform grayscale processing on the target image, identify the grayscale value corresponding to each pixel in the grayscale processed target image, count the number of pixels corresponding to each grayscale value, and determine the grayscale threshold based on the grayscale value with the largest number of corresponding pixels.

[0046] Step 204: Determine whether there are pixels in the target image after grayscale processing that have a grayscale value greater than the grayscale threshold, and when the determination result is that there are pixels, determine that there is an image background on the target image that is different from the target image.

[0047] In this embodiment, after obtaining the target image, it is converted to grayscale. Grayscale conversion is the process of converting a color image into a grayscale image. Each pixel in a grayscale image has only one brightness value, typically ranging from 0 (black) to 255 (white), which represents the grayscale level of that pixel. Grayscale conversion simplifies image data and facilitates subsequent processing. Next, from the grayscale-converted target image, the grayscale value corresponding to each pixel is identified, and the number of pixels for each grayscale value in the entire target image is counted to determine which grayscale values ​​dominate the target image. Then, based on the statistical results, the grayscale value with the most corresponding pixels is selected, and a grayscale threshold is determined based on this grayscale value. The grayscale value with the most corresponding pixels represents the main grayscale level of the image background, because for foreign object detection, the image background in the target image often occupies a large area of ​​the target image. The grayscale threshold is used to detect whether there are foreign objects in the target image. Under linear laser illumination, the grayscale value of foreign objects in a target image is often much larger than that of the image background. Therefore, after determining the grayscale value with the most pixels, a certain value can be added to this grayscale value to obtain the final grayscale threshold. Here, the added value can be based on experience or determined from sample images.

[0048] After determining the grayscale threshold, the process further iterates through each pixel in the grayscale-processed target image, determining whether its grayscale value is greater than the previously determined grayscale threshold. If there are pixels with grayscale values ​​greater than the grayscale threshold, it indicates that these pixels do not belong to the image background. Therefore, it can be inferred that there are other images different from the image background on the target image, thus determining that there is a foreign object on the target image. This embodiment of the application can effectively identify images different from the image background in a target image, while being simple and convenient.

[0049] Step 205: When there is an image background on the target image that is different from the target image, it is determined that there is a foreign object on the target foreign object detection layer of the transparent medium product.

[0050] Optionally, in this embodiment, the step of "adjusting the distance between the imaging system and the target mark in a first direction, and controlling the imaging system to image the target mark in focus mode until the image sharpness is greater than the target sharpness, and then fixing the imaging system" includes: gradually adjusting the distance between the imaging system and the target mark along the first direction at first preset distance intervals, and after each adjustment, controlling the imaging system to image the target mark in focus mode to obtain a first image, performing grayscale processing on the first image, calculating the image sharpness of the grayscale processed first image using a preset sharpness evaluation algorithm, and fixing the imaging system when the image sharpness is greater than the target sharpness.

[0051] In this embodiment, a first preset distance interval is pre-set, which is a fixed value used each time the distance between the imaging system and the target mark is adjusted. When adjusting the position of the imaging system, it proceeds along a first direction, and each time the position is adjusted, the imaging system is controlled to image the target mark once in focus mode, obtaining a first imaging image. Next, the first imaging image obtained from each imaging is converted to grayscale. A preset sharpness evaluation algorithm is used to calculate the image sharpness of the grayscale-processed first imaging image. The preset sharpness evaluation algorithm can be an algorithm that evaluates the sharpness of an image based on certain features of the imaging image (such as edge sharpness, contrast, etc.), such as the Brenner gradient method, the Tenegrad gradient method, the variance method, etc., and is not limited here. After each calculation of the image sharpness, it is compared with a target sharpness. Here, the target sharpness is a preset sharpness threshold, representing the standard of the minimum sharpness expected to be achieved. If the current image sharpness is found to be greater than the target sharpness after comparison, it is considered that a suitable imaging position has been found. At this point, the imaging system is fixed in the current position without further adjustment. If the current image sharpness is less than or equal to the target sharpness, the position of the imaging system continues to be adjusted along the first direction at a first preset distance interval, and the above imaging, grayscale processing, and sharpness evaluation process is repeated until a suitable position is found. This embodiment of the application finds the optimal imaging distance that allows the imaging system to clearly image the target mark in focus mode by gradually adjusting the position of the imaging system. This is of great significance for subsequent foreign object detection and image analysis. By combining grayscale processing and sharpness evaluation algorithms, the sharpness of the image can be objectively and accurately evaluated, thereby ensuring that the imaging system can work stably and reliably.

[0052] Optionally, in this embodiment, the step of "adjusting the linear laser along the second direction and controlling the imaging system to image the target mark in focusing mode until the brightness value of the target mark in the image is greater than the target brightness value, and fixing the linear laser" includes: adjusting the linear laser gradually along the second direction at second preset distance intervals, and after each adjustment, controlling the imaging system to image the target mark in focusing mode to obtain a second image, identifying the target mark from the second image, calculating the average brightness value corresponding to the target mark, and fixing the linear laser when the average brightness value is greater than the target brightness value.

[0053] In this embodiment, a second preset distance interval is pre-set, which is a fixed distance value used each time the linear laser is moved. When adjusting the position of the linear laser, the position of the linear laser is adjusted along the second direction according to the second preset distance interval. Each time the position is adjusted, the imaging system can be controlled to image the target mark once in focus mode, obtaining a second imaging image. For each second imaging image obtained, image processing techniques (such as edge detection, template matching, etc.) are used to identify the target mark in the image. When the target mark is successfully identified, the average brightness value of the corresponding area of ​​the target mark in the second imaging image can be calculated. The average brightness value can be obtained by summing the brightness values ​​of all pixels in the target mark area and then dividing by the total number of pixels. After each calculation of the average brightness value, it is compared with the target brightness value. The target brightness value can be a preset brightness threshold, representing the minimum brightness standard expected to be achieved. If the comparison reveals that the current average brightness value is greater than the target brightness value, a suitable illumination position is considered to have been found. At this point, the linear laser is fixed in its current position and no further movement is made. If the current average brightness value is less than or equal to the target brightness value, the linear laser continues to move along the second direction at preset distance intervals, and the above imaging, target mark recognition, and brightness calculation processes are repeated until a suitable position is found. This embodiment of the application finds the optimal illumination position where the target mark has sufficient brightness in the second imaging image by gradually adjusting the position of the linear laser, thereby improving the accuracy of foreign object detection. By calculating the average brightness value of the target mark and comparing it with the target brightness value, the current illumination conditions can be objectively and accurately assessed to ensure that the imaging system can operate stably and reliably.

[0054] Optionally, in this embodiment, the transparent medium product is placed on a linear motion device; before the step of "adjusting the position of the imaging system and the linear laser according to the target foreign object detection layer", the method further includes: placing a preset calibration fixture in the target detection area on the linear motion device, wherein the preset calibration fixture is a calibration tool made of the transparent medium and including multiple preset foreign object detection layers, each preset foreign object detection layer of the preset calibration fixture corresponds to a preset mark, the preset mark forms scattered light under laser beam irradiation, and the target detection area is the area of ​​the linear field of view of the imaging system corresponding to the linear motion device; determining the preset mark corresponding to the target foreign object detection layer from the multiple preset marks of the preset calibration fixture, and using it as the target mark.

[0055] In this embodiment, the device that moves the transparent medium product can be a linear motion device. A preset calibration fixture can be used during the adjustment of the positions of the imaging system and the linear laser. The preset calibration fixture is a calibration tool made of the same transparent medium material as the transparent medium product to be tested. It contains multiple preset foreign object detection layers, each with specific preset marks. These preset marks can be used to represent foreign objects present in the transparent medium product. The preset calibration fixture can be designed according to the transparent medium product to be tested and the testing requirements. For example, if the transparent medium product to be tested requires testing three layers A, B, and C, then the preset calibration fixture is also designed with three layers. Layer A of the preset calibration fixture has preset mark 1, layer B has preset mark 2, and layer C has preset mark 3. The thickness of the preset calibration fixture is consistent with that of the transparent medium product to be tested. The distance of the preset marks in the third direction of each layer is exactly the same as the distance of the layer required by the transparent medium product to be tested. For example, the distance of layer B of the transparent medium product to the upper surface is exactly the same as the distance of preset mark 2 of layer B of the preset calibration fixture to the upper surface. The preset marks in each layer of the preset calibration fixture have a diffuse reflection effect.

[0056] Before controlling the imaging system to image the target mark in focusing mode, a preset calibration fixture can first be placed within the target detection area on the linear motion device. Here, the target detection area is the portion of the linear field of view of the imaging system corresponding to the linear motion device. Next, among the multiple preset marks on the preset calibration fixture, the preset mark corresponding to the target foreign object detection layer is selected as the target mark. After the preset calibration fixture is placed and the target mark is determined, the positions of the imaging system and the linear laser can be adjusted according to the target mark. This embodiment of the application uses a preset calibration fixture to calibrate the positions of the imaging system and the linear laser, which can effectively improve the efficiency and accuracy of debugging.

[0057] Optionally, such as Figure 5As shown, a preset calibration fixture provided in an embodiment of this application is illustrated. Figure 5 The preset calibration fixture shown includes three preset foreign object detection layers: layer A, layer B, and layer C. The preset mark corresponding to layer A is mark 1, layer B is mark 2, and layer C is mark 3. When placing the preset calibration fixture on the linear motion device, layer C of the preset calibration fixture can be placed on the linear motion device, with the long side of the preset mark aligned with the first direction. Figure 4 The diagram illustrates the placement of a preset calibration fixture 4 on a linear motion device 5. Assuming the target foreign object detection layer is layer B, after placing the preset calibration fixture on the linear motion device, the positions of the imaging system and the linear laser can be adjusted according to the mark 2 on layer B. This ensures that the overlapping area of ​​the linear field of view of the imaging system and the linear spot of the linear laser is located on layer B, and that the image of mark 2 (only a small portion along the Y-axis, i.e., the third direction) in the imaging system is clear and very bright. Furthermore, the linear motion device can be activated to move the preset calibration fixture along the first direction, allowing for the detection of the imaging effect of the entire mark 2 within the imaging system, thereby improving the accuracy of the positions of the imaging system and the linear laser.

[0058] In this embodiment of the application, optionally, the transparent medium product includes multiple transparent medium products; for the first transparent medium product, after step 203, the method further includes: storing the grayscale threshold; for non-first transparent medium products, after "identifying the grayscale value corresponding to each pixel" in step 203, the method further includes: determining whether there are pixels in the target image after grayscale processing that have a grayscale value greater than the stored grayscale threshold, and when the determination result is that there are, determining that there is an image background on the target image that is different from the target image.

[0059] In this embodiment, the transparent medium products to be detected may include multiple products. These transparent medium products are placed sequentially on a linear motion device, and the imaging system sequentially images the target foreign object detection layer of the multiple transparent medium products. After the first transparent medium product is placed on the linear motion device, the imaging system can image the transparent medium product to obtain a target image. Further, the target image is processed to obtain a grayscale threshold. This grayscale threshold can then be directly stored. Under the same environment and with almost the same detection time, the difference in grayscale values ​​of the image background of the target images of different transparent medium products is almost negligible. Therefore, the grayscale threshold only needs to be calculated once for the first transparent medium product. For subsequent transparent medium products, this grayscale threshold can be directly used for judgment, which can greatly improve the foreign object detection efficiency of transparent medium products. Therefore, for other transparent media products, the acquired target image can be grayscaled, and the grayscale value corresponding to each pixel can be identified from the grayscaled target image. Then, based on the pre-stored grayscale threshold, it can be determined whether there are pixels in the grayscaled target image with a grayscale value greater than the stored grayscale threshold. When the determination result is that there is a foreign object, it is determined that there is a foreign object on the target foreign object detection layer of the target image.

[0060] Optionally, after "determining that there is an image background different from the target image on the target image", the method further includes: extracting target pixels with gray values ​​greater than a gray value threshold from the target image, and obtaining a foreign object image to be identified based on the target pixels using a region growing algorithm; inputting the foreign object image to be identified into a foreign object identification model, extracting the shape features, size features, texture features, and gray value features of the foreign object image to be identified through the foreign object identification model, and performing feature fusion on the shape features, size features, texture features, and gray value features to obtain fused features, and obtaining the foreign object type corresponding to the foreign object image to be identified based on the fused features.

[0061] In this embodiment, after determining that there is an image in the target image that differs from the image background, the type of foreign object can be further identified. First, target pixels with gray values ​​greater than a gray value threshold can be extracted from the target image, thus initially filtering out the parts of the target image that represent foreign objects. Next, a region growing algorithm is used to further obtain the image of the foreign object to be identified based on these target pixels. The region growing algorithm is an image segmentation method based on pixel similarity. It starts with a set of seed points (here, target pixels) and adds surrounding pixels similar to the seed points (based on attributes such as gray value, color, and texture) to the corresponding regions until no more pixels that meet the conditions can be added. In this way, the region where the target pixel is located can be completely extracted to form the image of the foreign object to be identified. Then, the image of the foreign object to be identified can be input into a foreign object identification model. Here, the foreign object identification model can be a classifier based on machine learning or deep learning, which can extract features from the input image of the foreign object to be identified. Specifically, the foreign object identification model can extract the shape features, size features, texture features, and gray value features of the image of the foreign object to be identified. These features together describe the appearance and attributes of the foreign object and are key to subsequent identification of the type of foreign object. After extracting the individual features, these features can be fused to obtain fused features. Feature fusion can be achieved through various methods, such as simple concatenation, weighted summation, and principal component analysis (PCA). The fused features contain information on shape, size, texture, and grayscale, providing a more comprehensive reflection of the foreign object's characteristics. Finally, based on the fused features, a foreign object recognition model is used to identify the type of foreign object in the image. Specifically, the foreign object recognition model can determine the type of foreign object in the input image based on learned knowledge and output the corresponding recognition result.

[0062] It should be noted that the foreign object recognition model in this application is trained using image samples containing various foreign objects. For example, image samples containing foreign objects such as lint, dust, dirt, and moisture. The foreign object recognition model trained in this way can better identify the types of foreign objects in the target image.

[0063] Optionally, in this embodiment, the method further includes: detecting the transparent medium product in motion using a preset sensor, generating an image acquisition command when the transparent medium product begins to enter the linear field of view of the imaging system, and generating an end command when the transparent medium product leaves the linear field of view of the imaging system; correspondingly, the method further includes: controlling the imaging system to end image acquisition and controlling the light source of the linear laser to turn off when the end command is received.

[0064] In this embodiment, a preset sensor is used to monitor a transparent medium product in motion. Here, the preset sensor can be various types of sensors, such as photoelectric sensors, laser rangefinders, or video image sensors. The preset sensor is positioned appropriately to detect when the transparent medium product enters the linear field of view of the imaging system. Specifically, the preset sensor can detect the first edge of the transparent medium product. When the first edge of the transparent medium product is detected to have entered the linear field of view of the imaging system, an image acquisition command is generated. Upon receiving the image acquisition command, the linear laser begins to illuminate, and the imaging system starts operating to acquire an image of the transparent medium product. Furthermore, when the preset sensor further detects that the transparent medium product has left the linear field of view, the image acquisition is considered complete. At this point, a termination command can be generated, which controls the imaging system to end image acquisition and controls the linear laser to shut down. This embodiment of the application controls the power supply of the linear laser and the image acquisition of the imaging system through a preset sensor. The entire process achieves closed-loop management of automatic detection, image acquisition, and termination control of a transparent medium product in motion, improving detection efficiency and accuracy while reducing the need for manual intervention.

[0065] Optionally, in this embodiment of the application, the method further includes: when the time interval during which no image acquisition instruction is received is greater than a preset interval, analyzing the detection pass rate corresponding to the target foreign object detection layer; when the detection pass rate is less than the preset pass rate, generating processing guidance data corresponding to the transparent medium product based on the type of foreign object corresponding to the transparent medium product.

[0066] In this embodiment, the time interval during which no image acquisition command is received can also be continuously monitored. This time interval refers to the length of time from when the last transparent medium product leaves the linear field of view of the imaging system (i.e., the end of the last image acquisition command) to the current time point, during which no new transparent medium product enters the field of view. If this time interval exceeds a preset interval, it is considered that all transparent medium products in the current batch have been detected on the target foreign object detection layer. Next, the detection pass rate corresponding to the target foreign object detection layer can be analyzed. If the detection pass rate is less than the preset pass rate, it indicates that there may be a problem with the processing of this batch of transparent medium products. In this case, the target image of the transparent medium product with foreign objects can be further analyzed to determine the type of foreign object. Then, based on the type of foreign object corresponding to the transparent medium product, processing guidance data for that transparent medium product is generated. Specifically, the processing guidance data may include: suggestions to adjust certain parameters or process steps of the processing line to reduce the possibility of foreign object generation; providing specific cleaning, inspection, or repair guidelines to ensure the quality of the transparent medium products, etc. This application provides an effective mechanism for automated inspection systems to deal with abnormal situations and ensure the quality of transparent media products by monitoring the time interval when no image acquisition command is received, analyzing the inspection pass rate, and generating processing guidance data. This helps to promptly identify and solve problems, reduce the generation of unqualified products, and improve product quality.

[0067] Optionally, after the "detection pass rate is less than the preset pass rate", the method further includes: determining whether there are more than a preset number of consecutive target images containing the same foreign object image, wherein the same foreign object image has the same imaging position and imaging shape in each of the target images; when the determination result is yes, determining the processing line fault corresponding to the transparent medium product by using big data analysis technology, based on the type of foreign object corresponding to the same foreign object image and the target foreign object detection layer.

[0068] In this embodiment, by comparing consecutive target images, it detects whether the same foreign object image appears in more than a preset number of consecutive target images. Here, a preset number can be set in advance to determine whether a sufficient number of the same foreign object images appear in consecutive target images. The preset number can be set according to actual needs to balance detection sensitivity and false alarm rate. The same foreign object image refers to foreign object images appearing in different target images with the same imaging position and shape. When the judgment result is yes, it is confirmed that the same foreign object image appears in multiple consecutive target images. Next, based on the type of foreign object corresponding to the same foreign object image and the target foreign object detection layer, big data analysis technology is used to analyze the possible reasons for the repeated appearance of the same foreign object image. Finally, based on the analyzed reasons, it is determined whether there is a malfunction in the processing line of the transparent medium product.

[0069] Specifically, production line faults can be identified using a combination of big data analytics and the following methods: First, data such as the type of foreign object, its location in the target image, and detection time corresponding to the same foreign object imaging are integrated with data on the equipment status, operation records, and production parameters of the production line when processing the transparent medium product to obtain target data. Next, data on the type of foreign object and the equipment status of the production line can be converted into numerical codes for easier subsequent operations. Then, using big data analytics, multiple historical sample data points corresponding to each type of production line fault are obtained. Each historical sample data point can also include data such as the foreign object contained in the sample image, the location of the foreign object in the sample image, the detection time, and the equipment status, operation records, and production parameters of the production line when processing the transparent medium product corresponding to the sample image. Clustering is then performed on the multiple historical sample data points for each type of production line fault. For example, K-means clustering can be used, specifying a cluster size of 1. The cluster centers output by K-means clustering are then the cluster centers of the multiple historical sample data points for this type of production line fault. After obtaining the cluster centers corresponding to each type of processing line fault, the Euclidean distance between the target data and the cluster centers corresponding to each type of processing line fault can be calculated to obtain the distance value. Then, the processing line fault corresponding to the cluster center with the smallest distance value is taken as the processing line fault corresponding to the transparent medium product. This application integrates multiple data sources, including foreign object imaging data, equipment status of the processing line, operation records, production parameters, etc., forming a comprehensive dataset. This data integration helps to more comprehensively understand the operation of the processing line, thereby more accurately judging the fault. Using the K-means clustering method to cluster the historical sample data corresponding to each type of processing line fault can more scientifically find the cluster centers for each type of processing line fault, making the identification of the current processing line fault more accurate. Furthermore, it fully utilizes the intelligent and automated characteristics of big data analysis technology, reducing the subjectivity of manual judgment and improving the accuracy and reliability of processing line fault judgment.

[0070] Optionally, in this embodiment of the application, the transparent medium product is affixed with an electronic tag, the electronic tag has a unique identifier, and an electronic tag reader is installed on the back side of the target detection area on the linear motion device; the method further includes: when the image acquisition instruction is received, reading the tag information of the electronic tag through the electronic tag reader, identifying the unique identifier from the tag information, and marking the unique identifier on the target image after obtaining the target image.

[0071] In this embodiment, electronic tags can be affixed to the transparent media product to be detected. These electronic tags are typically small in size and durable, able to adhere to the product surface without affecting its transparency and functionality. Each electronic tag carries a unique identifier (such as a serial number, product ID, etc.), which is a crucial identifier for the transparent media product, used to uniquely identify each transparent media product during production, tracking, and management. Furthermore, an electronic tag reader can be installed on the back side of the target detection area on the linear motion device. The electronic tag reader can read the tag information on the transparent media product as it passes through the target detection area. Specifically, when an image acquisition command is received, the electronic tag reader is activated and reads the tag information of the electronic tag affixed to the transparent media product, identifies the unique identifier of the transparent media product from this tag information, and associates this unique identifier with the acquired target image. In this way, each target image can establish a clear connection with its corresponding transparent media product. This embodiment, combined with electronic tags, allows for easy tracking of a transparent media product when a foreign object is present in the target foreign object detection layer, enabling rapid location of the specific production batch and product information.

[0072] Furthermore, as Figure 1 In specific implementation of the method, this application provides a foreign object detection device for transparent media products, such as... Figure 6 As shown, the device includes:

[0073] A position adjustment module is used to determine a target foreign object detection layer from multiple preset foreign object detection layers of a transparent medium product to be detected, and to adjust the position of the imaging system and the linear laser according to the target foreign object detection layer, so that the linear spot of the linear laser coincides with the linear field of view of the imaging system, and the overlapping area is located in the target foreign object detection layer. The imaging system includes a line scanning lens, which is used to receive the scattered light from the foreign object.

[0074] The image acquisition module is used to control the linear laser to send a laser beam and control the imaging system to acquire images of the transparent medium product in motion when an image acquisition command is received, so as to obtain a target image of the transparent medium product on the target foreign object detection layer.

[0075] The foreign object detection module is used to determine that there is a foreign object on the target foreign object detection layer of the transparent medium product when there is an image background on the target image that is different from the target image.

[0076] Optionally, the position adjustment module is used for:

[0077] The imaging system is adjusted to focus mode, the distance between the imaging system and the target mark is adjusted according to the first direction, and the imaging system is controlled to image the target mark in focus mode until the image clarity is greater than the target clarity. The imaging system is then fixed. The target mark is located on the plane where the target foreign object detection layer is located. The second direction is the direction of travel of the transparent medium product. The third direction is the direction on the plane where the target foreign object detection layer is located and perpendicular to the second direction. The first direction is the direction that is perpendicular to both the second direction and the third direction.

[0078] Adjust the linear laser in the second direction and control the imaging system to image the target mark in focus mode until the brightness value of the target mark in the image is greater than the target brightness value, and then fix the linear laser.

[0079] Accordingly, the device further includes:

[0080] The mode adjustment module is used to adjust the imaging system to the image acquisition mode after the linear laser is fixed.

[0081] Optionally, the position adjustment module is further configured to:

[0082] According to the first preset distance interval, the distance between the imaging system and the target mark is gradually adjusted along the first direction. After each adjustment, the imaging system is controlled to image the target mark in focus mode to obtain a first imaging image. The first imaging image is then grayscaled. A preset sharpness evaluation algorithm is used to calculate the imaging sharpness of the grayscaled first imaging image. When the imaging sharpness is greater than the target sharpness, the imaging system is fixed.

[0083] Optionally, the position adjustment module is further configured to:

[0084] The linear laser is moved step by step along the second direction according to the second preset distance interval. After each movement, the imaging system is controlled to image the target mark in the focusing mode to obtain a second imaging image. The target mark is identified from the second imaging image, and the average brightness value corresponding to the target mark is calculated. When the average brightness value is greater than the target brightness value, the linear laser is fixed.

[0085] Optionally, the transparent medium product is placed on a linear motion device; the device further includes:

[0086] A placement module is used to place a preset calibration fixture on the target detection area of ​​the linear motion device before the imaging system images the target mark in focusing mode. The preset calibration fixture is a calibration tool made of the transparent medium and including multiple preset foreign object detection layers. Each preset foreign object detection layer of the preset calibration fixture corresponds to a preset mark. The preset mark forms scattered light under laser beam irradiation. The target detection area is the area on the linear motion device corresponding to the linear field of view of the imaging system.

[0087] The marker determination module is used to determine the preset marker corresponding to the target foreign object detection layer from a plurality of preset markers of the preset calibration fixture, and use it as the target marker.

[0088] Optionally, the device further includes:

[0089] The grayscale processing module is used to perform grayscale processing on the target image after obtaining the target image of the transparent medium product on the target foreign object detection layer, identify the grayscale value corresponding to each pixel from the grayscale processed target image, count the number of pixels corresponding to each grayscale value, and determine the grayscale threshold based on the grayscale value with the most corresponding pixels.

[0090] The pixel determination module is used to determine whether there are pixels in the target image after grayscale processing that have a grayscale value greater than the grayscale threshold, and when the determination result is that there are pixels, it is determined that there is an image background on the target image that is different from the target image.

[0091] Optionally, the transparent medium product includes multiple products;

[0092] For the first transparent media product, the device also includes:

[0093] A storage module is used to store the grayscale threshold after it has been determined.

[0094] For products that are not the first transparent medium products, the pixel determination module is further used for:

[0095] After identifying the grayscale value corresponding to each pixel, it is determined whether there are pixels in the target image after grayscale processing that have a grayscale value greater than the stored grayscale threshold. If the determination result is that there are, it is determined that there is an image background on the target image that is different from the target image.

[0096] Optionally, the device further includes:

[0097] The extraction module is used to extract target pixels with gray values ​​greater than a gray threshold from the target image after determining that there is an image background different from the target image on the target image, and to obtain the image of the foreign object to be identified based on the target pixels through a region growing algorithm;

[0098] The foreign object type identification module is used to input the image of the foreign object to be identified into the foreign object identification model, extract the shape features, size features, texture features and grayscale features of the image of the foreign object to be identified through the foreign object identification model, and perform feature fusion on the shape features, size features, texture features and grayscale features to obtain fused features, and obtain the foreign object type corresponding to the image of the foreign object to be identified based on the fused features.

[0099] Optionally, the device further includes:

[0100] The instruction generation module is used to detect the transparent medium product in motion using a preset sensor, and generate an image acquisition instruction when the transparent medium product begins to enter the linear field of view of the imaging system, and generate an end instruction when the transparent medium product leaves the linear field of view of the imaging system.

[0101] Accordingly, the device further includes:

[0102] The instruction receiving module is used to control the imaging system to end image acquisition and to control the light source of the linear laser to turn off when an end instruction is received.

[0103] Optionally, the device further includes:

[0104] The detection pass rate analysis module is used to analyze the detection pass rate of the target foreign object detection layer when the time interval between not receiving the image acquisition command is greater than a preset interval.

[0105] The processing guidance data generation module is used to generate processing guidance data corresponding to the transparent medium product based on the type of foreign matter corresponding to the transparent medium product when the inspection pass rate is less than the preset pass rate.

[0106] Optionally, the device further includes:

[0107] An imaging judgment module is used to determine whether, when the detection pass rate is less than a preset pass rate, there are more than a preset number of consecutive target images containing the same foreign object imaging, wherein the same foreign object imaging has the same imaging position and imaging shape in each of the target images.

[0108] The production line fault determination module is used to determine the processing production line fault corresponding to the transparent medium product by using big data analysis technology, based on the type of foreign object corresponding to the same foreign object imaging and the target foreign object detection layer, when the judgment result is yes.

[0109] Optionally, the transparent medium product is affixed with an electronic tag, the electronic tag bearing a unique identifier, and an electronic tag reader / writer is mounted on the back side of the target detection area on the linear motion device; the device further includes:

[0110] The identification module is used to read the tag information of the electronic tag through the electronic tag reader when the image acquisition command is received, identify the unique identifier from the tag information, and mark the unique identifier on the target image after obtaining the target image.

[0111] It should be noted that other corresponding descriptions of the functional units involved in the foreign object detection device for transparent media products provided in this application embodiment can be found in the following references. Figures 1 to 5 The corresponding descriptions in the method will not be repeated here.

[0112] This application also provides a computer device, which may specifically be a personal computer, a server, a network device, etc. Figure 7 As shown, the computer device includes a bus, a processor, memory, and a communication interface, and may also include an input / output interface and a display device. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores location information. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.

[0113] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0114] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0115] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0116] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0118] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0119] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method of foreign object detection of a transparent medium product, characterized by, The method comprises the following steps: determining a target foreign matter detection layer from a plurality of preset foreign matter detection layers of a transparent medium product to be detected, and adjusting a position of an imaging system and a linear laser according to the target foreign matter detection layer, so that a linear light spot of the linear laser coincides with a linear field of view of the imaging system, and a coincidence area is located at the target foreign matter detection layer, wherein the imaging system comprises a line scanning lens for receiving scattered light of foreign matter; when a photographing instruction is received, controlling the linear laser to send a laser beam, and controlling the imaging system to photograph a transparent medium product in motion to obtain a target image of the transparent medium product on the target foreign matter detection layer; when there is imaging of an image background different from the target image on the target image, determining that there is foreign matter on the target foreign matter detection layer of the transparent medium product; after the target image of the transparent medium product on the target foreign matter detection layer is obtained, the method further comprises: performing grayscale processing on the target image, identifying a corresponding gray value of each pixel from the target image after grayscale processing, and counting a number of pixels corresponding to each gray value, and determining a gray threshold value according to a gray value corresponding to the largest number of pixels; judging whether there is a pixel point with a gray value greater than the gray threshold value in the target image after grayscale processing, and when the judgment result is that there is, determining that there is imaging of an image background different from the target image on the target image.

2. The method of claim 1, wherein, The method further comprises the following steps: adjusting the imaging system to a focusing mode, adjusting a distance between the imaging system and a target mark in a first direction, and controlling the imaging system to image the target mark in the focusing mode until the imaging clarity is greater than a target clarity, and then fixing the imaging system, wherein the target mark is located on a plane where the target foreign matter detection layer is located, a second direction is a direction of movement of the transparent medium product, a third direction is a direction perpendicular to the second direction on the plane where the target foreign matter detection layer is located, and the first direction is a direction perpendicular to the second direction and the third direction at the same time; adjusting the linear laser in the second direction, and controlling the imaging system to image the target mark in the focusing mode until the brightness value of the target mark in the imaging is greater than a target brightness value, and then fixing the linear laser; correspondingly, after the linear laser is fixed, the method further comprises: adjusting the imaging system to a photographing mode.

3. The method of claim 2, wherein, The method further comprises the following steps: adjusting the distance between the imaging system and the target mark in the first direction, and controlling the imaging system to image the target mark in the focusing mode until the imaging clarity is greater than the target clarity, and then fixing the imaging system. adjusting the distance between the imaging system and the target mark along the first direction according to a first preset distance interval, and after each adjustment, controlling the imaging system to image the target mark in a focusing mode to obtain a first imaging image, performing grayscale processing on the first imaging image, and calculating an imaging definition of the first imaging image after the grayscale processing by using a preset definition evaluation algorithm, and fixing the imaging system when the imaging definition is greater than a target definition.

4. The method according to claim 2 or 3, characterized in that, adjusting the linear laser along the second direction according to a second preset distance interval, and after each adjustment, controlling the imaging system to image the target mark in a focusing mode to obtain a second imaging image, identifying the target mark from the second imaging image, and calculating an average brightness value corresponding to the target mark, and fixing the linear laser when the average brightness value is greater than a target brightness value. adjusting the distance between the imaging system and the target mark along the first direction according to a first preset distance interval, and after each adjustment, controlling the imaging system to image the target mark in a focusing mode to obtain a first imaging image, performing grayscale processing on the first imaging image, and calculating an imaging definition of the first imaging image after the grayscale processing by using a preset definition evaluation algorithm, and fixing the imaging system when the imaging definition is greater than a target definition.

5. The method of claim 1, wherein, Before the step of adjusting the positions of the imaging system and the linear laser according to the target foreign matter detection layer, the method further comprises: placing a preset calibration jig in a target detection area on the linear motion device, wherein the preset calibration jig is a calibration tool made of the transparent medium and comprising a plurality of preset foreign matter detection layers, each preset foreign matter detection layer of the preset calibration jig corresponds to a preset mark, the preset mark forms scattered light under laser beam irradiation, and the target detection area is a region corresponding to a linear field of view of the imaging system on the linear motion device; determining a preset mark corresponding to the target foreign matter detection layer from a plurality of preset marks of the preset calibration jig as a target mark.

6. The method of claim 1, wherein, The transparent medium product comprises a plurality of For the first transparent medium product, after the step of determining the grayscale threshold, the method further comprises: storing the grayscale threshold; For the non-first transparent medium product, after the step of identifying the grayscale value corresponding to each pixel, the method further comprises: determining whether there is a pixel point with a grayscale value greater than the stored grayscale threshold in the target image after the grayscale processing, and when the determination result is that there is, determining that there is an imaging different from an image background of the target image on the target image.

7. The method of claim 6, wherein, After the step of determining that there is an imaging different from an image background of the target image on the target image, the method further comprises: extracting a target pixel with a grayscale value greater than the grayscale threshold from the target image, and obtaining a to-be-identified foreign matter image according to the target pixel by using a region growing algorithm; The foreign matter image to be identified is input into a foreign matter identification model, shape features, size features, texture features and gray scale features of the foreign matter image to be identified are extracted by the foreign matter identification model respectively, the shape features, the size features, the texture features and the gray scale features are fused to obtain fused features, and a foreign matter type corresponding to the foreign matter image to be identified is obtained according to the fused features.

8. The method of claim 1, wherein, The method further comprises: detecting the transparent medium product in motion by a preset sensor, and generating a photographing instruction when it is detected that the transparent medium product starts to enter the linear field of view of the imaging system, and generating an ending instruction when it is detected that the transparent medium product leaves the linear field of view of the imaging system; Correspondingly, the method further comprises: When the ending instruction is received, controlling the imaging system to end photographing, and controlling the light source of the linear laser to be turned off.

9. The method of claim 8, wherein, The method further comprises: When the time interval during which the photographing instruction is not received is greater than a preset interval, analyzing a detection pass rate corresponding to the target foreign matter detection layer; When the detection pass rate is less than a preset pass rate, generating processing guidance data corresponding to the transparent medium product based on a foreign matter type corresponding to the transparent medium product.

10. The method of claim 9, wherein, After the detection pass rate is less than the preset pass rate, the method further comprises: determining whether the same foreign matter imaging exists in more than a preset number of continuous target images in each target image, wherein the imaging position and the imaging shape of the same foreign matter imaging in each target image are the same; When the determination result is yes, determining a processing production line fault corresponding to the transparent medium product based on the same foreign matter imaging corresponding to the foreign matter type and the target foreign matter detection layer by using big data analysis technology.

11. The method of claim 1, wherein, The transparent medium product is attached with an electronic tag, the electronic tag carries a unique identifier, and an electronic tag reader is installed on the back side of the target detection area of the linear motion device; the method further comprises: When the photographing instruction is received, reading the tag information of the electronic tag by the electronic tag reader, identifying the unique identifier from the tag information, and marking the unique identifier on the target image after the target image is obtained.

12. A foreign matter detection device for a transparent medium product, characterized in that, It comprises: A position adjustment module is configured to determine a target foreign matter detection layer from a plurality of preset foreign matter detection layers of a transparent medium product to be detected, and adjust the positions of an imaging system and a linear laser according to the target foreign matter detection layer, so that the linear light spot of the linear laser coincides with the linear field of view of the imaging system, and the coincident area is located at the target foreign matter detection layer, wherein the imaging system comprises a line scanning lens configured to receive scattered light of foreign matters; A photographing module is configured to control the linear laser to send a laser beam and control the imaging system to photograph a transparent medium product in motion when a photographing instruction is received, so as to obtain a target image of the transparent medium product on the target foreign matter detection layer. The foreign matter judgment module is configured to determine that a foreign matter exists on the target foreign matter detection layer of the transparent medium product when the target image has imaging different from the image background of the target image. The device further comprises: The grayscale processing module is configured to perform grayscale processing on the target image after the target image of the transparent medium product on the target foreign matter detection layer is obtained, identify a corresponding gray value of each pixel from the target image after the grayscale processing, count a number of pixels corresponding to each gray value, and determine a gray threshold value according to a gray value corresponding to the largest number of pixels. The pixel point judgment module is configured to determine whether there is a pixel point with a gray value greater than the gray threshold value in the target image after the grayscale processing, and determine that the target image has imaging different from the image background of the target image when the determination result is that there is a pixel point with a gray value greater than the gray threshold value.

13. The apparatus of claim 12, wherein, The position adjustment module is configured to: adjust the imaging system to a focusing mode, adjust a distance between the imaging system and a target mark in a first direction, control the imaging system to image the target mark in the focusing mode until the imaging clarity is greater than a target clarity, and fix the imaging system, wherein the target mark is located on a plane where the target foreign matter detection layer is located, a second direction is a direction in which the transparent medium product moves, a third direction is a direction perpendicular to the second direction on the plane where the target foreign matter detection layer is located, and the first direction is a direction perpendicular to the second direction and the third direction. adjust the linear laser in the second direction, and control the imaging system to image the target mark in the focusing mode until a brightness value of the target mark in the imaging is greater than a target brightness value, and fix the linear laser. Correspondingly, the device further comprises: The mode adjustment module is configured to adjust the imaging system to a photographing mode after the linear laser is fixed.

14. The apparatus of claim 13, wherein, The position adjustment module is further configured to: adjust the distance between the imaging system and the target mark in the first direction at a first preset distance interval, control the imaging system to image the target mark in the focusing mode after each adjustment, obtain a first imaging image, perform grayscale processing on the first imaging image, calculate an imaging clarity of the first imaging image after the grayscale processing by using a preset clarity evaluation algorithm, and fix the imaging system when the imaging clarity is greater than the target clarity.

15. The apparatus of claim 13 or 14, wherein, The position adjustment module is further configured to: move the linear laser in the second direction at a second preset distance interval, control the imaging system to image the target mark in the focusing mode after each movement, obtain a second imaging image, identify the target mark from the second imaging image, calculate an average brightness value corresponding to the target mark, and fix the linear laser when the average brightness value is greater than a target brightness value.

16. The apparatus of claim 12, wherein, The transparent medium product is placed on a linear motion device; and the device further comprises: A placing module is configured to place a preset calibration jig in a target detection area on the linear motion device before adjusting the position of the imaging system and the linear laser according to the target foreign matter detection layer, wherein the preset calibration jig is a calibration tool made of the transparent medium and including a plurality of preset foreign matter detection layers, each preset foreign matter detection layer of the preset calibration jig corresponds to a preset mark, the preset mark forms scattered light under laser beam irradiation, and the target detection area is a corresponding area of a linear field of view of the imaging system on the linear motion device; A mark determining module is configured to determine a preset mark corresponding to the target foreign matter detection layer from a plurality of preset marks of the preset calibration jig as a target mark.

17. The apparatus of claim 12, wherein, The transparent medium product includes a plurality of For the first transparent medium product, the device further includes: A storing module is configured to store the gray threshold value after determining the gray threshold value; For a non-first transparent medium product, the pixel point determining module is further configured to: After identifying the gray value corresponding to each pixel, determine whether there is a pixel point with a gray value greater than the stored gray threshold value in the target image after the gray processing, and when the determination result is that there is, determine that there is imaging different from the image background of the target image on the target image.

18. The apparatus of claim 17, wherein, The device further includes: An extracting module is configured to extract a target pixel with a gray value greater than a gray threshold value from the target image after determining that there is imaging different from the image background of the target image on the target image, and obtain a to-be-identified foreign matter image according to the target pixel through a region growing algorithm; A foreign matter type identifying module is configured to input the to-be-identified foreign matter image into a foreign matter identifying model, extract shape features, size features, texture features, and gray features of the to-be-identified foreign matter image through the foreign matter identifying model, perform feature fusion on the shape features, the size features, the texture features, and the gray features to obtain fused features, and obtain a foreign matter type corresponding to the to-be-identified foreign matter image according to the fused features.

19. The apparatus of claim 12, wherein, The device further includes: An instruction generating module is configured to detect the transparent medium product in motion through a preset sensor, generate a photographing instruction when it is detected that the transparent medium product starts to enter the linear field of view of the imaging system, and generate an end instruction when it is detected that the transparent medium product leaves the linear field of view of the imaging system; Correspondingly, the device further includes: An instruction receiving module is configured to control the imaging system to end photographing and control the light source of the linear laser to be turned off when the end instruction is received.

20. The apparatus of claim 19, wherein, The device further includes: A detection qualified rate analyzing module is configured to analyze a detection qualified rate corresponding to the target foreign matter detection layer when a time interval during which no photographing instruction is received is greater than a preset interval; A processing guidance data generating module is configured to generate processing guidance data corresponding to the transparent medium product based on a foreign matter type corresponding to the transparent medium product when the detection qualified rate is less than a preset qualified rate.

21. The apparatus of claim 20, wherein, The device further includes: An imaging judgment module is configured to judge whether the same foreign object imaging exists in more than a preset number of continuous target images in each target image after the detection qualified rate is less than a preset qualified rate, wherein the imaging position and imaging shape of the same foreign object imaging in each target image are the same; A production line fault determination module is configured to determine the processing production line fault of the transparent medium product according to the foreign object type corresponding to the same foreign object imaging and the target foreign object detection layer by using a big data analysis technology when the judgment result is yes.

22. The apparatus of claim 12, wherein, The transparent medium product is attached with an electronic tag, the electronic tag is attached with a unique identifier, and a target detection area on the linear motion device is installed with an electronic tag read-write device; the device further comprises: An identifier identification module is configured to read the tag information of the electronic tag by using the electronic tag read-write device when the image acquisition instruction is received, identify the unique identifier from the tag information, and mark the unique identifier on the target image after the target image is obtained.

23. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the method in any one of claims 1 to 11.

24. A computer device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein, The processor executes the computer program to implement the method in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Line laser focusing method and device, optical equipment and storage medium

    CN116088130A

  • Detection method and device

    CN117760970A