CN108717697B - Circuit board detection method and device, computer equipment and storage medium - Google Patents

Circuit board detection method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN108717697B
CN108717697B CN201810482299.7A CN201810482299A CN108717697B CN 108717697 B CN108717697 B CN 108717697B CN 201810482299 A CN201810482299 A CN 201810482299A CN 108717697 B CN108717697 B CN 108717697B
Authority
CN
China
Prior art keywords
area
initial
feature
target
moved
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810482299.7A
Other languages
Chinese (zh)
Other versions
CN108717697A (en
Inventor
赵政
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201810482299.7A priority Critical patent/CN108717697B/en
Publication of CN108717697A publication Critical patent/CN108717697A/en
Application granted granted Critical
Publication of CN108717697B publication Critical patent/CN108717697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to a circuit board detection method, a circuit board detection system, computer equipment and a storage medium. The method comprises the following steps: acquiring N initial areas; the N initial areas cover all element characteristics of the circuit board; determining M target areas according to the N initial areas and the element characteristics covered by the N initial areas; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0; acquiring M regional images of the circuit board; the M area images correspond to the M target areas one by one; detecting element features in the M region images. By the circuit board detection method, the circuit board detection efficiency is improved.

Description

Circuit board detection method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of detection technologies, and in particular, to a method and an apparatus for detecting a circuit board, a computer device, and a storage medium.
Background
With the development of various intelligent electronic products, the quality requirement for a Printed Circuit Board (PCB) is higher and higher, and therefore, the PCB needs to be detected to ensure the manufacturing quality of the PCB.
At present, the common method for detecting a circuit board is to take an image of the circuit board and detect the feature of the component in the image. Generally, the inspection apparatus has a Field of View (FOV) limited by the FOV, and can inspect only a certain area of the circuit board in one inspection. Therefore, the detection device needs to divide the circuit board into a plurality of areas and detect the areas respectively to complete the task of detecting the circuit board.
However, the components of the printed circuit board may be distributed relatively sporadically, and when a small number of components are distributed in a plurality of divided areas, the detection equipment needs to detect the plurality of areas respectively to complete the detection of the small number of components, which results in low efficiency of the circuit board detection.
Therefore, the circuit board detection method in the prior art has the problem of low detection efficiency.
Disclosure of Invention
In view of the above, it is necessary to provide a circuit board detection method, an apparatus, a computer device and a storage medium capable of improving detection efficiency.
In a first aspect, an embodiment of the present invention provides a method for detecting a circuit board, where the method includes:
acquiring N initial areas; the N initial areas cover all element characteristics of the circuit board;
determining M target areas according to the N initial areas and the element characteristics covered by the N initial areas; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0;
acquiring M regional images of the circuit board; the M area images correspond to the M target areas one by one;
detecting element features in the M region images.
In one embodiment, the determining M target regions according to the N initial regions and the element characteristics covered thereby includes
Selecting at least one initial area as an area to be moved;
moving the area to be moved according to the element characteristics covered by the area to be moved to obtain the target area;
and when the element features covered by the target area comprise all the element features covered by another initial area, deleting the other initial area, and returning to the step of selecting at least one initial area as the area to be moved until the M target areas are obtained.
In one embodiment, the moving the to-be-moved area according to the element feature covered by the to-be-moved area to obtain the target area includes:
acquiring element features which are covered by the area to be moved and are associated with the area identification of the area to be moved to obtain a first candidate feature;
selecting a locating feature from the first candidate features;
and moving the area to be moved to the positioning feature to obtain the target area.
In one embodiment, after the moving the region to be moved according to the target feature to obtain the target region, the method further includes:
taking the area identification of the area to be moved as the area identification of the target area;
determining the element characteristics covered by the target area as second candidate characteristics;
taking a second candidate feature with the associated region identification different from the region identification of the target region as a re-association feature;
and modifying the area identification associated with the re-association feature into the area identification of the target area.
In one embodiment, after the moving the region to be moved according to the element feature covered by the region to be moved to obtain the target region, the method further includes:
acquiring the area identification of the other initial area;
and when the area identifier of the other initial area does not have the associated element feature, judging that the element feature covered by the target area comprises all the element features covered by the other initial area.
In one embodiment, the selecting a localization feature from the first candidate features includes:
acquiring the area edge of the area to be moved;
and selecting a first candidate feature with the minimum distance from the edge of the area to be moved to obtain the positioning feature.
In one embodiment, the moving the region to be moved to the positioning feature to obtain the target region includes:
acquiring a feature edge of the positioning feature;
calculating the distance between the area edge of the area to be moved and the feature edge of the positioning feature to obtain an edge distance;
and moving the area to be moved to the positioning feature by the edge distance to obtain the target area.
In one embodiment, the method further comprises the following steps:
dividing the circuit board into a plurality of positioning grids, and acquiring the characteristics of the positioning grids;
and when the characteristics of the positioning grid conform to the set characteristics, taking the characteristics of the positioning grid as the element characteristics.
In one embodiment, the method further comprises the following steps:
acquiring element characteristics covered by the initial area, and setting an area identifier of the initial area;
and establishing an association relation between the element characteristics covered by the initial area and the area identification of the initial area.
In one embodiment, the selecting at least one initial region as the region to be moved includes:
selecting an initial area corresponding to a set target moving direction from the N initial areas as the area to be moved;
the initial region has a plurality of candidate region edges, the candidate region edges have corresponding moving directions, and the acquiring the region edges of the region to be moved includes:
selecting a candidate region edge corresponding to the target moving direction from a plurality of candidate region edges of the region to be moved as a region edge of the region to be moved;
the element feature has a plurality of candidate feature edges with corresponding moving directions, and the acquiring the feature edges of the localization features comprises:
and selecting a candidate feature edge corresponding to the target moving direction from the plurality of candidate feature edges of the positioning feature as the feature edge of the positioning feature.
In one embodiment, before determining M target regions according to the N initial regions and the element features covered by the N initial regions, the method further includes:
and selecting one moving direction as the target moving direction from a plurality of preset moving directions.
In a second aspect, an embodiment of the present invention provides a circuit board detection apparatus, where the apparatus includes:
the initial acquisition module is used for acquiring N initial areas; the N initial areas cover all element characteristics of the circuit board;
the target determining module is used for determining M target areas according to the N initial areas and the element characteristics covered by the N initial areas; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0;
the image acquisition module is used for acquiring M regional images of the circuit board; the M area images correspond to the M target areas one by one;
and the detection module is used for detecting the element characteristics in the M area images.
In one embodiment, the goal determination module comprises
The selection submodule is used for selecting at least one initial area as an area to be moved;
the moving submodule is used for moving the area to be moved according to the element characteristics covered by the area to be moved to obtain the target area;
and the deleting submodule is used for deleting another initial area when the element characteristics covered by the target area include all the element characteristics covered by another initial area, and returning to the step of selecting at least one initial area as the area to be moved until the M target areas are obtained.
In one embodiment, the initial region has a region identifier, the component feature has an associated region identifier, and the moving submodule includes:
the acquiring unit is used for acquiring the element characteristics which are covered by the area to be moved and are associated with the area identification of the area to be moved to obtain a first candidate characteristic;
a locating feature unit, configured to select a locating feature from the first candidate features;
and the target area unit is used for moving the area to be moved to the positioning feature to obtain the target area.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the circuit board detection method according to the first aspect when executing the computer program.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is used to execute the circuit board detection method according to the first aspect when executed by a processor.
According to the circuit board detection method, the circuit board detection device, the computer equipment and the storage medium, the M target areas with the number less than N are determined according to the N initial areas of the circuit board and the element characteristics covered by the N initial areas, the M area images corresponding to the M target areas are obtained, and the element characteristics of the M area images are detected, so that the N area images do not need to be obtained according to the N initial areas and detected, the area images needing to be detected are reduced, and the circuit board detection efficiency is improved.
Drawings
Fig. 1 is a flowchart of a circuit board detection method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a circuit board;
FIG. 3 is a schematic diagram of a prior art circuit board inspection method;
FIG. 4 is a diagram of N initial regions according to a first embodiment of the present invention;
FIG. 5 is a diagram illustrating an initial area of movement according to a first embodiment of the present invention;
fig. 6 is a flowchart of a circuit board detection method according to a second embodiment of the present invention;
FIG. 7 is a schematic diagram of a positioning grid according to a second embodiment of the present invention;
FIG. 8 is a schematic diagram of a feature of an element of a second embodiment of the present invention;
FIG. 9 is a diagram illustrating a step of determining a target area according to a second embodiment of the present invention;
FIG. 10 is a diagram illustrating a moving area scene according to a second embodiment of the present invention;
FIG. 11 is a schematic diagram illustrating an effect of a shaking area according to an embodiment of the invention;
fig. 12 is a block diagram of a circuit board detection apparatus according to a third embodiment of the present invention;
fig. 13 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Example one
Fig. 1 is a flowchart of a circuit board detection method according to an embodiment of the present invention.
It should be noted that the circuit board detection method provided by the present embodiment may be executed by a detection device. The detection device may have a camera for capturing an area image for each area of the circuit board. The detection device is used for detecting each area image. When the area image is detected, the element characteristics of the circuit board elements reflected in the area image are mainly detected.
The circuit board can be arranged on electronic equipment such as a computer, a mobile phone, a tablet, a projector or an interactive intelligent tablet, and the electronic equipment can realize various functions through the circuit board. The interactive intelligent panel can be an integrated device which controls contents displayed on the display panel and realizes man-machine interaction operation through a touch technology, and integrates one or more functions of an electronic whiteboard, a sound device, a television and the like.
Fig. 2 is a schematic diagram of a circuit board. As can be seen in the figure, the circuit board may comprise a plurality of components 201, and the plurality of components 201 may be distributed at various locations on the circuit board.
Fig. 3 is a schematic diagram of a prior art circuit board inspection method. The imaging device of the inspection apparatus has a field angle FOV through which an area of the circuit board within the field angle FOV is imaged and the imaged image is inspected. At the time of inspection, the circuit board may be divided into a plurality of areas 301 in advance, and the range of each area 301 is the same as the range of one field angle FOV. When the shooting device shoots images, the images are shot in the range of the field angle FOV, and the image of one area of the circuit board can be obtained. The camera device can shoot images of a plurality of areas 301 of the circuit board by moving the field angle FOV, and the detection equipment can detect the images of the areas 301, so that the detection of all elements of the circuit board can be completed.
The example of fig. 3 illustrates that the prior art circuit board inspection method has a problem of low inspection efficiency. The components 302 in fig. 3 are distributed in four areas 301, and therefore, the detection device needs to capture the four areas 301 respectively and detect four images to complete the detection of the components 302, which is inefficient.
Specifically, referring to fig. 1, the method for detecting a circuit board provided in this embodiment specifically includes:
step S101, acquiring N initial areas; the N initial areas cover all component features of the circuit board.
The N initial regions may be a plurality of regions obtained by dividing the circuit board according to a preset rule. For example, the length and width of the circuit board may be equally divided into a plurality of portions, and one portion of the length and one portion of the width may be used as one region, thereby equally dividing the circuit board into N regions.
The component features may be features of electronic components on a circuit board. For example, the circuit board has electronic components thereon, and after the circuit board is divided into a plurality of areas, the image capturing device of the detection apparatus captures images of the areas, and the obtained image may include image features of the electronic components, and the image features of the electronic components may be regarded as one component feature. In practical application, the circuit board can be divided into a plurality of grids, a complete electronic component can be contained in the range of one grid, and the image characteristics of the complete electronic component contained in the grid can be used as a component characteristic; within the range of one lattice, only a local electronic element may be included, and the image feature of the local electronic element included in the lattice may be regarded as one element feature.
In a specific implementation, the detection device may divide N regions for the circuit board as the N initial regions. The circuit board may have a plurality of component features thereon and the N initial areas may be overlaid with all of the component features on the circuit board.
Fig. 4 is a schematic diagram of N initial regions according to a first embodiment of the present invention. As can be seen from the figure, the circuit board can be divided into 4 initial regions, namely an initial region 401, an initial region 402, an initial region 403 and an initial region 404. In the 4 initial regions, element feature E01, element feature E02, element feature E03, and element feature E04 were covered, respectively.
Step S102, determining M target areas according to the N initial areas and the element characteristics covered by the N initial areas; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0.
In particular implementations, one or more of the N initial regions may be moved depending on the characteristics of the element covered by the initial regions. When the initial area is moved, the element feature can be moved to a set target moving direction based on the edge of the element feature, when one or more initial areas are moved and all element features of another initial area are covered, it can be determined that the other initial area is a redundant initial area, and if the redundant initial area is used as a target area for detection, the same element feature is detected, and the detection efficiency is reduced. Therefore, the redundant initial area can be deleted. After the redundant initial regions are deleted, the remaining initial regions are used as target regions, and M target regions with the number less than N are obtained. For example, after moving 2 initial regions for 12 initial regions, 2 target regions are obtained, the 2 target regions cover all the element features of 1 unmoved initial region, the initial regions are determined to be redundant, the redundant initial regions are deleted without moving, the remaining 9 initial regions are continuously moved to obtain 9 target regions, and finally 11 target regions are obtained.
Fig. 5 is a schematic diagram of a moving initial area according to a first embodiment of the present invention. As can be seen from the figure, the initial area 501, the initial area 502, the initial area 503 and the initial area 504 are divided in the circuit board. Current initial region 501, initial region 502, initial region 503, and initial region 504 are covered with element feature E01, element feature E02, element feature E03, and element feature E04, respectively.
The initial region 501 is selected to move, so as to obtain an initial region 501 ', and the initial region 501' is used as a target region 505. The target area 505 covers the element feature E02 of the initial area 502, and the initial area 502 has only one element feature E02, i.e., the target area 505 covers all of the element features of the initial area 502. Similarly, the target area 505 covers all the component features of the initial area 503, and the target area 505 covers all the component features of the initial area 504. Therefore, it can be determined that the initial area 502, the initial area 503, and the initial area 504 are all redundant initial areas, and the initial area 502, the initial area 503, and the initial area 504 are deleted. Finally, a target area 505 is obtained that covers all the element features of the plurality of initial areas.
In practical application, whether a certain initial region is redundant or not can be judged according to the incidence relation between the element characteristics and the initial region. Specifically, the circuit board may be first divided into a plurality of positioning cells, characteristics in the plurality of positioning cells are obtained, and when a certain positioning cell includes characteristics of a complete component of the circuit board or characteristics of a local component, the characteristics are used as a component characteristic, and meanwhile, region identifiers of N initial regions are set, and a relationship is established between the component characteristics in one initial region and the region identifiers of the initial regions. When an initial area is moved, searching the element characteristic which is nearest to the area edge of the initial area and is associated with the area identification of the initial area in the initial area as a positioning characteristic, moving the initial area based on the positioning characteristic, taking the moved initial area as a target area, when the target area is covered with the element characteristic of another initial area, taking the element characteristic of the covered another initial area as a re-association characteristic, modifying the area identification associated with the re-association characteristic into the area identification of the target area, when there is no component feature associated with the area identifier of the other initial area among the component features covered by the other initial area, indicating that all the component features of the other initial area are covered by the target area, it may be determined that the other initial area is a redundant initial area.
Referring to fig. 5, an initial region 501, an initial region 502, an initial region 503, and an initial region 504 have region identifications S01, S02, S03, and S04, respectively. Currently, region identification S01 is associated with element feature E01, region identification S02 is associated with element feature E02, region identification S03 is associated with element feature E03, and region identification S04 is associated with element feature E04.
The initial area 501 is selected to be moved, it is determined that the element feature E01 is covered in the initial area 501, and the element feature E01 is associated with the area identifier S01 of the initial area 501, so that the initial area 501 is moved based on the element feature E01 to obtain an initial area 501 ', the initial area 501' is taken as the target area 505, and the area identifier of the target area 505 is also S01. The target area 505 covers the element feature E02 of the initial area 502, and the area identifier associated with the element feature E02 is modified from the area identifier S02 to the area identifier S01 of the target area 505. Similarly, the target area 505 covers the element feature E03 of the initial area 503 and the element feature E04 of the initial area 504, so that the area identifier associated with the element feature E03 is modified to the area identifier S01, and the area identifier associated with the element feature E04 is modified to the area identifier S01.
Then, the initial area 502 is selected, and since the area identifier S02 of the initial area 502 does not have associated component features, which indicates that all the component features of the initial area 502 have been covered by the target area, it may be determined that the initial area 502 is a redundant initial area, and the initial area 502 is deleted. Similarly, the initial areas 503 and 504 may be deleted, and finally, a target area 505 is obtained.
It should be noted that the above example of determining the target area is only used to illustrate the technical idea of the present embodiment, and a person skilled in the art can determine the target area in various ways according to the technical idea provided by the present embodiment, and the present embodiment does not limit the specific way of determining the target area.
Step S103, obtaining M area images of the circuit board; the M area images correspond to the M target areas one by one.
The area image is an image obtained by shooting a target area of the circuit board by a shooting device of the detection equipment.
In a specific implementation, after the M target areas are determined, the detection device may capture M target areas of the circuit board to obtain M area images, where the M area images include all component features of the circuit board.
Step S104, detecting element characteristics in the M area images.
In a specific implementation, the M area images include all the component features of the circuit board, and the detection is performed on the M area images, that is, the detection can be performed on all the component features of the circuit board.
Referring to fig. 5, the area image of the target area 505 is acquired, and the area image is detected, that is, the detection of the element feature E01, the element feature E02, the element feature E03, and the element feature E04 can be completed without detecting four area images corresponding to the initial area 501, the initial area 502, the initial area 503, and the initial area 504, respectively, so that the efficiency of detecting the circuit board is improved.
According to the technical scheme provided by the embodiment, M target areas with the quantity less than N are determined according to N initial areas of the circuit board and element characteristics covered by the initial areas, M area images corresponding to the M target areas are obtained, and the element characteristics of the M area images are detected, so that the N area images do not need to be obtained according to the N initial areas and the N area images do not need to be detected, the area images needing to be detected are reduced, and the efficiency of detecting the circuit board is improved.
Example two
Fig. 6 is a flowchart of a circuit board detection method according to a second embodiment of the present invention. The circuit board detection method provided by the embodiment specifically comprises the following steps:
step S201, acquiring N initial areas; the N initial areas cover all component features of the circuit board.
Optionally, the method further comprises:
dividing the circuit board into a plurality of positioning grids, and acquiring the characteristics of the positioning grids; and when the characteristics of the positioning grid conform to the set characteristics, taking the characteristics of the positioning grid as the element characteristics.
The positioning grids are used for positioning the element features. After the circuit board is divided into a plurality of positioning grids, the plurality of positioning grids form a positioning grid matrix with a plurality of rows and columns, and each positioning grid can be numbered according to the position of the positioning grid in the positioning grid matrix, for example, a certain positioning grid is located in the 2 nd column and the 3 rd row in the positioning grid matrix, and the number of the positioning grid is G _2_ 3. Accordingly, the component feature in the location grid is numbered as G _2_ 3. From the number, an association between the element feature and the region can be established.
Wherein the features of the positioning grid may include image features within the positioning grid. The characteristics of the complete element or the partial element can be preset, and when the characteristics of a certain positioning grid are matched with the characteristics of the complete element or the partial element, the characteristics in the positioning grid are used as the element characteristics.
In specific implementation, the circuit board can be divided into a plurality of grid-shaped positioning grids in an equal ratio according to the length and the width of the circuit board. Each positioning grid can have a feature, and when the feature is matched with the set feature, the feature in the positioning grid can be used as an element feature.
Fig. 7 is a schematic diagram of a positioning grid according to a second embodiment of the present invention. As shown in the figure, a plurality of positioning grids 701 can be obtained by dividing the circuit board, so as to form a positioning grid matrix.
Fig. 8 is a schematic diagram of a feature of an element according to a second embodiment of the present invention. As can be seen, the circuit board may be divided into a plurality of positioning grids, wherein the positioning grid 801 has a feature of a part of the component 802, and the feature of the positioning grid 801 is a component feature.
Step S202, acquiring the element features covered by the initial region, and setting a region identifier of the initial region.
Wherein the region identifier is used to identify the different regions. For example, the region of one initial region is identified as S01, and the region of another initial region is identified as S02.
In a specific implementation, a shooting device of the detection device may collect a preview image for the initial area, and identify image features in the preview image, that is, component features covered by the initial area may be determined.
Step S203, establishing an association relationship between the element features covered by the initial region and the region identifier of the initial region.
In a specific implementation, the element characteristics covered by an initial region may be obtained, and a region identifier may be set for the initial region. Then, the element characteristics covered by an initial area are associated with the area identification of the initial area. In practical application, the association relationship between the number of the element feature and the area identifier can be recorded. For example, the element feature E01 covered by an initial area is numbered G _2_3, the area of the initial area is identified as S01, and the association relationship between G _2_3 and S01 is recorded.
Step S204, determining M target areas according to the N initial areas and the element characteristics covered by the N initial areas; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0.
Optionally, as shown in fig. 9, a step diagram for determining a target area in the second embodiment is provided, and the step S204 may specifically include:
step S11, selecting at least one initial area as an area to be moved;
step S12, moving the area to be moved according to the element characteristics covered by the area to be moved to obtain the target area;
step S13, taking the area identifier of the area to be moved as the area identifier of the target area;
step S14, determining the element characteristics covered by the target area as second candidate characteristics;
step S15, using a second candidate feature with the associated region identification different from the region identification of the target region as a re-association feature;
step S16, modifying the area identification associated with the re-association feature into the area identification of the target area;
step S17, obtaining an area identifier of the another initial area;
step S18, when there is no related component feature in the area identifier of the another initial area, determining that the component feature covered by the target area includes all the component features covered by the another initial area.
Step S19, when the element features covered by the target area include all the element features covered by another initial area, delete the another initial area, and return to step S11 until M target areas are obtained.
In a specific implementation of the step S11, one initial region may be selected from the N initial regions according to a set selection rule, and the initial region is used as a region to be moved. After the initial area is moved, selecting the next initial area as the area to be moved, and moving the next initial area. And so on, moving multiple initial regions.
In practical application, the selection rule may be that the initial region is sequentially selected from the top left corner and from left to right and from top to bottom as the region to be moved, or the initial region is sequentially selected from the bottom right corner and from right to left and from bottom to top as the region to be moved. Of course, a person skilled in the art may set a selection rule according to an actual situation, and the embodiment of the present invention is not limited thereto.
Optionally, the selecting at least one initial region as a region to be moved includes:
and selecting an initial area corresponding to the set target moving direction from the N initial areas as the area to be moved.
Specifically, a plurality of moving directions such as lower right, upper left, and lower left may be set, and one moving direction may be set as the target moving direction before the initial region is moved. According to the set target moving direction, a corresponding initial area can be selected as an area to be moved. For example, if the current direction is moving towards the lower right, the detection area at the upper left corner is selected as the area to be moved, after the detection area at the upper left corner is moved, the detection area below the detection area at the upper left corner is selected as the area to be moved, and one or more detection areas are moved according to the sequence.
Fig. 10 is a schematic diagram of a moving area scene according to a second embodiment of the present invention. As can be seen from the figure, assuming that the target moving direction at the lower right is currently set, accordingly, the initial region 1001 located at the upper left corner may be selected as the region to be moved, and the region is moved to the lower right, so as to obtain the target region 1001'. Then, the initial region 1002 is selected as a region to be moved, and the region is moved to the lower right to obtain a target region 1002'. And so on, selecting the initial area according to the set rule to select the initial area to move.
In a specific implementation of step S12, the moving direction and the moving distance of the to-be-moved area may be determined according to the characteristics of the element covered by the to-be-moved area, and the to-be-moved area after moving is taken as the target area.
Optionally, the initial region has a region identifier, the element feature has an associated region identifier, and the step S12 includes:
step a, acquiring element features which are covered by the area to be moved and are associated with the area identification of the area to be moved to obtain a first candidate feature;
b, selecting a positioning feature from the first candidate features;
and c, moving the area to be moved to the positioning feature to obtain the target area.
In a specific implementation, the element features covered by the area to be moved may be obtained, and the element features associated with the area identifier of the area to be moved are searched for in the element features covered by the area to be moved, so as to obtain a plurality of first candidate features. And selecting one or more first candidate features from the first candidate features according to a preset rule to serve as the positioning features. And moving the area to be moved based on the positioning characteristics, and taking the moved area to be moved as a target area.
Referring to FIG. 10, the region of initial region 1001 is identified as S01, initial region 1001 covers element feature E01 through element feature E04, and current element feature E01 through element feature E04 are associated with region identification S01 of initial region 1001. Therefore, the element features E01 through E04 are the first candidate features of the initial region 1001. Among the first candidate features from the device feature E01 to the device feature E04, the device feature E01 is selected as the location feature according to a predetermined rule. The initial region 1001 moves towards element feature E01 to obtain target region 1001'.
Optionally, the step b includes:
acquiring the area edge of the area to be moved; and selecting a first candidate feature with the minimum distance from the edge of the area to be moved to obtain the positioning feature.
Wherein, the region edge is the edge of an initial region. For example, the initial region is a rectangle, and four sides of the rectangle are four region edges of the initial region.
In a specific implementation, the region to be moved may have a plurality of candidate region edges, and in the plurality of candidate region edges, one or more candidate region edges are selected as the region edge of the initial region according to a preset rule. Then, the first candidate feature having the smallest distance from the edge of the region to be moved is used as the above-mentioned positioning feature.
Optionally, the obtaining the area edge of the to-be-moved area includes:
and selecting a candidate region edge corresponding to the target moving direction from the plurality of candidate region edges of the region to be moved as the region edge of the region to be moved.
Referring to fig. 10, the initial region 1001 has 4 edges as candidate region edges, the currently set target movement direction is the lower right, and the upper candidate region edge and the left candidate region edge may be selected as the region edges of the initial region 1001.
Optionally, the step c includes:
acquiring a feature edge of the positioning feature; calculating the distance between the area edge of the area to be moved and the feature edge of the positioning feature to obtain an edge distance; and moving the area to be moved to the positioning feature by the edge distance to obtain the target area.
In particular implementations, the locating feature can have one or more feature edges. After determining the region edge of the initial region, the distance between the region edge and the feature edge may be calculated as the edge distance described above. And then, moving the area to be moved to the positioning feature by the edge distance to obtain a target area.
Referring to fig. 10, the element feature E01 is a positioning feature, and the element feature E01 has 4 edges, and an edge on the upper side and an edge on the left side of the element feature E01 are taken as feature edges of the positioning feature according to a preset rule. The initial region 1001 is a region to be moved, the initial region 1001 has 4 edges, and the upper side edge and the left side edge are region edges. The distance between the region edge and the feature edge is calculated, where the distance between the edge on the upper side of the initial region 1001 and the edge on the upper side of the element feature E01 is 2 bins, and the distance between the edge on the left side of the initial region 1001 and the edge on the left side of the element feature E01 is also 2 bins. Therefore, initial region 1001 is moved rightward by 2 positioning frames and moved downward by 2 positioning frames, thereby obtaining target region 1001'.
Optionally, the obtaining the feature edge of the localization feature includes:
and selecting a candidate feature edge corresponding to the target moving direction from the plurality of candidate feature edges of the positioning feature as the feature edge of the positioning feature.
Referring to fig. 10, the element feature E01 has 4 edges as candidate feature edges, and the currently set target moving direction is the lower right, and the candidate feature edge on the upper side and the candidate feature edge on the left side may be selected as the feature edges of the element feature E01.
In a specific implementation of step S13, after the area to be moved is moved to obtain the target area, the area identifier of the area to be moved may be used as the area identifier of the target area.
Referring to fig. 10, after the initial region 1001 is moved, a target region 1001' is obtained. The area of the initial area 1001 is denoted as S01, and thus the area of the target area 1001' is denoted as S01.
In a specific implementation of step S14, after the initial area is moved, the element characteristics covered by the initial area before the movement are different from the element characteristics covered by the initial area before the movement. Therefore, after the initial region is moved to obtain the target region, the feature of the element covered by the target region may be acquired as the second candidate feature.
Referring to FIG. 10, initial area 1001 covers element feature E01 through element feature E04, and moving the initial area to obtain target area 1001 ', the element features covered by target area 1001' include element feature E01 through element feature E06, and element feature E08 through element feature E09. The element features E01 through E06, E08 through E09 are second candidate features of the target region 1001'.
In a specific implementation of step S15, the area identifier associated with the second candidate feature may be obtained, and when the area identifier associated with a certain second candidate feature is not the same as the area identifier of the target area, the second candidate feature is used as the re-association feature.
Referring to FIG. 10, the zone designations associated with element features E05 through E06 and E08 through E09 are the same as zone designation S02 for initial zone 1002 and zone designation S01 for target zone 1001', and thus element features E05 through E06 and E08 through E09 are re-associated features.
In a specific implementation of step S16, when the re-association feature is associated with an area identifier of another initial area, the area identifier of another initial area may be deleted, and an area identifier of the target area may be newly added as an area identifier associated with the re-association feature.
Referring to fig. 10, regarding element feature E05 through element feature E06, element feature E08 through element feature E09, the associated region identifier S02 is modified to be the region identifier S01 of the target region.
In a specific implementation of the step S17, after moving one initial region, a next initial region may be selected for moving. Before moving the next initial area, it can be determined whether all the component features covered by the next initial area are covered by the target area. Specifically, a region identifier of a next initial region may be first obtained, and whether the region identifier has an associated element feature may be determined. Since the area identification associated with one or more element features of the initial area may be modified, the area identification of the next initial area is not associated with the element feature. The area identification of the next initial area does not have associated component features, indicating that all component features of the next initial area have been covered by the target area.
In the specific implementation of step S18, when there is no associated component feature in the area identifier of an initial area, it may be determined that all component features of the initial area are already included in the component features covered by the target area, that is, the initial area is a redundant initial area.
In a specific implementation of the step S19, after determining the redundant initial area, the redundant initial area may be deleted, and the step S11 is returned to, and the next initial area is selected to move. After moving the plurality of initial regions, M target regions may be obtained.
In order to facilitate understanding of the embodiment of the present invention by those skilled in the art, a process of determining M target areas will be described below based on fig. 10.
Referring to fig. 10, there are currently 12 initial regions. An initial area 1001 is selected as the area to be moved. Initial region 1001 includes element feature E01 through element feature E04. Currently, the element features E01 through E04 are all associated with the region identifier S01 of the initial region 1001, which are all first candidate features. Among them, the first candidate feature which is the smallest distance from the region edge of the initial region 1001 and is associated with S01 is the element feature E01, and the element feature E01 is used as the positioning feature.
The edge distance between the feature edge of the element feature E01 and the region edge of the initial region 1001 is determined as 2 positioning grids in the transverse direction and 2 positioning grids in the longitudinal direction, and the initial region 1001 moves 2 positioning grids to the right and downward respectively to obtain a target region 1001'.
The target region 1001' covers the element features E01 through E06, E08 through E09, which are second candidate features.
In the second candidate feature, the associated regions are identified as S02 from element feature E05 to element feature E06, element feature E08 to element feature E09, and thus element features E05 to E06, element feature E08 to E09 are re-associated features. And modifying the area identifier associated with the re-association feature into an area identifier S01 of the target area 1001'.
An initial area 1002 is selected as the area to be moved. Initial region 1002 includes element feature E05 through element feature E14. The region identifier S01 is the region associated with element feature E05 through element feature E06 and element feature E08 through element feature E09, and therefore, the element features covered by initial region 1002 and associated with region identifier S02 of initial region 1002 include element feature E07, element feature E10 through element feature E14, which are first candidate features. The first candidate feature that is the smallest distance from the region edge of the initial region 1002 and is associated with S02 is element feature E07, and element feature E07 is used as the locating feature.
Determining the edge distance between the feature edge of the element feature E07 and the region edge of the initial region 1002 as 1 positioning grid in the transverse direction and 1 positioning grid in the longitudinal direction, and respectively moving the 1 positioning grid to the right and downwards of the initial region 1002 to obtain a target region 1002'.
The target region 1002' covers element feature E07 through element feature E14, which are all second candidate features.
The second candidate feature, element feature E08 through element feature E09, is associated with the region identified as S01, and thus element feature E08 through element feature E09 are re-associated features. And modifying the area identifier associated with the re-association feature into an area identifier S02 of the target area 1002'.
And continuing to move the next initial region in the above manner, when moving to the initial region 1003, obtaining a target region 1003 ' after the initial region 1003 moves, covering the element features E15 to E18 by the target region 1003 ', and modifying the region identifier associated with the element features E15 to E18 into the region identifier S03 of the target region 1003 '. Since the element feature E16 covered by the initial area 1004 is not associated with the area identifier S04 of the initial area 1004, i.e., all the element features covered by the initial area 1004 are covered by the target area 1003', the initial area 1004 is a redundant initial area, and the initial area 1004 can be deleted. Similarly, the initial area 1005 and the initial area 1006 may be determined to be redundant initial areas, and the initial area 1005 and the initial area 1006 may be deleted. Therefore, when detection is carried out, detection of the initial region 1004 to the initial region 1006 is reduced while detection of all element features of the circuit board is guaranteed, and detection efficiency of the circuit board is improved.
Optionally, before the step S204, the method further includes:
and selecting one moving direction as the target moving direction from a plurality of preset moving directions.
In a specific implementation, the plurality of regions of the circuit board may be moved in a plurality of moving directions, such as lower right, upper left, and lower left, and before moving the initial region, a moving direction may be set as a target moving direction. When a plurality of initial areas are moved, the movement is performed in the target movement direction. After moving the initial area, the next moving direction may be selected as the target moving direction, and the initial area may be moved again. Therefore, the multiple areas move to different moving directions, the redundant areas are determined by shaking the areas for multiple times, the redundant initial areas can be determined quickly, and the efficiency of circuit board detection is further improved.
Fig. 11 is a schematic diagram illustrating an effect of a shaking area according to an embodiment of the invention. It can be seen from the figure that each area is moved according to different moving directions, so that the shaking effect of the areas is realized, and in M target areas obtained after shaking for multiple times, all element characteristics of the circuit board are covered, and the number of the areas is reduced.
Step S205, obtaining M area images of the circuit board; the M area images correspond to the M target areas one by one.
In specific implementation, the detection device can shoot M target areas of the circuit board to obtain corresponding M area images.
Step S206, detecting element features in the M area images.
In a specific implementation, the detectable device may detect the element features in the M area images, and determine whether the element features are abnormal.
According to the technical scheme provided by the embodiment, the redundant area can be determined by establishing the incidence relation between the area and the element characteristics, moving the area according to the incidence relation and modifying the incidence relation according to the moved area through a small number of moving times, so that the speed of determining the redundant area is increased, and the efficiency of detecting the circuit board is further improved.
It should be understood that although the various steps in the flowcharts and step diagrams of fig. 1, 6 and 9 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1, 6, and 9 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
EXAMPLE III
Fig. 12 is a block diagram of a circuit board detection apparatus according to a third embodiment of the present invention, where the circuit board detection apparatus specifically includes an initial acquisition module 301, a target determination module 302, an image acquisition module 303, and a detection module 304.
An initial obtaining module 301, configured to obtain N initial regions; the N initial areas cover all element characteristics of the circuit board;
a target determining module 302, configured to determine M target regions according to the N initial regions and the element features covered by the N initial regions; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0;
an image acquisition module 303, configured to acquire M area images of the circuit board; the M area images correspond to the M target areas one by one;
a detection module 304, configured to detect element features in the M area images.
In one embodiment, the goal determination module 302 includes:
the selection submodule is used for selecting at least one initial area as an area to be moved;
the moving submodule is used for moving the area to be moved according to the element characteristics covered by the area to be moved to obtain the target area;
and the deleting submodule is used for deleting another initial area when the element characteristics covered by the target area include all the element characteristics covered by another initial area, and returning to the step of selecting at least one initial area as the area to be moved until the M target areas are obtained.
In one embodiment, the initial region has a region identifier, the component feature has an associated region identifier, and the moving submodule includes:
the acquiring unit is used for acquiring the element characteristics which are covered by the area to be moved and are associated with the area identification of the area to be moved to obtain a first candidate characteristic;
a locating feature unit, configured to select a locating feature from the first candidate features;
and the target area unit is used for moving the area to be moved to the positioning feature to obtain the target area.
In one embodiment, the goal determining module 302 further includes:
the first identification submodule is used for taking the area identification of the area to be moved as the area identification of the target area;
the characteristic acquisition submodule is used for determining the element characteristics covered by the target area as second candidate characteristics;
the re-association submodule is used for taking the second candidate characteristics of which the associated area identifications are different from the area identifications of the target area as re-association characteristics;
and the identification modification submodule is used for modifying the area identification associated with the re-association characteristic into the area identification of the target area.
In one embodiment, the goal determining module 302 further includes:
the second identification submodule is used for acquiring the area identification of the other initial area;
and the judging submodule is used for judging that the element features covered by the target area contain all the element features covered by the other initial area when the area identifier of the other initial area does not have the associated element features.
In one embodiment, the positioning feature unit comprises:
the area edge subunit acquires the area edge of the area to be moved;
and the selecting subunit is used for selecting the first candidate feature with the minimum distance from the edge of the area to be moved to obtain the positioning feature.
In one embodiment, the target area unit includes:
a feature edge subunit, configured to obtain a feature edge of the positioning feature;
the distance calculation subunit is used for calculating the distance between the area edge of the area to be moved and the feature edge of the positioning feature to obtain an edge distance;
and the moving subunit is used for moving the area to be moved to the positioning feature by the edge distance to obtain the target area.
In one embodiment, the apparatus further comprises:
the dividing module is used for dividing the circuit board into a plurality of positioning grids and acquiring the characteristics of the positioning grids;
and the component characteristic determining module is used for taking the characteristic of the positioning grid as the component characteristic when the characteristic of the positioning grid conforms to the set characteristic.
In one embodiment, the apparatus further comprises:
the setting module is used for acquiring the element characteristics covered by the initial area and setting the area identification of the initial area;
and the establishing module is used for establishing the association relationship between the element characteristics covered by the initial area and the area identification of the initial area.
In one embodiment, the initial area has a corresponding moving direction, and the selecting sub-module includes:
a to-be-moved unit, configured to select, as the to-be-moved region, an initial region corresponding to a set target movement direction from the N initial regions;
the initial region has a plurality of candidate region edges having corresponding moving directions, the region edge subunit includes:
the first edge module is used for selecting a candidate area edge corresponding to the target moving direction from a plurality of candidate area edges of the area to be moved as an area edge of the area to be moved;
the element feature has a plurality of candidate feature edges having corresponding directions of movement, the feature edge subunit including:
and the second edge module is used for selecting a candidate feature edge corresponding to the target moving direction from the candidate feature edges of the positioning feature to be used as the feature edge of the positioning feature.
In one embodiment, the apparatus further comprises:
and the direction selection module is used for selecting one moving direction from a plurality of preset moving directions as the target moving direction.
For the specific definition of the circuit board detection device, reference may be made to the above definition of the circuit board detection method, which is not described herein again. The modules in the circuit board detection device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Example four
Fig. 13 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. The computer device may be a server, and its internal structure diagram may be as shown in fig. 13. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing circuit board detection data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a circuit board inspection method.
Those skilled in the art will appreciate that the architecture shown in fig. 13 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring N initial areas; the N initial areas cover all element characteristics of the circuit board; determining M target areas according to the N initial areas and the element characteristics covered by the N initial areas; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0; acquiring M regional images of the circuit board; the M area images correspond to the M target areas one by one; detecting element features in the M region images.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
selecting at least one initial area as an area to be moved;
moving the area to be moved according to the element characteristics covered by the area to be moved to obtain the target area;
and when the element features covered by the target area comprise all the element features covered by another initial area, deleting the other initial area, and returning to the step of selecting at least one initial area as the area to be moved until the M target areas are obtained.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring element features which are covered by the area to be moved and are associated with the area identification of the area to be moved to obtain a first candidate feature;
selecting a locating feature from the first candidate features;
and moving the area to be moved to the positioning feature to obtain the target area.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
taking the area identification of the area to be moved as the area identification of the target area;
determining the element characteristics covered by the target area as second candidate characteristics;
taking a second candidate feature with the associated region identification different from the region identification of the target region as a re-association feature;
and modifying the area identification associated with the re-association feature into the area identification of the target area.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring the area identification of the other initial area;
and when the area identifier of the other initial area does not have the associated element feature, judging that the element feature covered by the target area comprises all the element features covered by the other initial area.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring the area edge of the area to be moved;
and selecting a first candidate feature with the minimum distance from the edge of the area to be moved to obtain the positioning feature.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a feature edge of the positioning feature;
calculating the distance between the area edge of the area to be moved and the feature edge of the positioning feature to obtain an edge distance;
and moving the area to be moved to the positioning feature by the edge distance to obtain the target area.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
dividing the circuit board into a plurality of positioning grids, and acquiring the characteristics of the positioning grids;
and when the characteristics of the positioning grid conform to the set characteristics, taking the characteristics of the positioning grid as the element characteristics.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring element characteristics covered by the initial area, and setting an area identifier of the initial area;
and establishing an association relation between the element characteristics covered by the initial area and the area identification of the initial area.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
selecting an initial area corresponding to a set target moving direction from the N initial areas as the area to be moved;
the initial region has a plurality of candidate region edges, the candidate region edges have corresponding moving directions, and the acquiring the region edges of the region to be moved includes:
selecting a candidate region edge corresponding to the target moving direction from a plurality of candidate region edges of the region to be moved as a region edge of the region to be moved;
the element feature has a plurality of candidate feature edges with corresponding moving directions, and the acquiring the feature edges of the localization features comprises:
and selecting a candidate feature edge corresponding to the target moving direction from the plurality of candidate feature edges of the positioning feature as the feature edge of the positioning feature.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and selecting one moving direction as the target moving direction from a plurality of preset moving directions.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
in one embodiment, the computer program when executed by the processor further performs the steps of:
selecting at least one initial area as an area to be moved;
moving the area to be moved according to the element characteristics covered by the area to be moved to obtain the target area;
and when the element features covered by the target area comprise all the element features covered by another initial area, deleting the other initial area, and returning to the step of selecting at least one initial area as the area to be moved until the M target areas are obtained.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring element features which are covered by the area to be moved and are associated with the area identification of the area to be moved to obtain a first candidate feature;
selecting a locating feature from the first candidate features;
and moving the area to be moved to the positioning feature to obtain the target area.
In one embodiment, the computer program when executed by the processor further performs the steps of:
taking the area identification of the area to be moved as the area identification of the target area;
determining the element characteristics covered by the target area as second candidate characteristics;
taking a second candidate feature with the associated region identification different from the region identification of the target region as a re-association feature;
and modifying the area identification associated with the re-association feature into the area identification of the target area.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring the area identification of the other initial area;
and when the area identifier of the other initial area does not have the associated element feature, judging that the element feature covered by the target area comprises all the element features covered by the other initial area.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring the area edge of the area to be moved;
and selecting a first candidate feature with the minimum distance from the edge of the area to be moved to obtain the positioning feature.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a feature edge of the positioning feature;
calculating the distance between the area edge of the area to be moved and the feature edge of the positioning feature to obtain an edge distance;
and moving the area to be moved to the positioning feature by the edge distance to obtain the target area.
In one embodiment, the computer program when executed by the processor further performs the steps of:
dividing the circuit board into a plurality of positioning grids, and acquiring the characteristics of the positioning grids;
and when the characteristics of the positioning grid conform to the set characteristics, taking the characteristics of the positioning grid as the element characteristics.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring element characteristics covered by the initial area, and setting an area identifier of the initial area;
and establishing an association relation between the element characteristics covered by the initial area and the area identification of the initial area.
In one embodiment, the computer program when executed by the processor further performs the steps of:
selecting an initial area corresponding to a set target moving direction from the N initial areas as the area to be moved;
the initial region has a plurality of candidate region edges, the candidate region edges have corresponding moving directions, and the acquiring the region edges of the region to be moved includes:
selecting a candidate region edge corresponding to the target moving direction from a plurality of candidate region edges of the region to be moved as a region edge of the region to be moved;
the element feature has a plurality of candidate feature edges with corresponding moving directions, and the acquiring the feature edges of the localization features comprises:
and selecting a candidate feature edge corresponding to the target moving direction from the plurality of candidate feature edges of the positioning feature as the feature edge of the positioning feature.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and selecting one moving direction as the target moving direction from a plurality of preset moving directions.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (16)

1. A method of circuit board inspection, the method comprising:
acquiring N initial areas; the N initial areas cover all element characteristics of the circuit board; the N initial areas are obtained by dividing the circuit board;
determining M target areas of the circuit board according to the N initial areas and the element characteristics covered by the N initial areas; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0;
acquiring M regional images of the circuit board; the M area images correspond to the M target areas one by one; the M area images contain all element characteristics of the circuit board;
detecting element features in the M area images;
determining M target areas according to the N initial areas and the element characteristics covered by the N initial areas, wherein the method comprises the following steps:
selecting at least one initial area as an area to be moved;
moving the area to be moved according to the element characteristics covered by the area to be moved to obtain the target area;
and when the element features covered by the target area comprise all the element features covered by another initial area, deleting the other initial area, and returning to the step of selecting at least one initial area as the area to be moved until the M target areas are obtained.
2. The method of claim 1, wherein the initial area has an area identifier, the element feature has an associated area identifier, and the moving the area to be moved according to the element feature covered by the area to be moved to obtain the target area comprises:
acquiring element features which are covered by the area to be moved and are associated with the area identification of the area to be moved to obtain a first candidate feature;
selecting a locating feature from the first candidate features;
and moving the area to be moved to the positioning feature to obtain the target area.
3. The method according to claim 2, wherein after the moving the region to be moved according to the element feature covered by the region to be moved to obtain the target region, the method further comprises:
taking the area identification of the area to be moved as the area identification of the target area;
determining the element characteristics covered by the target area as second candidate characteristics;
taking a second candidate feature with the associated region identification different from the region identification of the target region as a re-association feature;
and modifying the area identification associated with the re-association feature into the area identification of the target area.
4. The method according to claim 3, wherein after the moving the region to be moved according to the element feature covered by the region to be moved to obtain the target region, the method further comprises:
acquiring the area identification of the other initial area;
and when the area identifier of the other initial area does not have the associated element feature, judging that the element feature covered by the target area comprises all the element features covered by the other initial area.
5. The method of claim 2, wherein said selecting a located feature from the first candidate features comprises:
acquiring the area edge of the area to be moved;
and selecting a first candidate feature with the minimum distance from the edge of the area to be moved to obtain the positioning feature.
6. The method according to claim 5, wherein the moving the region to be moved to the positioning feature to obtain the target region comprises:
acquiring a feature edge of the positioning feature;
calculating the distance between the area edge of the area to be moved and the feature edge of the positioning feature to obtain an edge distance;
and moving the area to be moved to the positioning feature by the edge distance to obtain the target area.
7. The method of claim 2, further comprising:
dividing the circuit board into a plurality of positioning grids, and acquiring the characteristics of the positioning grids;
and when the characteristics of the positioning grid conform to the set characteristics, taking the characteristics of the positioning grid as the element characteristics.
8. The method of claim 7, further comprising:
acquiring element characteristics covered by the initial area, and setting an area identifier of the initial area;
and establishing an association relation between the element characteristics covered by the initial area and the area identification of the initial area.
9. The method according to claim 6, wherein the initial areas have corresponding moving directions, and the selecting at least one initial area as an area to be moved comprises:
selecting an initial area corresponding to a set target moving direction from the N initial areas as the area to be moved;
the initial region has a plurality of candidate region edges, the candidate region edges have corresponding moving directions, and the acquiring the region edges of the region to be moved includes:
selecting a candidate region edge corresponding to the target moving direction from a plurality of candidate region edges of the region to be moved as a region edge of the region to be moved;
the element feature has a plurality of candidate feature edges with corresponding moving directions, and the acquiring the feature edges of the localization features comprises:
and selecting a candidate feature edge corresponding to the target moving direction from the plurality of candidate feature edges of the positioning feature as the feature edge of the positioning feature.
10. The method of claim 9, wherein prior to said determining M target regions from said N initial regions and their overlying element features, further comprising:
and selecting one moving direction as the target moving direction from a plurality of preset moving directions.
11. A circuit board inspection device, the device comprising:
the initial acquisition module is used for acquiring N initial areas; the N initial areas cover all element characteristics of the circuit board; the N initial areas are obtained by dividing the circuit board;
the target determining module is used for determining M target areas of the circuit board according to the N initial areas and the element characteristics covered by the N initial areas; the M target areas cover all element features covered by the N initial areas; wherein N is more than M and more than 0;
the image acquisition module is used for acquiring M regional images of the circuit board; the M area images correspond to the M target areas one by one; the M area images contain all element characteristics of the circuit board;
a detection module for detecting element features in the M region images;
the goal determination module includes:
the selection submodule is used for selecting at least one initial area as an area to be moved;
the moving submodule is used for moving the area to be moved according to the element characteristics covered by the area to be moved to obtain the target area;
and the deleting submodule is used for deleting another initial area when the element characteristics covered by the target area include all the element characteristics covered by another initial area, and returning to the step of selecting at least one initial area as the area to be moved until the M target areas are obtained.
12. The apparatus of claim 11, wherein the initial zone has a zone identifier, wherein the component feature has an associated zone identifier, and wherein the moving submodule comprises:
the acquiring unit is used for acquiring the element characteristics which are covered by the area to be moved and are associated with the area identification of the area to be moved to obtain a first candidate characteristic;
a locating feature unit, configured to select a locating feature from the first candidate features;
and the target area unit is used for moving the area to be moved to the positioning feature to obtain the target area.
13. The apparatus of claim 12, wherein the goal determination module further comprises:
the first identification submodule is used for taking the area identification of the area to be moved as the area identification of the target area;
the characteristic acquisition submodule is used for determining the element characteristics covered by the target area as second candidate characteristics;
the re-association submodule is used for taking the second candidate characteristics of which the associated area identifications are different from the area identifications of the target area as re-association characteristics;
and the identification modification submodule is used for modifying the area identification associated with the re-association characteristic into the area identification of the target area.
14. The apparatus of claim 13, wherein the goal determination module further comprises:
the second identification submodule is used for acquiring the area identification of the other initial area;
and the judging submodule is used for judging that the element features covered by the target area contain all the element features covered by the other initial area when the area identifier of the other initial area does not have the associated element features.
15. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor realizes the steps of the method of any one of claims 1 to 10 when executing the computer program.
16. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 10.
CN201810482299.7A 2018-05-18 2018-05-18 Circuit board detection method and device, computer equipment and storage medium Active CN108717697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810482299.7A CN108717697B (en) 2018-05-18 2018-05-18 Circuit board detection method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810482299.7A CN108717697B (en) 2018-05-18 2018-05-18 Circuit board detection method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108717697A CN108717697A (en) 2018-10-30
CN108717697B true CN108717697B (en) 2021-04-13

Family

ID=63899939

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810482299.7A Active CN108717697B (en) 2018-05-18 2018-05-18 Circuit board detection method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108717697B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112129227B (en) * 2020-11-23 2021-03-02 维嘉数控科技(苏州)有限公司 Method, device, equipment and medium for scanning printed circuit board
CN114040120B (en) * 2022-01-06 2022-04-12 深圳思谋信息科技有限公司 Shooting path determination method, device and equipment for panel element detection

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100810722B1 (en) * 2007-04-03 2008-03-07 (주)펨트론 Apparatus for measurement of surface profile and control method thereof
JP2010008149A (en) * 2008-06-25 2010-01-14 Panasonic Corp Inspection region setting method
CN105184793A (en) * 2015-09-02 2015-12-23 广东电网有限责任公司汕尾供电局 Electric energy meter sample appearance and PCB element detection method
CN105510348A (en) * 2015-12-31 2016-04-20 南京协辰电子科技有限公司 Flaw detection method and device of printed circuit board and detection equipment
CN106370671A (en) * 2016-10-12 2017-02-01 浙江理工大学 PCB (printed circuit board) component detection system and method based on machine vision

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7366321B2 (en) * 2004-06-18 2008-04-29 Agilent Technologies, Inc. System and method for performing automated optical inspection of objects
US8254661B2 (en) * 2008-06-02 2012-08-28 Applied Materials Israel, Ltd. System and method for generating spatial signatures
US9582874B2 (en) * 2012-11-23 2017-02-28 Alexander Phillip Davies Method of detection of faults on circuit boards
KR101511089B1 (en) * 2013-07-22 2015-04-10 (주)펨트론 Teaching data auto-generating method for aoi apparatus
CN105203549A (en) * 2015-09-10 2015-12-30 苏州威盛视信息科技有限公司 Circuit board AOI (automated optical inspection) detection method
EP3389007B1 (en) * 2015-12-07 2020-06-10 Fuji Corporation Substrate image processing device and substrate image processing method
CN107025648A (en) * 2017-03-20 2017-08-08 中国人民解放军空军工程大学 A kind of board failure infrared image automatic testing method
CN107330879A (en) * 2017-06-21 2017-11-07 广州视源电子科技股份有限公司 A kind of inspection method of device, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100810722B1 (en) * 2007-04-03 2008-03-07 (주)펨트론 Apparatus for measurement of surface profile and control method thereof
JP2010008149A (en) * 2008-06-25 2010-01-14 Panasonic Corp Inspection region setting method
CN105184793A (en) * 2015-09-02 2015-12-23 广东电网有限责任公司汕尾供电局 Electric energy meter sample appearance and PCB element detection method
CN105510348A (en) * 2015-12-31 2016-04-20 南京协辰电子科技有限公司 Flaw detection method and device of printed circuit board and detection equipment
CN106370671A (en) * 2016-10-12 2017-02-01 浙江理工大学 PCB (printed circuit board) component detection system and method based on machine vision

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
电路板元器件的检测与识别;宿鸣明;《中国优秀博硕士学位论文全文数据库 (硕士)信息科技辑》;20060316;正文第1页,第23-24页 *

Also Published As

Publication number Publication date
CN108717697A (en) 2018-10-30

Similar Documents

Publication Publication Date Title
CN108717697B (en) Circuit board detection method and device, computer equipment and storage medium
KR102356372B1 (en) White balance processing method, electronic device and computer readable storage medium
US11107246B2 (en) Method and device for capturing target object and video monitoring device
US20080225125A1 (en) Image feature identification and motion compensation apparatus, systems, and methods
CN112101378A (en) Robot repositioning method, device and equipment
CN108257186B (en) Method and device for determining calibration image, camera and storage medium
CN111246098B (en) Robot photographing method and device, computer equipment and storage medium
CN108961316B (en) Image processing method and device and server
CN110346704B (en) Method, device and equipment for determining test file in board test and storage medium
CN108764297B (en) Method and device for determining position of movable equipment and electronic equipment
CN111524086B (en) Moving object detection device, moving object detection method, and storage medium
CN114092720A (en) Target tracking method and device, computer equipment and storage medium
CN109279542B (en) Forklift fork entering method and device, computer equipment and storage medium
CN110930437B (en) Target tracking method and device
CN114040120B (en) Shooting path determination method, device and equipment for panel element detection
CN110365927B (en) Video recording method, video recording device, storage medium and computer equipment
CN111145674B (en) Display panel detection method, electronic device and storage medium
JP5983033B2 (en) Position relationship determination program, position relationship determination method, and position relationship determination device
CN112215897B (en) Camera frame data coverage rate determination method and device and computer equipment
CN112215311A (en) Sample warehousing method and device, computer equipment and storage medium
KR20150009842A (en) System for testing camera module centering and method for testing camera module centering using the same
CN110839126B (en) Zoom tracking method and device and zoom camera
CN112986239B (en) Hierarchical image acquisition method, hierarchical image acquisition device, computer equipment and storage medium
CN109242894B (en) Image alignment method and system based on mobile least square method
CN111754397B (en) Remote sensing image embedding method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant