Foreign matter detection method and device for transparent medium product, storage medium and equipment
Through the cooperation of linear laser and linear array camera, the light spot overlaps with the field of view, and the high precision and efficient automation of foreign object detection for transparent media products is solved, and the high rate of visual damage and misjudgment of manual detection in the prior art is solved, and the difficulty of automated detection is difficult to detect human detection in the existing technology. The issue of distinguishing levels.
Patent Information
- Application Number
- CN202411113447.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-14
AI Technical Summary
In the prior art, in the detection of foreign objects in transparent media products, the artificial detection has high visual damage and misjudgment rate, and it is difficult to determine the level of foreign objects in automated detection, and the existing automated detection methods require subsequent manual distinction.
The linear laser is used to cooperate with the linear array camera, and the linear light spot of the linear laser coincides with the linear field of view of the imaging system, only illuminates the target foreign object detection layer, and uses dark field imaging to improve detection accuracy and contrast, and realize automated foreign object detection.
It improves the accuracy and accuracy of foreign object detection in transparent media products, reduces manual intervention, and ensures the reliability and efficiency of the detection results.
Smart Images

Figure CN119086557A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical detection technology, and in particular to a method and device for detecting foreign matter in a transparent medium product, a storage medium, and a computer device. Background Art
[0002] Nowadays, products made of transparent media are increasingly used in people's daily lives. For example, car windshields, lenses of microscopes, telescopes, and cameras, display screens of mobile phones and tablet computers, etc. In order to ensure the performance of these transparent media products and the user experience, it is usually necessary to detect foreign matter before installing and using these transparent media products to determine whether there are foreign matter on the surface or in the interlayer of the transparent media products. For example, for smart interactive display electronic products such as mobile phones and tablet computers, the component 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 experience. Therefore, before the display screen is installed and used, it is necessary to detect foreign matter on the display screen.
[0003] There are usually two ways to detect foreign objects in transparent media products. One is manual detection, and the other is automated detection. However, for manual detection, quality inspectors are required to conduct detection under strong light, which will cause great harm to the eyesight of quality inspectors, and the detection results are affected by the subjectivity of quality inspectors, with a high misjudgment rate. At the same time, it is also difficult to manually determine which layer of the transparent media product the foreign object is in; for automated detection, although the existing automated detection method can identify foreign objects from transparent media products, it is also unable to determine which layer of the transparent media product the foreign object is in, and manual distinction is required later. Summary of the invention
[0004] In view of this, the present application provides a foreign body detection method and device, storage medium, and computer equipment for transparent medium products. By using a linear laser in conjunction with a linear array camera, the imaging efficiency is high and the stability is good; a linear laser is used and the linear light spot of the linear laser is controlled to only illuminate the target foreign body detection layer. Since the light spot width of the linear laser can be achieved at the micron level, the accuracy of layered detection can be greatly improved; by setting a line scan lens to only receive the scattered light of foreign bodies, and using the dark field imaging method, the contrast of subsequent foreign body imaging is high, thereby improving the accuracy of foreign body detection.
[0005] According to one aspect of the present application, a method for detecting foreign matter in a transparent medium product is provided, comprising:
[0006] 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 position of an imaging system and a linear laser according to the target foreign matter detection layer, so that the linear 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, and the line scanning lens is used to receive scattered light of foreign matter;
[0007] When receiving a map acquisition instruction, controlling the linear laser to send a laser beam, and controlling the imaging system to acquire a map of the traveling transparent medium product, so as to obtain a target image of the transparent medium product on the target foreign matter detection layer;
[0008] When an image different from the image background of the target image exists on the target image, it is determined that a foreign object exists on the target foreign object detection layer of the transparent medium product.
[0009] According to another aspect of the present application, a foreign body detection device for a transparent medium product is provided, comprising:
[0010] A position adjustment module, used 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 position of an imaging system and a linear laser according to the target foreign matter detection layer, so that the linear 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 includes a line scanning lens, and the line scanning lens is used to receive scattered light of foreign matter;
[0011] A mapping module, configured to control the linear laser to send a laser beam and control the imaging system to map the traveling transparent medium product to obtain a target image of the transparent medium product on the target foreign matter detection layer when receiving a mapping instruction;
[0012] The foreign matter judging module is used to determine that a foreign matter exists on the target foreign matter detecting layer of the transparent medium product when an image different from the image background of the target image exists on the target image.
[0013] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the foreign matter detection method for the transparent medium product described above is implemented.
[0014] According to another aspect of the present 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 implements the above-mentioned foreign matter detection method for transparent medium products when executing the program.
[0015] By means of the above technical scheme, the present application provides a method and device for detecting foreign matter in a transparent medium product, a storage medium, and a computer device. Before taking a picture of the transparent medium product, the position of the imaging system and the linear laser can be adjusted. Specifically, the linear spot of the adjusted linear laser and the linear field of view of the imaging system can be made to coincide, and the overlapping area is located at the target foreign matter detection layer, so as to ensure that the linear spot of the linear laser only illuminates the target foreign matter detection layer, while the remaining preset foreign matter detection layers are not illuminated. After the positions of the imaging system and the linear laser are adjusted to meet the above conditions, the positions of the imaging system and the linear laser can be fixed. Afterwards, when a picture taking instruction is received, the linear laser can be controlled to emit a laser beam, and the imaging system can be controlled to take a picture of the moving transparent medium product. In this way, after the transparent medium product passes through the linear field of view of the imaging system, the target image of the transparent medium product on the target foreign matter detection layer can be obtained. 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 means that the corresponding transparent medium product has foreign matter on the target foreign matter detection layer. The embodiment of the present application uses a linear laser in conjunction with a linear array camera, so the imaging efficiency is high and the stability is good; a linear laser is used and the linear spot of the linear laser is controlled to illuminate only the target foreign matter detection layer. Since the spot width of the linear laser can be at the micron level, the accuracy of layered detection can be greatly improved; by setting the line scanning lens to only receive the scattered light of foreign matter, and using the dark field imaging method, the subsequent foreign matter imaging has a high contrast, thereby improving the accuracy of foreign matter detection.
[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A schematic flow chart of a foreign body detection method for a transparent medium product provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic diagram of a linear field of view provided by an embodiment of the present application is shown;
[0020] Figure 3A schematic flow chart showing another method for detecting foreign matter in a transparent medium product provided in an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram showing the relative positions of an imaging system, a linear laser and a transparent medium product provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of a preset calibration fixture provided in an embodiment of the present application is shown;
[0023] Figure 6 A schematic structural diagram of a foreign body detection device for a transparent medium product provided in an embodiment of the present application is shown;
[0024] Figure 7 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0026] In this embodiment, a method for detecting foreign matter in a transparent medium product is provided. Figure 1 As shown, the method includes:
[0027] Step 101, 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 an imaging system and a position of 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 overlapping area is located at the target foreign matter detection layer, wherein the imaging system includes a line scanning lens, and the line scanning lens is used to receive scattered light of foreign matter.
[0028] A foreign body detection method for a transparent medium product provided in an embodiment of the present application can be applied to any product made of transparent medium, such as automobile windshields, microscopes, telescopes, camera lenses, display screens of mobile phones and tablet computers, etc. Before performing foreign body detection on a transparent medium product, the target foreign body detection layer corresponding to the transparent medium product to be detected can be determined first, that is, it is necessary to determine which layer of the transparent medium product to be detected for foreign bodies. For transparent medium products such as display screens, foreign bodies in the interlayer of the display screen are very common in screen detection and are the first category of defects. This type of defect seriously affects the visual senses and user experience of the mobile phone screen and is a zero-tolerance defect. Foreign bodies such as lint / dust spots / dirt on the surface of the display screen can be wiped off as OK defects and do not need to be detected, but foreign bodies in the interlayer of the display screen are zero-tolerance defects and need to be detected. Therefore, for transparent medium products such as display screens, the interlayer of the display screen can be used as the target foreign body detection layer.
[0029] The present application determines whether there are foreign objects in the target foreign object detection layer of a transparent medium product by means of image analysis. Specifically, the target foreign object detection layer of the transparent medium product is irradiated by a linear laser, and the transparent medium product is imaged by an imaging system. In order to avoid foreign objects in other layers appearing in the image during the process of imaging the transparent medium product by the imaging system, the position of the imaging system and the linear laser can be adjusted before imaging the transparent medium product. Specifically, the linear light spot of the adjusted linear laser and the linear field of view of the imaging system can be made to coincide, and the overlapping area is located in the target foreign object detection layer. Here, the imaging system can be composed of a linear array camera and a line scan lens, so that the imaging system can form a linear field of view, such as Figure 2 As shown, the linear field of view of the imaging system in one case is given. The overlap area is located at the target foreign body detection layer, that is, it is necessary to ensure that the linear spot of the linear laser only illuminates the target foreign body detection layer, and the other preset foreign body detection layers are not illuminated. For example, for a display screen, it includes layer A, layer B and layer C, wherein layer A is the upper surface layer of the display screen, layer B is the interlayer of the display screen, and layer C is the lower surface layer of the display screen. When the target foreign body detection layer is layer B, then the linear spot is required to illuminate only layer B, but not layer A and layer C. In this way, the image obtained by the imaging system can only include the image of the target foreign body detection layer, and the foreign bodies in the other layers cannot be imaged in the imaging system because they are not illuminated. In addition, the line scanning lens in the imaging system can be set to only receive the scattered light of the foreign body. In this way, when there is no foreign body, the entire background is a dark field; when there is a foreign body, the linear laser irradiates on the foreign body, the foreign body is diffusely reflected, and the line scanning lens receives the diffusely reflected scattered light, so that the foreign body presents high brightness. At this time, the imaging contrast of the imaging system is high and the imaging effect is good. After the positions of the imaging system and the linear laser are adjusted to meet the above conditions, the positions of the imaging system and the linear laser can be fixed.
[0030] Step 102, when receiving an image acquisition instruction, controlling the linear laser to send a laser beam, and controlling the imaging system to acquire an image of the moving transparent medium product, to obtain a target image of the transparent medium product on the target foreign matter detection layer.
[0031] In this embodiment, when the image acquisition instruction is received, the linear laser can be controlled to emit a laser beam, and the imaging system can be controlled to acquire an image of the moving transparent medium product. In this way, when the transparent medium product passes through the linear field of view of the imaging system, the target image of the transparent medium product on the target foreign matter detection layer can be obtained.
[0032] Step 103 : when there is an image different from the image background of the target image on 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 different from the image background on the target image. If there is, it means 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 different from the image background on the target image, a depth recognition model, gray value calculation, etc. can be used, which is not limited here.
[0034] In addition, if you want to perform foreign body detection on other preset foreign body detection layers, you can re-determine the target foreign body detection layer from the other preset foreign body detection layers and re-execute the above steps. Through the above steps, you can perform foreign body detection on any preset foreign body detection layer.
[0035] By applying the technical solution of this embodiment, before taking a picture of a transparent medium product, the position of the imaging system and the linear laser can be adjusted. Specifically, the linear spot of the adjusted linear laser can be made to coincide with the linear field of view of the imaging system, and the overlapping area can be located at the target foreign body detection layer, so as to ensure that the linear spot of the linear laser only illuminates the target foreign body detection layer, while the remaining preset foreign body detection layers are not illuminated. After the position of the imaging system and the linear laser is adjusted to meet the above conditions, the position of the imaging system and the linear laser can be fixed. Afterwards, when the picture taking instruction is received, the linear laser can be controlled to emit a laser beam, and the imaging system can be controlled to take a picture of the moving transparent medium product. In this way, after the transparent medium product passes through the linear field of view of the imaging system, the target image of the transparent medium product on the target foreign body detection layer can be obtained. After obtaining the target image of the transparent medium product, the target image can be further analyzed to determine whether there is an image different from the image background on the target image. If there is, it means that the corresponding transparent medium product has foreign matter on the target foreign body detection layer. The embodiment of the present application uses a linear laser in combination with a linear array camera to achieve high imaging efficiency and good stability. A linear laser is used and the linear light spot of the linear laser is controlled to illuminate only the target foreign matter detection layer. Since the light spot width of the linear laser can be achieved at the micron level, the accuracy of layered detection can be greatly improved. By setting a line scan lens to only receive the scattered light of foreign matter and using the dark field imaging method, the contrast of subsequent foreign matter imaging is high, thereby improving the accuracy of foreign matter detection.
[0036] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another foreign body detection method for transparent medium products is provided, such as Figure 3 As shown, the method includes:
[0037] Step 201, 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 an imaging system and a position of 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 overlapping area is located at the target foreign matter detection layer, wherein the imaging system includes a line scanning lens, and the line scanning lens is used to receive scattered light of foreign matter.
[0038] In an embodiment of the present application, optionally, the “adjusting the imaging system and the position of the linear laser according to the target foreign body 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 at the target foreign body detection layer” includes: adjusting the imaging system to a focus 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 focus mode until the imaging clarity is greater than the target clarity, and fixing the imaging system, wherein the target mark is located at the target foreign body detection layer. The linear laser is adjusted according to the second direction, and the imaging system is controlled to image the target mark in a focus mode until the brightness value of the target mark in the imaging is greater than the target brightness value, and the linear laser is fixed; accordingly, after "fixing the linear laser", the method further includes: adjusting the imaging system to a capture mode.
[0039] In this embodiment, the second direction is preset as the traveling direction of the transparent medium product, that is, the direction in which the transparent medium product moves on the production line or the detection line; the third direction is a direction on the plane where the target foreign matter detection layer is located and perpendicular to the traveling direction; the first direction is a direction perpendicular to both directions. First, the imaging system is set to focus mode. Focus mode is a special working 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 on the target foreign matter detection layer is adjusted along the first direction. By continuously adjusting the distance and calculating the imaging clarity, the adjustment is stopped until the imaging clarity is greater than the preset target clarity, and the imaging system is fixed at this position. Through this step, the optimal distance between the imaging system and the target mark can be found to maximize the imaging clarity.
[0040] After the imaging system is fixed, the position of the linear laser is adjusted next. The linear laser is used to project a laser line on the target mark to enhance the imaging effect. Specifically, the linear laser is adjusted according to the second direction. By calculating the brightness value of the target mark in the imaging, and continuously adjusting the position of the linear laser, the linear laser stops moving when the brightness value is greater than the preset target brightness value, and the linear laser is fixed at this position. Through this step, the best laser projection position can be found to maximize the brightness value of the target mark in the imaging.
[0041] It should be noted that in order to make the linear light spot illuminate only the target foreign body detection layer, the width of the linear light spot can be limited so that the width of the linear light spot between the target foreign body detection layer and any adjacent preset foreign body detection layer is smaller than the distance between the target foreign body detection layer and any adjacent preset foreign body detection layer. In this way, a suitable linear laser can be selected. In addition, the traveling direction of the transparent medium product can be set perpendicular to the long side direction of the linear field of view of the imaging system, so that the imaging efficiency of the imaging system is higher.
[0042] Through the above adjustment process, the embodiment of the present application can ensure that the imaging system can clearly capture the image of the target mark in the focus mode, which is very important for subsequent foreign body detection and quality control. At the same time, the accurate position of the linear laser also ensures that the laser line can be accurately projected on the target mark, improving the brightness of the foreign body imaging, thereby improving the accuracy of foreign body detection.
[0043] Specifically, the imaging system may be located above the transparent medium product to be inspected, and the linear laser is incident on the transparent medium product at a certain angle. Figure 4 The figure shows a relative position between the imaging system, the linear laser and the transparent medium product. Figure 4 As shown, the imaging system consists of a line scan lens 2 and a linear array camera 3. The illumination of the imaging system is provided by a special linear laser 1. The special linear laser 1 has the characteristics of narrow line width and high power, and can evenly illuminate a field of view with a width of 100 mm. The linear laser 1 is located above the target detection area, and the angle with the first direction (that is, the Z-axis direction in the figure) is 45°. The imaging system composed of the line scan lens 2 and the linear array camera 3 is located directly above the target detection area, and the angle with the first direction is 0. Assuming that the target foreign body detection layer is layer B, after setting the initial position of the imaging system and the linear laser, the position of the imaging system can be adjusted according to the first direction, facing the center of the camera position and focusing on the target mark of layer B clearly, and the position of the imaging system is fixed at this time. Then, the position of the linear laser 1 is adjusted along the second direction (that is, the X-axis direction in the figure) until the target mark of layer B becomes bright. At this time, 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. Then, when there is no foreign matter in layer B, the entire target image is a uniform dark field with a very low grayscale value; if there is a foreign matter in layer B, the foreign matter will be diffusely reflected, and a part of the reflected light will be captured by the line scanning lens 2 and imaged in the linear array camera 3. The grayscale value of the foreign matter in the image is very high and the image is obvious. At the same time, foreign matter in other layers, such as foreign matter in layer A or layer C, cannot be illuminated, so it will not be imaged in the target image, achieving the purpose of layered imaging of foreign matter. Similarly, when the overlapping area of the linear laser and the linear field of view is located in layer A or layer C, foreign matter 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 receiving an image acquisition instruction, controlling the linear laser to send a laser beam, and controlling the imaging system to acquire an image of the moving transparent medium product, to obtain a target image of the transparent medium product on the target foreign matter detection layer.
[0045] Step 203, grayscale processing is performed on the target image, and the grayscale value corresponding to each pixel in the grayscale processed target image is identified, and the number of pixels corresponding to each grayscale value is counted, and the grayscale threshold is determined according to the grayscale value with the largest number of corresponding pixels.
[0046] Step 204, determining whether there are pixels with grayscale values greater than the grayscale threshold in the target image after the grayscale processing, and when the determination result is yes, determining that there is an image background different from the target image on the target image.
[0047] In this embodiment, after obtaining the target image, the target image is grayed. Graying is the process of converting a color image into a gray image. Each pixel in the gray image has only one brightness value, usually ranging from 0 (black) to 255 (white), and this value represents the gray level of the pixel. Graying can simplify image data and facilitate subsequent processing. Then, from the target image after graying, the gray value corresponding to each pixel is identified, and the number of pixels in which each gray value appears in the entire target image is counted to determine which gray values dominate the target image. Afterwards, according to the statistical results, the gray value with the largest number of corresponding pixels is selected, and the gray threshold is determined based on the gray value. The gray value with the largest number of pixels represents the main gray level of the image background, because for foreign body detection, the image background in the target image often occupies most of the target image area. The gray threshold is used to detect whether there is a foreign body in the target image. Under the irradiation of the linear laser, the grayscale value corresponding to the foreign matter in the target image is often much greater than the grayscale value of the image background. Therefore, after determining the grayscale value with the largest number of pixels, a certain value can be added based on this grayscale value to finally obtain the grayscale threshold. Here, the added value can be determined based on experience or sample images.
[0048] After determining the grayscale threshold, further, traverse each pixel in the grayscale processed target image to determine whether its grayscale value is greater than the grayscale threshold determined previously. If there are pixels whose grayscale values are greater than the grayscale threshold, it means that these pixels do not belong to the image background, so it can be inferred that there are other images different from the image background on the target image, and at this time it is determined that there are foreign objects on the target image. The embodiment of the present application can effectively identify the images different from the image background in the target image, and it is simple and convenient.
[0049] Step 205 : When an image different from the image background of the target image exists on the target image, it is determined that a foreign object exists on the target foreign object detection layer of the transparent medium product.
[0050] In an embodiment of the present application, optionally, the "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 a focus mode until the imaging clarity is greater than the target clarity, and fixing the imaging system" includes: gradually 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 focus mode to obtain a first imaging image, graying the first imaging image, calculating the imaging clarity of the first imaging image after graying using a preset clarity evaluation algorithm, and fixing the imaging system when the imaging clarity is greater than the target clarity.
[0051] In this embodiment, a first preset distance interval is pre-set, and the interval is a fixed value used each time the distance between the imaging system and the target mark is adjusted. When the imaging system is adjusted in position, it is performed along the first direction, and each time the position is adjusted, the imaging system is controlled to image the target mark once in the focus mode to obtain a first imaging image. Then, the first imaging image obtained by each imaging is grayed. The grayed first imaging image is calculated using a preset clarity evaluation algorithm to obtain the imaging clarity of the image. The preset clarity evaluation algorithm can be an algorithm that evaluates the clarity of an image by 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., which are not limited here. After the imaging clarity is calculated each time, it is compared with the target clarity. Here, the target clarity is a preset clarity threshold, which represents the standard of the minimum clarity expected to be achieved. After comparison, if it is found that the current imaging clarity is greater than the target clarity, it is considered that a suitable imaging position has been found, and the imaging system is fixed at the current position without further adjustment; if the current imaging clarity is less than or equal to the target clarity, the position of the imaging system is adjusted along the first direction according to the first preset distance interval, and the above imaging, grayscale processing and clarity evaluation process are repeated until a suitable position is found. The embodiment of the present application gradually adjusts the position of the imaging system to find the optimal imaging distance that enables the imaging system to clearly image the target mark in the focus mode, which is of great significance for subsequent foreign body detection and image analysis; through the combined use of grayscale processing and clarity evaluation algorithm, the clarity of the image can be objectively and accurately evaluated, thereby ensuring that the imaging system can work stably and reliably.
[0052] In an embodiment of the present application, optionally, the "adjusting the linear laser according to the second direction, and controlling the imaging system to image the target mark in the focus mode until the brightness value of the target mark in the imaging is greater than the target brightness value, and fixing the linear laser" includes: gradually 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 the focus mode to obtain a second imaging image, identifying the target mark from the second imaging image, and calculating the average brightness value corresponding to the target mark, and when the average brightness value is greater than the target brightness value, fixing the linear laser.
[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 the position of the linear laser is adjusted, the position of the mobile 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 the focus mode to obtain a second imaging image. For the second imaging image obtained each time, image processing technology (such as edge detection, template matching, etc.) is 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 accordingly. The average brightness value can be obtained by summing the brightness values of all pixels in the target mark area and then dividing it by the total number of pixels. After the average brightness value is calculated each time, it is compared with the target brightness value. The target brightness value can be a preset brightness threshold value, representing the minimum brightness standard expected to be achieved. If the current average brightness value is found to be greater than the target brightness value after comparison, it is considered that a suitable lighting position has been found, and the linear laser is fixed at the current position without further movement; if the current average brightness value is less than or equal to the target brightness value, the position of the linear laser continues to be moved along the second direction at a preset distance interval, and the above-mentioned imaging, target mark recognition and brightness calculation process are repeated until a suitable position is found. The embodiment of the present application gradually adjusts the position of the linear laser to find the optimal lighting position that makes the target mark have sufficient brightness in the second imaging image, thereby facilitating the improvement of the accuracy of foreign body detection; by calculating the average brightness value of the target mark and comparing it with the target brightness value, it is possible to objectively and accurately evaluate whether the current lighting conditions meet the requirements, thereby ensuring that the imaging system can work stably and reliably.
[0054] In an embodiment of the present application, optionally, the transparent medium product is placed on a linear motion device; before the "adjusting the imaging system and the position of the linear laser according to the target foreign matter detection layer", the method also 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 matter detection layers, each preset foreign matter detection layer of the preset calibration fixture corresponds to a preset mark, and the preset mark forms scattered light under the irradiation of the laser beam, and the target detection area is the area corresponding to the linear field of view of the imaging system on the linear motion device; the preset mark corresponding to the target foreign matter detection layer is determined from the multiple preset marks of the preset calibration fixture as the target mark.
[0055] In this embodiment, the device that drives the transparent medium product to move can be a linear moving device. In the process of adjusting the position of the imaging system and the linear laser, a preset calibration fixture can be used. The preset calibration fixture is a calibration tool made of the same transparent medium material as the transparent medium product to be detected. It includes multiple preset foreign matter detection layers, each of which is designed with a specific preset mark, which can be used to represent foreign matter appearing in the transparent medium product. The preset calibration fixture can be designed according to the transparent medium product to be detected and the detection requirements. For example, if the transparent medium product to be detected needs to test three layers A, B, and C, then the preset calibration fixture is also designed into three layers, and the preset calibration fixture layer A has a preset mark 1, the B layer has a preset mark 2, and the C layer has a preset mark 3, and the thickness of the preset calibration fixture is consistent with the transparent medium product to be detected, and the position distance of each layer of the preset mark in the third direction is completely consistent with the layer required by the transparent medium product to be detected, such as the distance from the B layer of the transparent medium product to be detected to the upper surface is exactly the same as the distance from the preset mark 2 of the B layer 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 the focus mode, first, a preset calibration jig can be placed in the target detection area on the linear motion device. Here, the target detection area is the corresponding part of the linear field of view of the imaging system on the linear motion device. Then, among the multiple preset marks of the preset calibration jig, find the preset mark corresponding to the target foreign matter detection layer as the target mark. After the preset calibration jig is placed and the target mark is determined, the position of the imaging system and the linear laser can be adjusted according to the target mark. The embodiment of the present application can effectively improve the efficiency and accuracy of debugging by using a preset calibration jig to calibrate the position of the imaging system and the linear laser.
[0057] Alternatively, if Figure 5As shown, a preset calibration fixture provided in an embodiment of the present application is shown. Figure 5 The preset calibration fixture shown includes three preset foreign body detection layers, namely, layer A, layer B and layer C, wherein the preset mark corresponding to layer A is mark 1, the preset mark corresponding to layer B is mark 2, and the preset mark corresponding to layer C is mark 3. When the preset calibration fixture is placed on the linear motion device, layer C of the preset calibration fixture can be placed on the linear motion device, and the long side direction of the preset mark is consistent with the first direction. Figure 4 As shown, a schematic diagram of placing a preset calibration fixture 4 on a linear motion device 5 is shown. Assuming that the target foreign body detection layer is layer B, after placing the preset calibration fixture on the linear motion device, the position of the imaging system and the linear laser can be adjusted according to the mark 2 of layer B, so that the overlapping area of the linear field of view of the imaging system and the linear spot of the linear laser are located in layer B, and the image of the mark 2 in the imaging system (only along the Y axis, that is, a small part of the third direction) is clear and very bright. In addition, the linear motion device can be turned on to move the preset calibration fixture along the first direction, so that the imaging effect of the entire mark 2 in the imaging system can be detected, so that the position of the imaging system and the linear laser can be made more accurate.
[0058] In an embodiment of the present application, optionally, the transparent medium product includes multiple 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: judging whether there are pixels with grayscale values greater than the stored grayscale threshold in the target image after the grayscale processing, and when the judgment result is that there are pixels, determining that there is imaging of the image background different from the target image on the target image.
[0059] In this embodiment, the transparent medium products to be detected may include multiple ones, and these transparent medium products are placed on the linear motion device in sequence, and the target foreign matter detection layers of the multiple transparent medium products are imaged in sequence by the imaging system. 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. Afterwards, the grayscale threshold can be directly stored. In the same environment and at almost the same detection time, the grayscale value difference of the image background of the target images of different transparent medium products can be almost ignored. Therefore, the grayscale threshold only needs to be calculated once for the first transparent medium product, and the grayscale threshold can be directly used for judgment for the remaining transparent medium products in the future, which can greatly improve the foreign matter detection efficiency of transparent medium products. Therefore, for other transparent medium products, the captured target image can be grayscaled, and the grayscale value corresponding to each pixel in the grayscaled target image can be identified. Then, it is directly determined based on the pre-stored grayscale threshold whether there are pixels in the grayscaled target image with a grayscale value greater than the stored grayscale threshold. When the judgment result is that foreign matter exists, it is determined that there is foreign matter on the target foreign matter detection layer of the target image.
[0060] In an embodiment of the present application, optionally, after "determining that there is imaging on the target image that is different from the image background of the target image", the method also includes: extracting target pixels whose grayscale values are greater than a grayscale threshold from the target image, and obtaining a foreign object image to be identified based on the target pixels through a region growing algorithm; inputting the foreign object image to be identified into a foreign object recognition model, extracting shape features, size features, texture features and grayscale features of the foreign object image to be identified through the foreign object recognition model, and performing feature fusion on the shape features, size features, texture features and grayscale features to obtain fused features, and obtaining the type of foreign object corresponding to the foreign object image to be identified based on the fused features.
[0061] In this embodiment, after determining that there is imaging different from the image background in the target image, the type of foreign matter can be further identified. First, the target pixels whose grayscale values are greater than the grayscale threshold extracted from the target image can be preliminarily screened out in this way. Then, the foreign matter image to be identified is further obtained based on these target pixels using the region growing algorithm. The region growing algorithm is an image segmentation method based on pixel similarity. It starts with a set of seed points (here, the target pixels) and adds the surrounding pixels similar to the seed points (based on grayscale, color, texture and other attributes) to the corresponding region until no more qualified pixels can be added. In this way, the region where the target pixel is located can be completely extracted to form a foreign matter image to be identified. After that, the foreign matter image to be identified can be input into the foreign matter identification model. Here, the foreign matter identification model can be a classifier based on machine learning or deep learning, which can perform feature extraction on the input foreign matter image to be identified. Specifically, the foreign matter identification model can extract the shape features, size features, texture features and grayscale features of the foreign matter image to be identified respectively. These features jointly describe the appearance and properties of the foreign matter, which is the key to the subsequent identification of the type of foreign matter. After extracting each feature, these features can be fused to obtain fused features. Here, feature fusion can be achieved through a variety of methods, such as simple splicing, weighted summation, principal component analysis (PCA), etc. The fused feature contains information on shape, size, texture, grayscale, etc., which can more comprehensively reflect the characteristics of foreign objects. Finally, based on the fused features, the foreign object recognition model is used to identify the type of foreign object image to be identified. Specifically, the foreign object recognition model can determine which type of foreign object the currently input foreign object image to be identified belongs to based on the learned knowledge, and output the corresponding recognition result.
[0062] It should be noted that the foreign body recognition model in this application is trained by various image samples with foreign bodies, such as hair, dust, dirt, water vapor, etc. The foreign body recognition model trained in this way can better identify the types of foreign bodies in the target image.
[0063] In an embodiment of the present application, optionally, the method further includes: detecting a moving transparent medium product by means of a preset sensor, and generating a mapping instruction when it is detected that the transparent medium product begins to enter the linear field of view of the imaging system, and generating an end instruction when it is detected that the transparent medium product leaves the linear field of view of the imaging system; accordingly, the method further includes: when the end instruction is received, controlling the imaging system to end mapping, and controlling the light source of the linear laser to turn off.
[0064] In this embodiment, the preset sensor is used to monitor the transparent medium product in motion. Here, the preset sensor can be various types of sensors, such as photoelectric sensors, laser ranging sensors or video image sensors. The preset sensor is set at an appropriate position so as to detect when the transparent medium product enters the linear field of view of the imaging system. Specifically, the preset sensor can be used to detect the first edge of the transparent medium product. When the first edge of the transparent medium product is detected to enter the linear field of view of the imaging system, a map acquisition instruction is generated. After receiving the map acquisition instruction, the linear laser starts to irradiate, and the imaging system starts to work, and the imaging system is used to capture the transparent medium product. In addition, when the preset sensor further detects that the transparent medium product has left the linear field of view, it is considered that the map acquisition is completed. At this time, an end instruction can be generated, and the imaging system can be controlled to end the map acquisition through the end instruction, and the linear laser can be controlled to turn off the power. In the embodiment of the present application, the power of the linear laser is controlled by the preset sensor, and the image acquisition of the imaging system is controlled. The whole process realizes the closed-loop management of automatic detection, image acquisition and end control of the transparent medium product in motion, improves the detection efficiency and accuracy, and reduces the need for manual intervention.
[0065] In an embodiment of the present application, optionally, the method also includes: when the time interval for not receiving the image collection instruction is greater than a preset interval, analyzing the detection pass rate corresponding to the target foreign matter detection layer; when the detection pass rate is less than the preset pass rate, based on the type of foreign matter corresponding to the transparent medium product, generating processing guidance data corresponding to the transparent medium product.
[0066] In this embodiment, the time interval during which no image acquisition instruction is received can also be continuously monitored. This time interval refers to the length of time from the time 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 instruction) to the current time point when no new transparent medium product enters the field of view. If this time interval exceeds the preset interval, it is considered that the current batch of transparent medium products has been completely detected on the target foreign matter detection layer. Next, the detection pass rate corresponding to the target foreign matter detection layer can be analyzed. If the detection pass rate is less than the preset pass rate, it means that there may be problems with the processing of this batch of transparent medium products. In this case, the target image of the transparent medium product with foreign matter can be further analyzed to determine the type of foreign matter. Afterwards, according to the type of foreign matter corresponding to the transparent medium product, processing guidance data for the transparent medium product is generated. Specifically, the processing guidance data may include: recommending adjustment of certain parameters or process steps of the processing production line to reduce the possibility of foreign matter; providing specific cleaning, inspection or repair guidelines to ensure the quality of transparent medium products, etc. The embodiment of the present application provides an effective mechanism for the automated inspection system to deal with abnormal situations and ensure the quality of transparent medium products by monitoring the time intervals in which image acquisition instructions are not received, analyzing the inspection pass rate and generating processing guidance data, thereby helping to discover and solve problems in a timely manner, reduce the production of unqualified products and improve product quality.
[0067] In an embodiment of the present application, optionally, after "when the detection pass rate is less than a preset pass rate", the method further includes: determining whether, in each target image, there are greater than a preset number of consecutive target images in which the same foreign body image exists, wherein the imaging position and imaging shape of the same foreign body image in each of the target images are the same; when the judgment result is yes, determining the processing production line fault corresponding to the transparent medium product through big data analysis technology according to the type of foreign body corresponding to the same foreign body image and the target foreign body detection layer.
[0068] In this embodiment, by comparing continuous target images, it is detected whether the same foreign body image appears in more than a preset number of continuous target images. Here, a preset number can be set in advance to determine whether a sufficient number of the same foreign body images appear in continuous target images. The preset number can be set according to actual needs to balance the sensitivity and false alarm rate of detection. The same foreign body image refers to a foreign body image with the same imaging position and imaging shape that appears in different target images. When the judgment result is yes, it is confirmed that the same foreign body image appears in multiple continuous target images. Next, according to the type of foreign body corresponding to the same foreign body image and the target foreign body detection layer, the possible reasons for the repeated appearance of the same foreign body image can be analyzed through big data analysis technology. Finally, according to the reasons obtained by the analysis, it is determined whether there is a fault in the processing production line of the transparent medium product.
[0069] Specifically, the processing line failure can be judged by combining big data analysis technology in the following manner. First, according to the data such as the type of foreign matter, the position in the target image, the detection time, etc. corresponding to the same foreign matter imaging, and the corresponding equipment status, operation records, production parameters, etc. when the processing line processes the transparent medium product, the target data is integrated. Then, for the type of foreign matter, the equipment status of the processing line, etc., the data can be converted into numerical codes, etc., to facilitate subsequent further operations. After that, through big data analysis technology, multiple historical sample data corresponding to each processing line failure are obtained, and each historical sample data can also include the foreign matter contained in the sample image, the position of the foreign matter in the sample image, the detection time, the equipment status of the processing line when processing the transparent medium product corresponding to the sample image, the operation records, the production parameters, etc. The multiple historical sample data of each processing line failure are clustered separately, for example, using K-means clustering, specifying the number of clusters as 1, then the cluster center output by K-means clustering is the cluster center of the multiple historical sample data of this processing line failure. After obtaining the cluster center corresponding to each processing line fault, the Euclidean distance between the above target data and the cluster center corresponding to each processing line fault can be calculated to obtain the distance value, and then the processing line fault corresponding to the cluster center with the smallest distance value is used as the processing line fault corresponding to the transparent medium product. The embodiment of the present application integrates a variety of data sources, including foreign body imaging data, equipment status of the processing line, operation records, production parameters, etc., to form a comprehensive data set. This data integration helps to more comprehensively understand the operation of the processing line, so as to more accurately judge the fault; the K-means clustering method is used to cluster the historical sample data corresponding to each processing line fault, so that the cluster center of each processing line fault can be found more scientifically, making the identification of the current processing line fault more accurate; in addition, it also makes full use of the intelligent and automated characteristics of big data analysis technology, reduces the subjectivity of manual judgment, and improves the accuracy and reliability of processing line fault judgment.
[0070] In an embodiment of the present application, optionally, an electronic tag is affixed to the transparent medium product, and a unique identifier is attached to the electronic tag, and an electronic tag reader is installed on the back side of the target detection area on the linear motion device; the method also includes: when the image acquisition instruction is received, the label information of the electronic tag is read by the electronic tag reader, the unique identifier is identified from the label information, and after the target image is obtained, the unique identifier is marked on the target image.
[0071] In this embodiment, an electronic tag may be attached to the transparent medium product to be detected. These electronic tags are usually of small size and durability, and can be attached to the surface of the product without affecting its transparency and function. Each electronic tag is accompanied by a unique identifier (such as a serial number, product ID, etc.), which is an important identifier of the transparent medium product and is used to uniquely identify each transparent medium product during production, tracking and management. In addition, an electronic tag reader-writer may be installed on the back side of the target detection area on the linear motion device, and the electronic tag reader-writer can read the label information on the transparent medium product when the transparent medium product passes through the target detection area. Specifically, when receiving a map acquisition instruction, the electronic tag reader-writer is activated and reads the label information of the electronic tag attached to the transparent medium product, identifies the unique identifier of the transparent medium product from the label information, and associates the unique identifier with the target image after acquisition. In this way, each target image can establish a clear connection with its corresponding transparent medium product. In the embodiment of the present application, when there is a foreign body in the target foreign body detection layer of a certain transparent medium product, the transparent medium product can be easily tracked, and the specific production batch and product information can be quickly located.
[0072] Further, as Figure 1 In the specific implementation of the method, the embodiment of the present application provides a foreign body detection device for a transparent medium product, such as Figure 6 As shown, the device comprises:
[0073] A position adjustment module, used 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 position of an imaging system and a linear laser according to the target foreign matter detection layer, so that the linear 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 includes a line scanning lens, and the line scanning lens is used to receive scattered light of foreign matter;
[0074] A mapping module, configured to control the linear laser to send a laser beam and control the imaging system to map the traveling transparent medium product to obtain a target image of the transparent medium product on the target foreign matter detection layer when receiving a mapping instruction;
[0075] The foreign matter judging module is used to determine that a foreign matter exists on the target foreign matter detecting layer of the transparent medium product when an image different from the image background of the target image exists on the target image.
[0076] Optionally, the position adjustment module is used to:
[0077] The imaging system is adjusted to a focus mode, the distance between the imaging system and the target mark is adjusted according to a first direction, and the imaging system is controlled to image the target mark in the focus mode until the imaging clarity is greater than the target clarity, and the imaging system is fixed, wherein the target mark is located in the plane where the target foreign matter detection layer is located, the second direction is the moving direction of the transparent medium product, the third direction is a direction on the plane where the target foreign matter detection layer is located and perpendicular to the second direction, and the first direction is a direction perpendicular to both the second direction and the third direction;
[0078] Adjusting the linear laser according to the second direction, and controlling the imaging system to image the target mark in a focus mode until the brightness value of the target mark in the imaging is greater than the target brightness value, and fixing the linear laser;
[0079] Accordingly, the device further comprises:
[0080] The mode adjustment module is used to adjust the imaging system to an image acquisition mode after the linear laser is fixed.
[0081] Optionally, the position adjustment module is further used to:
[0082] According to a first preset distance interval, the distance between the imaging system and the target mark is gradually adjusted along the first direction, and after each adjustment, the imaging system is controlled to image the target mark in a focus mode to obtain a first imaging image, the first imaging image is gray-scaled, and the imaging clarity of the first imaging image after gray-scaled processing is calculated using a preset clarity evaluation algorithm, and when the imaging clarity is greater than the target clarity, the imaging system is fixed.
[0083] Optionally, the position adjustment module is further used to:
[0084] The linear laser is gradually moved along the second direction at a second preset distance interval, and after each movement, the imaging system is controlled to image the target mark in a focus mode to obtain a second imaging image, the target mark is identified from the second imaging image, and an average brightness value corresponding to the target mark is calculated, and 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 comprises:
[0086] a placement module, used for placing a preset calibration jig in a target detection area on the linear motion device before controlling the imaging system to image the target mark in a focus mode, 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, and the preset mark forms scattered light under the irradiation of the laser beam, and the target detection area is an area corresponding to the linear field of view of the imaging system on the linear motion device;
[0087] The mark determination module is used to determine the preset mark corresponding to the target foreign matter detection layer from the multiple preset marks of the preset calibration fixture as the target mark.
[0088] Optionally, the device further comprises:
[0089] A grayscale processing module is used for performing grayscale processing on the target image of the transparent medium product on the target foreign matter detection layer after obtaining the target image, identifying the grayscale value corresponding to each pixel in the grayscale processed target image, and counting the number of pixels corresponding to each grayscale value, and determining the grayscale threshold according to the grayscale value with the largest number of corresponding pixels;
[0090] The pixel point judgment module is used to judge whether there are pixels with grayscale values greater than the grayscale threshold in the target image after the grayscale processing, and when the judgment result is yes, determine that there is imaging of the image background different from the target image on the target image.
[0091] Optionally, the transparent medium product includes a plurality of;
[0092] For the first transparent medium product, the device further comprises:
[0093] A storage module, used for storing the grayscale threshold after the grayscale threshold is determined;
[0094] For non-first transparent medium product, the pixel point determination module is further used for:
[0095] After identifying the grayscale value corresponding to each pixel, it is determined whether there is a pixel point with a grayscale value greater than a stored grayscale threshold in the target image after the grayscale processing, and when the judgment result is that it exists, it is determined that there is an imaging of an image background different from the target image on the target image.
[0096] Optionally, the device further comprises:
[0097] An extraction module, for extracting target pixels whose grayscale values are greater than a grayscale threshold from the target image after determining that there is an image background different from the target image on the target image, and obtaining a foreign body image to be identified based on the target pixels through a region growing algorithm;
[0098] The foreign body type recognition module is used to input the foreign body image to be identified into the foreign body recognition model, respectively extract the shape features, size features, texture features and grayscale features of the foreign body image to be identified through the foreign body recognition model, and perform feature fusion on the shape features, size features, texture features and grayscale features to obtain fusion features, and obtain the foreign body type corresponding to the foreign body image to be identified based on the fusion features.
[0099] Optionally, the device further comprises:
[0100] An instruction generation module is used to detect the traveling transparent medium product through a preset sensor, and generate a picture acquisition instruction when it is detected that the transparent medium product begins 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;
[0101] Accordingly, the device further comprises:
[0102] The instruction receiving module is used to control the imaging system to end image acquisition and control the light source of the linear laser to turn off when receiving the end instruction.
[0103] Optionally, the device further comprises:
[0104] A detection qualification rate analysis module, used for analyzing the detection qualification rate corresponding to the target foreign body detection layer when the time interval during which the image acquisition instruction is not received is greater than a preset interval;
[0105] The processing guidance data generating 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 detection qualified rate is less than the preset qualified rate.
[0106] Optionally, the device further comprises:
[0107] An imaging judgment module, used for judging whether, in each target image, there are more than a preset number of consecutive target images with the same foreign body image, when the detection qualified rate is less than a preset qualified rate, wherein the imaging position and imaging shape of the same foreign body image in each of the target images are the same;
[0108] The production line fault determination module is used to determine the processing production line fault corresponding to the transparent medium product based on the type of foreign matter corresponding to the same foreign matter imaging and the target foreign matter detection layer through big data analysis technology when the judgment result is yes.
[0109] Optionally, the transparent medium product is attached with an electronic tag, the electronic tag is accompanied by 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 device also includes:
[0110] The identification recognition module is used to read the label information of the electronic label through the electronic label reader when receiving the image acquisition instruction, identify the unique identification from the label information, and mark the unique identification on the target image after obtaining the target image.
[0111] It should be noted that for other corresponding descriptions of the functional units involved in the foreign body detection device for a transparent medium product provided in the embodiment of the present application, reference can be made to Figures 1 to 5 The corresponding description in the method will not be repeated here.
[0112] The present application also provides a computer device, which may be a personal computer, a server, a network device, etc. Figure 7 As shown, the computer device includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.
[0113] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0114] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0115] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[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, stored data, displayed data, 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 can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0118] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for detecting foreign matter in a transparent medium product, characterized in that: include: 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 position of an imaging system and a linear laser according to the target foreign matter detection layer, so that the linear 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, and the line scanning lens is used to receive scattered light of foreign matter; When receiving a map acquisition instruction, controlling the linear laser to send a laser beam, and controlling the imaging system to acquire a map of the traveling transparent medium product, so as to obtain a target image of the transparent medium product on the target foreign matter detection layer; When an image different from the image background of the target image exists on the target image, it is determined that a foreign object exists on the target foreign object detection layer of the transparent medium product.
2. The method according to claim 1, characterized in that The step of adjusting the position of the imaging system and the linear laser according to the target foreign body detection layer so that the linear spot of the linear laser overlaps with the linear field of view of the imaging system, and the overlapping area is located at the target foreign body detection layer, comprises: The imaging system is adjusted to a focus mode, the distance between the imaging system and the target mark is adjusted according to a first direction, and the imaging system is controlled to image the target mark in the focus mode until the imaging clarity is greater than the target clarity, and the imaging system is fixed, wherein the target mark is located in the plane where the target foreign matter detection layer is located, the second direction is the moving direction of the transparent medium product, the third direction is a direction on the plane where the target foreign matter detection layer is located and perpendicular to the second direction, and the first direction is a direction perpendicular to both the second direction and the third direction; Adjusting the linear laser according to the second direction, and controlling the imaging system to image the target mark in a focus mode until the brightness value of the target mark in the imaging is greater than the target brightness value, and fixing the linear laser; Correspondingly, after fixing the linear laser, the method further comprises: The imaging system is adjusted to an image acquisition mode.
3. The method according to claim 2, characterized in that 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 a focus mode until the imaging clarity is greater than the target clarity, and fixing the imaging system comprises: According to a first preset distance interval, the distance between the imaging system and the target mark is gradually adjusted along the first direction, and after each adjustment, the imaging system is controlled to image the target mark in a focus mode to obtain a first imaging image, the first imaging image is gray-scaled, and the imaging clarity of the first imaging image after gray-scaled processing is calculated using a preset clarity evaluation algorithm, and when the imaging clarity is greater than the target clarity, the imaging system is fixed.
4. The method according to claim 2 or 3, characterized in that: The step of adjusting the linear laser according to the second direction and controlling the imaging system to image the target mark in a focus mode until the brightness value of the target mark in the imaging is greater than the target brightness value, and fixing the linear laser comprises: The linear laser is gradually adjusted along the second direction according to a second preset distance interval, and after each adjustment, the imaging system is controlled to image the target mark in a focus mode to obtain a second imaging image, the target mark is identified from the second imaging image, and an average brightness value corresponding to the target mark is calculated, and when the average brightness value is greater than the target brightness value, the linear laser is fixed.
5. The method according to claim 1, characterized in that The transparent medium product is placed on a linear motion device; before adjusting the position of the imaging system and the linear laser according to the target foreign matter detection layer, the method further includes: Placing a preset calibration jig in the target detection area on the linear motion device, wherein the preset calibration jig is a calibration tool made of the transparent medium and includes a plurality of preset foreign matter detection layers, each preset foreign matter detection layer of the preset calibration jig corresponds to a preset mark, and the preset mark forms scattered light under the irradiation of the laser beam, and the target detection area is the area corresponding to the linear field of view of the imaging system on the linear motion device; A preset mark corresponding to the target foreign matter detection layer is determined from a plurality of preset marks of the preset calibration fixture as the target mark.
6. The method according to claim 1, characterized in that After obtaining the target image of the transparent medium product on the target foreign matter detection layer, the method further includes: Grayscale 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 according to the grayscale value with the largest number of corresponding pixels; It is determined whether there are pixels whose grayscale values are greater than the grayscale threshold in the target image after the grayscale processing, and when the determination result is yes, it is determined that there is imaging of an image background different from the target image on the target image.
7. The method according to claim 6, characterized in that The transparent medium product comprises a plurality of; For the first transparent medium product, after determining the grayscale threshold, the method further includes: Storing the grayscale threshold; For a non-first transparent medium product, after identifying the grayscale value corresponding to each pixel, the method further includes: It is determined whether there are pixels whose grayscale values are greater than a stored grayscale threshold in the target image after the grayscale processing, and when the determination result is yes, it is determined that there is imaging of an image background different from the target image on the target image.
8. A foreign body detection device for a transparent medium product, characterized in that: include: A position adjustment module, used 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 position of an imaging system and a linear laser according to the target foreign matter detection layer, so that the linear 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 includes a line scanning lens, and the line scanning lens is used to receive scattered light of foreign matter; A mapping module, configured to control the linear laser to send a laser beam and control the imaging system to map the traveling transparent medium product to obtain a target image of the transparent medium product on the target foreign matter detection layer when receiving a mapping instruction; The foreign matter judging module is used to determine that a foreign matter exists on the target foreign matter detecting layer of the transparent medium product when an image different from the image background of the target image exists on the target image.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Flaky glass edge defect detection system based on image acquistion
CN110596127A
Defect detection method and device, optical imaging system, equipment and storage medium
CN113984791A
Line scan camera device, dimming method, electronic equipment and storage medium
CN115802137A
Line laser focusing method and device, optical equipment and storage medium
CN116088130A
Spectral imaging visual vibration measurement system and method based on line-plane camera combination
CN116952357A
Cited By
High-precision optical element laser lens control system and laser lens
CN120460390A
