CN108510513A - A kind of PCB image circle detection method based on PCA and segmentation RHT - Google Patents
A kind of PCB image circle detection method based on PCA and segmentation RHT Download PDFInfo
- Publication number
- CN108510513A CN108510513A CN201810205002.2A CN201810205002A CN108510513A CN 108510513 A CN108510513 A CN 108510513A CN 201810205002 A CN201810205002 A CN 201810205002A CN 108510513 A CN108510513 A CN 108510513A
- Authority
- CN
- China
- Prior art keywords
- circle
- image
- pca
- segmentation
- rht
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 25
- 230000011218 segmentation Effects 0.000 title claims abstract description 21
- 238000003708 edge detection Methods 0.000 claims abstract description 8
- 238000000034 method Methods 0.000 claims description 11
- 238000009825 accumulation Methods 0.000 claims description 3
- 230000007423 decrease Effects 0.000 claims description 3
- 239000011159 matrix material Substances 0.000 claims description 3
- 230000000452 restraining effect Effects 0.000 claims description 3
- 238000012216 screening Methods 0.000 claims description 3
- 230000009466 transformation Effects 0.000 claims 1
- 238000000513 principal component analysis Methods 0.000 abstract description 5
- 230000007547 defect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The PCB image circle detection method based on PCA and segmentation RHT that the invention discloses a kind of, includes the following steps:S1. it is loaded into original color pcb board image;S2. binarization of gray value is carried out to image, image border is extracted using edge detection algorithm, remove the more point of number of crossings;S3. the line segment in binarization of gray value image is marked, finds out the line segment that length is more than set threshold value t;S4. principal component analysis is carried out to every line segment, obtains characteristic value, reserved category circular curve segment;S5. round fitting is carried out to class circular curve segment, obtains rough Circle Parameters, efficiency curve section is filtered out in class circular curve segment;S6. segmentation loop truss is carried out to efficiency curve section, obtains accurate Circle Parameters.It is also advantageous in processing speed it is an advantage of the current invention that parameter error smaller more accurate to round detection, more efficient to the removal of non-circular curve, round.
Description
Technical field
The present invention relates to image procossings and field of machine vision, more particularly, to a kind of based on PCA's and segmentation RHT
PCB image circle detection method.
Background technology
Currently, the common method of printed circuit board (PCB) defects detection is the method that refers to, by plate to be matched and reference template figure
As registration, the wherein detection of round hole and positioning is mostly important.With technology, it is more single that some are only suitable for content for existing invention
Printed circuit board (PCB) image, some cannot be guaranteed preferable accuracy, some processing can introduce many noises, robust
Property is poor.
Invention content
The present invention is the defect overcome described in the above-mentioned prior art, provides a kind of PCB image based on PCA and segmentation RHT
Circle detection method.
In order to solve the above technical problems, technical scheme is as follows:
A kind of PCB image circle detection method based on PCA and segmentation RHT, includes the following steps:
S1. it is loaded into original color pcb board image;
S2. binarization of gray value is carried out to image, image border is extracted using edge detection algorithm, it is more to remove number of crossings
Point;
S3. the line segment in binarization of gray value image is marked, finds out the line segment that length is more than set threshold value t;
S4. principal component analysis (Principal Component Analysis, PCA) is carried out to every line segment, obtains spy
Value indicative, reserved category circular curve segment;
S5. round fitting is carried out to class circular curve segment, obtains rough Circle Parameters, efficiency curve is filtered out in class circular curve segment
Section;
S6. segmentation loop truss is carried out to efficiency curve section, obtains accurate Circle Parameters.
Above-mentioned operation principle is:Binarization of gray value is carried out to image first, image side is extracted by edge detection algorithm
Point more than edge and number of crossings of going out;Line segment in image is marked, by principal component analysis, filters out class circular curve
Section;Round fitting is carried out to class circular curve segment, obtains rough Circle Parameters, and filter out efficiency curve section;Finally using the side of segmentation
Formula carries out loop truss to efficiency curve section, obtains accurate Circle Parameters.
Preferably, the PCA Orientations of the step S4 are as follows:
For every line segment, if pixel is N, any point coordinates (xi,yi), according to following formula:
Obtain S11,S12,S21And S22, for constituting following covariance matrix:
Obtain the characteristic root λ of S1And λ2;
Judge whether line segment is to meet 1≤λ of condition1/λ2Otherwise the class circular curve segment of≤t just removes if it is, retaining
It goes.
Preferably, the detailed process of circle fitting is as follows in the step S5:
Using the Least Square Circle fitting process of belt restraining, approximation obtains the round center of circle and radius, is used for screening curve section.
Preferably, in the step S6 be segmented loop truss using randomized hough transform (Random Hough Transform,
RHT), detailed process is as follows:
If D is the image border point set remained, efficiency curve section is marked, is carried out successively according to flag sequence
Randomized hough transform:
3 points are randomly selected from curved section point concentration, a candidate Circle Parameters is determined, passes through accumulation of evidence calculated curve section
Points of the point set decline on candidate's circle then confirm that candidate circle is true circle if more than minimal point necessary to circle, from
The point on the circle is deleted in D, then proceeds by the detection of next circle, is finished until all curved sections all detect.
Preferably, the step S6 deletes corresponding pixel, Zhi Daosuo after obtaining accurate Circle Parameters in image space
Some curved section detections finish.
Preferably, the threshold value t is 1.5.
Preferably, the edge detection algorithm is canny operators.
Compared with prior art, the advantageous effect of technical solution of the present invention is:
The present invention carries out segmentation loop truss, to round on the basis of using principal component analysis using randomized hough transform
More accurate, more efficient to the removal of non-circular curve, the round parameter error smaller of detection, it is also advantageous in processing speed.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Obtain other attached drawings according to these attached drawings.
Fig. 1 is the PCB image circle detection method schematic diagram based on PCA and segmentation RHT.
Specific implementation mode
The attached figures are only used for illustrative purposes and cannot be understood as limitating the patent;
To those skilled in the art, it is to be appreciated that certain known features and its explanation, which may be omitted, in attached drawing
's.
The following further describes the technical solution of the present invention with reference to the accompanying drawings and examples.
A kind of PCB image circle detection method based on PCA and segmentation RHT, as shown in Figure 1, including the following steps:
S1. it is loaded into original color pcb board image;
S2. binarization of gray value is carried out to image, image border is extracted using edge detection algorithm, it is more to remove number of crossings
Point;
S3. the line segment in binarization of gray value image is marked, finds out the line segment that length is more than set threshold value t;
S4. PCA Orientations are carried out to every line segment, obtains characteristic value, reserved category circular curve segment;
S5. round fitting is carried out to class circular curve segment, obtains rough Circle Parameters, efficiency curve is filtered out in class circular curve segment
Section;
S6. segmentation loop truss is carried out to efficiency curve section, obtains accurate Circle Parameters.
In the present embodiment, the PCA Orientations of step S4 are as follows:
For every line segment, if pixel is N, any point coordinates (xi,yi), according to following formula:
Obtain S11,S12,S21And S22, for constituting following covariance matrix:
Obtain the characteristic root λ of S1And λ2;
Judge whether line segment is to meet 1≤λ of condition1/λ2Otherwise the class circular curve segment of≤t just removes if it is, retaining
It goes.
In the present embodiment, the detailed process of circle fitting is as follows in step S5:
Using the Least Square Circle fitting process of belt restraining, approximation obtains the round center of circle and radius, is used for screening curve section.
In the present embodiment, loop truss is segmented in step S6 uses randomized hough transform, detailed process as follows:
If D is the image border point set remained, efficiency curve section is marked, is carried out successively according to flag sequence
Randomized hough transform:
3 points are randomly selected from curved section point concentration, a candidate Circle Parameters is determined, passes through accumulation of evidence calculated curve section
Points of the point set decline on candidate's circle then confirm that candidate circle is true circle if more than minimal point necessary to circle, from
The point on the circle is deleted in D, then proceeds by the detection of next circle, is finished until all curved sections all detect.
In the present embodiment, step S6 deletes corresponding pixel after obtaining accurate Circle Parameters in image space, until
All curved section detections finish.
In the present embodiment, threshold value t is 1.5.
In the present embodiment, edge detection algorithm is canny operators.
Obviously, the above embodiment of the present invention be only to clearly illustrate example of the present invention, and not be pair
The restriction of embodiments of the present invention.For those of ordinary skill in the art, may be used also on the basis of the above description
To make other variations or changes in different ways.There is no necessity and possibility to exhaust all the enbodiments.It is all this
All any modification, equivalent and improvement etc., should be included in the claims in the present invention made by within the spirit and principle of invention
Protection domain within.
Claims (7)
1. a kind of PCB image circle detection method based on PCA and segmentation RHT, which is characterized in that include the following steps:
S1. it is loaded into original color pcb board image;
S2. binarization of gray value is carried out to image, image border is extracted using edge detection algorithm, it is more to remove number of crossings
Point;
S3. the line segment in binarization of gray value image is marked, finds out the line segment that length is more than set threshold value t;
S4. PCA Orientations are carried out to every line segment, obtains characteristic value, reserved category circular curve segment;
S5. round fitting is carried out to class circular curve segment, obtains rough Circle Parameters, efficiency curve section is filtered out in class circular curve segment;
S6. segmentation loop truss is carried out to efficiency curve section, obtains accurate Circle Parameters.
2. the PCB image circle detection method according to claim 1 based on PCA and segmentation RHT, which is characterized in that described
The PCA Orientations of step S4 are as follows:
For every line segment, if pixel is N, any point coordinates (xi,yi), according to following formula:
Obtain S11,S12,S21And S22, for constituting following covariance matrix:
Obtain the characteristic root λ of S1And λ2;
Judge whether line segment is to meet 1≤λ of condition1/λ2Otherwise the class circular curve segment of≤t just removes if it is, retaining.
3. the PCB image circle detection method according to claim 1 based on PCA and segmentation RHT, which is characterized in that described
The detailed process of circle fitting is as follows in step S5:
Using the Least Square Circle fitting process of belt restraining, approximation obtains the round center of circle and radius, is used for screening curve section.
4. the PCB image circle detection method according to claim 1 based on PCA and segmentation RHT, which is characterized in that described
Loop truss is segmented in step S6 uses randomized hough transform, detailed process as follows:
If D is the image border point set remained, efficiency curve section is marked, is carried out successively according to flag sequence random
Hough transformation:
3 points are randomly selected from curved section point concentration, a candidate Circle Parameters is determined, passes through accumulation of evidence calculated curve section point set
Decline the points on candidate's circle, if more than minimal point necessary to circle, then confirms candidate circle for true circle, from D
The point on the circle is deleted, the detection of next circle is then proceeded by, is finished until all curved sections all detect.
5. the PCB image circle detection method according to claim 1 based on PCA and segmentation RHT, which is characterized in that described
Step S6 deletes corresponding pixel after obtaining accurate Circle Parameters, in image space, until all curved section detections finish.
6. the PCB image circle detection method according to claim 1 based on PCA and segmentation RHT, which is characterized in that described
Threshold value t is 1.5.
7. the PCB image circle detection method according to claim 1 based on PCA and segmentation RHT, which is characterized in that described
Edge detection algorithm is canny operators.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810205002.2A CN108510513A (en) | 2018-03-13 | 2018-03-13 | A kind of PCB image circle detection method based on PCA and segmentation RHT |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810205002.2A CN108510513A (en) | 2018-03-13 | 2018-03-13 | A kind of PCB image circle detection method based on PCA and segmentation RHT |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108510513A true CN108510513A (en) | 2018-09-07 |
Family
ID=63376561
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810205002.2A Pending CN108510513A (en) | 2018-03-13 | 2018-03-13 | A kind of PCB image circle detection method based on PCA and segmentation RHT |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108510513A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111402283A (en) * | 2020-02-25 | 2020-07-10 | 上海航天控制技术研究所 | Mars image edge feature self-adaptive extraction method based on gray variance derivative |
CN111861997A (en) * | 2020-06-24 | 2020-10-30 | 中山大学 | Method, system and device for detecting circular hole size of pattern board |
CN113640445A (en) * | 2021-08-11 | 2021-11-12 | 贵州中烟工业有限责任公司 | Characteristic peak identification method based on image processing, computing equipment and storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103886597A (en) * | 2014-03-24 | 2014-06-25 | 武汉力成伟业科技有限公司 | Circle detection method based on edge detection and fitted curve clustering |
-
2018
- 2018-03-13 CN CN201810205002.2A patent/CN108510513A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103886597A (en) * | 2014-03-24 | 2014-06-25 | 武汉力成伟业科技有限公司 | Circle detection method based on edge detection and fitted curve clustering |
Non-Patent Citations (1)
Title |
---|
刘政 等: "基于PCA和分段RHT的PCB板圆Mark点定位", 《重庆理工大学学报(自然科学)》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111402283A (en) * | 2020-02-25 | 2020-07-10 | 上海航天控制技术研究所 | Mars image edge feature self-adaptive extraction method based on gray variance derivative |
CN111402283B (en) * | 2020-02-25 | 2023-11-10 | 上海航天控制技术研究所 | Mars image edge characteristic self-adaptive extraction method based on gray variance derivative |
CN111861997A (en) * | 2020-06-24 | 2020-10-30 | 中山大学 | Method, system and device for detecting circular hole size of pattern board |
CN111861997B (en) * | 2020-06-24 | 2023-09-29 | 中山大学 | Method, system and device for detecting circular hole size of patterned plate |
CN113640445A (en) * | 2021-08-11 | 2021-11-12 | 贵州中烟工业有限责任公司 | Characteristic peak identification method based on image processing, computing equipment and storage medium |
CN113640445B (en) * | 2021-08-11 | 2024-06-11 | 贵州中烟工业有限责任公司 | Characteristic peak identification method based on image processing, computing device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107808378B (en) | Method for detecting potential defects of complex-structure casting based on vertical longitudinal and transverse line profile features | |
CN111382704B (en) | Vehicle line pressing violation judging method and device based on deep learning and storage medium | |
Farina et al. | Fingerprint minutiae extraction from skeletonized binary images | |
CN109447067B (en) | Bill direction detection and correction method and automatic bill checking system | |
CN105447489B (en) | A kind of character of picture OCR identifying system and background adhesion noise cancellation method | |
CN108510513A (en) | A kind of PCB image circle detection method based on PCA and segmentation RHT | |
CN101122952A (en) | Picture words detecting method | |
RU2745098C2 (en) | Method of determinig authorship of a painting | |
CN101114335A (en) | Full angle rapid fingerprint identification method | |
CN115131348B (en) | Method and system for detecting textile surface defects | |
CN106778754A (en) | A kind of industrial ammeter digit recognition method of robust | |
CN112598647A (en) | Method for detecting weak line defect under arc-shaped surface gradual change background | |
CN116168218A (en) | Circuit board fault diagnosis method based on image recognition technology | |
JP3635795B2 (en) | Method and apparatus for detecting fine line defects | |
CN109977910B (en) | Rapid bill positioning method and system based on color line segments | |
US20050271260A1 (en) | Device, method and program for removing pores | |
CN108898584B (en) | Image analysis-based full-automatic veneered capacitor welding polarity discrimination method | |
CN112465817B (en) | Pavement crack detection method based on directional filter | |
CN112215783B (en) | Image noise point identification method, device, storage medium and equipment | |
JP2005250786A (en) | Image recognition method | |
CN107909075A (en) | A kind of Binarization of License Plate Images based on Laplacian enlargement oprators | |
JP2005031901A (en) | Coin identifying device and method | |
CN108960222B (en) | Image binarization method, device, equipment and storage medium | |
Kim | License plate location method unaffected by variation in size and aspect ratio | |
CN111028258A (en) | Self-adaptive threshold value extraction method for large-scale gray level image |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20180907 |
|
WD01 | Invention patent application deemed withdrawn after publication |