Keyboard cover plate surface image acquisition system and keyboard cover plate surface quality detection method
Patent Information
- Application Number
- CN202410029753.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2044-01-09
AI Technical Summary
[0003]在缺陷检测方面,现有技术一般利用深度学习的方式对缺陷进行检测,但目前难以在生产线上获得大量缺陷样本
[0056]1、本发明在键盘盖板表面图像的采集系统中,通过设计频闪线光源及盖板运动配合,可以实现一次运动采集多个角度光照图像;
Smart Images

Figure CN117929397B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to image defect detection technology, and particularly to a system for acquiring images of keyboard cover surfaces, and a method, apparatus, terminal equipment, and computer-readable storage medium for detecting the surface quality of keyboard cover surfaces. Background Technology
[0002] Detecting defects in plastic products, whether glossy or matte, is challenging, even with human visual inspection, as minute defects are easily missed. Currently, most plastic product inspections rely on quality inspectors constantly changing the angle of the product under strong light to identify defects and determine if they exceed quality standards. To improve inspection efficiency, automation of plastic keyboard cover inspection is desired. Automated inspection equipment, simulating human visual inspection and continuously changing product angles, requires significant time for data acquisition and processing.
[0003] In terms of defect detection, existing technologies generally use deep learning to detect defects, but it is currently difficult to obtain a large number of defect samples on the production line. Summary of the Invention
[0004] To address the shortcomings of the prior art, this invention provides a keyboard cover surface image acquisition system, a method, apparatus, terminal device, and computer-readable storage medium for detecting keyboard cover surface quality. The acquisition system, through the design of a strobe light source that coordinates with the cover's movement, enables the acquisition of multiple angle illumination images with a single movement. Simultaneously, a prism is placed in the system to reflect the extremely narrow side bezel of the keyboard onto a camera, allowing the camera to simultaneously acquire images of both the keyboard cover surface and its sides, achieving efficient acquisition. The detection method employs simple filtering and connected component analysis on the images acquired by the acquisition system, enabling rapid and efficient automated detection of defects on the keyboard cover surface.
[0005] The first objective of this invention is to provide a system for acquiring images of the surface of a keyboard cover.
[0006] The second objective of this invention is to provide a method for detecting the surface quality of a keyboard cover.
[0007] The third objective of this invention is to provide a device for detecting the surface quality of a keyboard cover.
[0008] The fourth objective of this invention is to provide a terminal device.
[0009] A fifth objective of this invention is to provide a computer-readable storage medium.
[0010] The first objective of this invention can be achieved by adopting the following technical solution:
[0011] A system for acquiring images of a keyboard cover surface includes a vertical line scan camera, an inclined line scan camera, multiple stroboscopic line light sources, a conveyor belt, and two prisms. The vertical line scan camera is perpendicular to the keyboard cover surface, which is placed on a rubber belt of the conveyor belt. Multiple stroboscopic line light sources are respectively positioned on both sides of the vertical line scan camera's perpendicular bisector and equidistant from the keyboard cover surface. The inclined line scan camera is positioned on one side of the vertical line scan camera's perpendicular bisector, with a stroboscopic line light source positioned on the opposite side. Two prisms are symmetrically positioned on both sides of the rubber belt to reflect the side border of the keyboard to the vertical and inclined line scan cameras, thereby acquiring images of the keyboard side.
[0012] Let 'a' be the angle between the perpendicular bisector of the multiple stroboscopic line light sources and the perpendicular bisector of the vertical line scan camera, and let 'b' be the angle between the perpendicular bisector of the tilted line scan camera and the perpendicular bisector of the vertical line scan camera. Then 'b' is greater than the minimum value of 'a' and less than the maximum value of 'a'. The angle between the perpendicular bisector of the stroboscopic line light source corresponding to the tilted line scan camera and the perpendicular bisector of the vertical line scan camera is 'b', and it is the same as the distance from the multiple stroboscopic line light sources to the surface of the keyboard cover.
[0013] Furthermore, when acquiring images of the keyboard cover surface using a vertical line scan camera and an inclined line scan camera, the acquisition frequency is synchronized with the stroboscopic line light source.
[0014] The second objective of this invention can be achieved by adopting the following technical solution:
[0015] A method for detecting the surface quality of a keyboard cover, the method comprising:
[0016] The above-described acquisition system is used to acquire images of the keyboard cover surface;
[0017] The circular detection holes in the acquired image are removed to obtain the detection image; based on the detection image, binarization is used to obtain the detection region image;
[0018] The detected image is filtered and denoised to obtain a denoised image;
[0019] Based on the denoised image and the detection region image, adaptive binarization is used to obtain bright defect binary images and dark defect binary images;
[0020] The connected components in the bright defect binary image and the dark defect binary image are filtered and merged respectively;
[0021] Determine whether there are defects on the surface of the keyboard cover based on the merged connected components.
[0022] Furthermore, the connected components in the defective binary graph are filtered, including:
[0023] Opening and closing operations are performed on the defect binary map to remove isolated noise;
[0024] Perform connected component analysis on the defective binary graph after opening and closing operations, and obtain the minimum bounding rectangle of each connected component;
[0025] Remove connected components that do not meet the following filtering criteria:
[0026]
[0027] In the formula, A is the number of actual pixels contained in the connected region; h and w are the lengths of the long and short sides of the minimum bounding rectangle, respectively; T4 is the area threshold to remove connected regions with too small an area; T5 is the aspect ratio threshold to distinguish between long strip defects and block defects; T6 is the area ratio threshold to avoid block connected regions containing a number of actual pixels that are much smaller than the minimum bounding rectangle.
[0028] The defect binary map is either a bright defect binary map or a dark defect binary map.
[0029] Furthermore, the opening operation uses a 3×3 rectangle as its structure element, while the closing operation uses a 13×13 rectangle as its structure element.
[0030] Furthermore, the connected components in the defective binary graph are merged, including:
[0031] Connected components that are adjacent in position and similar in angle are merged based on the following criteria:
[0032] Expand the length and width of the minimum bounding rectangle of a connected component by n pixels. If two expanded minimum bounding rectangles intersect, then the two connected components are adjacent; where n is a positive integer greater than or equal to 1.
[0033] Let the minimum bounding rectangle angles of two connected components be θ1 and θ2, respectively. If |θ1-θ2|<T7, then the angles of the two connected components are similar. The minimum bounding rectangle angle refers to the angle between the long side of the minimum bounding rectangle and the horizontal axis, with a value range of [-90, 90). T7 is a set angle error threshold.
[0034] Furthermore, the step of determining whether there are defects on the keyboard cover surface based on the merged connected components includes:
[0035] If it is a long strip-shaped defect, and the length of the longest side of the minimum bounding rectangle of the merged connected components is greater than the first set threshold, then there is a defect on the surface of the keyboard cover.
[0036] If it is a block defect, and the number of actual pixels contained in the merged connected region is greater than the second set threshold, then there is a defect on the surface of the keyboard cover.
[0037] Furthermore, the step of obtaining bright defect binary maps and dark defect binary maps using adaptive binarization based on the denoised image and the detection region image includes:
[0038] The denoised image and the detection region image are filtered multiple times using mean filtering with different filter sizes to obtain I. f and B f ;
[0039] According to I f and B f The binary image Q of the bright defect is obtained by the following formula. l Binary map of dark defects Q a :
[0040]
[0041]
[0042] In the formula, I B (x,y)=I'(x,y)×B f (x,y) is the baseline image, I'(x,y) is the denoised image; T2 is the bright defect ratio threshold, which is greater than 1; T3 is the dark defect ratio threshold, which is less than 1.
[0043] The third objective of this invention can be achieved by adopting the following technical solution:
[0044] A device for detecting the surface quality of a keyboard cover, the device comprising:
[0045] The acquisition module is used to acquire images of the keyboard cover surface using the acquisition system described above;
[0046] The binarization module is used to remove the circular detection holes from the acquired image to obtain the detection image; based on the detection image, binarization is used to obtain the detection region image;
[0047] The filtering module is used to filter and denoise the detected image to obtain a denoised image;
[0048] The adaptive binarization module is used to obtain bright defect binary maps and dark defect binary maps based on the denoised image and the detection region image using adaptive binarization.
[0049] The filtering and merging module is used to filter and merge connected components in the bright defect binary map and the dark defect binary map, respectively.
[0050] The defect identification module is used to determine whether there are defects on the surface of the keyboard cover plate based on the merged connected components.
[0051] The fourth objective of this invention can be achieved by adopting the following technical solution:
[0052] A terminal device includes a processor and a memory for storing a processor-executable program, wherein when the processor executes the program stored in the memory, it implements the above-described method for detecting the surface quality of a keyboard cover.
[0053] The fifth objective of this invention can be achieved by adopting the following technical solution:
[0054] A computer-readable storage medium storing a program that, when executed by a processor, implements the above-described method for detecting the surface quality of a keyboard cover.
[0055] The present invention has the following advantages over the prior art:
[0056] 1. In the keyboard cover surface image acquisition system of the present invention, by designing a strobe light source and coordinating the movement of the cover, it is possible to acquire multiple angle illumination images in a single movement;
[0057] 2. In the keyboard cover surface image acquisition system of the present invention, a prism is placed to reflect the extremely narrow side frame of the keyboard to the camera, so that the camera can simultaneously acquire images of the keyboard cover surface and the side, achieving efficient acquisition.
[0058] 3. In the method for detecting the surface quality of keyboard cover plates, this invention uses a simple filtering and connected component analysis method to improve the accuracy of defect detection, reduce the false negative rate, and achieve rapid and efficient detection of defects on the surface of keyboard cover plates. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0060] Figure 1 This is a side view of the keyboard cover surface image acquisition system according to Embodiment 1 of the present invention, showing the direction of cover plate movement.
[0061] Figure 2 This is a front view of the keyboard cover surface image acquisition system according to Embodiment 1 of the present invention, showing the direction of the cover plate movement.
[0062] Figure 3 This is a flowchart of the method for detecting the surface quality of the keyboard cover plate according to Embodiment 1 of the present invention;
[0063] Figure 4 The image is the original image captured by the keyboard cover surface image acquisition system of Embodiment 1 of the present invention;
[0064] Figure 5 This is the detection image from Embodiment 1 of the present invention;
[0065] Figure 6 This is an image of the detection area in Embodiment 1 of the present invention;
[0066] Figure 7 This is a binary image of a bright defect from Embodiment 1 of the present invention;
[0067] Figure 8 This is a diagram showing the defect detection results of Embodiment 1 of the present invention;
[0068] Figure 9 This is an enlarged view of the specific defect area in Embodiment 1 of the present invention;
[0069] Figure 10 This is a structural block diagram of the keyboard cover surface quality detection device according to Embodiment 2 of the present invention;
[0070] Figure 11 This is a structural block diagram of the terminal device according to Embodiment 3 of the present invention. Detailed Implementation
[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be understood that the specific embodiments described are merely used to explain this application and are not intended to limit this application.
[0072] Example 1:
[0073] like Figure 1 , 2 As shown, this embodiment provides a keyboard cover surface image acquisition system, including a vertical line scan camera, an inclined line scan camera, stroboscopic line light sources A1, A2, B, C1, and C2, a conveyor belt, prism 1, and prism 2. The vertical line scan camera is perpendicular to the keyboard cover surface placed on the rubber belt of the conveyor belt. In the direction from the vertical line scan camera to the keyboard cover surface, the angle α between the stroboscopic line light sources A1 and A2 and the perpendicular bisector of the vertical line scan camera is ±11°; the angle β between the stroboscopic line light source B and the inclined camera and the perpendicular bisector of the vertical line scan camera is ±20°; and the angle γ between the stroboscopic line light sources C1 and C2 and the perpendicular bisector of the vertical line scan camera is ±55°. Prisms are symmetrically arranged on both sides of the rubber belt to reflect the side frame of the keyboard to the vertical and inclined line scan cameras, thereby acquiring images of the keyboard side. All components in this acquisition system are existing structures.
[0074] To ensure image acquisition speed, the cameras in this embodiment are all line cameras. This type of camera acquires only one line of images at a time. By coordinating the movement of the strobe line light source with the keyboard cover, it is possible to acquire multiple illuminated images from different angles with a single movement. However, the acquisition timing needs to be strictly synchronized with the strobe line light source. In this embodiment, the acquisition timing and the light source switch are controlled synchronously by an external control level; that is, the camera acquires one line of images for every one strobe flash.
[0075] In addition to the keyboard cover surface, the four sides of the keyboard cover also need to be inspected. Since only a small portion of the sides is exposed after assembly, the defect detection standard for the sides is lower than that for surface defects. In this embodiment, the long side image of the keyboard cover is acquired simultaneously with the surface image using a prism, while the short side images are acquired separately by rotating the cover.
[0076] The acquired image is sent to the PC, which then uses the keyboard cover surface quality detection method provided in this embodiment to detect the image.
[0077] like Figure 3 As shown, the method for detecting the surface quality of a keyboard cover provided in this embodiment includes the following steps:
[0078] (1) System initialization: check the installation positions of the line scan camera and the stroboscopic light source, the prism settings, and the connection between the camera and the PC.
[0079] (2) Place the keyboard cover on the rubber belt of the conveyor belt;
[0080] (3) Each line scan camera uses the captured images as the original images (see...). Figure 4 ), and send it to the PC's memory;
[0081] (4) Divide the original image into regions to obtain the detection region image B;
[0082] The specific steps are as follows:
[0083] (4-1) The four circular detection holes in the original image can be located and removed using Hough circle transform to obtain detection image I, as shown. Figure 5 As shown;
[0084] (4-2) Obtain the detection region image B through binarization, such as Figure 6 As shown.
[0085] Since the lighting environment is fixed in this embodiment, a fixed threshold method is used for binarization, where x and y are the horizontal and vertical coordinates of the image, respectively, and T1 is a preset threshold.
[0086]
[0087] (5) Use 3×3 median filtering and 5×5 Gaussian filtering to process image I to obtain denoised image I';
[0088] (6) Based on the denoised image and the detection area image, adaptive binarization is used to obtain the bright defect binary map and the dark defect binary map;
[0089] The specific steps are as follows:
[0090] (6-1) Apply m×m mean filtering to both the denoised image I' and the detection region image B to obtain I. f and B f ; Filter by selecting different m values multiple times;
[0091] In this embodiment, the values of m are 32, 64, and 128.
[0092] (6-2) Obtain the binary image Q of the bright defect according to the following formula. l (like Figure 7 (as shown) and the binary image Q of the dark defect a :
[0093]
[0094]
[0095] In the formula I B (x,y)=I'(x,y)×B f (x,y) is the baseline image, used to avoid the influence of non-detection areas on the binarization result; T2 is the bright defect ratio threshold, which should be greater than 1; T3 is the dark defect ratio threshold, which should be less than 1.
[0096] (7) Initial selection and merging of defects;
[0097] The specific steps are as follows:
[0098] (7-1) Perform opening and closing operations on the binary defect map to remove isolated noise. The opening operation uses a 3×3 rectangle element, and the closing operation uses a 13×13 rectangle element.
[0099] (7-2) Perform connected component analysis on the binary graph after opening and closing operations, and obtain the minimum bounding rectangle of each connected component;
[0100] (7-3) Remove connected components that do not meet the initial selection criteria, where the initial selection criteria are:
[0101]
[0102] In the formula, A is the number of actual pixels contained in the connected component; h is the length of the long side of the minimum bounding rectangle; w is the length of the short side of the minimum bounding rectangle; T4 is the initial area threshold, used to remove connected components with too small an area; T5 is the aspect ratio threshold, used to distinguish between long strip defects (such as scratches) and block defects (such as blue-black dots, discolored blocks, etc.); T6 is the area ratio threshold, used to avoid block connected components containing a number of actual pixels that are much smaller than the minimum bounding rectangle.
[0103] (7-4) Merge connected components that are adjacent in position and have similar angles;
[0104] The criteria for determining adjacent positions are as follows:
[0105] Expand the length and width of the minimum bounding rectangle by n pixels. If the two expanded minimum bounding rectangles intersect, the two connected components are considered to be adjacent. The criterion for judging similar angles is as follows: Assume the angles of the minimum bounding rectangles of the two connected components are θ1 and θ2, respectively. If |θ1-θ2|<T7, the two connected components are considered to have similar angles. The angle of the minimum bounding rectangle refers to the angle between the longer side of the minimum bounding rectangle and the horizontal axis (x-axis), with a value range of [-90, 90). T7 is the angle error threshold.
[0106] (8) Determine whether there is a defect based on the parameters of the merged connected components.
[0107] This embodiment determines the defect by combining the actual number of pixels in the merged connected component and the length of the longest side of its smallest bounding rectangle. For elongated defects, the longest side of the smallest bounding rectangle must be greater than 70 pixels to be considered a true defect. For blocky defects, the actual number of pixels in the connected component must be greater than 300 to be considered a true defect. The final detection result is as follows: Figure 8 As shown, a magnified view of the specific defect area is as follows: Figure 9 As shown.
[0108] The keyboard cover surface image acquisition system and keyboard cover surface quality detection method provided in this embodiment are mainly applicable to plastic keyboard covers, but also applicable to keyboard covers made of other similar materials.
[0109] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware, and the corresponding program can be stored in a computer-readable storage medium.
[0110] It should be noted that although the method operations of the above embodiments are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the order of execution of the described steps may be changed. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0111] Example 2:
[0112] like Figure 10 As shown, this embodiment provides a device for detecting the surface quality of a keyboard cover. The device includes a data acquisition module 1001, a binarization module 1002, a filtering module 1003, an adaptive binarization module 1004, a screening and merging module 1005, and a defect identification module 1006, wherein:
[0113] Acquisition module 1001 is used to acquire images of the keyboard cover surface using the upper acquisition system;
[0114] The binarization module 1002 is used to remove the circular detection hole from the acquired image to obtain a detection image; and to obtain a detection region image by binarization based on the detection image.
[0115] The filtering module 1003 is used to filter and denoise the detected image to obtain a denoised image;
[0116] The adaptive binarization module 1004 is used to obtain a bright defect binary map and a dark defect binary map based on the denoised image and the detection region image using adaptive binarization.
[0117] The filtering and merging module 1005 is used to filter and merge the connected components in the bright defect binary map and the dark defect binary map, respectively.
[0118] The defect identification module 1006 is used to determine whether there are defects on the surface of the keyboard cover plate based on the merged connected components.
[0119] The acquisition system used in this embodiment is the acquisition system provided in Embodiment 1. The specific implementation of each module can be found in Embodiment 1 above, and will not be described in detail here. It should be noted that the device provided in this embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.
[0120] Example 3:
[0121] This embodiment provides a terminal device, which can be a computer, such as... Figure 11 As shown, the system includes a processor 1102, a memory, an input device 1103, a display 1104, and a network interface 1105 connected via a system bus 1101. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 1106 and internal memory 1107. The non-volatile storage medium 1106 stores the operating system, computer programs, and a database. The internal memory 1107 provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the processor 1102 executes the computer programs stored in the memory, it implements the keyboard cover surface quality detection method of Embodiment 1 described above, as follows:
[0122] The image acquisition system was used to capture images of the keyboard cover surface.
[0123] The circular detection holes in the acquired image are removed to obtain the detection image; based on the detection image, binarization is used to obtain the detection region image;
[0124] The detected image is filtered and denoised to obtain a denoised image;
[0125] Based on the denoised image and the detection region image, adaptive binarization is used to obtain bright defect binary images and dark defect binary images;
[0126] The connected components in the bright defect binary image and the dark defect binary image are filtered and merged respectively;
[0127] Determine whether there are defects on the surface of the keyboard cover based on the merged connected components.
[0128] The acquisition system used in this embodiment is the acquisition system provided in Embodiment 1.
[0129] Example 4:
[0130] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the keyboard cover surface quality detection method of Embodiment 1 above, as follows:
[0131] The image acquisition system was used to capture images of the keyboard cover surface.
[0132] The circular detection holes in the acquired image are removed to obtain the detection image; based on the detection image, binarization is used to obtain the detection region image;
[0133] The detected image is filtered and denoised to obtain a denoised image;
[0134] Based on the denoised image and the detection region image, adaptive binarization is used to obtain bright defect binary images and dark defect binary images;
[0135] The connected components in the bright defect binary image and the dark defect binary image are filtered and merged respectively;
[0136] Determine whether there are defects on the surface of the keyboard cover based on the merged connected components.
[0137] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. The acquisition system used is the acquisition system provided in Embodiment 1.
[0138] In summary, to efficiently acquire image data of the keyboard surface, this invention provides an integrated image acquisition system using combined multi-angle light and prism refraction imaging. This system can simultaneously acquire multiple images of the front and side surfaces of the keyboard cover from different angles, achieving efficient acquisition of keyboard surface images. Based on the acquired image data, the keyboard cover surface quality detection method provided by this invention, through the use of simple filtering and connected component analysis, improves the accuracy of defect detection, reduces the false negative rate, and rapidly completes the acquisition and detection of defect images.
[0139] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.
Claims
1. A method for detecting the surface quality of a keyboard cover, characterized in that, The method includes: An acquisition system is used to acquire images of the keyboard cover surface. The acquisition system includes a vertical line scan camera, an inclined line scan camera, multiple stroboscopic line light sources, a conveyor belt, and two prisms. The vertical line scan camera is perpendicular to the keyboard cover surface, which is placed on a rubber belt of the conveyor belt. Along the direction from the vertical line scan camera to the keyboard cover surface, multiple stroboscopic line light sources are respectively positioned on both sides of the vertical axis of the vertical line scan camera and are equidistant from the keyboard cover surface. The inclined line scan camera is positioned on one side of the vertical axis of the vertical line scan camera, and a stroboscopic line light source is positioned on the corresponding side. The two prisms... Mirrors are symmetrically arranged on both sides of the rubber strip to reflect the side frame of the keyboard to the vertical line scan camera and the tilt line scan camera to acquire images of the keyboard side. Let 'a' be the angle between the perpendicular bisector of the multiple stroboscopic light sources and the perpendicular bisector of the vertical line scan camera, and let 'b' be the angle between the perpendicular bisector of the tilt line scan camera and the perpendicular bisector of the vertical line scan camera. Then, 'b' is greater than the minimum value of 'a' and less than the maximum value of 'a'. The angle between the perpendicular bisector of the stroboscopic light source corresponding to the tilt line scan camera and the perpendicular bisector of the vertical line scan camera is 'b', and it is the same as the distance from the multiple stroboscopic light sources to the surface of the keyboard cover. The circular detection holes in the acquired image are removed to obtain the detection image; based on the detection image, binarization is used to obtain the detection region image; The detected image is filtered and denoised to obtain a denoised image; Based on the denoised image and the detection region image, adaptive binarization is used to obtain bright defect binary images and dark defect binary images; The connected components in the bright defect binary image and the dark defect binary image are filtered and merged respectively; Determine whether there are defects on the keyboard cover surface based on the merged connected components; The step of obtaining bright defect binary maps and dark defect binary maps using adaptive binarization based on the denoised image and the detection region image includes: The denoised image and the detection region image are filtered multiple times using mean filtering with different filter sizes to obtain I. f and B f ; According to I f and B f The binary image Q of the bright defect is obtained by the following formula. l Binary map of dark defects Q a : ; In the formula, I B (x,y)=I'(x,y)×B f (x,y) is the baseline image, I'(x,y) is the denoised image; T2 is the bright defect ratio threshold, which is greater than 1; T3 is the dark defect ratio threshold, which is less than 1.
2. The detection method according to claim 1, characterized in that, When using a vertical line scan camera and an oblique line scan camera to acquire images of the keyboard cover surface, the acquisition frequency is synchronized with the stroboscopic line light source.
3. The detection method according to claim 1, characterized in that, Filtering connected components in a defective binary graph includes: Opening and closing operations are performed on the defect binary map to remove isolated noise; Perform connected component analysis on the defective binary graph after opening and closing operations, and obtain the minimum bounding rectangle of each connected component; Remove connected components that do not meet the following filtering criteria: ; In the formula, A is the number of actual pixels contained in the connected region; h and w are the lengths of the long and short sides of the minimum bounding rectangle, respectively; T4 is the area threshold to remove connected regions with too small an area; T5 is the aspect ratio threshold to distinguish between long strip defects and block defects; T6 is the area ratio threshold to avoid block connected regions containing a number of actual pixels that are much smaller than the minimum bounding rectangle. The defect binary map is either a bright defect binary map or a dark defect binary map.
4. The detection method according to claim 3, characterized in that, The opening operation uses a 3×3 rectangle as its structuring element, while the closing operation uses a 13×13 rectangle as its structuring element.
5. The detection method according to claim 3, characterized in that, Merging connected components in a defective binary graph includes: Connected components that are adjacent in position and similar in angle are merged based on the following criteria: Expand the length and width of the minimum bounding rectangle of the connected region. For each pixel, if two expanded minimum bounding rectangles intersect, then the two connected components are adjacent; where, It is a positive integer greater than or equal to 1; Let the angles of the minimum bounding rectangles of the two connected components be respectively and ,like If the angles of the two connected components are similar, then the angle of the minimum bounding rectangle is the angle between the longer side of the minimum bounding rectangle and the horizontal axis, with a range of [value missing]. ; To set the angle error threshold.
6. The detection method according to any one of claims 1 to 5, characterized in that, The step of determining whether there are defects on the keyboard cover surface based on the merged connected components includes: If it is a long strip-shaped defect, and the length of the longest side of the minimum bounding rectangle of the merged connected components is greater than the first set threshold, then there is a defect on the surface of the keyboard cover. If it is a block defect, and the number of actual pixels contained in the merged connected region is greater than the second set threshold, then there is a defect on the surface of the keyboard cover.
7. A device for detecting the surface quality of a keyboard cover, characterized in that, The device includes: An acquisition module is used to acquire images of the keyboard cover surface using an acquisition system. The acquisition system includes a vertical line scan camera, an inclined line scan camera, multiple strobe light sources, a conveyor belt, and two prisms. The vertical line scan camera is perpendicular to the keyboard cover surface, which is placed on the rubber belt of the conveyor belt. In the direction from the vertical line scan camera to the keyboard cover surface, multiple strobe light sources are respectively positioned on both sides of the vertical line of the vertical line scan camera and are equidistant from the keyboard cover surface. The inclined line scan camera is positioned on one side of the vertical line of the vertical line scan camera, and a strobe light source is positioned on the other side. Two prisms are symmetrically arranged on both sides of the rubber strip to reflect the side frame of the keyboard to the vertical line scan camera and the tilt line scan camera to acquire images of the keyboard side. Let 'a' be the angle between the perpendicular bisector of the multiple stroboscopic light sources and the perpendicular bisector of the vertical line scan camera, and let 'b' be the angle between the perpendicular bisector of the tilt line scan camera and the perpendicular bisector of the vertical line scan camera. Then, 'b' is greater than the minimum value of 'a' and less than the maximum value of 'a'. The angle between the perpendicular bisector of the stroboscopic light source corresponding to the tilt line scan camera and the perpendicular bisector of the vertical line scan camera is 'b', and it is the same as the distance from the multiple stroboscopic light sources to the surface of the keyboard cover. The binarization module is used to remove the circular detection holes from the acquired image to obtain the detection image; based on the detection image, binarization is used to obtain the detection region image; The filtering module is used to filter and denoise the detected image to obtain a denoised image; The adaptive binarization module is used to obtain bright defect binary maps and dark defect binary maps based on the denoised image and the detection region image using adaptive binarization. The filtering and merging module is used to filter and merge connected components in the bright defect binary map and the dark defect binary map, respectively. The defect identification module is used to determine whether there are defects on the surface of the keyboard cover plate based on the merged connected components. The step of obtaining bright defect binary maps and dark defect binary maps using adaptive binarization based on the denoised image and the detection region image includes: The denoised image and the detection region image are filtered multiple times using mean filtering with different filter sizes to obtain I. f and B f ; According to I f and B f The binary image Q of the bright defect is obtained by the following formula. l Binary map of dark defects Q a : ; In the formula, I B (x,y)=I'(x,y)×B f (x,y) is the baseline image, I'(x,y) is the denoised image; T2 is the bright defect ratio threshold, which is greater than 1; T3 is the dark defect ratio threshold, which is less than 1.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Object surface defect detection system and method
CN110987970A
Weld joint pore defect detection method based on image processing
CN113496483A
Novel bearing surface defect intelligent detection system
CN113686892A