Nothing Special   »   [go: up one dir, main page]

CN117218070A - Method, device and equipment for detecting hardware defects - Google Patents

Method, device and equipment for detecting hardware defects Download PDF

Info

Publication number
CN117218070A
CN117218070A CN202311103064.XA CN202311103064A CN117218070A CN 117218070 A CN117218070 A CN 117218070A CN 202311103064 A CN202311103064 A CN 202311103064A CN 117218070 A CN117218070 A CN 117218070A
Authority
CN
China
Prior art keywords
hardware
defect
gray level
seed
pixel
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.)
Pending
Application number
CN202311103064.XA
Other languages
Chinese (zh)
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.)
Suzhou HYC Technology Co Ltd
Original Assignee
Suzhou HYC Technology 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 Suzhou HYC Technology Co Ltd filed Critical Suzhou HYC Technology Co Ltd
Priority to CN202311103064.XA priority Critical patent/CN117218070A/en
Publication of CN117218070A publication Critical patent/CN117218070A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The application discloses a method, a device and equipment for detecting hardware defects, wherein the method detects defect areas based on a seed growth algorithm, and the generation steps of seed points comprise: generating a plurality of lines of the hardware gray level image, wherein the lines correspond to pixel bands on the hardware gray level image; carrying out derivation of gray values between adjacent pixels on the pixel band; and selecting the pixel points with the derivative values larger than the derivative threshold as seed points. According to the method, on one hand, the defect area is accurately generated, so that the judging efficiency of the defect area is higher, and on the other hand, the generated effect is good, and the non-defect area is not easy to miss or to be identified as the defect area, so that the detecting method and the detecting device can improve the detecting efficiency of the hardware defect and the detecting accuracy.

Description

Method, device and equipment for detecting hardware defects
Technical Field
The present application relates to the field of hardware defect detection, and in particular, to a method, an apparatus, and a device for detecting a hardware defect.
Background
If the surface of the hardware is defective, the use is affected if the surface is light, and potential safety hazards exist if the surface is heavy, the hardware takes a circuit board as an example, for example, a battery protection board, the battery protection board can be used for protecting a battery, the problems of overdischarge, overcharge, overcurrent, short circuit and the like are prevented, some defects such as cracks possibly appear on the surface of the battery protection board, if the battery protection board is caused to fail, the service life of the battery is reduced, and even safety accidents are caused, so that the meaning of detecting the defects on the hardware in advance is great.
In the process of implementing the present application, the inventor finds that the following problems exist in the prior art:
the conventional CCD camera has insufficient detection precision, particularly when the noise affecting the defect detection exists on the surface of hardware, more noise points are easy to exist on a battery protection plate, and the defect area cannot be extracted accurately, so that the detection problem of the hardware defect cannot be solved well in the prior art.
Disclosure of Invention
In order to solve the above-mentioned problems of the prior art, the present application aims to provide a method, a device and a device for detecting a hardware defect, which have higher efficiency and high detection accuracy
In order to achieve the above object, an embodiment of the present application provides a method for detecting a hardware defect, including the following steps:
acquiring a hardware gray level image;
generating a plurality of seed points based on the hardware gray level image;
performing region growth based on the seed points to obtain a defect region of the hardware;
the seed point generation step comprises the following steps:
generating a plurality of lines of the hardware gray level image, wherein the lines correspond to pixel bands on the hardware gray level image;
carrying out derivation of gray values between adjacent pixels on the pixel band;
setting the pixel point with the derivative value larger than the derivative threshold value as a seed point to be selected;
and determining the seed point according to the seed point to be selected.
As a further improvement of the present application, the generating the lines of the hardware gray scale image by the step includes:
and determining the type of the line according to the shape of the hardware and/or the type of the defect to be detected, wherein the defect type comprises cracks and scratches.
As a further refinement of the application, the type of defect detected is a crack, the crack extending substantially in a first direction across the hardware;
the steps of generating the lines of the hardware gray scale image include:
a number of lines of the hardware grayscale image are generated, wherein the number of lines segment the hardware in a second direction that intersects the first direction.
As a further improvement of the present application, the length of the hardware in the first direction is a first length;
the steps of generating the lines of the hardware gray scale image include:
a number of lines of the hardware grayscale image are generated, wherein the number of lines divide the hardware into a number of aliquots over the first length.
As a further improvement of the present application, the step of performing region growth based on the seed point includes:
the seed points are subjected to regional growth based on a first criterion and a second criterion, and pixel points meeting growth requirements in the hardware gray level image are divided into defect sets, wherein the first criterion is that the gray level value of the current pixel point is smaller than a crack gray level threshold value, and the second criterion is that the difference value between the gray level value of the current pixel point and the gray level value of the seed point is smaller than a difference value threshold value;
wherein the step of performing region growing on the seed points based on the first criterion and the second criterion comprises:
and detecting whether the pixel points which are adjacent to the current seed point and are not detected meet the first criterion and the second criterion, and if so, continuing to grow the adjacent pixel points as new seed points until all the seed points are grown.
As a further improvement of the present application, the step of performing region growth based on the seed points, obtaining the defective region of the hardware further includes:
obtaining crack judgment conditions, wherein the crack judgment conditions comprise a height threshold value and a width-to-length ratio threshold value;
performing region growth based on the seed points to obtain a plurality of defect-like regions;
generating a minimum positive rectangle and a minimum external rectangle of the defect-like area;
if the height of the minimum positive rectangle is larger than the length threshold value and the width-to-length ratio of the minimum external rectangle is larger than the width-to-length ratio threshold value, the corresponding defect-like region is a defect region.
As a further improvement of the present application, the detected defect type is scratch;
the steps of generating the lines of the hardware gray scale image include:
and generating a plurality of lines of the hardware gray level image, wherein the lines cover the whole hardware gray level image as uniformly as possible.
As a further improvement of the present application, the step of performing region growth based on the seed point includes:
and carrying out region growth on the seed points based on a second criterion and a third criterion, and dividing the pixel points meeting the growth requirement in the hardware gray level image into defect sets, wherein the second criterion is that the difference value between the gray level value of the current pixel point and the gray level value of the seed point is smaller than a difference value threshold value, and the third criterion is that the gray level value of the current pixel point is larger than a scratch gray level threshold value.
As a further improvement of the present application, the hardware in the hardware gray scale image is rectangular;
the steps of generating the lines of the hardware gray scale image include:
generating a plurality of straight lines passing through the hardware gray level image along the length direction, wherein each straight line corresponds to one row of pixel points on the hardware gray level image along the length direction.
As a further improvement of the application, said step of deriving gray values between adjacent pixels of said band of pixels comprises:
and calculating a pixel point on the pixel band, a difference value between the pixel point and a pixel point adjacent to the left side of the pixel point and a difference value between the pixel point and a pixel point adjacent to the right side of the pixel point, wherein the quotient of the two difference values is a derivative corresponding to the pixel point.
As a further improvement of the present application, the step of determining the seed point according to the seed point to be selected further includes:
setting the seed point to be selected as the seed point;
or,
and setting a pixel point with a gray value lower than a lowest gray threshold value or higher than a highest gray threshold value selected from a plurality of adjacent pixel points in the vicinity of the pixel zone where the seed point to be selected is positioned as the seed point.
To achieve one of the above objects, an embodiment of the present application provides a device for detecting a hardware defect, including:
the acquisition module is used for acquiring the hardware gray level image;
the seed point generation module is used for generating a plurality of seed points based on the hardware gray level image;
the defect region generation module is used for carrying out region growth based on the seed points to obtain a defect region of the hardware;
wherein, the seed point generation module is further used for:
generating a plurality of lines of the hardware gray level image, wherein the lines correspond to pixel bands on the hardware gray level image;
carrying out derivation of gray values between adjacent pixels on the pixel band;
setting the pixel point with the derivative value larger than the derivative threshold value as a seed point to be selected;
and determining the seed point according to the seed point to be selected.
To achieve one of the above objects, an embodiment of the present application provides a hardware defect detecting apparatus, including:
the loading and unloading station is used for loading and unloading the hardware;
the conveying line is connected with the loading and unloading stations and transmits hardware;
the detection stations are positioned on the conveying line or at the side of the conveying line and are used for detecting a plurality of defects of hardware, and the detection stations adopt the method for detecting the defects of the hardware to detect the hardware and upload detection data;
the detection station is provided with a conveying mechanism, the conveying mechanism transfers hardware to the detection station, and after detection is completed, the hardware is transferred to the conveying line to carry out detection or blanking of the next process.
As a further improvement of the application, the hardware is a battery protection board, and the detection station comprises an appearance defect detection station and an electrical performance detection station.
To achieve one of the above objects, an embodiment of the present application provides a readable storage medium storing a computer program which, when executed by a processing module, performs the steps in the above-described method for detecting a hardware defect.
Compared with the prior art, the application has the following beneficial effects: the method, the device and the equipment for detecting the hardware defects detect the defect areas based on a seed growth algorithm, and combine the characteristics of hardware, acquire derivatives of a plurality of strip-shaped pixel points based on a plurality of lines, then determine proper seed points in a hardware scene, and then grow based on the seed points; on one hand, the defect area is accurately generated, so that the judging efficiency of the defect area is higher, and on the other hand, the generated effect is good, and the non-defect area is not easy to miss or to be identified as the defect area, so that the detection method and the detection device can improve the detection efficiency of the hardware defect and the detection accuracy.
Drawings
FIG. 1 is a flow chart of a method for detecting hardware defects according to an embodiment of the application;
FIG. 2 is a schematic diagram of a detected image according to an embodiment of the present application;
FIG. 3 is a flow chart of one embodiment of step S20 of FIG. 1;
FIG. 4 is a schematic diagram of one embodiment of the present application for generating a number of lines;
FIG. 5 is a schematic diagram of another embodiment of the present application for generating a number of lines;
FIG. 6 is a schematic diagram of yet another embodiment of the present application for generating a number of lines;
FIG. 7 is a flow chart of one embodiment of step S30 of FIG. 1;
FIG. 8 is a schematic view of a detected defect area as a crack according to a first embodiment of the present application;
FIG. 9 is a schematic diagram of a defect-like region with a minimum square and a minimum bounding rectangle, respectively, according to an embodiment of the present application;
FIG. 10a is a schematic diagram of one implementation of the second embodiment of the present application in which several lines are generated;
FIG. 10b is a schematic diagram of another implementation of the second embodiment of the present application that generates a number of lines;
FIG. 11 is a schematic view of a detected defect area as a scratch according to a second embodiment of the present application;
FIG. 12 is a block diagram of a hardware defect detection apparatus according to an embodiment of the application.
Detailed Description
The present application will be described in detail below with reference to specific embodiments shown in the drawings. These embodiments are not intended to limit the application and structural, methodological, or functional modifications of these embodiments that may be made by one of ordinary skill in the art are included within the scope of the application.
An embodiment of the application provides a method, a device and equipment for detecting hardware defects, which are higher in efficiency and high in detection accuracy.
In this embodiment, defects on the surface of the hardware are detected, and the defects can be obtained by analyzing the pictures according to the pictures acquired by the optical device, and the following defects mainly include two types of defects, namely cracks and scratches. Cracks refer to lines similar to broken lines on the surface of a material, and scratches refer to marks left on the surface of the material by other articles with higher hardness.
The hardware may be a circuit board, wafer, chip, housing or other tangible product, such as a battery protection plate in a circuit board as described in the background, the battery protection plate is mainly used for monitoring the state of the battery, and the upper surface of the battery protection plate is generally rectangular. The hardware may also be an optical lens or optical glass or a display product, such as a glass sheet or lens of a lens of an image pickup apparatus, such a lens being generally circular.
Correspondingly, taking the case that the hardware is a circuit board, more attention is paid to the defect type as a crack, the circuit board can detect scratches, for example, the scratch may damage the wiring on the surface of the circuit board. Taking the example where the hardware is an optical lens, the type of defect is more focused on scratches. The crack is characterized in that the color is darker than that of the crack-free area, and the gray value is lower on the gray map; the scratch is characterized in that the color is lighter than that of the scratch-free area, and the gray value is higher on the gray map.
The following description is divided into two examples, wherein example 1 is described by taking a defect type as a crack, example 2 is described by taking a defect type as a scratch, and the hardware of example 1 is described by taking a circuit board as an example, and more specifically, the circuit board may be a battery protection board.
Example 1
In the following, a method for detecting a hardware defect provided in embodiment 1 of the present application will be described with reference to the accompanying drawings, and although the present application provides the method operation steps shown in the following embodiments or flowcharts, the method is based on conventional or non-creative labor, and the execution sequence of these steps is not limited to the execution sequence provided in the embodiments of the present application.
The method for detecting hardware defects in this embodiment, as shown in fig. 1, includes the following steps S10-S30:
step S10: acquiring a hardware gray level image;
step S20: generating a plurality of seed points based on the hardware gray level image;
step S30: and carrying out region growth based on the seed points to obtain a defect region of the hardware.
The following describes these three steps in detail.
Step S10
Step S10 may include the following steps S11 to S14, or may further include step S15 as needed.
Step S11: a detection image is acquired.
The detected image is an image including the hardware to be detected, and may further include other background areas besides the hardware to be detected, where the black area shown in fig. 2 is a circuit board, and other white or light content is a background area.
Step S12: and identifying the detection image, and extracting the position and the angle of hardware in the detection image.
Still taking fig. 2 as an example, since the detected image contains other contents except the circuit board, and the angle of the circuit board is not fixed, the bottom edge of the circuit board is not parallel to the bottom edge of the detected image, in order to prevent the background area from affecting the extraction of the subsequent defect, the circuit board needs to be separated from other background areas, and the position and the angle of the hardware are extracted by adopting an image recognition method.
Step S13: and extracting a hardware image from the detection image according to the position and the angle of the hardware.
Only hardware is included in the hardware image, and the background area in fig. 2 is removed. And taking the upper surface of the hardware in fig. 2 as a rectangle as an example, based on the angle of step S12, it can be rotated to the bottom side to be in a horizontal state.
Step S14: a gray scale map is generated based on the hardware image.
The gray-scale image obtained here may be the hardware gray-scale image described in step S10.
In addition, the gray scale map obtained in step S14 may further be followed by step S15:
step S15: and enhancing the contrast of the gray level image by using an image enhancement method based on logarithmic transformation, and generating a hardware gray level image.
The hardware according to this embodiment is a circuit board, and the hard plastic material on the surface of the circuit board makes the contrast of the defect, i.e. the crack defect, aimed at in embodiment 1 on the circuit board not obvious, so that the contrast between the reinforced defect area and the background content outside the defect area in the gray scale map in step S15 is increased, and a final hardware gray scale image is obtained. The formula for the logarithmic transformation is as follows:
s=clog (1+r), where c is a constant and r is 0.
Step S20
Step S20 may include the following steps S21-S24 as shown in fig. 3.
Step S21: and generating a plurality of lines of the hardware gray level image, wherein the lines correspond to pixel bands on the hardware gray level image.
Here, the several lines may be generated based on the following steps S211 to S212, or may further include step S213:
step S211: and determining the type of the line according to the shape of the hardware and/or the type of the defect to be detected.
In step S211, three cases are specifically included, where:
(1) Determining the type of the line according to the shape of the hardware;
(2) Determining the type of the line according to the type of the defect to be detected;
(3) And determining the type of the line according to the shape of the hardware and the type of the defect to be detected.
For the first case, taking fig. 4, 5 and 6 as examples, if the hardware is rectangular, the line is a straight line; if the edges of the hardware are wavy, the lines are wavy; the hardware is circular, and the lines are also circular, so that the specific purpose of the arrangement is that the lines matched with the shape of the hardware can be selected according to the shape of the hardware.
In the second case, the defect for which example 1 is directed is a crack, which generally grows in a certain direction, i.e. has a certain directionality, where the crack extends substantially in the first direction over the hardware, and since the crack is not a straight line, what is meant here is that the crack may be curved, inclined somewhat, but extends substantially in the first direction, e.g. on a rectangular circuit board, where the crack is substantially in the width direction. In the second case, the line is therefore preferably a line which is required to be cut to the crack, where the line may not be parallel to the direction of propagation of the crack.
For the third case, i.e. the first case and the second case are combined at the same time, the effect is the combination of the two.
Step S212: a number of lines of the hardware grayscale image are generated, wherein the number of lines segment the hardware in a second direction that intersects the first direction.
I.e. the lines generated are able to cut as much as possible into cracks in the hardware, preferably the first direction is perpendicular to the second direction, e.g. the first direction is longitudinal and the second direction is transverse.
In addition, the length of the hardware along the first direction is a first length; taking the hardware of fig. 4 as a rectangle as an example, the first direction is the width direction, and the first length is the width; taking the hardware of fig. 5 as an example, the first direction is a width direction similar to a rectangle, and the first length is a width similar to a rectangle; taking the hardware of fig. 6 as an example, the hardware is circular, the first direction is radial, and the first length is radius or diameter.
Step S213: a number of lines of the hardware grayscale image are generated, wherein the number of lines divide the hardware into a number of aliquots over the first length.
The number of lines may be n, thus equally dividing the image into n+1 regions, where n.gtoreq.1. The purpose of the bisection is to divide the image into two when n=1, at the middle of the image, the line crossing the crack as much as possible. When n >1, for example, the image 3 is equally divided, the detection is not significantly affected by the crack at 1 position, and the detection of as many areas as possible in the image can be covered at a plurality of positions of the image, which is advantageous in improving the accuracy of the detection.
Taking the rectangular hardware of fig. 4 as an example, the lines are straight lines, and the hardware gray level image can be segmented into a plurality of equal-sized rectangular strips; taking the special-shaped hardware of fig. 5 as an example, the lines are wavy lines, and the hardware gray level image can be segmented into a plurality of wavy bars with equal size; taking the hardware of fig. 6 as an example of a circle, the line is a circle line, and the first length is divided into several equal parts, that is, equal parts of radius (or diameter), for example, radius 3 is equal in fig. 6, and 3 concentric circles are equal.
Taking fig. 4 as an example, the third situation above is combined, namely, considering that the hardware in the hardware gray level image is rectangular and the defect in the embodiment is a crack, the generation process of a plurality of lines is described:
generating a plurality of straight lines passing through the hardware gray level image along the length direction, wherein each straight line corresponds to one row of pixel points on the hardware gray level image along the length direction.
The image is divided into n+1 areas by n straight lines, the n straight lines are positioned in the hardware gray level image, a row of pixel points where each line is positioned is a pixel band, and finally the n pixel bands are extracted.
Step S22: and carrying out derivation of gray values between adjacent pixels on the pixel band.
The step S22 specifically includes:
and calculating a pixel point, a difference value between the pixel point and the left adjacent pixel point of the pixel point and a difference value between the pixel point and the right adjacent pixel point of the pixel point, wherein the quotient of the two difference values is the derivative corresponding to the pixel point.
Step S23: setting the pixel point with the derivative value larger than the derivative threshold value as a seed point to be selected;
the point with larger derivative value corresponds to the mutation of the pixel at the position, and the position may generate defects such as cracks or scratches, and the seed point to be selected is a possible seed point.
Step S24: and determining the seed point according to the seed point to be selected.
Step S24 includes two embodiments, one of which is:
setting the seed point to be selected as the seed point;
another embodiment is:
and setting a pixel point with a gray value lower than a lowest gray threshold value or higher than a highest gray threshold value selected from a plurality of adjacent pixel points in the vicinity of the pixel zone where the seed point to be selected is positioned as the seed point. In addition, the lowest gray value point, or the highest gray value point, may be selected as the seed point in some embodiments.
The seed point to be selected obtained in step S23 is a pixel point where there is a mutation in the pixel, which may be at the edge of the crack or scratch, and the mutation in the pixel point in the defect may be relatively small, so in this embodiment, a seed point located further in the defect is found in the vicinity of the seed point to be selected, and the meaning of the vicinity may be m pixels on the left side of the seed point to be selected and m pixels on the right side of the seed point to be selected are all taken as the vicinity pixel points.
For example, since the gradation value in the crack is generally lower, a pixel having a gradation value lower than the lowest gradation threshold value is selected as the seed point.
For example, since the gradation value in the crack is generally higher for the scratch, a pixel having a gradation value higher than the highest gradation threshold value is selected as the seed point.
Step S30
Step S30 may include the following steps S31-S35 as shown in fig. 7.
Step S31: and carrying out region growth on the seed points based on a first criterion and a second criterion, and dividing the pixel points meeting the growth requirement in the hardware gray level image into defect sets, wherein the first criterion is that the gray level value of the current pixel point is smaller than a crack gray level threshold value, and the second criterion is that the difference value between the gray level value of the current pixel point and the gray level value of the seed point is smaller than a difference value threshold value.
Step S32: a crack determination condition is obtained, wherein the crack determination condition comprises a height threshold and a width to length ratio threshold.
In this embodiment 1, based on the general form of the crack, two judging conditions of a height threshold and a width-to-length ratio threshold are determined, the crack is generally in a slender state, and even can penetrate through the whole circuit board in the first direction, for example, the rectangular board body in fig. 4 from top to bottom breaks, all the length thresholds are used for judging whether the crack defect is long enough, the width-to-length ratio threshold is used for judging whether the crack defect is thin enough, and the crack defect is the crack defect when the two threshold judging conditions are met.
Step S33: performing region growth based on the seed points to obtain a plurality of defect-like regions;
based on the first criterion and the second criterion, a seed growing algorithm is applied to the hardware gray level image, pixels close to the pixels of the seed points are searched, each time the pixels which are adjacent to the current seed point and not detected are searched and compared, for example, all pixels adjacent to one seed point are not detected, the adjacent pixels are 8 pixels around the seed point, whether the pixels meet the first criterion and the second criterion or not is detected, if yes, the pixels are used as new seed points to continue growing, and all the seed points are grown until the growth is completed.
Here, as shown in fig. 8, a corresponding mask map may be generated, in which the pixel points in the region grown based on the seed points are all 1, and the remaining pixel points are all 0.
Step S34: and generating a minimum positive rectangle and a minimum external rectangle of the defect-like area.
Step S35: and judging whether the height of the minimum positive rectangle is larger than a height threshold value and whether the width-to-length ratio of the minimum external rectangle is larger than the width-to-length ratio threshold value.
The minimum positive rectangle and the minimum bounding rectangle may be respectively shown in fig. 9, where one side of the minimum positive rectangle is parallel to the first direction, and the minimum bounding rectangle is the minimum rectangle that circumscribes the defect-like region. Wherein the height threshold and the height of the smallest positive rectangle can be referred to as the height in fig. 9; the ratio of width to length in fig. 9 can be referred to as the ratio of width to length of the width to length threshold and the width to length ratio of the minimum bounding rectangle.
If the height of the minimum positive rectangle is larger than the height threshold value and the width-to-length ratio of the minimum external rectangle is larger than the width-to-length ratio threshold value, namely, the two conditions are met, the corresponding defect-like region is a defect region.
If at least one of the two conditions is not met, the noise is used as the noise and the non-defect area.
As shown in fig. 8, only the second left region of the finally generated mask pattern is a defective region, i.e., a crack region extending in the width direction, and all the regions generated by the remaining seed points are noise regions.
Example 2
Example 2 differs from example 1 in that the type of defect is different, and the type of defect detected in example 2 is a scratch. Other embodiments of the non-illustrated portions may be described with reference to example 1, except as described differently below.
Step S21 of example 1 is specifically described in example 2 as follows:
and generating a plurality of lines of the hardware gray level image, wherein the lines cover the whole hardware gray level image as uniformly as possible.
The meaning of the term as far as possible here is that it may be either absolute uniformity, or overall non-absolute, a relative uniformity, such as the uniformity of fig. 4, 5, 6 in example 1, or the uniformity of the diagonal lines, as shown in fig. 10a, or the uniformity of one line in the shape of a Chinese character 'hui' cuts the whole hardware gray scale image, as shown in fig. 10 b.
Because scratches may appear at various positions in the hardware gray scale image in any position and in any form, a plurality of lines cover the various positions of the whole hardware gray scale image as uniformly as possible, which is beneficial to detecting the defect condition of the various positions.
In addition, for step S31 of example 1, in example 2, it is replaced with:
and carrying out region growth on the seed points based on a second criterion and a third criterion, and dividing the pixel points meeting the growth requirement in the hardware gray level image into defect sets, wherein the second criterion is that the difference value between the gray level value of the current pixel point and the gray level value of the seed point is smaller than a difference value threshold value, and the third criterion is that the gray level value of the current pixel point is larger than a scratch gray level threshold value.
Here, since the gray value of the scratch is higher than that of the non-scratch area, the above-mentioned second criterion and third criterion are adopted, and the other steps of step S30 are also corresponding to the adjustment of the scratch response, for example, step S32 is replaced with: the scratch determination condition is obtained, and the scratch is generally slender, so the scratch determination condition can also comprise a height threshold value and a width-to-length ratio threshold value, but the scratch does not necessarily extend along the first direction, so the height threshold value of the determination condition corresponding to the scratch can be smaller, the width-to-length ratio threshold value can also be smaller, and a specific value can be measured according to experiments.
As shown in fig. 11, only the middle region of the finally generated mask pattern is a defective region, that is, a scratched region extending in the left-right direction, and the regions generated by the remaining seed points are noise regions.
Compared with the prior art, the embodiment has the following beneficial effects:
the method and the device for detecting the hardware defects detect the defect areas based on a seed growth algorithm, and combine the characteristics of hardware, acquire derivatives of a plurality of strip-shaped pixel points based on a plurality of lines, then determine proper seed points in a hardware scene, and then grow based on the seed points; on one hand, the defect area is accurately generated, so that the judging efficiency of the defect area is higher, and on the other hand, the generated effect is good, and the non-defect area is not easy to miss or to be identified as the defect area, so that the detection method and the detection device can improve the detection efficiency of the hardware defect and the detection accuracy.
Hardware defect detection device
In one embodiment, a hardware defect detection apparatus is provided, as shown in FIG. 12. The hardware defect detection device comprises modules and specific functions of the modules as follows:
the acquisition module is used for acquiring the hardware gray level image;
the seed point generation module is used for generating a plurality of seed points based on the hardware gray level image;
the defect region generation module is used for carrying out region growth based on the seed points to obtain a defect region of the hardware;
wherein, the seed point generation module is further used for:
generating a plurality of lines of the hardware gray level image, wherein the lines correspond to pixel bands on the hardware gray level image;
carrying out derivation of gray values between adjacent pixels on the pixel band;
setting the pixel point with the derivative value larger than the derivative threshold value as a seed point to be selected;
and determining the seed point according to the seed point to be selected.
It should be noted that, for details not disclosed in the device for detecting a hardware defect in the embodiment of the present application, please refer to details disclosed in the method for detecting a hardware defect in the embodiment of the present application.
It will be appreciated by those skilled in the art that the block diagram is merely an example of a hardware defect detection apparatus, and does not constitute a limitation of the terminal device of the hardware defect detection apparatus, and may include more or fewer components than illustrated, or may combine some components, or different components, e.g., the hardware defect detection apparatus may further include an input/output device, a network access device, a bus, etc.
The device for detecting a hardware defect may further include a computing device such as a computer, a notebook, a palm computer, a cloud server, and the like, and include, but are not limited to, a processing module, a storage module, and a computer program stored in the storage module and capable of running on the processing module, for example, a method program for detecting a hardware defect as described above. The processing module, when executing the computer program, implements the steps in the embodiments of the method for detecting hardware defects described above, for example, the steps shown in fig. 1, 3, and 7.
Hardware defect detection device
In one embodiment, there is provided a hardware defect detection apparatus including:
the loading and unloading station is used for loading and unloading the hardware;
the conveying line is connected with the loading and unloading stations and transmits hardware;
the detection stations are positioned on the conveying line or at the side of the conveying line and are used for detecting a plurality of defects of hardware, and the detection stations adopt the method for detecting the defects of the hardware to detect the hardware and upload detection data;
the detection station is provided with a conveying mechanism, the conveying mechanism transfers hardware to the detection station, and after detection is completed, the hardware is transferred to the conveying line to carry out detection or blanking of the next process.
In one embodiment, the hardware is a battery protection board, and the detection station includes an appearance defect detection station and an electrical performance detection station.
In addition, the application also provides an electronic device, which comprises a storage module and a processing module, wherein the processing module can realize the steps in the method for detecting the hardware defects when executing the computer program, that is, realize the steps in any technical scheme in the method for detecting the hardware defects.
The electronic device may be part of a detection device integrated in the hardware defect, or may be a local terminal device, or may be part of a cloud server.
The processing module may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor, but in the alternative, it may be any conventional processor. The processing module is a control center of the hardware defect detection device and is connected with various parts of the whole hardware defect detection device by various interfaces and lines.
The storage module may be used to store the computer program and/or the module, and the processing module may implement various functions of the hardware defect detection device by running or executing the computer program and/or the module stored in the storage module and invoking the data stored in the storage module. The memory module may mainly include a memory program area and a memory data area, wherein the memory program area may store an operating system, application programs required for at least one function, and the like. In addition, the memory module may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), at least one disk storage device, a Flash memory device, or other volatile solid-state storage device.
The computer program may be divided into one or more modules/units, which are stored in a storage module and executed by a processing module to accomplish the present application, for example. The one or more modules/units may be a series of instruction segments of a computer program capable of performing a specific function, the instruction segments being used to describe the execution of the computer program in a hardware defect detection device.
Further, an embodiment of the present application provides a readable storage medium storing a computer program, where the computer program when executed by a processing module can implement the steps in the method for detecting a circuit board defect, that is, implement the steps in any one of the technical solutions of the method for detecting a circuit board defect.
The module integrated with the method for detecting circuit board defects can be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and the computer program may implement the steps of each of the method embodiments described above when executed by the processing module.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U-disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random-access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunication signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be understood that although the present disclosure describes embodiments, not every embodiment is provided with a separate embodiment, and that this description is for clarity only, and that the skilled artisan should recognize that the embodiments may be combined as appropriate to form other embodiments that will be understood by those skilled in the art.
The above list of detailed descriptions is only specific to practical embodiments of the present application, and they are not intended to limit the scope of the present application, and all equivalent embodiments or modifications that do not depart from the spirit of the present application should be included in the scope of the present application.

Claims (14)

1. The method for detecting the hardware defect is characterized by comprising the following steps:
acquiring a hardware gray level image;
generating a plurality of seed points based on the hardware gray level image;
performing region growth based on the seed points to obtain a defect region of the hardware;
the seed point generation step comprises the following steps:
generating a plurality of lines of the hardware gray level image, wherein the lines correspond to pixel bands on the hardware gray level image;
carrying out derivation of gray values between adjacent pixels on the pixel band;
setting the pixel point with the derivative value larger than the derivative threshold value as a seed point to be selected;
and determining the seed point according to the seed point to be selected.
2. The method of claim 1, wherein the step of generating lines of the hardware gray scale image comprises:
and determining the type of the line according to the shape of the hardware and/or the type of the defect to be detected, wherein the defect type comprises cracks and scratches.
3. The method of claim 2, wherein the type of defect detected is a crack, the crack extending substantially in a first direction across the hardware;
the steps of generating the lines of the hardware gray scale image include:
a number of lines of the hardware grayscale image are generated, wherein the number of lines segment the hardware in a second direction that intersects the first direction.
4. The method for detecting a hardware defect according to claim 3, wherein a length of the hardware in the first direction is a first length;
the steps of generating the lines of the hardware gray scale image include:
a number of lines of the hardware grayscale image are generated, wherein the number of lines divide the hardware into a number of aliquots over the first length.
5. The method of claim 3, wherein the step of performing region growing based on the seed points comprises:
the seed points are subjected to regional growth based on a first criterion and a second criterion, and pixel points meeting growth requirements in the hardware gray level image are divided into defect sets, wherein the first criterion is that the gray level value of the current pixel point is smaller than a crack gray level threshold value, and the second criterion is that the difference value between the gray level value of the current pixel point and the gray level value of the seed point is smaller than a difference value threshold value;
wherein the step of performing region growing on the seed points based on the first criterion and the second criterion comprises:
and detecting whether the pixel points which are adjacent to the current seed point and are not detected meet the first criterion and the second criterion, and if so, continuing to grow the adjacent pixel points as new seed points until all the seed points are grown.
6. The method for detecting a hardware defect according to claim 3, wherein the step of performing region growing based on the seed points, the obtaining a defective region of the hardware further comprises:
obtaining crack judgment conditions, wherein the crack judgment conditions comprise a height threshold value and a width-to-length ratio threshold value;
performing region growth based on the seed points to obtain a plurality of defect-like regions;
generating a minimum positive rectangle and a minimum external rectangle of the defect-like area;
if the height of the minimum positive rectangle is larger than the height threshold value and the width-to-length ratio of the minimum external rectangle is larger than the width-to-length ratio threshold value, the corresponding defect-like region is a defect region.
7. The method for detecting a hardware defect according to claim 2, wherein the type of defect detected is a scratch;
the steps of generating the lines of the hardware gray scale image include:
generating a plurality of lines of the hardware gray level image, wherein the lines uniformly cover the whole hardware gray level image as much as possible;
the step of performing region growth based on the seed points comprises:
and carrying out region growth on the seed points based on a second criterion and a third criterion, and dividing the pixel points meeting the growth requirement in the hardware gray level image into defect sets, wherein the second criterion is that the difference value between the gray level value of the current pixel point and the gray level value of the seed point is smaller than a difference value threshold value, and the third criterion is that the gray level value of the current pixel point is larger than a scratch gray level threshold value.
8. The method for detecting a hardware defect according to claim 2, wherein the hardware in the hardware gray scale image is rectangular;
the steps of generating the lines of the hardware gray scale image include:
generating a plurality of straight lines passing through the hardware gray level image along the length direction, wherein each straight line corresponds to one row of pixel points on the hardware gray level image along the length direction.
9. The method according to claim 1, wherein the deriving the gray value between adjacent pixels of the pixel band comprises:
and calculating a pixel point on the pixel band, a difference value between the pixel point and a pixel point adjacent to the left side of the pixel point and a difference value between the pixel point and a pixel point adjacent to the right side of the pixel point, wherein the quotient of the two difference values is a derivative corresponding to the pixel point.
10. The method of claim 1, wherein the determining the seed point according to the seed point to be selected further comprises:
setting the seed point to be selected as the seed point;
or,
and setting a pixel point with a gray value lower than a lowest gray threshold value or higher than a highest gray threshold value selected from a plurality of adjacent pixel points in the vicinity of the pixel zone where the seed point to be selected is positioned as the seed point.
11. A hardware defect detection apparatus, comprising:
the acquisition module is used for acquiring the hardware gray level image;
the seed point generation module is used for generating a plurality of seed points based on the hardware gray level image;
the defect region generation module is used for carrying out region growth based on the seed points to obtain a defect region of the hardware;
wherein, the seed point generation module is further used for:
generating a plurality of lines of the hardware gray level image, wherein the lines correspond to pixel bands on the hardware gray level image;
carrying out derivation of gray values between adjacent pixels on the pixel band;
setting the pixel point with the derivative value larger than the derivative threshold value as a seed point to be selected;
and determining the seed point according to the seed point to be selected.
12. A hardware defect detection apparatus, comprising:
the loading and unloading station is used for loading and unloading the hardware;
the conveying line is connected with the loading and unloading stations and transmits hardware;
the detection stations are positioned on the conveying line or at the side of the conveying line, the detection stations are used for detecting a plurality of defects of hardware, and the detection stations adopt the method for detecting the defects of the hardware according to any one of claims 1-10 to detect the hardware and upload detection data;
the detection station is provided with a conveying mechanism, the conveying mechanism transfers hardware to the detection station, and after detection is completed, the hardware is transferred to the conveying line to carry out detection or blanking of the next process.
13. The hardware defect inspection apparatus of claim 12 wherein the hardware is a battery protection board and the inspection station comprises an appearance defect inspection station and an electrical performance inspection station.
14. A readable storage medium storing a computer program, which when executed by a processing module, performs the steps of the method for detecting a hardware defect according to any one of claims 1 to 10.
CN202311103064.XA 2023-08-30 2023-08-30 Method, device and equipment for detecting hardware defects Pending CN117218070A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311103064.XA CN117218070A (en) 2023-08-30 2023-08-30 Method, device and equipment for detecting hardware defects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311103064.XA CN117218070A (en) 2023-08-30 2023-08-30 Method, device and equipment for detecting hardware defects

Publications (1)

Publication Number Publication Date
CN117218070A true CN117218070A (en) 2023-12-12

Family

ID=89045352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311103064.XA Pending CN117218070A (en) 2023-08-30 2023-08-30 Method, device and equipment for detecting hardware defects

Country Status (1)

Country Link
CN (1) CN117218070A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118397011A (en) * 2024-07-01 2024-07-26 苏州华兴源创科技股份有限公司 Golden finger defect detection method, golden finger defect detection device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118397011A (en) * 2024-07-01 2024-07-26 苏州华兴源创科技股份有限公司 Golden finger defect detection method, golden finger defect detection device, computer equipment and storage medium
CN118397011B (en) * 2024-07-01 2024-09-27 苏州华兴源创科技股份有限公司 Golden finger defect detection method, golden finger defect detection device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN101464418B (en) Flaw detection method and apparatus
US20210366122A1 (en) Method and apparatus for segmenting G-banded adhered chromosome based on geometrical characteristic and regional fusion, and chromosome karyotype analysis device
CN113109368B (en) Glass crack detection method, device, equipment and medium
CN113646801A (en) Defect detection method and device for defect image and computer readable storage medium
CN109738450B (en) Method and device for detecting notebook keyboard
CN117094975A (en) Method and device for detecting surface defects of steel and electronic equipment
CN117218070A (en) Method, device and equipment for detecting hardware defects
US20170011502A1 (en) Defect inspection apparatus for inspecting sheet-like inspection object, computer-implemented method for inspecting sheet-like inspection object, and defect inspection system for inspecting sheet-like inspection object
CN116503414B (en) Screen defect detection method, device, computer equipment and storage medium
CN109191516B (en) Rotation correction method and device of structured light module and readable storage medium
CN115100104A (en) Defect detection method, device and equipment for glass ink area and readable storage medium
CN114862817A (en) Circuit board golden finger area defect detection method, system, device and medium
CN113362238A (en) Test image processing method and device, electronic equipment and storage medium
WO2023280080A1 (en) Shadow elimination device and method, empty disk recognition device and method
CN112419207A (en) Image correction method, device and system
JP2004030188A (en) Method, apparatus and program for dividing image into areas
CN114998217A (en) Method for determining defect grade of glass substrate, computer device and storage medium
CN111814778B (en) Text line region positioning method, layout analysis method and character recognition method
CN115187593B (en) Screen defect detection method and device
CN115861315B (en) Defect detection method and device
CN116542998B (en) Contour detection method, device, equipment and medium for photoetching film inductance
CN115661156B (en) Image generation method, image generation device, storage medium, image generation apparatus, and computer program product
CN108510636B (en) Image segmentation method, image segmentation device and terminal equipment
CN113012121B (en) Method and device for processing bare chip scanning result, electronic equipment and storage medium
CN115564727A (en) Method and system for detecting abnormal defects of exposure development

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