Part mounting detection method and device, electronic equipment and storage medium

By acquiring and processing images of the device under test, and utilizing positioning templates and color channel separation technology, the problem of low efficiency and accuracy in parts installation inspection in automated quality inspection equipment has been solved, achieving efficient detection of parts installation anomalies.

CN116721047BActive Publication Date: 2026-03-27BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing technologies, automated quality inspection equipment suffers from low efficiency and accuracy when detecting assembly defects in product parts.

Method used

By acquiring images of the device under test, cropping and processing of the positioning template image to generate a target image, and performing steps such as de-glare processing, color channel separation and matching, and color difference calculation on the target image, it is possible to determine whether there are any installation abnormalities in the parts.

Benefits of technology

It improves the accuracy of parts installation inspection and can effectively detect whether parts are missing, incorrectly installed, or other installation abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116721047B_ABST
    Figure CN116721047B_ABST
Patent Text Reader

Abstract

The present disclosure provides a part installation detection method and device, electronic equipment and storage medium, belonging to the technical field of computer vision. The part installation detection method comprises: acquiring a to-be-detected image of a to-be-detected device, the to-be-detected image being used to detect one or more to-be-detected parts on the to-be-detected device; acquiring a positioning template image of the to-be-detected part, and performing interception processing on the to-be-detected image based on the positioning template image to obtain a target image of the to-be-detected part; and determining whether the to-be-detected part has installation abnormalities based on the target image. Thus, it can be detected whether the to-be-detected part has installation abnormalities, and the accuracy of to-be-detected part detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer vision, and particularly relates to a part installation detection method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the development of automation technology, the efficiency of factories producing products such as mobile phones, computers, smart watches and televisions has been greatly improved, but occasionally there are installation defects of parts in the produced products. In order to ensure the quality of the products, quality inspection is an indispensable process before the products are shipped.

[0003] In order to improve the efficiency of quality inspection, factories often use automatic quality inspection equipment to automatically inspect products. In the related art, due to the influence of product materials, the efficiency and accuracy of quality inspection are low. SUMMARY

[0004] The embodiments of the present disclosure provide a part installation detection method and device, electronic equipment and storage medium, which can detect whether the to-be-tested part has installation abnormalities and improve the accuracy of to-be-tested part detection.

[0005] The first aspect of the present disclosure provides a part installation detection method, comprising: acquiring a to-be-tested image of a to-be-tested device, the to-be-tested image being used to detect one or more to-be-tested parts on the to-be-tested device; acquiring a positioning template image of the to-be-tested part, and performing interception processing on the to-be-tested image based on the positioning template image to acquire a target image of the to-be-tested part; and determining installation information of whether the to-be-tested part has installation abnormalities based on the target image.

[0006] In an embodiment of the present disclosure, the interception processing on the to-be-tested image based on the positioning template image to acquire the target image of the to-be-tested part comprises: performing to-be-tested part position positioning on the to-be-tested image according to the positioning template image to generate position information of the to-be-tested part; generating a to-be-tested part offset value according to the position information and a matching template image of the to-be-tested part; and intercepting the to-be-tested image according to the to-be-tested part offset value and the position information to generate the target image of the to-be-tested part.

[0007] In an embodiment of the present disclosure, the determination of the installation information of whether the to-be-tested part has installation abnormalities based on the target image comprises: performing anti-glare processing on the target image to generate a target detection image related to the to-be-tested part; matching the target detection image with the matching template image to generate a matching result; and determining whether the to-be-tested part is missing according to the matching result.

[0008] In one embodiment of the present disclosure, the determining, based on the target image, whether the to-be-tested part has installation abnormality installation information comprises: intercepting the target image according to an interception strategy to generate a to-be-tested color region of the to-be-tested part and a standard color region of the to-be-tested part; performing color channel separation on a to-be-tested color of the to-be-tested color region and a standard color of the standard color region according to at least one color space respectively to generate a plurality of to-be-tested target colors of the to-be-tested color and a plurality of standard target colors of the standard color; calculating a color difference value between the to-be-tested color and the standard color according to the plurality of to-be-tested target colors and the plurality of standard target colors; and determining whether the to-be-tested part is misinstalled according to the color difference value.

[0009] In one embodiment of the present disclosure, the performing anti-glare processing on the target image to generate a target detection image related to the to-be-tested part comprises: dividing the target image to generate a plurality of region images; calculating a gray mean value of the target image and each region image in the plurality of region images respectively; and processing the plurality of region images according to the gray mean values to generate the target detection image.

[0010] In one embodiment of the present disclosure, the processing the plurality of region images according to the gray mean values to generate the target detection image comprises: processing the plurality of region images according to the gray mean values to generate a detection image; obtaining contour circumscription information of the to-be-tested part according to the detection image; and performing image restoration on the detection image according to part information of the to-be-tested part and the contour circumscription information to generate the target detection image.

[0011] In one embodiment of the present disclosure, the processing the plurality of region images according to the gray mean values to generate a detection image comprises: for each region image, if a gray mean value of the region image is greater than a gray mean value of the target image, obtaining a difference value between the gray mean value of the region image and the gray mean value of the target image and taking the difference value as a gray value of the region image; if the gray mean value of the region image is less than or equal to the gray mean value of the target image, taking the gray mean value of the region image as the gray value of the region image; and creating the detection image according to the gray value corresponding to each region image.

[0012] In one embodiment of the present disclosure, the matching the target detection image with the matching template image to generate a matching result comprises: performing gradient detection on the target detection image to generate a target contour image of the to-be-tested part; and matching the target contour image with the matching template image to generate the matching result.

[0013] In one embodiment of the present disclosure, the matching result at least includes a matching score, and the determining whether the to-be-tested part is missing according to the matching result includes: if the matching score is greater than a matching threshold, determining that the to-be-tested part is not missing; and if the matching score is less than or equal to the matching threshold, determining that the to-be-tested part is missing.

[0014] In one embodiment of the present disclosure, the determining whether the to-be-tested part is misassembled according to the color difference value includes: if the color difference value is greater than a color difference threshold, determining that the to-be-tested part is misassembled; and if the color difference value is less than or equal to the color difference threshold, determining that the to-be-tested part is not misassembled.

[0015] The second aspect of the present disclosure provides a part installation detection device, including: an acquisition module configured to acquire a to-be-tested image of a to-be-tested device, the to-be-tested image being used to detect one or more to-be-tested parts on the to-be-tested device; a cutting module configured to acquire a positioning template image of the to-be-tested part, and perform cutting processing on the to-be-tested image based on the positioning template image to acquire a target image of the to-be-tested part; and a determination module configured to determine, based on the target image, whether the to-be-tested part has installation information of installation abnormality.

[0016] In one embodiment of the present disclosure, the cutting module is specifically configured to: perform to-be-tested part position positioning on the to-be-tested image according to the positioning template image to generate position information of the to-be-tested part; generate a to-be-tested part offset value according to the position information and a matching template image of the to-be-tested part; and perform cutting on the to-be-tested image according to the to-be-tested part offset value and the position information to generate the target image of the to-be-tested part.

[0017] In one embodiment of the present disclosure, the determination module includes: an anti-reflection sub-module configured to perform anti-reflection processing on the target image to generate a target detection image related to the to-be-tested part; a matching sub-module configured to match the target detection image with the matching template image to generate a matching result; and a first determination sub-module configured to determine whether the to-be-tested part is missing according to the matching result.

[0018] In one embodiment of the present disclosure, the determining module comprises: a clipping sub-module, configured to clip the target image according to a clipping strategy to generate a to-be-tested color region of the to-be-tested part and a standard color region of the to-be-tested part; a generating sub-module, configured to perform color channel separation on a to-be-tested color of the to-be-tested color region and a standard color of the standard color region respectively according to at least one color space to generate a plurality of to-be-tested target colors of the to-be-tested color and a plurality of standard target colors of the standard color; a calculating sub-module, configured to calculate a color difference value between the to-be-tested color and the standard color according to the plurality of to-be-tested target colors and the plurality of standard target colors; and a second determining sub-module, configured to determine whether the to-be-tested part is misassembled according to the color difference value.

[0019] In one embodiment of the present disclosure, the anti-glare sub-module comprises: a division unit, configured to divide the target image to generate a plurality of region images; a calculation unit, configured to calculate a gray mean value of the target image and each region image in the plurality of region images respectively; and a generating unit, configured to process the plurality of region images according to the gray mean values to generate the target detection image.

[0020] In one embodiment of the present disclosure, the generating unit comprises: a first generating sub-unit, configured to process the plurality of region images according to the gray mean values to generate a detection image; an acquiring sub-unit, configured to acquire contour circumscribed information of the to-be-tested part according to the detection image; and a second generating sub-unit, configured to perform image restoration on the detection image according to part information of the to-be-tested part and the contour circumscribed information to generate the target detection image.

[0021] In one embodiment of the present disclosure, the first generating sub-unit is specifically configured to: for each region image, if the gray mean value of the region image is greater than the gray mean value of the target image, acquire a difference value between the gray mean value of the region image and the gray mean value of the target image, and take the difference value as a gray value of the region image; if the gray mean value of the region image is less than or equal to the gray mean value of the target image, take the gray mean value of the region image as the gray value of the region image; and create the detection image according to the gray value corresponding to each region image.

[0022] In one embodiment of the present disclosure, the matching sub-module is specifically configured to: perform gradient detection on the target detection image to generate a target contour image of the to-be-tested part; and match the target contour image with the matching template image to generate the matching result.

[0023] In an embodiment of the present disclosure, the first determining sub-module is specifically configured to: if the matching score is greater than a matching threshold, determining that the to-be-tested part is not missing; and if the matching score is less than or equal to the matching threshold, determining that the to-be-tested part is missing.

[0024] In an embodiment of the present disclosure, the second determining sub-module is specifically configured to: if the color difference value is greater than a color difference threshold, determining that the to-be-tested part is misassembled; and if the color difference value is less than or equal to the color difference threshold, determining that the to-be-tested part is not misassembled.

[0025] An electronic device is provided in a third aspect of the present disclosure, comprising: a processor; a memory for storing instructions executable by the processor; and wherein the processor is configured to execute the instructions to implement the part installation detection method provided in the first aspect of the present disclosure.

[0026] A non-transitory computer-readable storage medium is provided in a fourth aspect of the present disclosure, and when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the part installation detection method provided in the first aspect of the present disclosure.

[0027] The part installation detection method, device, electronic device and storage medium provided by the embodiments of the present disclosure can first acquire a to-be-tested image of a to-be-tested device, acquire a positioning template image of a to-be-tested part, and acquire a target image of the to-be-tested part by performing interception processing on the to-be-tested image based on the positioning template image, and then determine whether the to-be-tested part has installation abnormality based on the target image. Thus, it can be determined whether the to-be-tested part has installation abnormality, and the accuracy of the to-be-tested part detection is improved.

[0028] Additional aspects and advantages of the present disclosure will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS

[0029] The above and / or additional aspects and advantages of the present disclosure will become apparent and be readily appreciated from the following description, taken in conjunction with the accompanying drawings, in which:

[0030] Figure 1 A flowchart of a part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 2;

[0031] Figure 2 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 3;

[0032] Figure 3 A specific detail display of a to-be-tested image of a mobile phone card holder provided by an embodiment of the present disclosure is shown in FIG. 4;

[0033] Figure 4 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 6;

[0034] Figure 5 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 6;

[0035] Figure 6 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 6;

[0036] Figure 7 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 6;

[0037] Figure 8 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 6;

[0038] Figure 9 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 6;

[0039] Figure 10 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 6;

[0040] Figure 11 A flowchart of another part installation detection method provided by an embodiment of the present disclosure is shown in FIG. 6; DETAILED DESCRIPTION

[0041] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements, and the various embodiments are not intended to limit the present disclosure. Rather, the following description is made for the sake of example only, and the scope of the disclosure is not limited to the examples given.

[0042] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0043] It should be understood that, although the terms first, second, third, etc. can be used herein to describe various information, the information should not be limited to these terms. These terms are only used to differentiate one piece of information from another piece of information. For example, without departing from the scope of embodiments of the present disclosure, first information can also be referred to as second information, and similarly, second information can also be referred to as first information. Depending on the context, the words "if' and "when' as used herein can be interpreted to mean "upon determining" or "in response to determining".

[0044] Embodiments of the present disclosure are described in detail below with reference to the accompanying drawings, examples of which are shown in the drawings, in which the same or similar reference numerals represent the same or similar elements throughout. The embodiments described below by reference to the drawings are exemplary and are intended to explain the present disclosure, and should not be understood as limiting the present disclosure.

[0045] The part installation detection method, device, electronic device and storage medium of embodiments of the present disclosure are described below with reference to the accompanying drawings. The part installation detection method provided by the embodiments of the present disclosure can be executed by an electronic device, which can be a detection device (such as a quality inspection device, etc.), used to detect whether the parts of a product in a production process have installation abnormalities, wherein the product can include terminal devices (such as mobile phones, tablet computers, notebook computers, etc.), wearable devices (such as smart watches, smart glasses, and VR (Virtual Reality) head-mounted devices, etc.), and home appliances (such as air conditioners, refrigerators, and washing machines, etc.), etc., which are not limited here.

[0046] In embodiments of the present disclosure, a processing component, a storage component and a driving component can be provided in the electronic device. Optionally, the driving component and the processing component can be integrally arranged, and the storage component can store an operating system, an application program or other program modules, and the processing component can implement the part installation detection method provided by the embodiments of the present disclosure by executing the application program stored in the storage component.

[0047] Figure 1 A flowchart of a part installation detection method provided by an embodiment of the present disclosure.

[0048] The part installation detection method of the embodiments of the present disclosure can also be executed by the part installation detection device provided by the embodiments of the present disclosure, which can be configured in the electronic device to achieve the following: acquiring a to-be-tested image of a to-be-tested device, acquiring a positioning template image of a to-be-tested part, performing interception processing on the to-be-tested image based on the positioning template image to acquire a target image of the to-be-tested part, and determining installation information of whether the to-be-tested part has installation abnormalities based on the target image, so as to detect whether the to-be-tested part has installation abnormalities and improve the accuracy of the to-be-tested part detection.

[0049] AsFigure 1 As shown, the part installation detection method can include steps 101 to 103.

[0050] In step 101, an image to be detected of a device to be detected is acquired, and the image to be detected is used to detect one or more parts to be detected on the device to be detected. The device to be detected can include a terminal device (for example, a mobile phone, a tablet computer, a notebook computer, and the like), a wearable device (for example, a smart watch, smart glasses, a VR head-mounted device, and the like), and a household appliance (for example, an air conditioner, a refrigerator, a washing machine, and the like), and the like, without any limitation. The part to be detected is an installed part on the device to be detected, for example, a card holder, a volume key, a power key, and the like installed on a mobile phone, without any limitation.

[0051] Specifically, when detecting the part to be detected of the device to be detected in a detection position, the electronic device (that is, a quality inspection device) can capture a part or parts of the part to be detected of the device to be detected through a built-in camera to acquire one or more images to be detected.

[0052] For example, when detecting whether a card holder of a mobile phone is installed abnormally, a part of the card holder of the mobile phone can be captured to obtain an image to be detected of the mobile phone.

[0053] In step 102, a positioning template image of the part to be detected is acquired, and the image to be detected is intercepted based on the positioning template image to obtain a target image of the part to be detected.

[0054] In step 102, the positioning template image is used to indicate a sample image for the interception operation of the image to be detected. The positioning template image can be pre-set, and the positioning template image is a standard image when the terminal device is installed with the part to be detected.

[0055] In step 103, installation information of whether the part to be detected is installed abnormally is determined based on the target image.

[0056] In step 103, the installation information is information related to the installation of the part to be detected, and the installation information at least includes misinstallation and / or missing installation, and the like. It can be understood that the above embodiments can detect whether the part to be detected is misinstalled and / or missing on the terminal device.

[0057] The part installation detection method, device, electronic device, and storage medium provided by the embodiments of the present disclosure first acquire an image to be detected of a device to be detected, acquire a positioning template image of a part to be detected, intercept the image to be detected based on the positioning template image to obtain a target image of the part to be detected, and then determine installation information of whether the part to be detected is installed abnormally based on the target image. Thus, whether the part to be detected is installed abnormally can be detected, and the accuracy of the detection of the part to be detected is improved.

[0058] On the basis of the above embodiments, as shown inFigure 2 As shown, the intercepting processing of the to-be-tested image based on the positioning template image to obtain the target image of the to-be-tested part can include steps 201 to 203.

[0059] Step 201: Positioning the to-be-tested part in the to-be-tested image according to the positioning template image to generate the position information of the to-be-tested part.

[0060] In the embodiments of the present disclosure, when the material (e.g., pearl material) of the to-be-tested part of the to-be-tested device is prone to reflection, and / or the surface of the to-be-tested part has a protective film that is prone to reflection, the outline of the to-be-tested part in the to-be-tested image is prone to be unclear, and in this case, it is difficult to determine the position (installation position) of the to-be-tested part. Therefore, the image of the part of the to-be-tested device that is not prone to reflection or the part of the to-be-tested device that is relatively stable in reflection can be used as the positioning template image, and the position of the to-be-tested part can be determined according to the positioning template image. The positioning template image can be pre-stored in the storage space of the electronic device for easy retrieval and use.

[0061] Specifically, after the electronic device obtains the to-be-tested image, the electronic device can retrieve the positioning template image from the storage space of the electronic device, and perform gray-scale matching between the positioning template image and the to-be-tested image to determine the position of the positioning template image in the to-be-tested image. Then, the position of the to-be-tested part in the to-be-tested image is determined according to the positional relationship between the positioning template image and the to-be-tested part, and the position information of the to-be-tested part is generated.

[0062] For example, Figure 3 The specific detail display diagram of the to-be-tested image of the mobile phone is as shown in FIG. 6. Figure 3 As shown, the mobile phone can include a middle frame, an antenna, a charging interface, a sensor, and a loudspeaker, etc. Since the antenna, the charging interface, the sensor, and the loudspeaker are not prone to reflection, the images thereof will be clear. The images of the antenna, the charging interface, the sensor, and / or the loudspeaker can be used as the positioning template image. When determining the position information of the card holder in the to-be-tested image of the mobile phone, the positioning template image (i.e., the images of the antenna, the charging interface, the sensor, and / or the loudspeaker) can be matched with the to-be-tested image of the mobile phone in terms of gray scale to determine the specific position of the positioning template image in the to-be-tested image of the mobile phone. Then, the specific position of the card holder is determined according to the positional relationship between the positioning template image and the card holder, and the position information of the card holder is generated.

[0063] Step 202: Generating the offset value of the to-be-tested part according to the position information and the matching template image of the to-be-tested part.

[0064] The matching template image can be a standard image of the to-be-tested device in a standard detection position. The standard image includes the image of the normally installed to-be-tested part. The matching template image can be pre-stored in the storage space of the electronic device for easy retrieval and use.

[0065] Specifically, after the electronic device obtains the position information of the to-be-tested part, the electronic device can retrieve a matching template image from a storage space of the electronic device, and obtain standard position information of the to-be-tested part according to the matching template image, and then obtain a to-be-tested part offset value according to the standard position information and the (current) position information of the to-be-tested part, where the to-be-tested part offset value can reflect an offset of a current position of the to-be-tested part.

[0066] In step 203, the to-be-tested image is intercepted according to the to-be-tested part offset value and the position information, to generate a target image of the to-be-tested part.

[0067] Specifically, after the electronic device obtains the offset value and the position information of the to-be-tested part, the electronic device can intercept an image of a region of interest (ROI) of the to-be-tested image according to the offset value and the position information, and take the image of the ROI as the target image of the to-be-tested part.

[0068] It should be noted that the ROI region described in this embodiment includes a mounting region of the to-be-tested part, and the ROI region can be calibrated according to actual conditions.

[0069] The part installation detection method and device, the electronic device, and the storage medium provided in the embodiments of the present disclosure first obtain position information of a to-be-tested part on a to-be-tested image according to a positioning template image, and generate a to-be-tested part offset value according to the position information and a matching template image of the to-be-tested part, and then intercept the to-be-tested image by comprehensively considering the to-be-tested part offset value and the position information, to generate a target image of the to-be-tested part, thereby improving the accuracy of image interception.

[0070] On the basis of the above-mentioned embodiments, as shown in Figure 4 Based on the target image, determining whether the to-be-tested part has installation abnormity installation information can include steps 401 to 403.

[0071] In step 401, the target image is subjected to anti-reflection processing to generate a target detection image related to the to-be-tested part.

[0072] In step 402, the target detection image is matched with the matching template image to generate a matching result.

[0073] In step 403, it is determined whether the to-be-tested part is missing according to the matching result.

[0074] The part installation detection method and device, the electronic device, and the storage medium provided in the embodiments of the present disclosure can perform anti-reflection processing on the target image to generate a target detection image related to the to-be-tested part, and match the target detection image with the matching template image to generate a matching result, and determine whether the to-be-tested part is missing according to the matching result, thereby achieving detection of whether the to-be-tested part is missing.

[0075] For the sake of clarity of the above embodiment, in an embodiment of the present disclosure, as shown in Figure 5 The step of performing anti-glare processing on the target image to generate a target detection image related to the part to be detected can include steps 501-503.

[0076] Step 501: dividing the target image to generate a plurality of region images.

[0077] Specifically, after obtaining the target image of the part to be detected, the electronic device can divide the target image into a plurality of small regions, such as rectangular regions, according to a certain row-column ratio to obtain a plurality of region images. The divided target image is a first target image. If the number of row and column small regions is taken as the size of the first target image, the first target image is reduced in size relative to the target image.

[0078] Step 502: calculating the gray mean value of the target image and each region image in the plurality of region images, respectively.

[0079] Specifically, after dividing the target image into a plurality of region images, the electronic device can calculate the gray mean value of the target image, the gray mean value of each region image, and the gray mean value of each region image in the plurality of region images, respectively.

[0080] As a possible case, the gray mean value of the target image can also be calculated before the target image is divided into a plurality of region images.

[0081] Step 503: processing the plurality of region images according to the gray mean value to generate a target detection image.

[0082] The part installation detection method and device, electronic device, and storage medium provided by the embodiments of the present disclosure can divide a target image to generate a plurality of region images, calculate the gray mean value of the target image and each region image in the plurality of region images, respectively, process the plurality of region images according to the gray mean value to generate a target detection image, and perform anti-glare processing on the target image according to the plurality of region images, thereby improving the accuracy of the anti-glare processing.

[0083] Based on the above embodiments, as shown in Figure 6 The step of processing the plurality of region images according to the gray mean value to generate a target detection image can include steps 601-603.

[0084] Step 601: processing the plurality of region images according to the gray mean value to generate a detection image.

[0085] To clearly illustrate the above embodiment, in an embodiment of the present disclosure, processing the plurality of region images according to the gray mean value to generate the detection image can include: for each region image, if the gray mean value of the region image is greater than the gray mean value of the target image, obtaining the difference value between the gray mean value of the region image and the gray mean value of the target image, and taking the difference value as the gray value of the region image; if the gray mean value of the region image is less than or equal to the gray mean value of the target image, taking the gray mean value of the region image as the gray value of the region image; and creating the detection image according to the gray value corresponding to each region image.

[0086] Specifically, after the electronic device calculates the gray mean values of the target image and the plurality of region images respectively, for each region image, it can be determined whether the gray mean value of the region image is greater than the gray mean value of the target image. If yes, the difference value between the gray mean value of the region image and the gray mean value of the target image is obtained, and the difference value is taken as the gray value of the region image. If no, the gray mean value of the region is taken as the gray value of the region image. In this way, the gray value corresponding to each region can be obtained. Then, the gray value corresponding to each region can be used to replace the gray value of the corresponding region in the first target image to obtain a second target image. Then, the size of the second target image can be restored (enlarged) to the size of the target image by using the cubic spline interpolation method to obtain a detection image. The detection image is an image in which the reflection is removed. The contour of the part to be detected that is not blocked by the reflection part can be found according to the detection image.

[0087] Therefore, the reflection on the part to be detected in the target detection image can be removed, thereby improving the detection accuracy.

[0088] In step 602, contour circumscription information of the part to be detected is obtained according to the detection image.

[0089] In the embodiment of the present disclosure, the contour circumscription information of the part to be detected can be obtained from the detection image based on the shape and size of the part to be detected. For example, a circumscribed rectangle, a circumscribed triangle, a circumscribed circle, and a circumscribed irregular figure of the contour of the part to be detected can be obtained.

[0090] Specifically, after the electronic device obtains the above detection image, the contour of the part to be detected that is not blocked by the reflection part can be found from the detection image, and the contour circumscription information of the part to be detected can be determined according to the contour of the part to be detected.

[0091] In step 603, the detection image is restored according to the part information and the contour circumscription information of the part to be detected to generate a target detection image.

[0092] The part information can include the shape, size, and color of the part to be detected.

[0093] Specifically, after the electronic device obtains the contour circumscribed information of the to-be-tested part, the contour of the to-be-tested part blocked by the reflective part can be recovered according to the part information and the contour circumscribed information of the to-be-tested part, and a complete contour of the to-be-tested part is obtained, so that image recovery of the detection image is realized to obtain a target detection image with a complete contour of the to-be-tested part.

[0094] The part installation detection method and device, the electronic device, and the storage medium provided in the embodiments of the present disclosure can process a plurality of region images according to the gray mean value to generate a detection image, obtain contour circumscribed information of a to-be-tested part according to the detection image, and perform image recovery on the detection image according to part information and the contour circumscribed information of the to-be-tested part to generate a target detection image, so that the plurality of region images can be processed according to the gray mean value to generate the target detection image.

[0095] On the basis of the above-mentioned embodiments, as shown in Figure 7 The matching of the target detection image and the matching template image to generate a matching result can include steps 701 to 702.

[0096] Step 701: Gradient detection is performed on the target detection image to generate a target contour image of the to-be-tested part.

[0097] Step 702: The target contour image is matched with the matching template image to generate a matching result.

[0098] In the embodiments of the present disclosure, the target image can be matched with the matching template in contour and / or gray scale to generate a matching result.

[0099] Specifically, after the electronic device obtains the target detection image, gradient detection can be performed on the target detection image to generate a target contour image of the to-be-tested part, and then the target contour image is matched in contour and / or gray scale to generate a matching result.

[0100] Further, in one embodiment of the present disclosure, the matching result can at least include a matching score, and determining whether the to-be-tested part is missing can include: if the matching score is greater than a matching threshold, it is determined that the to-be-tested part is not missing; and if the matching score is less than or equal to the matching threshold, it is determined that the to-be-tested part is missing. The matching threshold can be calibrated according to actual conditions.

[0101] In the embodiments of the present disclosure, in the process of matching the target contour image with the matching template image, if contour matching is performed, the contour matching score can be taken as the matching score; if grayscale matching is performed, the grayscale matching can be taken as the matching score; if contour matching and grayscale matching are performed, the matching score can be obtained according to the contour matching score and the grayscale matching score, for example, the contour matching score and the grayscale matching score can be processed by weighted summation to obtain the matching score.

[0102] Specifically, after obtaining the matching score of the target contour image and the matching template image, it can be judged whether the matching score is greater than a matching threshold, if yes, it is determined that the to-be-tested part is not missing; if no, it is determined that the to-be-tested part is missing.

[0103] The part installation detection method and device, the electronic device and the storage medium provided by the embodiments of the present disclosure can perform gradient detection on the target detection image to generate a target contour image of the to-be-tested part, match the target contour image with a matching template image to generate a matching result, and improve the accuracy of the matching result.

[0104] In addition, in one embodiment of the present disclosure, as shown in Figure 8 the installation information of the to-be-tested part based on the target image whether there is an installation abnormality can further include steps 801 to 804.

[0105] Step 801: According to the intercepting strategy, the target image is intercepted to generate a to-be-tested color region of the to-be-tested part and a standard color region of the to-be-tested part.

[0106] The intercepting strategy can be calibrated according to actual conditions.

[0107] In the embodiments of the present disclosure, for the to-be-tested color region of the to-be-tested part, part of the region in the installation region of the to-be-tested part can be intercepted from the target image as the to-be-tested color region, wherein the interference of other colors (colors other than the color of the to-be-tested part) should be avoided during the interception, for example, referring to Figure 3 When detecting whether the card holder of the mobile phone is installed abnormally, if the card holder hole of the card holder is located on the card holder, the region in the card holder installation region other than the card holder hole should be intercepted as the to-be-tested color region to avoid the interference of the color of the card holder hole.

[0108] For the standard color region of the to-be-tested part, part of the region with a standard color on the to-be-tested device can be intercepted from the target image as the standard color region, wherein the standard color region does not include the installation region of the to-be-tested part. Generally, the region near the installation region of the to-be-tested part has a standard color, and the region near the installation region of the to-be-tested part can be selected as the standard color region, for example, referring to Figure 3 The middle frame of the mobile phone has a standard color, and the region near the card holder installation region on the mobile phone frame can be selected as the standard color region.

[0109] As a possible case, in order to improve the accuracy of the detected part detection, the target image can be first refined, and then the refined target image is intercepted according to the interception strategy to generate the detected color region of the card and the standard color region of the card.

[0110] Specifically, the image of the minimum circumscribed shape (minimum circumscribed rectangle, minimum circumscribed triangle, or minimum circumscribed circle, etc.) of the contour of the detected part can be first intercepted from the target image, and then the detected color region and the standard color region of the detected part are intercepted from the image according to the interception strategy.

[0111] Step 802, respectively performing color channel separation on the detected color of the detected color region and the standard color of the standard color region according to at least one color space to generate a plurality of detected target colors of the detected color and a plurality of standard target colors of the standard color.

[0112] The color space can include RGB (Red Green Blue), HSV (Hue Saturation Value), Lab (L represents a brightness channel, and a and b are two color channels, wherein a represents a component from green to red, and b represents a component from blue to yellow), etc.

[0113] In the embodiments of the present disclosure, for each color space, the detected color of the detected color region and the labeled color of the standard color region can be respectively separated into a plurality of color channels corresponding to the color space to obtain a plurality of detected target colors and a plurality of standard target colors of the plurality of color channels. For example, for the color space RGB, the detected color of the detected color region and the labeled color of the standard color region can be separated into RGB three color channels to obtain the detected target color of the RGB three color channels and the standard target color of the RGB three color channels; for the color space HSV, the detected color of the detected color region and the labeled color of the standard color region can be separated into HSV three color channels to obtain the detected target color of the HSV three color channels and the standard target color of the HSV three color channels; for the color space Lab, the detected color of the detected color region and the labeled color of the standard color region can be separated into Lab three color channels to obtain the detected target color of the Lab three color channels and the standard target color of the Lab three color channels.

[0114] Step 803, calculating the color difference value between the detected color and the standard color according to the plurality of detected target colors and the plurality of standard target colors.

[0115] Specifically, after obtaining the plurality of to-be-tested target colors and the plurality of standard target colors, the electronic device can calculate a first target color difference value between each to-be-tested target color and the standard target color corresponding to the color channel of the to-be-tested target color. For example, for a to-be-tested target color of the R (red) channel, a first target color difference value between the to-be-tested target color and the standard target color of the R channel can be calculated, and in this way, a plurality of first target color difference values can be obtained. When calculating the plurality of first target color difference values between the plurality of to-be-tested target colors and the plurality of standard target colors in each color space (RGB, HSV, Lab, etc.), different color difference formulas can be used for calculation based on the characteristics represented by the color channels of each color space, so as to expand the difference in the current color space, thereby increasing the first target color difference value, facilitating subsequent processing of the first target color difference value, facilitating subsequent color discrimination by the color difference threshold, and improving the accuracy of the to-be-tested part detection.

[0116] It should be noted that the color difference formula in this embodiment can be calibrated according to actual conditions, and is not limited herein.

[0117] Further, after obtaining the plurality of first target color difference values, the electronic device can perform maximum-minimum normalization (a kind of normalization processing method) processing on the plurality of first target color difference values to obtain a plurality of second target color difference values of the same order of magnitude, and then select the maximum second target color difference value from the plurality of second target color difference values as the color difference value between the to-be-tested color and the standard color.

[0118] As a possible case, after obtaining the plurality of first target color difference values, the electronic device can perform weighted processing on the plurality of first target color difference values to obtain the color difference value between the to-be-tested color and the standard color.

[0119] In step 804, it is determined whether the to-be-tested part is misassembled according to the color difference value.

[0120] In an embodiment of the present disclosure, determining whether the to-be-tested part is misassembled according to the color difference value can include: if the color difference value is greater than a color difference threshold, determining that the to-be-tested part is misassembled; and if the color difference value is less than or equal to the color difference threshold, determining that the to-be-tested part is not misassembled. It should be noted that the color difference threshold described in this embodiment can be calibrated according to actual conditions, and is not limited herein.

[0121] Specifically, after obtaining the color difference value between the to-be-tested color and the standard color, the electronic device can determine whether the color difference value is greater than a color difference threshold, and if so, determine that the to-be-tested part is misassembled; and if not, determine that the to-be-tested part is not misassembled.

[0122] In this way, it can be detected whether the to-be-tested part is in a color misassembly state.

[0123] The component assembly detection method, apparatus, electronic device, and storage medium provided in this disclosure can capture a target image according to a capture strategy to generate a test color region and a standard color region for the component under test. Color channels are separated for the test color of the test color region and the standard color of the standard color region according to at least one color space to generate multiple test target colors for the test color and multiple standard target colors for the standard colors. Based on the multiple test target colors and multiple standard target colors, the color difference value between the test color and the standard colors is calculated. The color difference value is used to determine whether the component under test is incorrectly assembled, thus enabling the detection of whether the component under test is incorrectly assembled.

[0124] In order to enable those skilled in the art to more clearly understand this disclosure, Figure 9 A flowchart illustrating the process of installing and testing a SIM card tray. Figure 9 As shown, firstly, the positioning template image and the image to be tested are matched in grayscale to locate the position of the cassette in the image to be tested, obtaining the position information of the cassette, and then the offset value of the cassette is calculated. Then, based on the offset value and position information of the cassette, the image to be tested is cropped to obtain the target image. Next, the grayscale mean of the target image is calculated, and the target image is divided into multiple region images. The grayscale mean of these multiple region images is calculated. Then, based on the grayscale mean of both (the target image and each region image), the grayscale value corresponding to each region image is obtained, thus obtaining the second target image. Finally, cubic spline difference is used. The size of the second target image is restored using a value-based method to obtain the detection image. Then, the caddie contour in the detection image is searched to obtain the bounding rectangle information of the caddie contour. Based on the caddie information and the bounding rectangle information, the detection image is restored to obtain the target detection image. Then, gradient checking is performed on the target detection image to generate the target contour information of the caddie. The target contour is then matched with the caddie contour in the caddie template image using grayscale matching and contour matching to obtain the matching score of the caddie. It is then determined whether the matching score is greater than the matching threshold. If it is, the caddie is not missing; otherwise, the caddie is missing.

[0125] In addition, after obtaining the target image by cropping the image under test based on the offset value and position information of the cassette, the target image can be cropped to obtain the color region to be tested and the standard color region of the cassette. Then, according to at least one color space, the color channels of the color region to be tested and the standard color region of the standard color region are separated. Then, the color difference can be calculated to obtain the color difference value, and it is determined whether the color difference value is greater than the color difference threshold. If it is, the cassette is misinstalled; if not, the cassette is not misinstalled.

[0126] It should be noted that either the process of confirming missing parts or the process of confirming incorrect parts can be chosen or used in combination. The embodiments of this application are not limited to the implementation methods described above.

[0127] Figure 10 FIG. 1 is a structural schematic diagram of a part installation detection device according to an embodiment of the present disclosure.

[0128] The part installation detection device according to the embodiment of the present disclosure can be configured in an electronic device to obtain a to-be-tested image of the electronic device, obtain a positioning template image of a to-be-tested part, perform intercepting processing on the to-be-tested image based on the positioning template image to obtain a target image of the to-be-tested part, and determine installation information of the to-be-tested part based on the target image, thereby detecting whether the to-be-tested part is installed abnormally and improving the accuracy of detection of the to-be-tested part.

[0129] As shown in FIG. 1, the part installation detection device 1000 can include an obtaining module 1010, an intercepting module 1020, and a determining module 1030. Figure 10

[0130] The obtaining module 1010 is configured to obtain a to-be-tested image of an electronic device, and the to-be-tested image is used to detect one or more to-be-tested parts on the electronic device.

[0131] The intercepting module 1020 is configured to obtain a positioning template image of a to-be-tested part, and perform intercepting processing on the to-be-tested image based on the positioning template image to obtain a target image of the to-be-tested part.

[0132] The determining module 1030 is configured to determine installation information of the to-be-tested part based on the target image.

[0133] In an embodiment of the present disclosure, the intercepting module 1020 is specifically configured to: perform to-be-tested part position positioning on the to-be-tested image according to the positioning template image to generate position information of the to-be-tested part; generate a to-be-tested part offset value according to the position information and a matching template image of the to-be-tested part; and perform intercepting on the to-be-tested image according to the to-be-tested part offset value and the position information to generate the target image of the to-be-tested part.

[0134] In an embodiment of the present disclosure, the determining module 1030 can include a glare-removing submodule 1031 configured to perform glare-removing processing on the target image to generate a target detection image related to the to-be-tested part, a matching submodule 1032 configured to match the target detection image with the matching template image to generate a matching result, and a first determining submodule 1033 configured to determine whether the to-be-tested part is missing according to the matching result.

[0135] ​In one embodiment of the present disclosure, the determining module 1030 can comprise: a clipping sub-module 1034 configured to clip the target image according to a clipping strategy to generate a to-be-tested color region of the to-be-tested part and a standard color region of the to-be-tested part; a generating sub-module 1035 configured to perform color channel separation on the to-be-tested color of the to-be-tested color region and the standard color of the standard color region respectively according to at least one color space to generate a plurality of to-be-tested target colors of the to-be-tested color and a plurality of standard target colors of the standard color; a calculating sub-module 1036 configured to calculate a color difference value between the to-be-tested color and the standard color according to the plurality of to-be-tested target colors and the plurality of standard target colors; and a second determining sub-module 1037 configured to determine whether the to-be-tested part is misassembled according to the color difference value.

[0136] In one embodiment of the present disclosure, the anti-glare sub-module 1031 can comprise: a dividing unit 10 configured to divide the target image to generate a plurality of region images; a calculating unit 20 configured to calculate a gray mean value of the target image and each region image in the plurality of region images respectively; and a generating unit 30 configured to process the plurality of region images according to the gray mean values to generate a target detection image.

[0137] In one embodiment of the present disclosure, the generating unit 30 can comprise: a first generating sub-unit 31 configured to process the plurality of region images according to the gray mean values to generate a detection image; an acquiring sub-unit 32 configured to acquire contour circumscribed information of the to-be-tested part according to the detection image; and a second generating sub-unit 33 configured to perform image restoration on the detection image according to part information of the to-be-tested part and the contour circumscribed information to generate the target detection image.

[0138] In one embodiment of the present disclosure, the first generating sub-unit 31 is specifically configured to: for each region image, if the gray mean value of the region image is greater than the gray mean value of the target image, acquire a difference value between the gray mean value of the region image and the gray mean value of the target image, and take the difference value as a gray value of the region image; if the gray mean value of the region image is less than or equal to the gray mean value of the target image, take the gray mean value of the region image as the gray value of the region image; and create the detection image according to the gray value corresponding to each region image.

[0139] In one embodiment of the present disclosure, the matching sub-module 1032 is specifically configured to: perform gradient detection on the target detection image to generate a target contour image of the to-be-tested part; and match the target contour image with a matching template image to generate a matching result.

[0140] In one embodiment of the present disclosure, the first determining sub-module 1033 is specifically configured to: if the matching score is greater than a matching threshold, determine that the to-be-tested part is not missing; and if the matching score is less than or equal to the matching threshold, determine that the to-be-tested part is missing.

[0141] In one embodiment of the present disclosure, the second determination sub-module 1037 is specifically configured to: if the color difference value is greater than the color difference threshold, determine that the to-be-tested part is misassembled; and if the color difference value is less than or equal to the color difference threshold, determine that the to-be-tested part is not misassembled.

[0142] It should be noted that the foregoing explanations of the part installation detection method embodiments are also applicable to the part installation detection device of this embodiment, which will not be described here again.

[0143] The part installation detection device provided by the embodiments of the present disclosure acquires the to-be-tested image of the to-be-tested equipment through the acquisition module, acquires the positioning template image of the to-be-tested part through the intercepting module, acquires the target image of the to-be-tested part by performing intercepting processing on the to-be-tested image based on the positioning template image, and then determines whether the to-be-tested part has installation abnormality installation information based on the target image through the determination module, so as to detect whether the to-be-tested part has installation abnormality and improve the accuracy of to-be-tested part detection.

[0144] According to the third aspect of the embodiments of the present disclosure, an electronic device is also provided, which includes: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to execute the instructions to implement the part installation detection method as described above.

[0145] In order to implement the above-mentioned embodiments, the present disclosure further provides a storage medium.

[0146] When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can perform the part installation detection method as described above.

[0147] Figure 11 is a block diagram of an electronic device according to an exemplary embodiment. Figure 11 The electronic device shown is merely an example, and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.

[0148] As Figure 11 shown, the electronic device 1100 includes a processor 111, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 112 or loaded from a memory 116 into a random access memory (RAM) 113. In the RAM 113, various programs and data required for operation of the electronic device 1100 are also stored. The processor 111, the ROM 112, and the RAM 113 are connected to each other through a bus 114. An input / output (I / O) interface 115 is also connected to the bus 114.

[0149] The following components are connected to the I / O interface 115: a storage 116 including a hard disk or the like; and a communication section 117 including a network interface card such as a LAN (Local Area Network) card, a modem, or the like, which performs communication processing via a network such as the Internet; and a drive 118 is also connected to the I / O interface 115 as necessary.

[0150] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program carried on a computer-readable medium, which contains program code for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 117. When the computer program is executed by the processor 111, the above-described functions defined in the methods of the present disclosure are performed.

[0151] In an exemplary embodiment, a storage medium including instructions, such as a memory including instructions, is also provided, which can be executed by the processor 111 of the electronic device 1100 to complete the above-described method. Alternatively, the storage medium can be a non-transitory computer-readable storage medium, such as a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0152] In the present disclosure, a computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, a computer readable signal medium can include a data signal that is propagated in baseband or as part of a carrier wave, in which a computer readable program code is carried. Such a propagated data signal can take any of a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0153] Embodiments of the present disclosure provide technical solutions at least with the following beneficial effects:

[0154] ①After removing the reflection part in the image, the gray scale matching and contour matching of the measured part are performed, which can detect whether the measured part is missing, and improve the accuracy of the measured part detection.

[0155] ②、Based on the characteristics of each color of the to-be-tested part in different color spaces, a color difference calculation formula is designed under different color spaces, the maximum color difference is calculated, and the maximum color difference is compared with the color difference threshold, the accuracy of color matching of the to-be-tested part is improved, the accuracy of color detection of the to-be-tested part is improved, and whether the to-be-tested part is misassembled is detected.

[0156] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the present disclosure cover any and all variations of the present application including combinations of features falling within the general scope of the application. The specification and examples are to be considered exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.

[0157] It is to be understood that the present disclosure is not limited to the precise construction described above and shown in the attached drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the claims appended hereto.

Claims

1. A method of detecting mounting of a part, characterized by, The method comprises the following steps: acquiring a to-be-tested image of a to-be-tested device, the to-be-tested image being used to detect one or more to-be-tested parts on the to-be-tested device; acquiring a positioning template image of the to-be-tested part, and performing intercept processing on the to-be-tested image based on the positioning template image to acquire a target image of the to-be-tested part, the positioning template image being an image of a non-reflective part or a relatively stable reflective part of the to-be-tested device; based on the target image, determining whether the to-be-tested part has installation abnormality installation information; wherein, comprising: performing anti-reflective processing on the target image to generate a target detection image related to the to-be-tested part; matching the target detection image with a matching template image to generate a matching result; determining whether the to-be-tested part is missing according to the matching result.

2. The part mounting inspection method according to claim 1, characterized by, The intercept processing on the to-be-tested image based on the positioning template image to acquire the target image of the to-be-tested part comprises: positioning the to-be-tested part in the to-be-tested image according to the positioning template image to generate position information of the to-be-tested part; generating a to-be-tested part offset value according to the position information and a matching template image of the to-be-tested part; performing intercept on the to-be-tested image according to the to-be-tested part offset value and the position information to generate the target image of the to-be-tested part.

3. The part mount detection method according to claim 1, characterized by, The determination of whether the to-be-tested part has installation abnormality installation information based on the target image comprises: performing intercept on the target image according to an intercept strategy to generate a to-be-tested color region of the to-be-tested part and a standard color region of the to-be-tested part; performing color channel separation on a to-be-tested color of the to-be-tested color region and a standard color of the standard color region according to at least one color space respectively to generate a plurality of to-be-tested target colors of the to-be-tested color and a plurality of standard target colors of the standard color; calculating a color difference value between the to-be-tested color and the standard color according to the plurality of to-be-tested target colors and the plurality of standard target colors; determining whether the to-be-tested part is misassembled according to the color difference value.

4. The part mount detection method according to claim 1, characterized by, The anti-reflective processing on the target image to generate the target detection image related to the to-be-tested part comprises: dividing the target image to generate a plurality of region images; calculating a gray mean value of the target image and each region image in the plurality of region images respectively; processing the plurality of region images according to the gray mean values to generate the target detection image.

5. The part-mount detecting method according to claim 4, characterized by, The processing of the plurality of region images according to the gray mean values to generate the target detection image comprises: processing the plurality of region images according to the gray mean values to generate a detection image; acquiring contour circumscription information of the to-be-tested part according to the detection image; performing image restoration on the detection image according to part information of the to-be-tested part and the contour circumscription information to generate the target detection image.

6. The part-mount detecting method according to claim 5, characterized by, The processing of the plurality of region images according to the gray mean values to generate a detection image comprises: For each of the region images, if the gray mean value of the region image is greater than the gray mean value of the target image, a difference value between the gray mean value of the region image and the gray mean value of the target image is obtained, and the difference value is taken as the gray value of the region image; If the gray mean value of the region image is less than or equal to the gray mean value of the target image, the gray mean value of the region image is taken as the gray value of the region image; According to the gray value corresponding to each of the region images, the detection image is created.

7. The part mount detection method according to claim 1, characterized by, The matching of the target detection image and the matching template image to generate a matching result comprises: Gradient detection is performed on the target detection image to generate a target contour image of the part under test; The target contour image is matched with the matching template image to generate the matching result.

8. The part-mount detecting method according to claim 1 or 7, characterized by, The matching result at least comprises a matching score, and the determination of whether the part under test is missing according to the matching result comprises: If the matching score is greater than a matching threshold, it is determined that the part under test is not missing; If the matching score is less than or equal to the matching threshold, it is determined that the part under test is missing.

9. The part mount detection method according to claim 3, characterized by, The determination of whether the part under test is misassembled according to the color difference value comprises: If the color difference value is greater than a color difference threshold, it is determined that the part under test is misassembled; If the color difference value is less than or equal to the color difference threshold, it is determined that the part under test is not misassembled.

10. A component mounting inspection apparatus characterized by comprising: Comprise: An acquisition module is configured to acquire a target image of a device under test, the target image being used to detect one or more parts under test on the device under test; An intercepting module is configured to acquire a positioning template image of the part under test, and perform intercepting processing on the target image based on the positioning template image to acquire a target image of the part under test, the positioning template image being an image of a non-reflective part or a relatively stable reflective part of the device under test; A determination module is configured to determine, based on the target image, whether the part under test has installation information of installation abnormality; The determination module comprises: A de-reflecting sub-module is configured to perform de-reflecting processing on the target image to generate a target detection image related to the part under test; A matching sub-module is configured to match the target detection image with a matching template image to generate a matching result; A first determination sub-module is configured to determine, according to the matching result, whether the part under test is missing.

11. The part mount detection apparatus according to claim 10, characterized by The intercepting module is specifically configured to: Perform part under test position positioning on the target image according to the positioning template image to generate position information of the part under test; Generate a part under test offset value according to the position information and a matching template image of the part under test; Perform intercepting on the target image according to the part under test offset value and the position information to generate the target image of the part under test.

12. The part mount detection apparatus according to claim 10, characterized by The determination module comprises: An intercepting sub-module is configured to perform intercepting on the target image according to an intercepting strategy to generate a test color region of the part under test and a standard color region of the part under test; The generating submodule is configured to perform color channel separation on the to-be-tested color of the to-be-tested color region and the standard color of the standard color region respectively according to at least one color space, to generate a plurality of to-be-tested target colors of the to-be-tested color and a plurality of standard target colors of the standard color; The calculating submodule is configured to calculate a color difference value between the to-be-tested color and the standard color according to the plurality of to-be-tested target colors and the plurality of standard target colors; The second determining submodule is configured to determine whether the to-be-tested part is misassembled according to the color difference value.

13. The part mount detection apparatus of claim 10, wherein The anti-glare submodule comprises: The dividing unit is configured to divide the target image to generate a plurality of region images; The calculating unit is configured to calculate a gray mean value of the target image and each region image in the plurality of region images respectively; The generating unit is configured to process the plurality of region images according to the gray mean values to generate the target detection image.

14. The part mount detection apparatus according to claim 13, characterized by The generating unit comprises: The first generating subunit is configured to process the plurality of region images according to the gray mean values to generate a detection image; The acquiring subunit is configured to acquire contour circumscribed information of the to-be-tested part according to the detection image; The second generating subunit is configured to perform image restoration on the detection image according to part information of the to-be-tested part and the contour circumscribed information to generate the target detection image.

15. The part mount detection apparatus of claim 14, wherein The first generating subunit is specifically configured to: For each region image, if the gray mean value of the region image is greater than the gray mean value of the target image, a difference value between the gray mean value of the region image and the gray mean value of the target image is acquired, and the difference value is taken as a gray value of the region image; If the gray mean value of the region image is less than or equal to the gray mean value of the target image, the gray mean value of the region image is taken as the gray value of the region image; The detection image is created according to the gray value corresponding to each region image.

16. The part installation detection apparatus of claim 10, wherein The matching submodule is specifically configured to: Perform gradient detection on the target detection image to generate a target contour image of the to-be-tested part; Match the target contour image with the matching template image to generate the matching result.

17. The part mount detection apparatus according to claim 10 or 16, characterized by The first determining submodule is specifically configured to: If the matching score is greater than a matching threshold, it is determined that the to-be-tested part is not missed; If the matching score is less than or equal to the matching threshold, it is determined that the to-be-tested part is missed.

18. The part installation detection apparatus of claim 12, wherein The second determining submodule is specifically configured to: If the color difference value is greater than a color difference threshold, it is determined that the to-be-tested part is misassembled; If the color difference value is less than or equal to the color difference threshold, it is determined that the to-be-tested part is not misassembled.

19. An electronic device, comprising: comprise: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the part installation detection method of any one of claims 1 to 9.

20. A non-transitory computer-readable storage medium, comprising: When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can perform the part installation detection method of any one of claims 1 to 9.

Citation Information

Patent Citations

  • Mobile phone part abnormity detection method and equipment

    CN112801987A

  • Assembly-type part inspecting device and method therefor

    JP2002310918A