Method for detecting product defect, electronic device and storage medium

TWI935462BActive Publication Date: 2026-08-11DYNABOOK SOLUTIONS & SERVICES (HANGZHOU) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
TW113133358
Authority / Receiving Office
TW · TW
Patent Type
Patents
Current Assignee / Owner
Priority Date
2024-08-28
Filing Date
2024-09-03
Publication Date
2026-08-11
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

Existing defect detection methods for products, such as laptop keyboards, are inefficient due to reliance on manual inspection, which is prone to subjective errors from inspector fatigue and attention fluctuations.

Method used

A method involving image acquisition, detection area determination based on design drawings, and comparison with reference areas using pixel similarity calculations to identify defects accurately and efficiently.

Benefits of technology

Ensures accurate and rapid defect detection by aligning product images with design drawings, enabling quick identification of deviations and abnormalities, thereby improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure TWG2TB001905397_001
    Figure TWG2TB001905397_001
  • Figure TWG2TB001905397_002
    Figure TWG2TB001905397_002
  • Figure TWG2TB001905397_003
    Figure TWG2TB001905397_003
Patent Text Reader

Abstract

This application provides a product defect detection method, electronic device, and storage medium. The method includes: acquiring an image of a product to be tested; determining a corresponding detection area in the image based on a detection location, wherein the detection location is determined based on a design drawing of the product to be tested; and determining a detection result of the product to be tested based on a comparison between the detection area and a reference area corresponding to the detection location. Using the above method, the efficiency of product defect detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates to the field of testing technology, and in particular to a product defect detection method, electronic device and storage medium. [Previous Technology]

[0002] In the product manufacturing field, defect detection is often necessary to ensure product quality and production efficiency. Taking the keyboard of a laptop as an example, as the main interface for user interaction with the device, its quality is directly related to user experience and product image. If there are defects such as repeated keystrokes or stains on the keyboard, it will directly affect the user experience and negatively impact the product image. Therefore, efficient and accurate defect detection of laptop keyboards is particularly important.

[0003] In related technologies, defect detection often relies on manual methods. This manual detection method is easily affected by subjective factors, such as the fatigue level of the inspector and fluctuations in attention, resulting in poor defect detection efficiency. [Summary of the Invention]

[0004] In view of the above, it is necessary to provide a product defect detection method, electronic device and storage medium that can solve the technical problem of poor product defect detection efficiency.

[0005] On one hand, this application provides a product defect detection method, the method comprising: acquiring an image of a product to be tested; determining a corresponding detection area in the image according to a detection location, the detection location being determined based on a design drawing of the product to be tested; and determining a detection result of the product to be tested based on a comparison between the detection area and a reference area corresponding to the detection location.

[0006] In some embodiments of this application, the product under test includes a keyboard or a seal.

[0007] In some embodiments of this application, if the product to be tested is a keyboard, the method further includes: obtaining design drawings of multiple types of keyboards, determining the position of each key in each type of keyboard based on the preprocessed image corresponding to the design drawing of each type of keyboard, and establishing a correspondence between the identification information corresponding to each type of keyboard and the position of all keys in each type of keyboard.

[0008] In some embodiments of this application, determining the position of each key in each type of keyboard based on the preprocessed image corresponding to the design drawing of each type of keyboard includes: detecting the outline of each key in the preprocessed image, and determining the position of each key based on the vertices of the inscribed rectangle in the outline.

[0009] In some embodiments of this application, the determination of the detection position includes: taking the positions of all buttons corresponding to the product under test as the detection position based on the identification information corresponding to the product under test.

[0010] In some embodiments of this application, determining the reference area includes: acquiring an image of a keyboard that belongs to the same category as the product under test and whose keys are correctly installed as a reference image; performing a correction process on the reference image so that the corrected reference image is aligned with the corresponding design drawing; and determining the reference area from the corrected reference image based on the detection position.

[0011] In some embodiments of this application, determining the detection result of the product under test based on the comparison between the detection area and the reference area corresponding to the detection position includes: calculating the similarity of each pixel in the detection area based on the reference area using a preset algorithm; determining whether the detection area includes a defect area based on the preprocessing value corresponding to the similarity of each pixel; if the detection area includes at least one defect area, determining that the product under test has a defect; if the detection area does not include any defect area, determining that the product under test does not have a defect.

[0012] In some embodiments of this application, determining whether the detection region includes a defect region based on the preprocessing value corresponding to the similarity of each pixel includes: determining whether the detection region includes abnormal pixels based on the preprocessing value corresponding to the similarity of each pixel; if the detection region includes the abnormal pixels, determining the area of ​​the candidate region formed by the abnormal pixels; if the area of ​​the candidate region formed by the abnormal pixels is greater than or equal to a preset threshold, determining that the candidate region is a defect region; if the area is less than the preset threshold, determining that the candidate region is not a defect region.

[0013] On the other hand, this application provides an electronic device, the electronic device comprising: a memory for storing at least one instruction; and a processor for executing the at least one instruction to implement the product defect detection method.

[0014] On the other hand, this application provides a computer-readable storage medium storing at least one instruction that, when executed by a processor in an electronic device, implements the product defect detection method.

[0015] In the product defect detection method of this embodiment, since the design drawing can accurately reflect the layout, shape, size, and other features of the product under test, determining the detection location based on the design drawing of the product under test can ensure the accuracy of the detection location. Since the detection location has a corresponding reference area, the detection area can be quickly compared with the corresponding reference area, thereby quickly identifying whether there are deviations, abnormalities, or defects in the detection area that do not conform to the reference area. Since the reference area is standardized and can reflect the expected state of the product under test, the detection result of the product under test can be quickly and accurately determined through comparison, thereby improving the efficiency of product defect detection.

Implementation Method

[0031] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence. In the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of "exemplary" or "for example" is intended to present related concepts in a specific manner. Without conflict, the following embodiments and features can be combined with each other.

[0032] In the product manufacturing field, defect detection is often required to ensure product quality and production efficiency. Taking the keyboard of a laptop as an example, as the main interface for user interaction with the device, the quality of the keyboard is directly related to user experience and product image. If there are defects such as repeated keystrokes or stains on the keyboard, it will directly affect the user experience and have a negative impact on the product image. Therefore, efficient and accurate defect detection of laptop keyboards is particularly important.

[0033] As shown in Figure 1, this is a schematic diagram of a keyboard with repeating keys according to an embodiment of this application. In Figure 1, the keys Q, F, B, C, and L selected by the rectangle are the repeating keys on the keyboard.

[0034] In related technologies, defect detection often relies on manual methods. This manual detection method is easily affected by subjective factors, such as the fatigue level of the inspector and fluctuations in attention, resulting in poor defect detection efficiency.

[0035] This application provides a product defect detection method that can improve the efficiency of product defect detection. The product defect detection method provided in this application can be applied to one or more electronic devices, such as notebook computers, mobile phones, computers, and servers. This application does not limit the type of electronic device.

[0036] Figure 2 shows a flowchart of a product defect detection method according to an embodiment of this application. Depending on different needs, the order of each step in the flowchart can be adjusted according to actual requirements, and some steps can be omitted. The method is applied to electronic devices, such as the electronic device 10 shown in Figure 15.

[0037] S11, Obtain an image of the product to be tested.

[0038] In some embodiments of this application, the product to be tested includes, but is not limited to, keyboards and seals. This application does not limit the type of product to be tested. To clearly illustrate the product defect detection method provided in the embodiments of this application, a keyboard will be used as an example of the product to be tested below.

[0039] In some embodiments of this application, electronic devices can acquire images of the product under test through various methods. This application does not limit the methods of image acquisition.

[0040] Electronic devices can take pictures of a laptop computer through a camera to obtain an image of the laptop computer, detect the outline of the keyboard in the image of the laptop computer, and crop out the area corresponding to the keyboard in the laptop computer based on the outline of the keyboard, thereby obtaining an image of the product under test.

[0041] To reduce the interference of ambient light, reflection, and other factors on the shooting quality, a darkroom can be introduced as the shooting environment, thereby providing a stable and controllable dark environment for shooting. To make the image of the laptop clearer, the shooting environment can be supplemented with light source. For example, the light source can be a backlight with an opening in the middle, and the size of the backlight's luminous surface can be 45x30 cm or 60x40 cm, etc., so as to fully cover and illuminate. The shooting device can be a camera or webcam, etc., and this application does not limit it. The position of the shooting device and the light source can be set to adjustable, so as to flexibly adjust according to shooting needs and ensure the shooting effect. The shooting angle can be vertical, and a certain height can be maintained between the shooting device and the laptop. For example, the vertical height between the shooting device and the laptop can be 40 cm. In order to avoid the impact of the laptop's movement or vibration on the imaging effect, the laptop can be fixed on the fixture to ensure the stability of the laptop.

[0042] In other embodiments, due to factors such as the shooting angle, the keyboard may be tilted in the cropped area. To address this, the cropped area can be corrected so that the corrected area aligns with the design drawing of the product under test, and the corrected area is used as the image to be tested. Figure 3 shows a schematic diagram of the corrected image of the product under test provided in one embodiment of this application. The design drawing will be described below.

[0043] S12, Based on the detection position, determine the corresponding detection area in the image of the product to be tested, and the detection position is determined based on the design drawing of the product to be tested.

[0044] In some embodiments of this application, the design drawing may be an image including key information such as the appearance, structure, size, and functional layout of the product under test. As shown in Figure 4, it is a schematic diagram of the design drawing of a product under test provided in an embodiment of this application. Figure 4 is a design drawing of a keyboard, which reflects information such as the layout and size of the keys on the keyboard.

[0045] In some embodiments of this application, the detection location can be the location of the product under test in the design drawing corresponding to the product under test, and the detection area can be the area corresponding to the product under test in the image of the product under test. For example, if the product under test is a keyboard, the detection location can be the location of each key in the design drawing, and the detection area can be the area corresponding to each key in the image of the product under test, thereby obtaining multiple detection areas. If the product under test is a seal, the detection location can be the location of the seal in the design drawing, and the detection area can be the area corresponding to the seal in the image of the product under test.

[0046] Regarding the method for determining the detection position, taking the product under test as a keyboard as an example, the electronic device can acquire design drawings of multiple types of keyboards. Based on the pre-processed image corresponding to the design drawing of each type of keyboard, the position of each key in each type of keyboard is determined, and a correspondence is established between the identification information corresponding to each type of keyboard and the position of all keys in each type of keyboard.

[0047] The identification information can be used to identify the keyboard's identity. For example, the identification information can be the keyboard's serial number (SN) or barcode, or the identification information can be the serial number or barcode of the notebook computer to which the keyboard is located; this application does not impose any limitations on this. The preprocessed image corresponding to the design drawing of each type of keyboard can be obtained by preprocessing the design drawing of each type of keyboard. The preprocessing includes, but is not limited to, grayscale processing and binarization processing.

[0048] Based on the correspondence, the positions of all buttons in the product under test can be determined as detection positions by identifying the corresponding identification information of the product under test. The electronic device can detect the outline of each button in the preprocessed image and determine the position of each button based on the vertices of the inscribed rectangle in the outline.

[0049] This application does not limit the method for detecting the outline of the buttons. For example, pixels in the preprocessed image that are less than or equal to a preset value can be determined as pixels constituting the outline of the buttons, thereby determining the outline of each button. The preset value can be customized, and this application does not limit this. For example, as shown in Figure 5, it is a schematic diagram of the outline of the buttons in a design drawing provided by an embodiment of this application. In Figure 5, the white edge of each button represents the outline of the button. The above examples of methods for detecting the outline of buttons are merely examples, and are not limited to these in actual applications. For example, electronic devices can also determine the outline of each button in the preprocessed image through an edge detection algorithm. The edge detection algorithm can be the Canny algorithm, the Sobel operator, etc.

[0050] For example, the electronic device can determine the position of the button by the coordinates of all or some of the vertices of the inscribed rectangle in the outline of each button. For example, the position of the button can be determined by the coordinates of the top-left vertex and the bottom-right vertex, or the coordinates of the top-left vertex and the bottom-right vertex, in the inscribed rectangle in the outline of each button.

[0051] Based on the identification information corresponding to the product under test, the electronic device can determine the positions of all buttons corresponding to the product under test as the detection positions.

[0052] For example, by reading the serial number corresponding to the product under test, or by scanning and recognizing the barcode of the product under test, the electronic device can determine the position of the button corresponding to the product under test and determine the position of the button corresponding to the product under test as the detection position.

[0053] In other embodiments of this application, the electronic device can establish a correspondence between each type of product under test and the design drawing of each type of product under test. By directly reading the serial number corresponding to the product under test, or by scanning and recognizing the barcode of the product under test, the electronic device can determine the design drawing corresponding to the product under test, and determine the detection position corresponding to the product under test from the determined design drawing.

[0054] In some embodiments of this application, the corresponding detection area can be determined from the image of the product to be tested based on the detection location.

[0055] In other embodiments, the electronic device may use techniques such as image matting to cut out or segment the detection area from the image of the product to be tested based on the detection location.

[0056] For example, if the detection position is the coordinates of the upper left and lower right vertices of an inscribed rectangle, the electronic device can determine the rectangular outline corresponding to the button in the image of the product under test through the detection position, and use the area within the rectangular outline as the detection area. Figure 6 shows a schematic diagram of the determination of the detection area provided in an embodiment of this application. In Figure 6, the white rectangle is the outline corresponding to each button. Based on the detection position, the rectangular outline corresponding to each button in the image of the product under test shown in Figure 3 can be determined, and the area within the rectangular outline can be used as the detection area.

[0057] In this embodiment, since the design drawing can accurately reflect the layout, shape, size and other features of the product under test, determining the detection position based on the design drawing of the product under test can ensure the accuracy of the detection position.

[0058] S13, Based on the comparison between the detection area and the reference area corresponding to the detection position, determine the detection result of the product to be tested.

[0059] In some embodiments of this application, the product under test is a keyboard as an example. The determination of the reference area includes: obtaining an image of a keyboard that belongs to the same category as the product under test and whose keys are correctly installed as a reference image; performing a correction process on the reference image so that the corrected reference image is aligned with the corresponding design drawing; and determining the reference area from the corrected reference image based on the detection position.

[0060] The method for obtaining the reference image can refer to the description of the method for obtaining the image of the product under test in step S11, and will not be repeated in this application. In practical applications, the reference image corresponding to the product under test can be the first image of a product of the same category as the product under test that can be received by the electronic device.

[0061] For example, a correspondence can be established between each type of product under test and a reference image for each type of product under test. When a reference image corresponding to a product under test cannot be found (e.g., during initial testing), a prompt text can be generated, in which the user creates the corresponding reference image. Upon receiving a reference image corresponding to each type of product under test, the design drawing and reference image corresponding to each type of product under test can be simultaneously displayed visually for the user to view and confirm.

[0062] The area corresponding to the detection position in the corrected reference image can be determined as the reference area. If there are multiple detection positions, the reference area corresponding to each detection position can be determined from the reference image.

[0063] In other embodiments, image matting technology can be used to extract the reference region corresponding to each detection position from the reference image, thereby obtaining the reference region corresponding to each detection position.

[0064] For example, as shown in FIG7, it is a schematic diagram of a corrected reference diagram provided in an embodiment of this application. As shown in FIG8, it is a schematic diagram of determining a reference area provided in an embodiment of this application. In FIG8, the white rectangle is the outline corresponding to each button. Based on the detection position, the rectangular outline corresponding to each button in the reference diagram shown in FIG7 can be determined, and the area within the rectangular outline is used as the reference area.

[0065] As shown in Figure 9, it is a comparative schematic diagram of the detection area and the reference area provided in an embodiment of this application. The upper part of Figure 9 is the reference area shown in Figure 8, and the lower part of Figure 9 is the reference area shown in Figure 6. Through comparison, it can be determined that buttons F, B, C, Q, L and the right parenthesis button (refer to the thick rectangle in Figure 9) in the reference area shown in Figure 6 are different from buttons E, D, G, L, O and the left parenthesis button in the corresponding positions in Figure 8.

[0066] In some embodiments of this application, determining the detection result of the product to be tested based on the comparison between the detection area and the reference area corresponding to the detection position includes: calculating the similarity of each pixel in the detection area based on the reference area using a preset algorithm; determining whether the detection area includes a defect area based on the preprocessing value corresponding to the similarity of each pixel; if the detection area includes at least one defect area, it can be determined that the product to be tested has a defect; if the detection area does not include any defect area, it can be determined that the product to be tested does not have a defect.

[0067] The preset algorithm can be a structural similarity (SSIM) algorithm. The calculation method for the similarity of each pixel in the detection area can refer to the formula of the structural similarity algorithm, which will not be described in detail in this application. The preprocessed value corresponding to the similarity of each pixel can be obtained by preprocessing the similarity of each pixel. The preprocessing for the similarity of each pixel can include steps such as contrast enhancement, binarization, and morphological operations, and the morphological operations can be erosion and dilation, etc.

[0068] For example, a first region can be generated based on the similarity of each pixel in the detection region, a contrast enhancement process can be performed on the first region to obtain a second region, a binarization process can be performed on the second region to obtain a binary image, morphological operations such as erosion and dilation can be performed on the binary image to obtain a third region, and the pixel value of each pixel in the third region can be determined as the preprocessed value corresponding to the pixel in the detection region.

[0069] For example, the electronic device can determine whether the detection area includes abnormal pixels by using the preprocessed value corresponding to each pixel in the detection area. If the detection area includes abnormal pixels, the area of ​​the candidate area formed by the abnormal pixels is determined. If the area is greater than or equal to a preset threshold, the candidate area is determined to be a defective area; otherwise, if the area is less than the preset threshold, the candidate area is determined not to be a defective area. If the detection area includes at least one candidate area that is a defective area, it can be determined that the detection area includes a defective area. The preset threshold can be customized, and this application does not limit it. For example, the preset threshold can be 7.

[0070] In other embodiments of this application, the electronic device can select a defect area and visually display the selected defect area and its area.

[0071] When there are multiple inspection areas, it can be determined whether each inspection area includes a defective area. If all inspection areas include at least one defective area, it can be determined that the product under test has a defect. If all inspection areas do not include any defective areas, it can be determined that the product under test does not have a defect.

[0072] In this embodiment, when the area is greater than or equal to a preset threshold, the probability that the candidate region does not match the corresponding region in the reference region is relatively high. Therefore, determining that the candidate region is not a defective region ensures the accuracy of the candidate region determination. When the area is less than the preset threshold, the probability that the candidate region does not match the corresponding region in the reference region is relatively low. Therefore, determining that the candidate region is not a defective region ensures the accuracy of the candidate region determination.

[0073] To ensure the accuracy of product testing, the product defect detection method provided in this application embodiment was tested multiple times using multiple sets of test images. Each set of test images includes a test image and a reference image. As shown in Figure 10, it is a test schematic diagram of the first set of test images provided in an embodiment of this application. Figure 10(a) is the reference image in the first set of test images, and Figure 10(b) is the test image in the first set of test images. Figure 10(c) is the first region corresponding to the first set of test images, Figure 10(d) is the second region corresponding to the first set of test images, and Figure 10(e) is the third region corresponding to the first set of test images. As can be seen from Figure 10(f), the product defect detection method provided in this application embodiment can select the defect area in the test image that does not match the reference image and display the area 278 of the defect area.

[0074] As shown in Figure 11, this is a test schematic diagram of the second set of test images provided in an embodiment of this application. Figure 11(a) is a reference image in the second set of test images, and Figure 11(b) is the image to be tested in the second set of test images. Figure 11(c) is the second region corresponding to the second set of test images, Figure 11(d) is the second region corresponding to the second set of test images, and Figure 11(e) is the third region corresponding to the second set of test images. As can be seen from Figure 11(f), the product defect detection method provided in this embodiment of the application can select four defective regions in the image to be tested that do not match the reference image and display the area of ​​each defective region. The areas of the four defective regions are 606, 70, 70, and 539, respectively.

[0075] As shown in Figure 12, this is a test schematic diagram of the third set of test images provided in an embodiment of this application. Figure 12(a) is a reference image in the third set of test images, and Figure 12(b) is the image to be tested in the third set of test images. Figure 12(c) is the third region corresponding to the third set of test images, Figure 12(d) is the third region corresponding to the third set of test images, and Figure 12(e) is the third region corresponding to the third set of test images. As can be seen from Figure 12(f), the product defect detection method provided in this embodiment of the application can select defective areas in the image to be tested that do not match the reference image and display the area 50 of each defective area.

[0076] As shown in Figure 13, this is a test schematic diagram of the fourth set of test images provided in an embodiment of this application. Figure 13(a) is a reference image in the fourth set of test images, and Figure 13(b) is the image to be tested in the fourth set of test images. Figure 13(c) is the third region corresponding to the fourth set of test images, Figure 13(d) is the third region corresponding to the fourth set of test images, and Figure 13(e) is the third region corresponding to the fourth set of test images. As can be seen from Figure 13(f), the product defect detection method provided in this embodiment of the application can select four defective regions in the image to be tested that do not match the reference image and display the area of ​​each defective region. The areas of the four defective regions are 10, 10, 8, and 271, respectively.

[0077] As shown in Figure 14, this is a test schematic diagram of the fifth set of test images provided in an embodiment of this application. Figure 14(a) is a reference image in the fifth set of test images, and Figure 14(b) is the image to be tested in the fifth set of test images. Figure 14(c) is the third region corresponding to the fifth set of test images, Figure 14(d) is the third region corresponding to the fifth set of test images, and Figure 14(e) is the third region corresponding to the fifth set of test images. As can be seen from Figure 14(f), the product defect detection method provided in this embodiment of the application can select two defective regions in the image to be tested that do not match the reference image and display the area of ​​each defective region. The areas of the two defective regions are 6 and 9, respectively.

[0078] In the product defect detection method provided in this application embodiment, since the design drawing can accurately reflect the layout, shape, size, and other characteristics of the product under test, determining the detection location based on the design drawing of the product under test can ensure the accuracy of the detection location. Since the detection location has a corresponding reference area, the detection area can be quickly compared with the corresponding reference area, thereby quickly identifying whether there are deviations, abnormalities, or defects in the detection area that do not conform to the reference area. Since the reference area is standardized and can reflect the expected state of the product under test, the detection result of the product under test can be quickly and accurately determined through comparison, thereby improving the efficiency of product defect detection.

[0079] As shown in Figure 15, this is a structural diagram of an electronic device provided in an embodiment of this application. The electronic device 10 can be a mobile phone, tablet computer, laptop computer, computer, server, or other electronic devices. This application embodiment does not impose any restrictions on the specific type of electronic device.

[0080] As shown in FIG15, the electronic device 10 may include a communication module 101, a memory 102, a processor 103, an input / output (I / O) interface 104, and a bus 105. The processor 103 is coupled to the communication module 101, the memory 102, and the input / output interface 104 through the bus 105.

[0081] Communication module 101 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as Universal Serial Bus (USB) and Controller Area Network (CAN). The wireless communication module may provide one or more wireless communication solutions such as Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication networks, frequency modulation (FM), near field communication (NFC), and infrared (IR).

[0082] Memory 102 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM can be directly read and written by the processor 103, and can be used to store executable programs (e.g., machine instructions) of other running programs, as well as user and application data. The RAM may include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.

[0083] Non-volatile memory can also store executable programs and user and application data, etc., and can be pre-loaded into random access memory for direct reading and writing by the processor 103. Non-volatile memory may include disk memory and flash memory.

[0084] Memory 102 is used to store one or more computer programs. The one or more computer programs are configured to be executed by processor 103. The one or more computer programs include multiple instructions that, when executed by processor 103, enable a product defect detection method to be executed on electronic device 10.

[0085] In other embodiments, the electronic device 10 shown in FIG15 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device 10.

[0086] The processor 103 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video transcoder, a digital signal processor (DSP), and / or a neural network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0087] The processor 103 provides computing and control capabilities. For example, the processor 103 is used to execute computer programs stored in the memory 102 to implement the above-described product defect detection method.

[0088] The input / output interface 104 is used to provide a channel for user input or output. For example, the input / output interface 104 can be used to connect various input / output devices, such as mice, keyboards, touch devices, and display screens, so that users can enter information or visualize information.

[0089] Bus 105 is used at least to provide a channel for communication between communication modules 101, memory 102, processor 103 and input / output interface 104 in electronic device 10.

[0090] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 10. In other embodiments of this application, the electronic device 10 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of hardware and software.

[0091] This application also provides a computer-readable storage medium storing a computer program, which includes program instructions. When the program instructions are executed, the method implemented can refer to the methods in the above embodiments of this application.

[0092] The computer-readable storage medium may be the internal memory of the electronic device described in the above embodiments, such as the hard drive or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. equipped on the electronic device.

[0093] In some embodiments, the computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, etc.; and the data storage area may store data created based on the use of the electronic device, etc.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of the modules is merely a logical functional division, and there may be other division methods in actual implementation.

[0095] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] In addition, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware form or in the form of hardware plus software functional modules.

[0097] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be incorporated into this application. No appended diagram markings in the claims should be construed as limiting the scope of the claims involved.

[0098] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in this application may also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not imply any specific order. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application. [Simplified Explanation of the Diagram]

[0016] Figure 1 is a schematic diagram of a keyboard with repeated keystrokes provided in an embodiment of this application.

[0017] Figure 2 is a flowchart of a product defect detection method provided in an embodiment of this application.

[0018] Figure 3 is a schematic diagram of an image of a calibrated product under test provided in an embodiment of this application.

[0019] Figure 4 is a schematic diagram of the design of the product under test provided in an embodiment of this application.

[0020] Figure 5 is a schematic diagram of the outline of the button in a design drawing provided in an embodiment of this application.

[0021] Figure 6 is a schematic diagram of the determination of the detection area provided in an embodiment of this application.

[0022] Figure 7 is a schematic diagram of a corrected reference diagram provided in an embodiment of this application.

[0023] Figure 8 is a schematic diagram of the determination of a reference area provided in an embodiment of this application.

[0024] Figure 9 is a schematic diagram comparing the detection area and the reference area provided in an embodiment of this application.

[0025] Figure 10 is a test schematic diagram of the first set of test images provided in an embodiment of this application.

[0026] Figure 11 is a test schematic diagram of the second set of test images provided in an embodiment of this application.

[0027] Figure 12 is a test schematic diagram of the third set of test images provided in an embodiment of this application.

[0028] Figure 13 is a test schematic diagram of the fourth set of test images provided in an embodiment of this application.

[0029] Figure 14 is a test schematic diagram of the fifth set of test images provided in an embodiment of this application.

[0030] Figure 15 is a structural diagram of an electronic device provided in an embodiment of this application.

Claims

1. A product defect detection method, applied to electronic devices, wherein, The method includes: acquiring an image of the product to be tested; determining a corresponding detection area in the image based on a detection location, wherein the detection location is determined based on a design drawing of the product to be tested; and determining a detection result of the product to be tested based on a comparison between the detection area and a reference area corresponding to the detection location, including: calculating the similarity of each pixel in the detection area using a preset algorithm based on the reference area; determining whether the detection area includes a defect area based on a preprocessed value corresponding to the similarity of each pixel; if the detection area includes at least one defect area, determining that the product to be tested has a defect; and if the detection area does not include any defect area, determining that the product to be tested does not have a defect.

2. The product defect detection method as described in claim 1, wherein, The product to be tested includes a keyboard or a seal.

3. The product defect detection method as described in claim 2, wherein, If the product to be tested is a keyboard, the method further includes: acquiring design drawings of multiple types of keyboards; determining the position of each key in each type of keyboard based on the preprocessed image corresponding to the design drawing of each type of keyboard; and establishing a correspondence between the identification information corresponding to each type of keyboard and the position of all keys in each type of keyboard.

4. The product defect detection method as described in claim 3, wherein, The step of determining the position of each key in each type of keyboard based on the preprocessed image corresponding to the design drawing of each type of keyboard includes: detecting the outline of each key in the preprocessed image; and determining the position of each key based on the vertices of the inscribed rectangle in the outline.

5. The product defect detection method as described in claim 3 or 4, wherein, The determination of the detection location includes: based on the identification information corresponding to the product under test, taking the positions of all buttons corresponding to the product under test as the detection location.

6. The product defect detection method as described in claim 3, wherein, Determining the reference area includes: acquiring an image of a keyboard belonging to the same category as the product under test and with correctly installed keys as a reference image; performing a calibration process on the reference image to align the calibrated reference image with the corresponding design drawing; and determining the reference area from the calibrated reference image based on the detection position.

7. The product defect detection method as described in claim 1, wherein, The step of determining whether the detection region includes a defect region based on the preprocessed value corresponding to the similarity of each pixel includes: determining whether the detection region includes abnormal pixels based on the preprocessed value corresponding to the similarity of each pixel; if the detection region includes the abnormal pixels, determining the area of ​​the candidate region formed by the abnormal pixels; if the area of ​​the candidate region formed by the abnormal pixels is greater than or equal to a preset threshold, determining the candidate region as a defect region; if the area is less than the preset threshold, determining the candidate region is not a defect region; if the detection region does not include the abnormal pixels, determining that the detection region does not include the defect region.

8. An electronic device, wherein, The electronic device includes: a memory storing at least one instruction; and a processor executing the at least one instruction to implement the product defect detection method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, wherein, The computer-readable storage medium stores at least one instruction, which is executed by a processor in an electronic device to implement the product defect detection method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image detection method and device, electronic equipment and storage medium

    CN115841480A

  • Universal keyboard anomaly detection method

    CN115861288A

  • A method for inspecting the appearance quality of a laptop

    CN116452580B

  • System and method for domain adaptive defect detection - Patents.com

    JP6873129B2

  • Extraction apparatus and method for defect pattern of tested object, and storage medium

    WO2021184525A1