Keyboard keycap defect detection system and method

Identifying keycap defects through optical imaging and multi-level image processing modules solves the problem of defect hiding caused by unreasonable threshold settings in the existing technology, achieves more accurate detection and production line optimization, and improves the quality and user experience of the keyboard.

CN118594971AInactive Publication Date: 2024-09-06SHENZHEN LOFREE CULTURE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410641594.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the binary image processing process of existing keyboard keycap defect detection methods, unreasonable threshold settings cause possible particle defects to be hidden, causing defective keyboards to flow into the market and affecting the user experience.

Method used

The optical imaging module is used to obtain the keyboard image, and the image processing module is used for preprocessing and secondary processing. The completeness of the printing information and the pixel value of the particle profile are combined to determine whether there are defects, and the defective keycaps are removed through the sorting module. The feedback module is adjusted according to the defect category. Production line optimization.

Benefits of technology

Accurately identify defects on keycap images to avoid hiding defects caused by unreasonable threshold settings, improve detection accuracy, ensure user experience, and optimize the production line through frequency adjustment to reduce the frequency of defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118594971A
    Figure CN118594971A
Patent Text Reader

Abstract

The invention belongs to the technical field of keycap defect detection, and particularly relates to a keyboard keycap defect detection system and method.The keyboard keycap defect detection system comprises an optical imaging module used for shooting a keyboard keycap to obtain a keyboard image; the image processing module is used for preprocessing the keyboard image to obtain a keycap image; the primary processing module is used for processing the keycap image and identifying a defective keycap; printing information and a background in a keycap image are segmented through the primary processing module, whether the keycap image has defects or not is determined by judging the integrity of the printing information, and whether particle contours belong to the defects or not is calculated and analyzed through the secondary processing module, so that the defects possibly existing on the keycap image are accurately recognized, and the phenomenon that the defects possibly exist in the keycap image due to binarization image processing is avoided. Due to the fact that the threshold value is set unreasonably, possible particle defects are hidden, then the keyboard with the defects flows into the market, and the experience feeling of a user is affected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of key cap defect detection, and in particular to a keyboard key cap defect detection system and method. Background Art

[0002] The keyboard is one of the indispensable tools in the digital age, and the keycaps are an essential part of the keyboard. After the keyboard is produced, the quality of the keycaps needs to be monitored. The complete printed information on the keycap surface and the absence of particle defects are important guarantees for users to have a good experience.

[0003] During the keyboard production stage, due to the influence of materials, molds, etc., the printed information on the keycaps may be incomplete, or there may be particle defects on the keycaps. If the above defects cannot be detected, users will not have a good experience after entering the market. For example, a machine vision-based keycap surface particle defect detection method disclosed in Application No. 202211601776X uses a visual detection camera to capture a keycap tray image, and then uses an image processing algorithm to detect particle defects on the keycap surface to determine whether the product is qualified. Specifically, an image processing algorithm, i.e., binarization processing, is used to process the keycap image by setting a threshold value, so that the particle defects in the keycap image are separated from the background, and then the minimum pixel value, maximum pixel value, and average pixel value of the contour to which the particle defect belongs are calculated to determine whether the particle defect exists.

[0004] However, in the binarization process of keyboard keycap images, the preset threshold is not necessarily reasonable. In the binary image processing technology, when the threshold is set unreasonably, possible particle defects will be hidden, and defective keycaps will not be screened out, resulting in defective keyboards entering the market and causing a bad experience for users.

[0005] To this end, the present invention provides a keyboard keycap defect detection system and method. Summary of the invention

[0006] In order to make up for the deficiencies of the prior art, at least one technical problem raised in the background technology is solved.

[0007] The technical solution adopted by the present invention to solve the technical problem is: a keyboard keycap defect detection system described in the present invention comprises:

[0008] An optical imaging module is used to photograph the keyboard keycaps and obtain a keyboard image;

[0009] An image processing module is used to pre-process the keyboard image and obtain the key cap image and background image;

[0010] A primary processing module, used to determine whether the keycap image has defects according to the completeness of the printed information;

[0011] A secondary processing module is used to determine whether the keycap image has defects according to the pixel value of the particle outline;

[0012] The sorting module removes the keycaps according to their defect categories;

[0013] Feedback module adjusts and optimizes the production line according to the frequency of occurrence of keycap defect categories.

[0014] Preferably, the method for the image processing module to obtain the key cap image is:

[0015] According to the acquired keyboard image;

[0016] Preset a first threshold, and perform binarization processing on the keyboard image according to the first threshold;

[0017] Perform morphological processing and median filtering on the binarized keyboard image;

[0018] Capture all contours in the processed keyboard image and filter out all keycap contours by calculation;

[0019] Each keycap image corresponding to the filtered keycap contour is intercepted.

[0020] Preferably, the method in which the primary processing module determines whether the keycap image has defects according to the completeness of the printed information is:

[0021] Binarizing the acquired keycap image according to a second threshold value to separate the printed information from the background in the keycap image;

[0022] Filter the printed information outline and calculate the area of ​​the minimum circumscribed rectangle surrounding the printed information outline, denoted as Sj;

[0023] Compare Sj with the minimum circumscribed rectangular area Sy of the printed information outline in the sample keycap image;

[0024] If |Sj-Sy|>Sq, the keycap image is directly judged to have defects and a rejection signal is output to the sorting module; otherwise, it is screened whether there is a particle outline;

[0025] Wherein, j represents any printed information profile; Sq is the error threshold.

[0026] Preferably, the method of performing binarization processing on the acquired key cap image according to the second threshold value is:

[0027] The second threshold [Z1-Z2] is constructed by using the average grayscale value of the keycap image printing information and the average grayscale value of the remaining positions of the keycap image, and Z1<Z2;

[0028] The pixel values ​​below the threshold Z1 and above the threshold Z2 in the keycap image are set to 255; the remaining pixel values ​​are set to 0;

[0029] The printed information and the background in the key cap image are segmented according to the second threshold [Z1-Z2], the portion with a pixel value of 255 is recorded as Q1, and the portion with a pixel value of 0 is recorded as Q2.

[0030] Preferably, the method in which the secondary processing module determines whether the keycap image has defects according to the particle contour pixel value is:

[0031] When the particle outline exists, calculate the minimum circumscribed rectangle surrounding the particle outline;

[0032] Obtain the minimum pixel value and the maximum pixel value in the minimum bounding rectangle, and calculate the average pixel value of all pixels in the bounding rectangle;

[0033] When the minimum pixel value, the maximum pixel value and the average pixel value are all within the threshold range [0-Z1] or [Z2-255], it is determined that the keycap image has defects. Otherwise, the optimized threshold Z is determined, and Q2 is binarized according to the optimized threshold Z.

[0034] Preferably, the method of determining the optimized threshold Z and binarizing Q2 according to the optimized threshold Z is:

[0035] Get all pixel values ​​of part Q2 and determine the optimization threshold Z;

[0036] Use the optimized threshold Z to binarize the Q2 part and separate the target from the background;

[0037] Find all contours in the target and find the minimum enclosing rectangle of the contours;

[0038] Calculate the maximum pixel value, minimum pixel value and average pixel value of the contour enclosed by the minimum circumscribed rectangle;

[0039] When the minimum pixel value, the maximum pixel value and the average pixel value of the contour are all within the threshold range [0-Z], it is determined that the keycap image has defects, otherwise it is determined that the keycap image has defects.

[0040] Preferably, the method for determining the optimization threshold Z is:

[0041] Get all pixel values ​​of part Q2 and display them in a histogram;

[0042] The discrete degree and distribution of pixel values ​​in part Q2 are reflected according to the histogram;

[0043] Get the pixel value corresponding to the lowest trough position in the histogram as the initial threshold Zi

[0044] The initial threshold Zi is used to binarize the Q2 part in the key cap image, and the Q2 part is divided into two parts, Q21 and Q22;

[0045] Calculate the average pixel value and corresponding area weight of part Q21 and part Q22 respectively. The average pixel value is recorded as Zi1 and Zi2, and the area weight is recorded as α and β;

[0046] According to Zi1, Zi2 and the corresponding α, β, the updated threshold Zi' is calculated according to the formula:

[0047] Zi'=(Zi1·α+Zi2·β) / (α+β);

[0048] The image is segmented and the updated threshold Zi' is calculated iteratively with the updated threshold Zi' until the difference between the updated threshold Zi' of two consecutive iterations is less than the preset gray value, and the optimized threshold Z is obtained.

[0049] Preferably, the method for the sorting module to remove keycaps according to defect categories is:

[0050] According to the determination result of the key cap image, the corresponding key cap is marked and removed;

[0051] The determination result includes missing printed information, presence of defective position, or a combination of the two.

[0052] Preferably, the feedback module adjusts and optimizes the production line according to the frequency of occurrence of key cap defect categories in a method as follows:

[0053] Record the determination result of the key cap image;

[0054] The result information of the missing and defective positions of the printed information are recorded as P1 and P2 respectively;

[0055] Use the cloud platform to count the frequency of P1 and P2 on the same production line within a unit time;

[0056] Adjust and optimize the production line according to the frequency of the result information.

[0057] Preferably, a keyboard keycap defect detection method comprises the following steps:

[0058] S1: setting a first threshold, and using a binarization technique to process the keyboard image to obtain a key cap image;

[0059] S2: setting a second threshold, processing the key cap image using a binarization technique, and segmenting the printed information from the background image;

[0060] S3: judging whether the selected contour is a keycap defect contour according to the completeness of the printing information and the pixel value of the particle contour;

[0061] S4: Screening defective keycaps and removing the corresponding keycaps;

[0062] S5: Adjust the production line according to the frequency of keycap defects.

[0063] The beneficial effects of the present invention are as follows:

[0064] 1. A keyboard keycap defect detection system and method described in the present invention adopts an AOI optical imaging system, and through fixedly arranged light sources and sensors, the difference between the keyboard image taken by the keyboard to be detected and the sample keycap image is reduced, so that the obvious difference between the keyboard image to be detected and the sample keycap image can be obtained by comparison, so as to reach a preliminary judgment on the keyboard image or keycap image to be detected. In the case of no difference in the preliminary judgment, it is necessary to continue to segment the printed information and the background in the keycap image through a primary processing module, and determine whether the keycap image has defects by judging the completeness of the printed information. Then, the secondary processing module is used to calculate and analyze whether the particle contour is a defect, so as to accurately identify possible defects on the keycap image, and avoid hiding possible particle defects due to unreasonable threshold setting during binary image processing, which in turn causes defective keyboards to enter the market and affect the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The present invention will be further described below in conjunction with the accompanying drawings.

[0066] Figure 1 is a flow chart of the present invention; DETAILED DESCRIPTION

[0067] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.

[0068] After the keycaps are produced, an optical imaging system is used to detect whether the keycaps have defects. If there are defects on the keycaps, it will affect the users. Specifically, conventional defect detection of keycaps is generally performed by extracting the keycap image from the entire keyboard image through binary image processing technology to judge whether there are defects in the appearance of the keycaps. The main defect types considered include: whether the printed pattern is clear and complete, and whether there are particle defects. Among them, the incomplete printed pattern affects the users, and the presence of particle defects makes the keyboard have a poor tactile experience during the use stage. As an embodiment of the present invention, Figure 1As shown, a keyboard keycap defect detection system described in an embodiment of the present invention includes: an optical imaging module, used to photograph keyboard keycaps and obtain a keyboard image; an image processing module, used to preprocess the keyboard image and obtain a keycap image and a background image; a primary processing module, used to determine whether the keycap image has defects based on the completeness of printed information; a secondary processing module, used to determine whether the keycap image has defects based on the pixel value of the particle contour; a sorting module, which removes the keycaps according to the keycap defect category; and a feedback module, which adjusts and optimizes the production line according to the frequency of occurrence of the keycap defect category.

[0069] An optical imaging module is used to photograph the keyboard keycaps to obtain a keyboard image, wherein the optical imaging module uses an AOI optical imaging system, and through fixedly arranged light sources and sensors, the difference between the keyboard image photographed by the keyboard to be tested and the sample keycap image is reduced, so that the obvious difference between the keyboard image to be tested and the sample keycap image can be obtained by comparison, so as to achieve a preliminary judgment on the keyboard image or keycap image to be tested. If there is no difference in the preliminary judgment, the keycap image needs to be optimized through the primary processing module and the secondary processing module, so as to accurately identify possible defects on the keycap image, and avoid the possible particle defects being hidden in the background image after the binarization process due to unreasonable threshold setting during the binarization image processing, thereby causing defective keyboards to enter the market and affect the user experience;

[0070] Secondly, based on the defect detection of the keyboard to be inspected, the number and frequency of defects are recorded by computer. For the defect types with high frequency, the production line is optimized in time to reduce the frequency of defects.

[0071] After obtaining the keyboard image, including the keyboard image to be detected and the sample keyboard image; respectively, through the first threshold, the keyboard image to be detected and the sample keycap image are processed by binarization to obtain the keycap image to be detected and the sample keycap image; by screening the contour of the keycap image to be detected, it is preliminarily determined whether the printing information of the keycap image to be detected is complete, and if the printing information is incomplete, it is directly determined that the keycap has defects, wherein, to determine whether the printing information of the keycap image to be detected is complete, it is necessary to compare it with the printing information in the sample keycap image, and then determine whether the printing information of the keycap image to be detected is complete; as an embodiment of the present invention, the method for the image processing module to obtain the keycap image is:

[0072] According to the acquired keyboard image;

[0073] Preset a first threshold, and perform binarization processing on the keyboard image according to the first threshold;

[0074] Perform morphological processing and median filtering on the binarized keyboard image;

[0075] Capture all contours in the processed keyboard image and filter out all keycap contours by calculation;

[0076] Each keycap image corresponding to the filtered keycap contour is intercepted.

[0077] After the keycap image is acquired, it is necessary to use a threshold to segment the printed information and the background image in the keycap image, and compare the printed information area in the keycap image to be detected with the printed information area in the sample keycap image, so as to judge whether the integrity of the printed information in the keycap image to be detected meets the standard. As an embodiment of the present invention, the method for the primary processing module to judge whether the keycap image has defects according to the integrity of the printed information is as follows:

[0078] Binarizing the acquired keycap image according to a second threshold value to separate the printed information from the background in the keycap image;

[0079] Filter the printed information outline and calculate the area of ​​the minimum circumscribed rectangle surrounding the printed information outline, denoted as Sj;

[0080] Compare Sj with the minimum circumscribed rectangular area Sy of the printed information outline in the sample keycap image;

[0081] If |Sj-Sy|>Sq, the keycap image is directly judged to have defects and a rejection signal is output to the sorting module; otherwise, it is screened whether there is a particle outline;

[0082] Wherein, j represents any printed information profile; Sq is the error threshold.

[0083] In the above embodiment, the sample keycap image and the keycap image to be detected are both binarized using the same second threshold value. In this embodiment, the second threshold value is [75-180], that is, in the keycap image to be detected, the pixel values ​​below 75 or above 180 are set to 255, and the pixel values ​​between 75 and 180 are set to 0; the sample keycap image is processed in the same way; after the binarization process, the printed information outline is screened, and the area of ​​the minimum circumscribed rectangle surrounding the printed information outline is used as the printed information area in the keycap image to be detected and the sample keycap image, and the difference between Sj and Sy and the error threshold Sq are judged to determine whether the keycap image to be detected has defects.

[0084] The preset first threshold is used to filter out the keycap images in the keyboard image. The preset first threshold is obtained based on experience, and both the keyboard image to be detected and the sample keyboard image are binarized by the first threshold, so as to obtain keycap images of the same size.

[0085] The purpose of the binary image processing technology is to simplify the image and separate the target from the background in the image, so as to facilitate the judgment of the target. As an embodiment of the present invention, the method of performing binary processing on the acquired key cap image according to the second threshold is:

[0086] The second threshold [Z1-Z2] is constructed by using the average grayscale value of the keycap image printing information and the average grayscale value of the remaining positions of the keycap image, and Z1<Z2;

[0087] The pixel values ​​below the threshold Z1 and above the threshold Z2 in the keycap image are set to 255; the remaining pixel values ​​are set to 0;

[0088] The printed information and the background in the key cap image are segmented according to the second threshold [Z1-Z2], the portion with a pixel value of 255 is recorded as Q1, and the portion with a pixel value of 0 is recorded as Q2.

[0089] As mentioned above, in this embodiment, a second threshold value [75-180] is pre-constructed, and the pixel values ​​below the threshold value 75 and above the threshold value 180 are set to 255, and the remaining pixel values ​​are set to 0, in order to screen out the target containing printing information and particle defects from the background, wherein the pixel value of the printing information is lower than 75, and therefore it will be set to 255 together with the particle defects, and the background excluding the printing information and the particle defects is set to 0; through the above-mentioned binarization processing, the Q1 part containing the printing information and the particle defects can be separated from the Q2 part corresponding to the background, and then compared with the area of ​​the printing information in the sample keycap image, so as to determine whether the keycap image has defects.

[0090] After determining whether the keycap image has defects according to the completeness of the printed information, if the printed information in the keycap image is complete, in order to avoid particle defects in the Q1 part, it is necessary to detect other contours corresponding to the removed printed information in the Q1 part. Specifically, as an embodiment of the present invention, the secondary processing module determines whether the keycap image has defects according to the particle contour pixel value. The method is:

[0091] When the particle outline exists, calculate the minimum circumscribed rectangle surrounding the particle outline;

[0092] Obtain the minimum pixel value and the maximum pixel value in the minimum bounding rectangle, and calculate the average pixel value of all pixels in the bounding rectangle;

[0093] When the minimum pixel value, the maximum pixel value and the average pixel value are all within the threshold range [0-Z1] or [Z2-255], it is determined that the keycap image has defects. Otherwise, the optimized threshold Z is determined, and Q2 is binarized according to the optimized threshold Z.

[0094] Due to the judgment on the completeness of the printed information in the keycap image, it can be directly determined that the keycap image has defects only after it is determined that the printed information is incomplete. When the printed information is complete, in order to avoid the existence of particle defects, it is necessary to supplement the detection of the particle contour in the keycap image. In this embodiment, if there is a particle defect, the corresponding contour is screened, and the minimum pixel value, the maximum pixel value and the average pixel value are calculated to determine whether the contour belongs to the keycap defect contour. If there is no particle contour in the Q1 part after the second threshold processing or the corresponding particle contour is not a defect, in order to prevent the unreasonable setting of the second threshold, resulting in the existence of particle defects in the background image, it is necessary to optimize the threshold and binarize the keycap image again with the optimized threshold Z to prevent the particle defect from being hidden due to the unreasonable setting of the second threshold.

[0095] As mentioned above, in order to prevent the unreasonable setting of the second threshold, which causes some particle defects to be hidden in the Q2 part, resulting in defective keyboards entering the market and causing poor user experience, as an embodiment of the present invention, the method of determining the optimized threshold Z and binarizing Q2 according to the optimized threshold Z is:

[0096] Get all pixel values ​​of part Q2 and determine the optimization threshold Z;

[0097] Use the optimized threshold Z to binarize the Q2 part and separate the target from the background;

[0098] Find all contours in the target and find the minimum enclosing rectangle of the contours;

[0099] Calculate the maximum pixel value, minimum pixel value and average pixel value of the contour enclosed by the minimum circumscribed rectangle;

[0100] When the minimum pixel value, the maximum pixel value and the average pixel value of the contour are all within the threshold range [0-Z], it is determined that the keycap image has defects, otherwise it is determined that the keycap image has defects.

[0101] Since there is no particle outline in the Q1 part of the keycap image after the second threshold processing, or the particle outline is not a defect, the Q2 part is re-binarized by optimizing the threshold Z. After processing, the target and background of the Q2 part are segmented, and the particle outline is found. The pixel value of the outline is calculated to determine whether the particle outline is a defect. If there is still no particle outline, or the particle outline is not a defect, it means that the keycap image does not have a defect.

[0102] In order to obtain an optimized threshold Z that can more accurately segment the target and background images in the Q2 part, as an embodiment of the present invention, the method for determining the optimized threshold Z is:

[0103] Get all pixel values ​​of part Q2 and display them in a histogram;

[0104] The discrete degree and distribution of pixel values ​​in part Q2 are reflected according to the histogram;

[0105] Get the pixel value corresponding to the lowest trough position in the histogram as the initial threshold Zi

[0106] The initial threshold Zi is used to binarize the Q2 part in the key cap image, and the Q2 part is divided into two parts, Q21 and Q22;

[0107] Calculate the average pixel value and corresponding area weight of part Q21 and part Q22 respectively. The average pixel value is recorded as Zi1 and Zi2, and the area weight is recorded as α and β;

[0108] According to Zi1, Zi2 and the corresponding α, β, the updated threshold Zi' is calculated according to the formula:

[0109] Zi'=(Zi1·α+Zi2·β) / (α+β);

[0110] The image is segmented and the updated threshold Zi' is calculated iteratively with the updated threshold Zi' until the difference between the updated threshold Zi' of two consecutive iterations is less than the preset gray value, and the optimized threshold Z is obtained.

[0111] Since the second threshold is not calculated based on the data fed back by the actual image, there is a certain error, resulting in possible particle defects being hidden in the background image. In order to obtain the optimized threshold Z that can accurately segment the target and background images in the actual keycap image, an initial threshold Zi is pre-acquired using a histogram, and then the target and background in part Q2 are segmented according to the initial threshold Zi, recorded as parts Q21 and Q22. The updated threshold Zi' is calculated based on the average pixel value and the corresponding area weight of parts Q21 and Q22, and then the updated threshold Zi' is iteratively calculated until the difference between the updated thresholds Zi' after iteration on both sides is less than the preset grayscale value. At this time, the updated threshold Zi' obtained can be used as the optimized threshold Z. The Q2 part is binarized with the optimized threshold Z. If there is a particle contour, the pixel value is calculated and the keycap image is judged to have defects based on the pixel value. If there is no particle contour, it is determined that the keycap image has no defects.

[0112] For example: assuming that there is a particle outline with a pixel value of 85 in the keycap image after being processed by the second threshold [75-180], and the particle outline should be in the Q2 part after binarization. After judging the completeness of the printed information in the Q1 part, the particle outline cannot be found (theoretically, the particle outline does not exist, that is, the particle image is hidden in Q2). At this time, by obtaining the optimized threshold Z, Z=87.5, the Q2 part is binarized again according to the optimized threshold 87.5, and the pixels with pixel values ​​lower than 87.5 in the Q2 part can be screened out. If there is a particle outline with a pixel value of 85, the particle outline can be screened out from Q2. By calculating the small pixel value, the maximum pixel value and the average pixel value, if they are all within the threshold range [0-Z], it is determined that the keycap image has defects, otherwise the keycap image does not have defects.

[0113] As an embodiment of the present invention, the method of removing keycaps according to defect categories by the sorting module is:

[0114] According to the determination result of the key cap image, the corresponding key cap is marked and removed;

[0115] The determination result includes missing printed information, presence of defective position, or a combination of the two.

[0116] As an embodiment of the present invention, the method for adjusting and optimizing the production line according to the occurrence frequency of keycap defect categories by the feedback module is:

[0117] Record the determination result of the key cap image;

[0118] The result information of the missing and defective positions of the printed information are recorded as P1 and P2 respectively;

[0119] Use the cloud platform to count the frequency of P1 and P2 on the same production line within a unit time;

[0120] Adjust and optimize the production line according to the frequency of the result information.

[0121] As an embodiment of the present invention, a keyboard keycap defect detection method is provided, the detection method comprising the following steps:

[0122] S1: setting a first threshold, and using a binarization technique to process the keyboard image to obtain a key cap image;

[0123] S2: setting a second threshold, processing the key cap image using a binarization technique, and segmenting the printed information from the background image;

[0124] S3: judging whether the selected contour is a keycap defect contour according to the completeness of the printing information and the pixel value of the particle contour;

[0125] S4: Screening defective keycaps and removing the corresponding keycaps;

[0126] S5: Adjust the production line according to the frequency of keycap defects.

[0127] Working principle: The printed information and background in the keycap image are segmented through the primary processing module, and the integrity of the printed information is judged to determine whether the keycap image has defects. The secondary processing module then calculates and analyzes whether the particle outline is a defect, thereby accurately identifying possible defects in the keycap image and avoiding the hiding of possible particle defects due to unreasonable threshold setting during binary image processing, which in turn causes defective keyboards to enter the market and affect the user experience.

[0128] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A keyboard keycap defect detection system, characterized in that: include: An optical imaging module is used to photograph the keyboard keycaps and obtain a keyboard image; An image processing module is used to pre-process the keyboard image and obtain the key cap image and background image; A primary processing module, used to determine whether the keycap image has defects according to the completeness of the printed information; A secondary processing module is used to determine whether the keycap image has defects according to the pixel value of the particle outline; The sorting module removes the keycaps according to their defect categories; Feedback module adjusts and optimizes the production line according to the frequency of occurrence of keycap defect categories.

2. A keyboard keycap defect detection system according to claim 1, characterized in that: The method for the image processing module to obtain the key cap image is: According to the acquired keyboard image; Preset a first threshold, and perform binarization processing on the keyboard image according to the first threshold; Perform morphological processing and median filtering on the binarized keyboard image; Capture all contours in the processed keyboard image and filter out all keycap contours by calculation; Each keycap image corresponding to the filtered keycap contour is intercepted.

3. A keyboard keycap defect detection system according to claim 2, characterized in that: The method for the primary processing module to judge whether the key cap image has defects according to the completeness of the printed information is: Binarizing the acquired keycap image according to a second threshold value to separate the printed information from the background in the keycap image; Filter the printed information outline and calculate the area of ​​the minimum circumscribed rectangle surrounding the printed information outline, denoted as Sj; Compare Sj with the minimum circumscribed rectangular area Sy of the printed information outline in the sample keycap image; If |Sj-Sy|>Sq, the keycap image is directly judged to have defects and a rejection signal is output to the sorting module; otherwise, it is screened whether there is a particle outline; Wherein, j represents any printed information profile; Sq is the error threshold.

4. A keyboard keycap defect detection system according to claim 3, characterized in that: The method for performing binarization processing on the acquired key cap image according to the second threshold value is: The second threshold [Z1-Z2] is constructed by using the average grayscale value of the keycap image printing information and the average grayscale value of the remaining positions of the keycap image, and Z1<Z2; The pixel values ​​below the threshold Z1 and above the threshold Z2 in the keycap image are set to 255; the remaining pixel values ​​are set to 0; The printed information and the background in the key cap image are segmented according to the second threshold [Z1-Z2], the portion with a pixel value of 255 is recorded as Q1, and the portion with a pixel value of 0 is recorded as Q2.

5. A keyboard keycap defect detection system according to claim 4, characterized in that: The method in which the secondary processing module determines whether the key cap image has defects according to the particle outline pixel value is: When the particle outline exists, calculate the minimum circumscribed rectangle surrounding the particle outline; Obtain the minimum pixel value and the maximum pixel value in the minimum bounding rectangle, and calculate the average pixel value of all pixels in the bounding rectangle; When the minimum pixel value, the maximum pixel value and the average pixel value are all within the threshold range [0-Z1] or [Z2-255], it is determined that the keycap image has defects. Otherwise, the optimized threshold Z is determined, and Q2 is binarized according to the optimized threshold Z.

6. A keyboard keycap defect detection system according to claim 5, characterized in that: The method for determining the optimized threshold Z and binarizing Q2 according to the optimized threshold Z is: Get all pixel values ​​of part Q2 and determine the optimization threshold Z; Use the optimized threshold Z to binarize the Q2 part and separate the target from the background; Find all contours in the target and find the minimum enclosing rectangle of the contours; Calculate the maximum pixel value, minimum pixel value and average pixel value of the contour enclosed by the minimum circumscribed rectangle; When the minimum pixel value, the maximum pixel value and the average pixel value of the contour are all within the threshold range [0-Z], it is determined that the keycap image has defects, otherwise it is determined that the keycap image has defects.

7. A keyboard keycap defect detection system according to claim 6, characterized in that: The method for determining the optimization threshold Z is: Get all pixel values ​​of part Q2 and display them in a histogram; The discrete degree and distribution of pixel values ​​in part Q2 are reflected according to the histogram; Get the pixel value corresponding to the lowest trough position in the histogram as the initial threshold Zi The initial threshold Zi is used to binarize the Q2 part in the key cap image, and the Q2 part is divided into two parts, Q21 and Q22; Calculate the average pixel value and corresponding area weight of part Q21 and part Q22 respectively. The average pixel value is recorded as Zi1 and Zi2, and the area weight is recorded as α and β; According to Zi1, Zi2 and the corresponding α, β, the updated threshold Zi' is calculated according to the formula: Zi'=(Zi1·α+Zi2·β) / (α+β); The image is segmented and the updated threshold Zi' is calculated iteratively with the updated threshold Zi' until the difference between the updated threshold Zi' of two consecutive iterations is less than the preset gray value, and the optimized threshold Z is obtained.

8. A keyboard keycap defect detection system according to claim 7, characterized in that: The method of removing keycaps according to defect categories by the sorting module is as follows: According to the determination result of the key cap image, the corresponding key cap is marked and removed; The determination result includes missing printed information, presence of defective position, or a combination of the two.

9. A keyboard keycap defect detection system according to claim 8, characterized in that: The method for adjusting and optimizing the production line according to the occurrence frequency of the key cap defect category by the feedback module is: Record the determination result of the key cap image; The result information of the missing and defective positions of the printed information are recorded as P1 and P2 respectively; Use the cloud platform to count the frequency of P1 and P2 on the same production line within a unit time; Adjust and optimize the production line according to the frequency of the result information.

10. A method for detecting defects in keyboard keycaps, characterized in that: The detection method comprises the following steps: S1: setting a first threshold, and using a binarization technique to process the keyboard image to obtain a key cap image; S2: setting a second threshold, processing the key cap image using a binarization technique, and segmenting the printed information from the background image; S3: judging whether the selected contour is a keycap defect contour according to the completeness of the printing information and the pixel value of the particle contour; S4: Screening defective keycaps and removing the corresponding keycaps; S5: Adjust the production line according to the frequency of keycap defects.

Citation Information

Cited By

  • Measuring system for measuring pitches between keycaps on keyboard

    TWI939053B