Electronic component detection method and device, electronic equipment and automatic quality inspection equipment

By combining the YOLOv7 model and color information mask with morphological processing, the problems of manual reliance and preset image templates in electronic component inspection are solved, realizing efficient and customized automatic quality inspection, reducing inspection costs and improving accuracy.

CN115619725BActive Publication Date: 2026-04-14INSPUR COMM TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR COMM TECH CO LTD
Filing Date
2022-09-29
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Current technologies for electronic component inspection rely on manual labor and preset image templates, resulting in low efficiency, high cost, and poor customization.

Method used

The YOLOv7 target detection model is used to extract coarse positioning images of electronic components. Masking is performed based on color information, and the precise position is determined by combining morphological processing and threshold judgment to achieve automatic quality inspection.

Benefits of technology

By eliminating reliance on preset image templates, detection efficiency can be improved, costs can be reduced, customized detection can be achieved, and the accuracy and efficiency of quality inspection can be increased.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115619725B_ABST
    Figure CN115619725B_ABST
Patent Text Reader

Abstract

The application provides an electronic component detection method and device, electronic equipment and automatic quality inspection equipment, wherein the method comprises the following steps: obtaining an original image of a to-be-detected object, and extracting a rough positioning image of a target electronic component from the original image; performing mask processing on the rough positioning image based on a mask corresponding to color information of the target electronic component that is determined in advance, to obtain a mask image that retains an installation area of the target electronic component; performing morphological processing on the mask image to obtain a processed mask image; determining the areas of each contour in the processed mask image, and determining the boundary of the accurate position of the target electronic component in the to-be-detected object based on the contour that meets the threshold requirement; and cutting out the image of the target electronic component in the rough positioning image based on the boundary of the accurate position. In the foregoing manner, the application does not need to rely on a preset image template, can get rid of strict control over the placement position and direction of the motherboard, improves the detection efficiency, and reduces the detection cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to methods, apparatus, electronic devices and automatic quality inspection equipment for the inspection of electronic components. Background Technology

[0002] In the PCB motherboard production process, the quality inspection of the motherboard now mainly relies on PCB optical inspection combined with manual quality inspection. Traditional manual visual inspection quality inspectors need to maintain a high level of concentration at all times to find defective components. This places extremely high demands on physical strength, mental strength and concentration, and still has drawbacks such as a high error rate, low quality inspection efficiency, small coverage and inconsistent quality inspection standards.

[0003] Electronic components are numerous on motherboards, and their small size and indistinct orientation make manual quality inspection difficult. Traditional manual quality inspection combined with PCB optical inspection can achieve accurate results, but its drawbacks are also obvious. First, it requires high-precision preset images as templates, which strictly limits the placement and orientation of the motherboard. Second, the inspection efficiency is generally low, and the cost is high. Third, it lacks customization for the quality inspection of individual components. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and automatic quality inspection equipment for testing electronic components, in order to solve the defects of existing technologies that rely on manual labor and preset image templates for testing electronic components.

[0005] This invention provides a method for detecting electronic components, comprising: acquiring an original image of the object to be detected, and extracting a coarse positioning image of the target electronic component from the original image; masking the coarse positioning image based on a mask corresponding to the color information of the target electronic component, to obtain a masked image that retains the mounting area of ​​the target electronic component; performing morphological processing on the masked image to obtain a processed masked image; determining the area of ​​each contour in the processed masked image, and determining the boundary of the precise position of the target electronic component in the object to be detected based on the contours that meet the threshold requirements; and extracting the image of the target electronic component from the coarse positioning image based on the boundary of the precise position.

[0006] According to the present invention, an electronic component detection method extracts a coarse localization image of a target electronic component from an original image. Specifically, the method includes: inputting the original image into a YOLOv7 target detection model to obtain a coarse localization image of the target electronic component; wherein, the YOLOv7 target detection model is obtained by training a dataset of the target electronic component.

[0007] According to the present invention, an electronic component detection method is provided, which masks a rough positioning image based on a mask corresponding to the color information of a target electronic component, to obtain a masked image that retains the mounting area of ​​the target electronic component. Specifically, the method includes: determining a target mask based on the target color information of the target electronic component in a target color space; determining a specified image of the rough positioning image in the target color space; and masking the mounting area of ​​the target electronic component in the specified image based on the target mask to obtain a masked image.

[0008] According to the present invention, an electronic component detection method is provided, which determines a target mask based on the target color information of the target electronic component in the target color space. Specifically, the method includes: determining the mask retention range of the target electronic component based on the value range of the target color information; and determining the target mask based on the mask retention range.

[0009] According to the present invention, the target color space of an electronic component testing method includes one of the following: RGB color space, grayscale space, and HSV color space.

[0010] According to the present invention, an electronic component detection method further includes, after extracting the image of the target electronic component from a roughly located image based on the boundary of the precise location, performing grayscale and binarization processing on the image of the target electronic component, determining the pixel value distribution, and obtaining the installation status of the target electronic component.

[0011] The present invention also provides an electronic component inspection device, comprising: a coarse positioning image module for acquiring an original image of the object to be inspected and extracting a coarse positioning image of the target electronic component from the original image; a masking image module for masking the coarse positioning image based on a mask corresponding to the color information of the target electronic component, thereby obtaining a masking image that retains the mounting area of ​​the target electronic component; a morphological processing module for performing morphological processing on the masking image to obtain a processed masking image; a precise position module for determining the area of ​​each contour in the processed masking image and determining the boundary of the precise position of the target electronic component in the object to be inspected based on contours that meet threshold requirements; and a target electronic component module for extracting an image of the target electronic component from the coarse positioning image based on the boundary of the precise position.

[0012] The present invention also provides an automatic quality inspection device, including an image acquisition device and the above-mentioned electronic component inspection device, wherein the image acquisition device is connected to the electronic component inspection device; the image acquisition device is used to acquire the original image of the object to be inspected and send the original image to the electronic component inspection device; the electronic component inspection device is used to acquire the original image and, based on the original image, determine the installation position of the target electronic component in the object to be inspected.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the above-described electronic component detection methods.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described electronic component detection methods.

[0015] The electronic component inspection method, apparatus, electronic device, and automatic quality inspection equipment provided by this invention extract a coarse positioning image of the target electronic component from an original image; based on a mask corresponding to the color information of the target electronic component, a mask is applied to the coarse positioning image to obtain a masked image that retains the mounting area of ​​the target electronic component; morphological processing is performed on the masked image to obtain a processed masked image; the area of ​​each contour in the processed masked image is determined, and based on contours that meet threshold requirements, the boundary of the precise position of the target electronic component in the object to be inspected is determined; based on the boundary of the precise position, the image of the target electronic component is extracted from the coarse positioning image. Through the above method, this invention utilizes machine vision to replace manual visual quality inspection and PCB optical inspection, eliminating the reliance on preset image templates in PCB optical quality inspection, thereby eliminating the limitations on the placement position and orientation of the object to be inspected, reducing the cost of the inspection machine's inlet and the time cost of motherboard placement. This achieves the goal of improving inspection efficiency and reducing inspection costs. Meanwhile, the quality inspection of target electronic components is a customized process, with different testing methods for each component. This approach is more targeted than PCB optical quality inspection, improving both efficiency and accuracy. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating an embodiment of the electronic component testing method of the present invention;

[0018] Figure 2 This is a schematic diagram of an embodiment of the electronic component testing device of the present invention;

[0019] Figure 3 This is a schematic diagram of an embodiment of the automatic quality inspection equipment of the present invention;

[0020] Figure 4This is a schematic diagram of the structure of an embodiment of the electronic device of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0022] This invention provides a method for testing electronic components. Please refer to [link / reference]. Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the electronic component testing method of the present invention. In this embodiment, the electronic component testing method may include steps S110 to S160, and the specific steps are as follows:

[0023] S110: Acquire the original image of the object to be detected, and extract a rough location image of the target electronic component from the original image.

[0024] This embodiment uses an image acquisition device in an automated quality inspection system to acquire the original image of the object to be inspected. The original image is an image of the entire object to be inspected captured by the image acquisition device, and may include one or more target electronic components.

[0025] Optionally, the object to be inspected includes a motherboard, the target electronic components include connector components, and the image acquisition device includes an industrial quality inspection camera.

[0026] Because the placement and orientation of the motherboard are somewhat random, the location of the connectors needs to be determined first. Specifically, a rough location image of the target electronic components within the object to be detected can be extracted from the original image using object detection algorithms based on artificial intelligence.

[0027] Optionally, a coarse localization image of the target electronic component is extracted from the original image, specifically including: inputting the original image into the YOLOv7 target detection model to obtain a coarse localization image of the target electronic component; wherein, the YOLOv7 target detection model is obtained by training the model on a dataset of the target electronic component.

[0028] Data sets can be constructed using target electronic component data; the dataset can be used to train a YOLOv7 target detection model for the target electronic components; based on the YOLOv7 target detection model, the target electronic components are detected, and the regions where the target electronic components are detected are used as coarse localization images.

[0029] This embodiment uses the YOLOv7 object detection algorithm to identify connectors in the region to be detected. YOLOv7 is one of the most advanced methods in the field of object detection, offering higher detection speed and accuracy compared to other YOLO versions. Furthermore, YOLOv7 trains faster, resulting in more efficient subsequent algorithm iterations. After processing with YOLOv7, a rough location of the connector can be obtained, and this location area can be extracted for subsequent steps.

[0030] S120: Based on the mask corresponding to the color information of the target electronic component, the rough positioning image is masked to obtain a masked image that retains the installation area of ​​the target electronic component.

[0031] Optionally, based on a mask corresponding to the color information of the target electronic component, the rough positioning image is masked to obtain a masked image that retains the mounting area of ​​the target electronic component, specifically including:

[0032] The target mask is determined based on the target color information of the target electronic component in the target color space; the specified image in the target color space is determined based on the coarse positioning image; based on the target mask, the mounting area of ​​the target electronic component in the specified image is masked to obtain the masked image.

[0033] Optionally, the target mask determined based on the target color information of the target electronic component in the target color space specifically includes:

[0034] Based on the range of target color information, determine the mask retention range of the target electronic component; based on the mask retention range, determine the target mask.

[0035] The target color space includes one of the following: RGB color space, grayscale space, and HSV color space.

[0036] Specifically, the obtained image of the roughly located target electronic component area can be transformed from the RGB color space to the HSV color space. The purpose is to convert the red, green, and blue components of the image into hue, saturation, and brightness. Since the colors of the target electronic components are mostly pure colors, the HSV color space can be used to obtain a mask of the corresponding color of the target electronic component by setting upper and lower thresholds. This mask is then used to mask the original image of the target electronic component, resulting in a masked image.

[0037] Specifically, parts of the mask image whose hue are outside the Mask threshold range will be set to black, while parts of the mask image whose hue are within the Mask threshold range will be set to white.

[0038] S130: Perform morphological processing on the mask image to obtain the processed mask image.

[0039] After converting the masked image to grayscale, it is then binarized. Erosion and dilation techniques are used to process white areas in the image, removing excessively small white areas and connecting closely spaced white areas together.

[0040] S140: Determine the area of ​​each contour in the processed mask image, and based on the contours that meet the threshold requirements, determine the boundary of the precise location of the target electronic component in the object to be detected.

[0041] The system identifies the number of contours in the current image and sets a contour area threshold, retaining only contours larger than the threshold and deleting those that are too small, ultimately obtaining the contour of the target electronic component. The system then calculates the four boundary values ​​(top, bottom, left, right) where white pixels appear within the contour; these are the precise coordinates for locating the target electronic component.

[0042] S150: Extracts an image of the target electronic component from a coarsely located image based on the boundary of the precise location.

[0043] Based on the four boundary values ​​obtained in the above steps, the precise positioning coordinates of the target electronic component can be obtained, and thus the precise positioning image of the target electronic component can be obtained.

[0044] In addition, after step S150: extracting the image of the target electronic component from the coarse positioning image based on the boundary of the precise location, the process may further include: performing grayscale and binarization processing on the image of the target electronic component, determining the pixel value distribution, and obtaining the installation status of the target electronic component.

[0045] The connector is precisely positioned by converting the image to grayscale, then binarizing it, and displaying it with inverted black and white colors. The number of white pixels in the entire image is calculated. If the number of white pixels is greater than 50% of the total pixels, the connector is not installed. If it is less than 50%, the number of white pixels on either side of the connector is determined; the connector always points towards the side with fewer white pixels. This allows the connector's orientation to be determined.

[0046] The electronic component inspection method provided by this invention involves: extracting a coarse positioning image of the target electronic component from an original image; masking the coarse positioning image based on a mask corresponding to the color information of the target electronic component, resulting in a masked image that retains the mounting area of ​​the target electronic component; performing morphological processing on the masked image to obtain a processed masked image; determining the area of ​​each contour in the processed masked image, and based on contours that meet threshold requirements, determining the boundary of the precise position of the target electronic component in the object to be inspected; and based on the boundary of the precise position, extracting the image of the target electronic component from the coarse positioning image. Through this method, this invention eliminates the need for preset image templates, freeing it from strict control over the placement and orientation of the motherboard, improving inspection efficiency, and reducing inspection costs; it also provides customized processing for the quality inspection of electronic components, making it more targeted. This reduces the workload of quality inspectors while improving inspection efficiency and accuracy.

[0047] The present invention utilizes an industrial camera installed in automated quality inspection equipment to acquire images of the area to be inspected on the motherboard. YOLOv7 target detection technology is used to locate the connector position, and the corresponding image is captured. The obtained connector component area image is transformed from the RGB color space to the HSV color space. Prior knowledge is used to set upper and lower thresholds in the HSV color space to obtain a mask for the corresponding color of the connector component. This mask is then used to mask the original image of the connector component, resulting in a masked image. Based on the contour area size in the masked image, contours that can represent the connector edge are selected. The upper, lower, left, and right boundaries of the connector are determined by the left side of the boundary pixels. The image is then cropped to obtain a precisely positioned connector image. The precise connector image is then grayscaled and binarized. By determining the number of white pixels in the left and right halves of the connector in the binarized image, the connector orientation and presence / absence can be accurately determined. This design achieves rapid, accurate, stable, and reliable detection of the connector component's installation orientation and presence / absence, significantly reducing labor costs in quality inspection.

[0048] The electronic component testing device provided by the present invention is described below. The electronic component testing device described below can be referred to in correspondence with the electronic component testing method described above.

[0049] This invention also provides an electronic component testing device; please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram of an embodiment of the electronic component detection device of the present invention. In this embodiment, the electronic component detection device includes: a coarse positioning image module 210, a mask image module 220, a morphological processing module 230, a precise positioning module 240, and a target electronic component module 250.

[0050] Specifically:

[0051] The coarse positioning image module 210 is used to acquire the original image of the object to be detected and extract the coarse positioning image of the target electronic component from the original image;

[0052] The masking image module 220 is used to mask the coarse positioning image based on the mask corresponding to the color information of the target electronic component, so as to obtain a masking image that retains the installation area of ​​the target electronic component.

[0053] The morphological processing module 230 is used to perform morphological processing on the mask image to obtain the processed mask image;

[0054] The precise positioning module 240 is used to determine the area of ​​each contour in the processed mask image, and based on the contours that meet the threshold requirements, to determine the boundary of the precise position of the target electronic component in the object to be detected.

[0055] The target electronic component module 250 is used to extract images of target electronic components from a coarsely positioned image based on the boundaries of the precise location.

[0056] In some embodiments, the coarse localization image module 210 is used to: input the original image into the YOLOv7 target detection model to obtain a coarse localization image of the target electronic component; wherein the YOLOv7 target detection model is obtained by training the model on a dataset of the target electronic component.

[0057] In some embodiments, the masking image module 220 is used to: determine a target mask based on the target color information of the target electronic component in the target color space; determine a specified image of the coarse positioning image in the target color space; and mask the mounting area of ​​the target electronic component in the specified image based on the target mask to obtain a masking image.

[0058] In some embodiments, the masking image module 220 is used to: determine the mask retention range of the target electronic component based on the value range of the target color information; and determine the target mask based on the mask retention range.

[0059] In some embodiments, the target color space may include one of the following: RGB color space, grayscale space, and HSV color space.

[0060] In some embodiments, the electronic component inspection device may further include an installation status module, wherein the installation status module is used to perform grayscale and binarization processing on the image of the target electronic component, determine the pixel value distribution, and obtain the installation status of the target electronic component.

[0061] This invention also provides an automatic quality inspection device; please refer to [link / reference]. Figure 3 , Figure 3 This is a schematic diagram of an embodiment of the automatic quality inspection equipment of the present invention. In this embodiment, the automatic quality inspection equipment may include an image acquisition device 310 and the aforementioned electronic component testing device 320, wherein the image acquisition device 310 is connected to the electronic component testing device 320.

[0062] The image acquisition device 310 is used to acquire the original image of the object to be inspected and send the original image to the electronic component inspection device 320; the electronic component inspection device 320 is used to acquire the original image and determine the installation position of the target electronic component in the object to be inspected based on the original image.

[0063] The following example uses a motherboard as the object to be tested and connector components as the target electronic components. It should be noted that the object to be tested in this application includes, but is not limited to, the motherboard, and the target electronic components include, but are not limited to, connector components.

[0064] This embodiment uses an industrial camera installed in an automated quality inspection device to acquire images of the area to be inspected on the motherboard, which contains various components. Considering cost and efficiency, the motherboard can be placed relatively arbitrarily under the lens; the placement angle and position are not entirely fixed.

[0065] To locate the connector in an image, this embodiment uses the YOLOv7 target detection algorithm to pinpoint its location. The resulting image of the connector component area is transformed from the RGB color space to the HSV color space. By setting upper and lower thresholds in the HSV color space using prior knowledge, the connector itself can be filtered out. A mask representing the corresponding color of the connector component is obtained and used to mask the original image of the connector component, resulting in a masked image. The outermost boundaries where white pixels appear in the top, bottom, left, and right directions are found in the masked image. Using these boundary values, the connector image is cropped to obtain a precisely located connector image. The precise connector image is then grayscaled and binarized. By determining the number of white pixels in the left and right halves of the connector in the binarized image, the orientation and presence of the connector can be accurately determined.

[0066] On the other hand, the present invention also provides an electronic device, please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of an embodiment of the electronic device of the present invention. In this embodiment, the electronic device may include a memory 420, a processor 410, and a computer program stored in the memory 420 and executable on the processor 410. When the processor 410 executes the program, it implements the electronic component detection methods provided by the above-described methods.

[0067] Optionally, the electronic device may further include a communication bus 430 and a communication interface 440, wherein the processor 410, the communication interface 440, and the memory 420 communicate with each other via the communication bus 430. The processor 410 can call logic instructions in the memory 420 to execute an electronic component detection method, which includes:

[0068] The process involves: acquiring the original image of the object to be detected and extracting a rough location image of the target electronic component from the original image; masking the rough location image based on a mask corresponding to the color information of the target electronic component, resulting in a masked image that retains the mounting area of ​​the target electronic component; performing morphological processing on the masked image to obtain a processed masked image; determining the area of ​​each contour in the processed masked image and, based on contours that meet the threshold requirements, determining the boundary of the precise location of the target electronic component in the object to be detected; and extracting the image of the target electronic component from the rough location image based on the boundary of the precise location.

[0069] Furthermore, the logical instructions in the aforementioned memory 420 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0070] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the electronic component detection method provided by the above methods. The steps and principles of the method have been described in detail in the above methods and will not be repeated here.

[0071] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units 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. Those skilled in the art can understand and implement this without any creative effort.

[0072] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for testing electronic components, characterized in that, include: Acquire the original image of the object to be detected, and extract a rough location image of the target electronic component from the original image; Based on the mask corresponding to the color information of the target electronic component, the rough positioning image is masked to obtain a masked image that retains the installation area of ​​the target electronic component; The mask image is subjected to morphological processing to obtain the processed mask image; The area of ​​each contour in the processed mask image is determined, and based on the contours that meet the threshold requirements, the boundary of the precise location of the target electronic component in the object to be detected is determined. Based on the boundaries of the precise location, an image of the target electronic component is extracted from the coarse positioning image; The extraction of a rough location image of the target electronic component from the original image specifically includes: The original image is input into the YOLOv7 target detection model to obtain a rough localization image of the target electronic component; The YOLOv7 target detection model is obtained by training the model on the dataset of the target electronic components. After extracting the image of the target electronic component from the coarsely located image based on the boundary of the precise location, the method further includes: The image of the target electronic component is processed by grayscale and binarization, and the pixel value distribution is determined to obtain the installation status of the target electronic component.

2. The electronic component testing method according to claim 1, characterized in that, The step of masking the rough positioning image based on a pre-determined mask corresponding to the color information of the target electronic component to obtain a masked image that retains the mounting area of ​​the target electronic component specifically includes: The target mask is determined based on the target color information of the target electronic component in the target color space; Determine the specified image of the coarsely located image in the target color space; Based on the target mask, the target electronic component installation area in the specified image is masked to obtain the masked image.

3. The electronic component testing method according to claim 2, characterized in that, The target mask determined based on the target color information of the target electronic component in the target color space specifically includes: Based on the value range of the target color information, the mask retention range of the target electronic component is determined; The target mask is determined based on the mask retention range.

4. The electronic component testing method according to claim 3, characterized in that, The target color space includes one of the following: RGB color space, grayscale space, and HSV color space.

5. An electronic component testing device, characterized in that, include: The coarse positioning image module is used to acquire the original image of the object to be detected and extract the coarse positioning image of the target electronic component from the original image; The masking image module is used to mask the rough positioning image based on a mask corresponding to the color information of the target electronic component, so as to obtain a masked image that retains the installation area of ​​the target electronic component. A morphological processing module is used to perform morphological processing on the masking image to obtain a processed masking image; The precise positioning module is used to determine the area of ​​each contour in the processed mask image, and based on the contours that meet the threshold requirements, to determine the boundary of the precise position of the target electronic component in the object to be detected. A target electronic component module is used to extract an image of the target electronic component from the coarse positioning image based on the boundary of the precise location; The coarse localization image module is specifically used to input the original image into the YOLOv7 target detection model to obtain a coarse localization image of the target electronic component; wherein, the YOLOv7 target detection model is obtained by training the model on the dataset of the target electronic component; The electronic component detection device also includes an installation status module, which is used to perform grayscale and binarization processing on the image of the target electronic component, determine the pixel value distribution, and obtain the installation status of the target electronic component.

6. An automatic quality inspection device, characterized in that, It includes an image acquisition device and an electronic component testing device as described in claim 5, wherein the image acquisition device is connected to the electronic component testing device; The image acquisition device is used to acquire the original image of the object to be detected and send the original image to the electronic component detection device; The electronic component detection device is used to acquire the original image and, based on the original image, determine the installation position of the target electronic component in the object to be detected.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the electronic component testing method as described in any one of claims 1 to 4.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the electronic component testing method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Electronic component detection method and device and automatic quality inspection equipment

    CN115115596A