A method, system and storage medium for visual detection of foreign matter in a light guide plate conveyor line
By using light sources with different light intensities and image processing technology in light guide plate foreign body detection, the problem of foreign bodies with grayscale values similar to the background being difficult to identify is solved, achieving more efficient and accurate foreign body detection.
Patent Information
- Application Number
- CN202511053591.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-30
AI Technical Summary
Existing light guide plate foreign body detection technology is difficult to accurately identify foreign bodies with grayscale values similar to the background due to interference from the external environment and defects in the light guide plate itself, resulting in reduced detection accuracy.
Light sources with different illumination intensities are used to capture images of the light guide plate. Through image preprocessing, segmentation processing and grayscale change extraction, the foreign matter information on the surface of the light guide plate is obtained, and the foreign matter is detected using grayscale changes.
The stability and reliability of light guide plate foreign body detection are improved, and foreign bodies with grayscale values similar to the background can be accurately identified, the interference of the external environment and light guide plate defects is reduced, and the detection efficiency and accuracy are improved.
Smart Images

Figure CN120563505B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of light guide plate foreign body detection, and in particular to a method, system and storage medium for visually detecting foreign bodies on a light guide plate conveyor line. Background Art
[0002] Light guide plate (LGP) foreign object detection technology utilizes various techniques and equipment to identify, locate, and analyze foreign matter on the LGP surface. As a crucial component of core display components, the optical performance of the LGP directly determines the visual quality of the display product. The presence of foreign matter can severely disrupt the LGP's light transmission and uniform distribution, leading to visual defects such as uneven brightness, flare, and streaks on the display, significantly reducing product quality and user experience.
[0003] Common light guide plate foreign body detection technologies include optical detection, machine vision detection, and laser detection. Existing foreign body detection technologies using machine vision often collect grayscale images of the light guide plate and perform detection by analyzing the grayscale values of the image. However, single grayscale image detection relies on the grayscale difference between the foreign body and the background. If the grayscale of the foreign body is close to that of the background, it is easy to miss the detection. In addition, in actual production environments, there may be interference factors such as ambient light fluctuations and subtle material unevenness on the surface of the light guide plate itself. These factors will affect the detection accuracy of a single grayscale image. For example, the patent application number CN109 Patent application 064451A discloses a method for detecting defects in light guide plates. This solution performs a series of image processing on a single grayscale image to obtain the grayscale difference between the defect and the background, thereby detecting the defect. If the grayscale value of the defect is close to that of the background, it is easy to miss the detection and is easily interfered by external factors. It may be difficult to accurately identify tiny foreign objects. Therefore, when the existing light guide plate foreign object detection technology detects foreign objects on the surface of the light guide plate through a grayscale image, it cannot accurately distinguish foreign objects with grayscale values similar to the grayscale image background under the interference of the external environment and the defects of the light guide plate itself. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems in the prior art to a certain extent, by performing image acquisition and processing on a light guide plate based on light sources with different illumination intensities to obtain a light guide plate image data set; performing image preprocessing on the light guide plate image data set and performing image segmentation processing to obtain a grid grayscale image data set; performing grayscale change extraction processing based on the grid grayscale image data set to obtain first grayscale change data; and detecting and judging foreign matter on the surface of the light guide plate based on the first grayscale change data; so as to solve the problem that the existing light guide plate foreign matter detection technology cannot accurately distinguish foreign matter with a grayscale value similar to the grayscale image background when detecting foreign matter on the surface of the light guide plate through a grayscale image under the interference of the external environment and the defects of the light guide plate itself.
[0005] To achieve the above objectives, in a first aspect, the present application provides a method for visually detecting foreign matter in a light guide plate conveyor line, comprising the following steps:
[0006] Perform image acquisition and processing on the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image dataset;
[0007] Performing image preprocessing and image segmentation on the light guide plate image dataset to obtain a grid grayscale image dataset;
[0008] Performing grayscale change extraction processing based on the grid grayscale image data set to obtain first grayscale change data;
[0009] Foreign matter on the surface of the light guide plate is detected and judged based on the first grayscale change data.
[0010] Furthermore, performing image acquisition and processing on the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image dataset includes the following sub-steps:
[0011] A group of light sources with evenly decreasing light intensity are installed directly above the light guide plate conveyor line. They are sorted from highest to lowest according to light intensity and are recorded as A1, A2, ..., An. The light intensity of light source A1 is set to E1 Lux, and the decreasing light intensity is E0 Lux.
[0012] An image acquisition device is installed on the side of the light sources A1, A2, ..., An. When the light guide plate is transported to the bottom of the light sources A1, A2, ..., An in sequence, the image acquisition device collects the images of the light guide plate under the light sources A1, A2, ..., An in sequence, and sorts them in the order of collection, which is recorded as the light guide plate image dataset.
[0013] Furthermore, performing image preprocessing and image segmentation processing on the light guide plate image dataset to obtain a grid grayscale image dataset includes the following sub-steps:
[0014] Record any light guide plate image in the light guide plate image data set as an original light guide plate image, divide the image area corresponding to the light guide plate in the original light guide plate image into light guide plate areas, remove the image area of the original light guide plate image that is not the light guide plate area, and rotate the remaining light guide plate area according to the geometric shape of the corresponding light guide plate so that the edge of the remaining light guide plate area is horizontal or vertical; after completion, a first light guide plate image is obtained, and the first light guide plate image is grayscaled to obtain a second light guide plate image;
[0015] Repeatedly obtain all second light guide plate images corresponding to the light guide plate image data set, and sort them according to the corresponding acquisition order, and record them as a light guide plate grayscale image set.
[0016] Furthermore, performing image preprocessing and image segmentation processing on the light guide plate image dataset to obtain a grid grayscale image dataset further includes the following sub-steps:
[0017] The second light guide plate images with odd arrangement numbers in the light guide plate grayscale image set are recorded as an odd grayscale image set, and the second light guide plate images with even arrangement numbers are recorded as an even grayscale image set;
[0018] Performing grayscale adjustment processing on all second light guide plate images in the even grayscale image set, and obtaining an even grayscale adjusted image set after completion;
[0019] The grayscale adjustment processing includes: for any second light guide plate image, recorded as the original grayscale image, calculating the average grayscale value M in the original grayscale image, and adjusting the grayscale value of each pixel in the original grayscale image through the grayscale adjustment formula to obtain a new grayscale value. The grayscale adjustment formula is as follows: V1(x, y)=V0(x, y)+k*(V0(x, y)-M), where V1 represents the new grayscale value obtained by adjusting the pixel point, V0 represents the original grayscale value of the pixel point, k is the set adjustment coefficient, and (x, y) represents the position coordinates of the pixel point in the original grayscale image; after completion, a grayscale adjusted image is obtained.
[0020] Furthermore, performing image preprocessing and image segmentation processing on the light guide plate image dataset to obtain a grid grayscale image dataset further includes the following sub-steps:
[0021] Merge the even grayscale adjusted image set and the odd grayscale image set, sort them according to the corresponding acquisition order, and record them as the light guide plate grayscale adjusted image set;
[0022] For any image in the light guide plate grayscale adjustment image set, it is recorded as the first grayscale adjustment image, the size of the divided grid unit is set to a*b, and the divided grid unit is used to grid the first grayscale adjustment image, and a grayscale grid image is obtained after completion; all corresponding grayscale grid images in the light guide plate grayscale adjustment image set are obtained and recorded as the grid grayscale image data set.
[0023] Furthermore, performing grayscale change extraction processing based on the grid grayscale image dataset to obtain first grayscale change data includes the following sub-steps:
[0024] For any grayscale grid image in the grid grayscale image dataset, the divided grids in the grayscale grid image are denoted as W1 to Wf in order from left to right and from top to bottom, and the range position information corresponding to the divided grids is recorded; for any divided grid from W1 to Wf, it is denoted as We, and the grayscale values of all pixels in We are arranged in order from small to large, which is denoted as the first grayscale sequence of We;
[0025] Set the first cropping ratio to T1%, extract the smallest grayscale value (1-T1) / 2% and the largest grayscale value (1-T1) / 2% in the first grayscale sequence We, and record them as the second grayscale sequence We; calculate the average value of the second grayscale sequence We, and record it as the reference grayscale value of We;
[0026] Repeatedly obtain the reference grayscale values of all divided grids in the grayscale grid image, and record the positions of the corresponding divided grids on the corresponding grayscale grid image as the reference grayscale information of the grayscale grid image;
[0027] The reference grayscale information of all grayscale grid images in the grid grayscale image dataset is repeatedly obtained and sorted according to the corresponding acquisition order, which is recorded as the first reference grayscale data.
[0028] Furthermore, performing grayscale change extraction processing based on the grid grayscale image dataset to obtain first grayscale change data further includes the following sub-steps:
[0029] Any reference grayscale value in the first reference grayscale data is denoted as H(i, j), where i represents the i-th grayscale grid image, and j represents the j-th subdivision grid in the i-th grayscale grid image; the difference between H(i, j) and the reference grayscale value H(i+1, j) of the corresponding subdivision grid in the next grayscale grid image is calculated according to the grayscale difference formula, and is denoted as the i-th reference difference value G(j, i) of the j-th subdivision grid. The grayscale difference formula is as follows: G(j, i)=H(i+1, j)-H(i, j);
[0030] Repeatedly obtain all reference difference values corresponding to all divided grids and record them as first grayscale change data.
[0031] Furthermore, detecting and judging foreign matter on the surface of the light guide plate based on the first grayscale change data includes the following sub-steps:
[0032] Obtain any reference difference value G(j, i) in the first grayscale change data, and arrange the reference difference values with the same value i from small to large, recording them as the i-th reference difference value sequence, and obtain all reference difference value sequences, record the maximum value of i, recorded as I0, and perform foreign body grid marking processing; obtain grayscale marking data;
[0033] The foreign body grid marking process includes: setting the second cropping ratio to T2%, removing the smallest T2% reference difference and the largest T2% reference difference in the i-th reference difference sequence, and calculating the average value and standard deviation of the remaining reference differences, which are recorded as Pi and Ri in order; judging all reference differences in the i-th reference difference sequence, if the reference difference satisfies G(j, i) < |Pi-v*Ri| or satisfies G(j, i) > |Pi+v*Ri|, then marking the reference difference that satisfies G(j, i) as an abnormal difference; if not, marking the reference difference that satisfies G(j, i) as a normal difference; where v is the proportional coefficient;
[0034] Set the abnormality threshold to T3, T3≤I0; obtain any reference difference G(j, i) in the grayscale mark data, and record the reference difference with the same j as the j-th grid difference sequence, and obtain all grid difference sequences; if the number of abnormal differences in the j-th grid reference difference sequence is greater than or equal to T3, then mark the corresponding j-th grid as a foreign object grid, otherwise mark the corresponding j-th grid as a normal grid; repeat the marking of all grid difference sequences to obtain the light guide plate foreign object data;
[0035] According to the light guide plate foreign matter data of the light guide plate, if there is a foreign matter grid in the light guide plate foreign matter data, it is output that there is a foreign matter in the light guide plate, and the range position information corresponding to the foreign matter grid is output; if there is no foreign matter grid in the light guide plate foreign matter data, it is output that there is no foreign matter in the light guide plate.
[0036] In a second aspect, the present application provides a light guide plate conveyor line foreign body visual detection system, comprising an image acquisition module, a first processing module, a parameter extraction module and a foreign body judgment module;
[0037] The image acquisition module performs image acquisition processing on the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image data set;
[0038] The first processing module includes a preprocessing unit and a division processing unit, the preprocessing unit is used to perform image preprocessing on the light guide plate image data set, and the division processing unit is used to perform image division processing to obtain a grid grayscale image data set;
[0039] The parameter extraction module performs grayscale change extraction processing based on the grid grayscale image data set to obtain first grayscale change data;
[0040] The foreign matter judging module detects and judges foreign matter on the surface of the light guide plate based on the first grayscale change data.
[0041] In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the above method are performed.
[0042] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above method are executed.
[0043] Beneficial effects of the present invention: The present invention acquires a light guide plate image dataset by performing image acquisition processing on the light guide plate based on light sources of different illumination intensities; performs image preprocessing and image segmentation processing on the light guide plate image dataset to obtain a grid grayscale image dataset; performs grayscale change extraction processing based on the grid grayscale image dataset to obtain first grayscale change data; and detects and determines foreign matter on the surface of the light guide plate based on the first grayscale change data. When detecting foreign matter on the surface of the light guide plate using the grayscale image, interference from the external environment and defects of the light guide plate itself can be avoided, and foreign matter with a grayscale value similar to the grayscale image background can be accurately distinguished.
[0044] The present invention collects grayscale change images of the light guide plate under different light sources, and then detects foreign matter based on the grayscale change. The advantage is that even if the grayscale of the foreign matter is similar to that of the background, its light reflection and absorption characteristics will change differently from the background under different lighting, thereby effectively detecting foreign matter. Since the grayscale changes of multiple images under different light intensities are compared, the influence of other interference factors can be avoided to a certain extent, and the stability and reliability of detection can be improved. By only adjusting the grayscale of the even-numbered grayscale image set, the advantage is that only half of the images are processed, which can improve the detection efficiency to a certain extent. It can also complement the images that have not been grayscale adjusted, which helps to improve the accuracy of foreign matter judgment and avoids the problem of over-enhancement that may be caused by contrast adjustment of all images. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a principle block diagram of the system of the present invention;
[0046] Figure 2 is a flow chart of the steps of the method of the present invention;
[0047] Figure 3 Schematic diagram of image acquisition of the present invention;
[0048] Figure 4 The image division and rotation flow chart of the present invention;
[0049] Figure 5 Schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0051] Example 1, please refer to Figure 1 As shown, the present application provides a light guide plate conveyor line foreign body visual detection system, including an image acquisition module, a first processing module, a parameter extraction module and a foreign body judgment module;
[0052] The image acquisition module performs image acquisition and processing on the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image data set;
[0053] The image acquisition module is configured with an image acquisition strategy, which includes: Figure 3 As shown in the figure, a group of light sources with uniformly decreasing light intensity are installed just above the light guide plate conveyor line, and are sorted from large to small according to light intensity, and are recorded as A1, A2, ..., An. The light intensity of light source A1 is set to E1 Lux, and the light intensity decreases to E0 Lux. Then the light intensity of A2 is (E1-E0) Lux, and so on. The light intensity of An is [(E1-(n-1)*E0] Lux.
[0054] An image acquisition device is installed on the side of light sources A1, A2, ..., An. When the light guide plate is transported to the bottom of light sources A1, A2, ..., An, the image acquisition device sequentially captures images of the light guide plate under light sources A1, A2, ..., An. The images are sorted in the acquisition order and recorded as the light guide plate image dataset.
[0055] During the specific implementation process, it is necessary to ensure that the size of the light guide plate in the captured images is consistent. For example, if the pixel size corresponding to the light guide plate in the first captured image is 500*500, the pixel size corresponding to the light guide plate in the subsequent captured images must also be 500*500.
[0056] The first processing module includes a preprocessing unit and a division processing unit, the preprocessing unit is used to perform image preprocessing on the light guide plate image data set, and the division processing unit is used to perform image division processing to obtain a grid grayscale image data set;
[0057] The preprocessing unit is configured with preprocessing strategies, which include: Figure 4As shown; any light guide plate image in the light guide plate image data set is recorded as the original light guide plate image, the image area corresponding to the light guide plate in the original light guide plate image is divided and recorded as the light guide plate area, the image area of the original light guide plate image that is not the light guide plate area is removed, and the remaining light guide plate area is rotated according to the geometric shape of the corresponding light guide plate. If it is a circular light guide plate, no rotation is required; the edge of the remaining light guide plate area is made horizontal or vertical; that is, the light guide plate image is rotated and straightened to facilitate subsequent division and numbering; after completion, a first light guide plate image is obtained, and the first light guide plate image is grayscaled to obtain a second light guide plate image;
[0058] Repeatedly obtain all second light guide plate images corresponding to the light guide plate image dataset, and sort them according to the corresponding acquisition order, and record them as a light guide plate grayscale image set;
[0059] The second light guide plate images with odd arrangement numbers in the light guide plate grayscale image set are recorded as an odd grayscale image set, and the second light guide plate images with even arrangement numbers are recorded as an even grayscale image set;
[0060] Grayscale adjustment processing is performed on all second light guide plate images in the even grayscale image set, and after completion, an even grayscale adjusted image set is obtained; grayscale adjustment processing can also be performed on the odd grayscale image set, while the even and odd grayscale image sets are not processed;
[0061] The grayscale adjustment process includes: for any second light guide plate image, recorded as the original grayscale image, calculating the average grayscale value M in the original grayscale image, and adjusting the grayscale value of each pixel in the original grayscale image to obtain a new grayscale value through the grayscale adjustment formula. The grayscale adjustment formula is as follows: V1(x, y)=V0(x, y)+k*(V0(x, y)-M), where V1 represents the new grayscale value obtained by adjusting the pixel point, V0 represents the original grayscale value of the pixel point, k is the set adjustment coefficient, and (x, y) represents the position coordinates of the pixel point in the original grayscale image; after completion, a grayscale adjusted image is obtained; the value range of k is generally between 0 and 2, and can be adjusted according to the actual image effect; for the grayscale value of foreign matter; it will change further after adjustment; this can make the grayscale value difference between the foreign matter and the normal area of the light guide plate larger, while the grayscale difference in the normal area of the light guide plate remains relatively stable, because the pixel grayscale values in the normal area are relatively concentrated, and the relative difference between them does not change much after adjustment, thereby improving the accuracy of subsequent detection;
[0062] The division processing unit is configured with a division processing strategy, which includes: merging the even grayscale adjustment image set and the odd grayscale image set, and sorting them according to the corresponding acquisition order, and recording them as the light guide plate grayscale adjustment image set;
[0063] For any image in the light guide plate grayscale adjustment image set, record it as the first grayscale adjustment image, set the size of the division grid unit to a*b, use the division grid unit to grid the first grayscale adjustment image, and obtain a grayscale grid image after completion; obtain all corresponding grayscale grid images in the light guide plate grayscale adjustment image set, record them as the grid grayscale image dataset;
[0064] The shape and size of the grid units can be set according to the actual application scenario, such as triangles, rectangles, and hexagons. In this embodiment, the shape of the grid units is a square. The size should not be too large or too small. The unit can be measured in pixels. A larger grid may cause smaller foreign objects to be contained within one grid unit, and the overall grayscale change of the grid may not be obvious, resulting in the inability to detect small foreign objects. A grid that is too small may cause the grayscale change of each grid to fluctuate greatly due to factors such as noise and texture of the image itself, and it is easy to misjudge normal image texture or noise as grayscale changes caused by foreign objects, resulting in a large number of false positives and increased computing costs.
[0065] In the specific implementation process, only grayscale adjustment processing is performed on the even-numbered grayscale image set, which can reduce the amount of calculation. Because only half of the images are processed, the amount of calculation when performing operations such as contrast adjustment is reduced by half compared with full adjustment, which can improve processing efficiency to a certain extent and shorten detection time, especially when processing a large number of images, and is complementary to the odd-numbered grayscale image set that has not been adjusted; when subsequently judging foreign objects, the information of the original image and the adjusted image can be comprehensively compared to more comprehensively analyze the details in the image, which helps to improve the accuracy of foreign object judgment; it avoids the problem of over-enhancement that may be caused by contrast adjustment of all images; if contrast adjustment is performed on all images, some originally inconspicuous noise or interference may also be enhanced, affecting the accuracy of foreign object judgment; adjusting only part of the images can reduce this risk to a certain extent.
[0066] The parameter extraction module performs grayscale change extraction processing based on the grid grayscale image data set to obtain first grayscale change data;
[0067] The parameter extraction module is configured with a parameter extraction strategy, which includes: for any grayscale grid image in the grid grayscale image dataset, the divided grids in the grayscale grid image are recorded as W1 to Wf in order from left to right and from top to bottom, and the range position information corresponding to the divided grids is recorded; for any divided grid from W1 to Wf is recorded as We, the grayscale values of all pixels in We are arranged in order from small to large, and recorded as the first grayscale sequence of We;
[0068] The first cropping ratio is set to T1%, and the minimum grayscale value (1-T1) / 2% and the maximum grayscale value (1-T1) / 2% in the first grayscale sequence We are extracted, and recorded as the second grayscale sequence We; the average value of the second grayscale sequence We is calculated, and recorded as the reference grayscale value of We; that is, the middle T1% is removed; in this embodiment, the first cropping ratio T1% is 70%; only the grayscale values at the two ends are retained because if there is foreign matter on the light guide plate, it will usually cause extreme changes in grayscale values in the local area, which may cause the grayscale value to decrease or increase; retaining only the two end values of the grayscale sequence can highlight the extreme grayscale changes caused by these abnormalities, making the grayscale difference between them and the normal area more obvious, facilitating the subsequent accurate identification of foreign matter;
[0069] Repeatedly obtain the reference grayscale values of all divided grids in the grayscale grid image, and record the positions of the corresponding divided grids on the corresponding grayscale grid image as the reference grayscale information of the grayscale grid image;
[0070] Repeatedly obtain reference grayscale information of all grayscale grid images in the grid grayscale image dataset, and sort them according to the corresponding acquisition order, and record them as first reference grayscale data;
[0071] Any reference grayscale value in the first reference grayscale data is denoted as H(i, j), where i represents the i-th grayscale grid image, j represents the j-th divided grid in the i-th grayscale grid image, and the order of the divided grids is from left to right and from top to bottom; for example, H(2, 2) represents the second divided grid in the second grayscale grid image;
[0072] The grayscale difference formula is used to calculate the difference between H(i, j) and the reference grayscale value H(i+1, j) of the corresponding grid in the next grayscale grid image, and this difference is recorded as the i-th reference difference value G(j, i) of the j-th grid. For example, G(1, 2) represents the second reference difference value of the first grid. The grayscale difference formula is as follows: G(j, i) = H(i+1, j) - H(i, j).
[0073] Repeatedly obtain all reference difference values corresponding to all divided grids, and record them as first grayscale change data;
[0074] In the specific implementation process, the advantage of dividing the grayscale image into grids and then processing it is that the grayscale changes within each grid can be observed more carefully, which helps to capture local features at different positions in the image; for images where tiny foreign objects may exist, such as light guide plates, it can more accurately detect grayscale anomalies caused by foreign objects in local areas, thereby improving the detection ability of small-sized foreign objects; grid division can also provide more accurate information for the positioning of foreign objects.
[0075] The foreign matter judging module detects and judges foreign matter on the surface of the light guide plate based on the first grayscale change data;
[0076] The foreign body judgment module is equipped with a foreign body judgment strategy, which includes: obtaining any reference difference value G(j, i) in the first grayscale change data, arranging the reference difference values with the same value i from small to large, recording them as the i-th reference difference value sequence, obtaining all reference difference value sequences, recording the maximum value of i, recording it as I0, and performing foreign body grid marking processing; obtaining grayscale marking data;
[0077] The foreign body grid marking process includes: setting a second cropping ratio of T2%, removing the smallest T2% reference difference value and the largest T2% reference difference value in the i-th reference difference value sequence, and calculating the average and standard deviation of the remaining reference differences, which are recorded as Pi and Ri respectively. In this embodiment, the second cropping ratio T2% is 15%. Removing a portion of the data at both ends can avoid the excessive impact of extreme values on the overall data characteristics, making the remaining data more representative of the reference difference value distribution under normal conditions, thereby improving data reliability and providing accurate reference data for subsequent judgments.
[0078] All reference differences in the i-th reference difference sequence are judged. If the reference difference satisfies G(j, i) < |Pi-v*Ri| or satisfies G(j, i) > |Pi+v*Ri|, the reference difference satisfying G(j, i) is marked as an abnormal difference. If not, the reference difference satisfying G(j, i) is marked as a normal difference. Where v is a proportional coefficient. v can be flexibly adjusted according to the actual application scenario, generally 1-3. In this embodiment, v=2.
[0079] Set the abnormality threshold to T3, T3≤I0; obtain any reference difference G(j, i) in the grayscale mark data, and record the reference difference with the same j as the j-th grid difference sequence, and obtain all grid difference sequences; if the number of abnormal differences in the j-th grid reference difference sequence is greater than or equal to T3, then mark the corresponding j-th grid as a foreign object grid, otherwise mark the corresponding j-th grid as a normal grid; repeat the marking of all grid difference sequences; obtain the light guide plate foreign object data; the setting of the abnormality threshold T3 is related to the image acquisition number I0, generally 0.3*I0-0.6*I0. In this embodiment, T3 is 0.3*I0;
[0080] According to the light guide plate foreign body data of the light guide plate, if a foreign body grid exists in the light guide plate foreign body data, it is output that a foreign body exists in the light guide plate, and the range position information corresponding to the foreign body grid is output; if the foreign body grid does not exist in the light guide plate foreign body data, it is output that no foreign body exists in the light guide plate;
[0081] In practice, by capturing grayscale variation images of the light guide plate under different light sources and then detecting foreign objects based on grayscale variation, compared to traditional methods of detecting foreign objects using a single grayscale image, foreign objects can be identified by grayscale variation under different light intensities. Even if the grayscale of a foreign object is similar to that of the background, its light reflection and absorption characteristics may still vary differently from the background under different lighting conditions, thereby effectively detecting more types of foreign objects. In actual production environments, there may be interference factors such as ambient light fluctuations and subtle material unevenness on the surface of the light guide plate itself, which can affect the detection accuracy of a single grayscale image. However, grayscale variation detection, by comparing the grayscale variations of multiple images under different light intensities, can eliminate the influence of these static interference factors to a certain extent, thereby improving the stability and reliability of detection. Traditional single grayscale image detection is limited to the information of a single imaging, and may have difficulty in accurately identifying tiny foreign objects. However, by calculating grayscale variation, more dimensional information can be obtained, and the grayscale variations of tiny foreign objects under different lighting conditions can also be captured, thereby more accurately detecting tiny foreign objects and improving detection accuracy.
[0082] Example 2, please refer to Figure 2 As shown, the present application provides a method for visually detecting foreign matter in a light guide plate conveyor line, comprising the following steps:
[0083] Step S1, performing image acquisition and processing on the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image dataset; Step S1 includes the following sub-steps:
[0084] Step S101: Install a group of light sources with uniformly decreasing illumination intensities directly above the light guide plate conveyor line, and sort them from highest to lowest according to illumination intensities, denoted as A1, A2, ..., An;
[0085] Step S102, setting the illumination intensity of light source A1 to E1 Lux, and setting the illumination intensity to decrease to E0 Lux;
[0086] In step S103, an image acquisition device is installed on the side of the light sources A1, A2, ..., An. When the light guide plate is sequentially transported to the bottom of the light sources A1, A2, ..., An, the image acquisition device is used to sequentially capture images of the light guide plate under the light sources A1, A2, ..., An. The images are sorted in the acquisition order and recorded as the light guide plate image dataset.
[0087] Step S2, performing image preprocessing on the light guide plate image dataset and performing image segmentation processing to obtain a grid grayscale image dataset; Step S2 includes the following sub-steps:
[0088] Step S201, recording any light guide plate image in the light guide plate image data set as an original light guide plate image, and dividing the image area corresponding to the light guide plate in the original light guide plate image into light guide plate areas;
[0089] Step S202: removing the image area other than the light guide plate area from the original light guide plate image, and rotating the remaining light guide plate area according to the geometric shape of the corresponding light guide plate so that the edges of the remaining light guide plate area are horizontal or vertical. After completion, a first light guide plate image is obtained, and the first light guide plate image is grayscaled to obtain a second light guide plate image.
[0090] Step S203, repeatedly acquiring all second light guide plate images corresponding to the light guide plate image dataset, and sorting them according to the corresponding acquisition order, and recording them as a light guide plate grayscale image set;
[0091] Step S204, recording the second light guide plate images with odd arrangement numbers in the light guide plate grayscale image set as an odd grayscale image set, and recording the second light guide plate images with even arrangement numbers as an even grayscale image set;
[0092] Step S205 , performing grayscale adjustment processing on all second light guide plate images in the even grayscale image set, and obtaining an even grayscale adjusted image set after completion;
[0093] Step S206, grayscale adjustment processing includes: for any second light guide plate image, recorded as the original grayscale image, calculating the average grayscale value M in the original grayscale image, and adjusting the grayscale value of each pixel in the original grayscale image to obtain a new grayscale value using a grayscale adjustment formula, the grayscale adjustment formula is as follows: V1(x, y)=V0(x, y)+k*(V0(x, y)-M), where V1 represents the new grayscale value obtained by adjusting the pixel, V0 represents the original grayscale value of the pixel, k is a set adjustment coefficient, and (x, y) represents the position coordinates of the pixel in the original grayscale image; after completion, a grayscale adjusted image is obtained;
[0094] Step S207 , merging the even grayscale adjusted image set and the odd grayscale image set, and sorting them according to the corresponding acquisition order, and recording them as the light guide plate grayscale adjusted image set;
[0095] Step S208: For any image in the light guide plate grayscale adjustment image set, record it as the first grayscale adjustment image, set the size of the division grid unit to a*b, use the division grid unit to grid-divide the first grayscale adjustment image, and obtain a grayscale grid image after completion; obtain all corresponding grayscale grid images in the light guide plate grayscale adjustment image set, record them as the grid grayscale image data set.
[0096] Step S3, performing grayscale change extraction processing based on the grid grayscale image dataset to obtain first grayscale change data; Step S3 includes the following sub-steps:
[0097] Step S301: for any grayscale grid image in the grid grayscale image dataset, the divided grids in the grayscale grid image are denoted as W1 to Wf in order from left to right and from top to bottom, and the range position information corresponding to the divided grids is recorded;
[0098] Step S302: for any grid from W1 to Wf, denoted as We, arrange the grayscale values of all pixels in We in ascending order, denoted as the first grayscale sequence of We;
[0099] Step S303: Set the first cropping ratio to T1%, extract the smallest grayscale value (1-T1) / 2% and the largest grayscale value (1-T1) / 2% in the first grayscale sequence We, and record them as the second grayscale sequence We; calculate the average value of the second grayscale sequence We, and record it as the reference grayscale value We;
[0100] Step S304, repeatedly obtaining reference grayscale values of all divided grids in the grayscale grid image, and recording the positions of the corresponding divided grids on the corresponding grayscale grid image as reference grayscale information of the grayscale grid image;
[0101] Step S305, repeatedly obtaining reference grayscale information of all grayscale grid images in the grid grayscale image dataset, and sorting them according to the corresponding acquisition order, and recording them as first reference grayscale data;
[0102] Step S306: Any reference grayscale value in the first reference grayscale data is recorded as H(i, j), where i represents the i-th grayscale grid image and j represents the j-th subdivision grid in the i-th grayscale grid image. The difference between H(i, j) and the reference grayscale value H(i+1, j) of the corresponding subdivision grid in the next grayscale grid image is calculated according to the grayscale difference formula, and recorded as the i-th reference difference value G(j, i) of the j-th subdivision grid. The grayscale difference formula is as follows: G(j, i)=H(i+1, j)-H(i, j);
[0103] Step S307 , repeatedly obtaining all reference difference values corresponding to all divided grids, and recording them as first grayscale change data.
[0104] Step S4, detecting and judging foreign matter on the surface of the light guide plate based on the first grayscale change data; Step S4 includes the following sub-steps:
[0105] Step S401: Obtain any reference difference value G(j, i) in the first grayscale change data, and arrange the reference difference values with the same value i from small to large, recording them as the i-th reference difference value sequence. Then, obtain all reference difference value sequences, record the maximum value of i, recorded as I0, and perform foreign body grid marking processing to obtain grayscale marking data.
[0106] Step S402: foreign body grid marking process, step S402 includes the following sub-steps:
[0107] Step S4021: Set the second cropping ratio to T2%, remove the smallest T2% reference difference and the largest T2% reference difference in the i-th reference difference sequence, and calculate the average and standard deviation of the remaining reference differences, which are denoted as Pi and Ri, respectively.
[0108] Step S4022: All reference differences in the i-th reference difference sequence are judged. If the reference difference satisfies G(j, i)<|Pi-v*Ri| or G(j, i)>|Pi+v*Ri|, the reference difference satisfying G(j, i) is marked as an abnormal difference.
[0109] Step S4023: If not, mark the reference difference G(j, i) as a normal difference; where v is the proportional coefficient;
[0110] Step S403: Set the abnormality threshold to T3, T3≤I0; obtain any reference difference G(j, i) in the grayscale mark data, and record the j-th reference difference as the j-th grid difference sequence, and obtain all grid difference sequences;
[0111] Step S404: If the number of abnormal differences in the j-th grid reference difference sequence is greater than or equal to T3, then the corresponding j-th grid is marked as a foreign object grid; otherwise, the corresponding j-th grid is marked as a normal grid; repeat the marking process for all grid difference sequences to obtain the light guide plate foreign object data;
[0112] Step S405, based on the light guide plate foreign matter data of the light guide plate, if there is a foreign matter grid in the light guide plate foreign matter data, output that there is a foreign matter in the light guide plate, and output the range position information corresponding to the foreign matter grid; if there is no foreign matter grid in the light guide plate foreign matter data, output that there is no foreign matter in the light guide plate.
[0113] Example 3, please refer to Figure 5 As shown, Figure 5The present invention provides a schematic structural diagram of an electronic device, which may include a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. The memory stores computer-readable instructions, and the processor can call the instructions in the memory. When the computer-readable instructions are executed by the processor, the processor executes the steps of a method for visually detecting foreign objects on a light guide plate conveyor line to achieve the following functions: performing image acquisition processing on the light guide plate based on light sources of different illumination intensities to obtain a light guide plate image dataset; performing image preprocessing and image segmentation processing on the light guide plate image dataset to obtain a grid grayscale image dataset; performing grayscale change extraction processing on the grid grayscale image dataset to obtain first grayscale change data; and detecting and judging foreign objects on the surface of the light guide plate based on the first grayscale change data.
[0114] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the existing technology, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0115] Example 4. The present application also provides a computer-readable storage medium. The present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method for visual detection of foreign objects in a light guide plate conveyor line are executed to achieve the following functions: performing image acquisition and processing on the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image data set; performing image preprocessing and image division processing on the light guide plate image data set to obtain a grid grayscale image data set; performing grayscale change extraction processing based on the grid grayscale image data set to obtain first grayscale change data; and detecting and judging foreign objects on the surface of the light guide plate based on the first grayscale change data.
[0116] Through the description of the above embodiments, the embodiments of the present invention can be provided as methods, systems, or computer program products. Based on this understanding, the essence of the above technical solutions or the portion that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for enabling a computer device (such as a personal computer, server, or network device) to execute the methods described in various embodiments or certain portions of the embodiments.
[0117] In the embodiments provided in this application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of systems, modules and units can be electrical, mechanical or other forms.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for visually detecting foreign matter in a light guide plate conveyor line, characterized in that: The steps include: Perform image acquisition and processing on the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image dataset; Performing image preprocessing and image segmentation on the light guide plate image dataset to obtain a grid grayscale image dataset; Performing grayscale change extraction processing based on the grid grayscale image data set to obtain first grayscale change data; Detecting and judging foreign matter on the surface of the light guide plate based on the first grayscale change data; Performing grayscale change extraction processing based on the grid grayscale image dataset to obtain first grayscale change data includes the following sub-steps: For any grayscale grid image in the grid grayscale image dataset, the divided grids in the grayscale grid image are denoted as W1 to Wf in order from left to right and from top to bottom, and the range position information corresponding to the divided grids is recorded; For any grid from W1 to Wf, denoted as We, the grayscale values of all pixels in We are arranged in ascending order, denoted as the first grayscale sequence of We; Set the first cropping ratio to T1%, extract the smallest grayscale value (1-T1) / 2% and the largest grayscale value (1-T1) / 2% in the first grayscale sequence We, and record them as the second grayscale sequence We; calculate the average value of the second grayscale sequence We, and record it as the reference grayscale value of We; Repeatedly obtain the reference grayscale values of all divided grids in the grayscale grid image, and record the positions of the corresponding divided grids on the corresponding grayscale grid image as the reference grayscale information of the grayscale grid image; Repeatedly obtain reference grayscale information of all grayscale grid images in the grid grayscale image dataset, and sort them according to the corresponding acquisition order, and record them as first reference grayscale data; Performing grayscale change extraction processing based on the grid grayscale image dataset to obtain first grayscale change data further includes the following sub-steps: Any reference grayscale value in the first reference grayscale data is denoted as H(i, j), where i represents the i-th grayscale grid image, and j represents the j-th divided grid in the i-th grayscale grid image; According to the grayscale difference formula, the difference between H(i, j) and the reference grayscale value H(i+1, j) of the corresponding grid in the next grayscale grid image is calculated and recorded as the i-th reference difference G(j, i) of the j-th grid. The grayscale difference formula is as follows: ; Repeatedly obtain all reference difference values corresponding to all divided grids, and record them as first grayscale change data; Detecting and judging foreign matter on the surface of the light guide plate based on the first grayscale change data includes the following sub-steps: Obtain any reference difference value G(j, i) in the first grayscale change data, and arrange the reference difference values with the same i from small to large, recording them as the i-th reference difference value sequence, and obtain all reference difference sequences, record the maximum value of i, recorded as I0, and perform foreign body grid marking processing; Get grayscale labeled data; The foreign body grid marking process includes: setting the second cropping ratio to T2%, removing the smallest T2% reference difference and the largest T2% reference difference in the i-th reference difference sequence, and calculating the average value and standard deviation of the remaining reference differences, which are recorded as Pi and Ri in order; judging all reference differences in the i-th reference difference sequence, if the reference difference satisfies G(j, i) < |Pi-v*Ri| or satisfies G(j, i) > |Pi+v*Ri|, then marking the reference difference that satisfies G(j, i) as an abnormal difference; if not, marking the reference difference that satisfies G(j, i) as a normal difference; where v is the proportional coefficient; Set the abnormality threshold to T3, T3≤I0; obtain any reference difference G(j, i) in the grayscale mark data, and record the reference difference with the same j as the j-th grid difference sequence, and obtain all grid difference sequences; if the number of abnormal differences in the j-th grid reference difference sequence is greater than or equal to T3, then mark the corresponding j-th grid as a foreign object grid, otherwise mark the corresponding j-th grid as a normal grid; repeat the marking of all grid difference sequences to obtain the light guide plate foreign object data; According to the light guide plate foreign matter data of the light guide plate, if there is a foreign matter grid in the light guide plate foreign matter data, it is output that there is a foreign matter in the light guide plate, and the range position information corresponding to the foreign matter grid is output; if there is no foreign matter grid in the light guide plate foreign matter data, it is output that there is no foreign matter in the light guide plate.
2. A method for visually detecting foreign matter in a light guide plate conveyor line according to claim 1, characterized in that: The image acquisition and processing of the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image dataset includes the following sub-steps: A group of light sources with evenly decreasing light intensity are installed directly above the light guide plate conveyor line. They are sorted from highest to lowest according to light intensity and are recorded as A1, A2, ..., An. The light intensity of light source A1 is set to E1 Lux, and the decreasing light intensity is E0 Lux. An image acquisition device is installed on the side of the light sources A1, A2, ..., An. When the light guide plate is transported to the bottom of the light sources A1, A2, ..., An in sequence, the image acquisition device collects the images of the light guide plate under the light sources A1, A2, ..., An in sequence, and sorts them in the order of collection, which is recorded as the light guide plate image dataset.
3. A method for visually detecting foreign matter in a light guide plate conveyor line according to claim 2, characterized in that: Performing image preprocessing and image segmentation on the light guide plate image dataset to obtain a grid grayscale image dataset includes the following sub-steps: Record any light guide plate image in the light guide plate image data set as an original light guide plate image, divide the image area corresponding to the light guide plate in the original light guide plate image into light guide plate areas, remove the image area of the original light guide plate image that is not the light guide plate area, and rotate the remaining light guide plate area according to the geometric shape of the corresponding light guide plate so that the edge of the remaining light guide plate area is horizontal or vertical; after completion, a first light guide plate image is obtained, and the first light guide plate image is grayscaled to obtain a second light guide plate image; Repeatedly obtain all second light guide plate images corresponding to the light guide plate image data set, and sort them according to the corresponding acquisition order, and record them as a light guide plate grayscale image set.
4. A method for visually detecting foreign matter in a light guide plate conveyor line according to claim 3, characterized in that: Performing image preprocessing and image segmentation on the light guide plate image dataset to obtain a grid grayscale image dataset also includes the following sub-steps: The second light guide plate images with odd arrangement numbers in the light guide plate grayscale image set are recorded as an odd grayscale image set, and the second light guide plate images with even arrangement numbers are recorded as an even grayscale image set; Performing grayscale adjustment processing on all second light guide plate images in the even grayscale image set, and obtaining an even grayscale adjusted image set after completion; Grayscale adjustment processing includes: for any second light guide plate image, recorded as the original grayscale image, calculating the average grayscale value M in the original grayscale image, and adjusting the grayscale value of each pixel in the original grayscale image using the grayscale adjustment formula to obtain a new grayscale value. The grayscale adjustment formula is as follows: , where V1 represents the new grayscale value obtained by pixel adjustment, V0 represents the original grayscale value of the pixel, k is the set adjustment coefficient, and (x, y) represents the position coordinates of the pixel in the original grayscale image; after completion, the grayscale adjusted image is obtained.
5. A method for visually detecting foreign matter in a light guide plate conveyor line according to claim 4, characterized in that: Performing image preprocessing and image segmentation on the light guide plate image dataset to obtain a grid grayscale image dataset also includes the following sub-steps: Merge the even grayscale adjusted image set and the odd grayscale image set, sort them according to the corresponding acquisition order, and record them as the light guide plate grayscale adjusted image set; For any image in the light guide plate grayscale adjustment image set, it is recorded as the first grayscale adjustment image, the size of the divided grid unit is set to a*b, and the divided grid unit is used to grid the first grayscale adjustment image, and a grayscale grid image is obtained after completion; all corresponding grayscale grid images in the light guide plate grayscale adjustment image set are obtained and recorded as the grid grayscale image data set.
6. A light guide plate conveyor line foreign body visual detection system, used to implement a light guide plate conveyor line foreign body visual detection method according to any one of claims 1 to 5, characterized in that: It includes an image acquisition module, a first processing module, a parameter extraction module and a foreign body judgment module; The image acquisition module performs image acquisition processing on the light guide plate based on light sources with different illumination intensities to obtain a light guide plate image data set; The first processing module includes a preprocessing unit and a division processing unit, the preprocessing unit is used to perform image preprocessing on the light guide plate image data set, and the division processing unit is used to perform image division processing to obtain a grid grayscale image data set; The parameter extraction module performs grayscale change extraction processing based on the grid grayscale image data set to obtain first grayscale change data; The foreign matter judging module detects and judges foreign matter on the surface of the light guide plate based on the first grayscale change data.
7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Defect detection method of light guide plate
CN109064451A
Light source detection method based on image processing
CN114612345A
Defect detection method, device and equipment and storage medium
CN119579489A