CN104680509B - A kind of real-time circular printing image defect detection method - Google Patents

A kind of real-time circular printing image defect detection method Download PDF

Info

Publication number
CN104680509B
CN104680509B CN201310639612.0A CN201310639612A CN104680509B CN 104680509 B CN104680509 B CN 104680509B CN 201310639612 A CN201310639612 A CN 201310639612A CN 104680509 B CN104680509 B CN 104680509B
Authority
CN
China
Prior art keywords
circle
real
search
point
online
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
CN201310639612.0A
Other languages
Chinese (zh)
Other versions
CN104680509A (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.)
Shenyang Institute of Automation of CAS
Original Assignee
Shenyang Institute of Automation of CAS
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 Shenyang Institute of Automation of CAS filed Critical Shenyang Institute of Automation of CAS
Priority to CN201310639612.0A priority Critical patent/CN104680509B/en
Publication of CN104680509A publication Critical patent/CN104680509A/en
Application granted granted Critical
Publication of CN104680509B publication Critical patent/CN104680509B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • 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/30144Printing quality

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The present invention relates to technical field of image processing, specifically a kind of real-time circular printing image defect detection method, obtain the standard form figure and online figure in real time of target to be detected, step-size in search method is sexually revised by index and obtains the upper point coordinates of circle, method is justified according to three-point fix and calculates standard form figure and the online center of circle of figure border circular areas and radius in real time, border circular areas is divided into multiple annular regions, and count the grey level histogram feature of annular region, the annular region grey level histogram feature of standard of comparison Prototype drawing and online figure in real time, completes image deflects detection.The present invention improves the speed of circular printing image defect detection in terms of two, and a kind of feasible method is provided for the online defects detection based on machine vision.

Description

A kind of real-time circular printing image defect detection method
Technical field
The present invention relates to technical field of image processing, specifically a kind of real-time circular printing image defect detection side Method.
Background technology
With the development of industrial technology, pipelining is realized in the production of product substantially, circular printed matter such as bottle cap, Badge etc., speed of production is typically very fast, but is due to that the random error of equipment, part etc. may result in portioned product and lack Fall into.To improve the qualification rate and industrial automaticity of product, urgent need is a kind of to be examined with the printing defects of real-time implementation Survey method.The present invention judges real-time from the angle of images match according to the similarity of online figure in real time and standard form figure The product of shooting whether there is printing defects.
It generally there are and rotate at any angle between realtime graphic and template image on streamline, give traditional images matching The application of method brings certain difficulty.Existing circular printing image defect detection method be determine the center of circle, radius and After the anglec of rotation of real-time figure, real-time figure is transformed to Prototype drawing similarity-rough set is carried out under same direction.Wherein, the center of circle and Radius is calculated by putting the principle justified after determination according to three-point fix on circle, therefore the positioning put on circle is crucial.One As method by the graded of a row or column in bianry image, determine point on the circle in the row, column.This method requirement Full line or the Grad of permutation data are calculated, then compares the position coordinates for drawing and being put on circle, it is computationally intensive.The meter of the anglec of rotation Accuracy and speed is calculated, the rotation process of image seriously restricts the lifting of efficiency of algorithm.
For existing detection method the two above problem present invention propose a kind of method for rapidly positioning for justifying upper point and Image matching method based on annular region histogram feature.The method for rapidly positioning put on circle refers to according to the reference point in circle Number sexually revises step-size in search and finds the upper point of circle, greatly reduces the points for participating in calculating, improves locating speed.Annular region Nogata The rotational invariance of figure feature can avoid the lengthy and tedious calculating process of the anglec of rotation, the performance and speed of boosting algorithm.
The content of the invention
In view of the shortcomings of the prior art, the present invention proposes a kind of method for rapidly positioning for justifying upper point and based on annular region The image matching method of histogram feature.The method for rapidly positioning put on circle is according to the reference point in circle, and index sexually revises search Step-length finds the upper point of circle, greatly reduces the points for participating in calculating, improves locating speed.The rotation of annular region histogram feature Consistency can avoid the lengthy and tedious calculating process of the anglec of rotation, the performance and speed of boosting algorithm.
The technical scheme that is used to achieve the above object of the present invention is:
A kind of real-time circular printing image defect detection method, obtain target to be detected standard form figure and it is online in real time Figure;Step-size in search method is sexually revised by index and obtains the upper point coordinates of circle;According to three-point fix justify method calculate standard form figure and The online center of circle of figure border circular areas and radius in real time;Border circular areas is divided into multiple annular regions, and counts annular region Grey level histogram feature;The annular region grey level histogram feature of standard of comparison Prototype drawing and online figure in real time, completes image and lacks Fall into detection.
Index sexually revises step-size in search method and comprised the following steps:
Adaptive threshold binaryzation is carried out to standard form figure and online figure in real time;
Choose the interior arbitrfary point of circle as a reference point, determine 360 degree of directions of search;
The initial value of step-size in search is determined, index change is carried out, the upper point coordinates of circle is obtained.
The direction of search is preferably four, the upper and lower, left and right direction of search.
The index change procedure is:
When meeting index increase condition, the increase of step-size in search exponentially;
When being unsatisfactory for index increase condition, step-size in search exponentially reduces.
The index increases condition:
First, current point is in image range;
Secondly, the gray value of current point meets the condition of point in circle;
Finally, between current point and reference point in somewhat middle circle the shared ratio of point be more than credible threshold value.
The annular region and the border circular areas center of circle are concentric.
The invention has the advantages that and advantage:
1. during according to reference to being put on point search circle, the change of step-size in search exponentially greatly reduces amount of calculation, improved The locating speed put on circle;
2. annular region histogram feature proposed by the invention has rotational invariance, overcome using traditional images The shortcoming of the necessary anglec of rotation between calculation template figure and real-time figure of method of completing the square, simplifies detection process.
Brief description of the drawings
Fig. 1 is flow chart of the method for the present invention;
Fig. 2 is to put quick finder flow chart on the circle of the present invention;
Fig. 3 is the beer bottle cap Prototype drawing of the embodiment of the present invention;
Fig. 4 is the defective beer bottle cap master drawing of the embodiment of the present invention;
Fig. 5 is the beer bottle cap Prototype drawing binaryzation result figure of the embodiment of the present invention;
Fig. 6 is the border circular areas annular concentric segmentation result figure of the embodiment of the present invention;
Fig. 7 is that the part of the embodiment of the present invention schemes with Prototype drawing wherein a, b, c, e to be defective beer bottle cap in real time online Online figure in real time;D is beer bottle cap Prototype drawing;F, g, h are that zero defect beer bottle cap is schemed in real time online.
Embodiment
Below in conjunction with the accompanying drawings and embodiment the present invention is described in further detail.
In order to make the purpose , technical scheme and advantage of the present invention be clearer, below in conjunction with accompanying drawing, with beer bottle cap Exemplified by defects detection, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only used To explain the present invention, it is not intended to limit the present invention.
Fig. 1 shows the implementation process figure of circular printing image defect detection method provided in an embodiment of the present invention.
Detection method provided in an embodiment of the present invention is comprised the following steps that:
1. obtain standard circular printing stencil image(Hereinafter referred to as Prototype drawing)With online circular printing realtime graphic(Below Referred to as scheme in real time);
Wherein beer bottle cap template image as shown in figure 3, defective real-time figure as shown in figure 4, respectively with tempI and TestI represents that image size is size=m*n, wherein m=240, n=320.
2. to Prototype drawing and in real time, figure carries out adaptive threshold binaryzation, segmentation circular image regions and background respectively;
In actual operating process, the condition that real-time figure is obtained online is usually can be with human intervention, specific method It is:When circle printing image gray scale itself is brighter, background can be set to dark background, otherwise background is set to bright background. Gray scale is brighter at the top of beer bottle cap in this example, and side is dark, forms being automatically separated for circular target region and background.
Adaptive threshold is calculated by statistic histogram, and its criterion is:Gray scale in histogrammic two class being divided to through threshold value Average is equal.Then binary conversion treatment is carried out to image using this threshold value, border circular areas is 1, and background area is 0;The two of this example Value result with tempIBinary as shown in figure 5, represented.
Scanned for 3. arbitrfary point is as a reference point in rough determination circle, step-size in search is sexually revised by index, circle is realized The quick positioning of upper point, so as to realize the real-time determination of the center of circle and radius;
Under normal circumstances, in order to cost-effective, improve border circular areas in the detection speed of algorithm, real-time figure and account for entire image More than 60 percent, so image center location be generally acknowledged that circle in.
The quick finder flow chart put on circle is as shown in Fig. 2 when to during search on the right side of reference point, step is as follows:
1) first, determine that image center [120,160], as circle internal reference examination point referP, is then put initialization with this and worked as The position oldcurrentP and newcurrentP of preceding point, initialization step-size in search step are 2(Also step-length can be for initialization search 3 or 1.5 grade other initial values, Normal practice is that initialization step-size in search is defined as into 2);
2) recover newcurrentP.x to oldcurrentP.x, update newcurrentP.x=newcurrentP.x+ step;
3) judge that newcurrentP.x whether in image, that is, judges 0<newcurrentP.x<Whether 320 set up, into It is vertical then go to next step, otherwise go to 7);
4) newcurrentP is judged whether in circle, i.e., whether binaryzation result herein is 1, is to go to next step, no Then go to 7);
5) in the data in statistics binary image on referP.y rows, abscissa is in newcurrentP.x and reference point Between referP.x number numall a little, and be wherein 1 points num1, judge num1/numall>Whether thresh Set up, establishment then goes to next step, otherwise goes to 7);
6) oldcurrentP.x=newcurrentP.x is updated, while step exponentiallies increase, step=step*2;Then Go to 2);
7) index reduces step, makes step=step/2;Go to next step;
8) judge whether step decreases below 1 number, if step>=1, then go to 2), otherwise, terminate.
The radius of border circular areas is 90 or so in this example, when being put as stated above on search circle, at most only needs to 15 times repeatedly In generation, can complete the search of a point;If with commonsense method, full line search then at least needs the calculating of 320 times with being compared.
When being searched for the left side of reference point, principle is identical, is simply updated newcurrentP.x and oldcurrentP.x When original plus step position be changed to subtraction operation.
K round internal reference examination point is selected, left and right directions search can obtain the upper point of 2*k circle.
The center of circle and radius can determine that a round formula is calculated by three point coordinates.
Because the circular edge in binaryzation result is not definitely smooth, so we take the average of multiple result of calculation to make For the center of circle and the final result of radius.In this example, put on circle and take 10 altogether, be equally divided into two groups, every optional 3 points of calculating of 5 points The center of circle and radius, finally regard the average value of 20 groups of results as the center of circle and the final result of radius.
4. according to the fixed center of circle and radius, circular image is divided into multiple not overlapping concentric annular regions, and unite Count grey level histogram;
Border circular areas is divided into 6 circles, annular regions, schematic diagram in this example as shown in fig. 6, wherein each circle, annular Inner and outer boundary radius of circle is as shown in the table:
Circle, number of rings Inner circle radius Exradius
Center circle 0 10
Second annulus 11 20
3rd annulus 21 30
4th annulus 31 50
5th annulus 51 60
6th annulus 61 80
Table 1 is each circle, the inner and outer boundary radius of circle of annular(Unit, pixel)
The points for participating in statistics with histogram with corresponding region normalize the histogram statistical features of regional respectively.
Assuming that Prototype drawing and real-time figure subregion normalization histogram statistical result respectively with tempHistgram and TestHistgram represents, tempHistgram [i,:], i=1,2 ..., 6 represent the statistic histogram spy of Prototype drawing ring Levy;In the same manner testHistgram [i,:], i=1,2 ..., 6 represent the statistic histogram feature of real-time figure ring.
5. distinguish the similarity of calculation template figure annular region histogram feature corresponding with scheming each in real time;
The calculating formula of similarity of Prototype drawing and real-time the i-th ring of figure histogram feature is as follows:
6. judge that real-time print figure whether there is defect by similarity.
Similarity is compared with threshold vector, if meeting condition, then it is assumed that defect is not present in figure in real time, otherwise Judge real-time figure as defect image.Judgment condition in this example is as follows:
Following table is the matching result of each subgraph and Fig. 3 in Fig. 7, and image is listed in fig. 7 with reference numeral.
Table 2 is the matching result of each subgraph of Fig. 7 and Prototype drawing
7. program is run under the operating system of 32-bit Windows 7, MicrosoftVisualC++6.0 platforms, detection time For 3-5ms, requirement of real-time is not only met, is also laid the first stone further to increase productivity.

Claims (5)

1. a kind of real-time circular printing image defect detection method, it is characterised in that
Obtain the standard form figure and online figure in real time of target to be detected;
Step-size in search method is sexually revised by index and obtains the upper point coordinates of circle;
Method is justified according to three-point fix and calculates standard form figure and the online center of circle of figure border circular areas and radius in real time;
Border circular areas is divided into multiple annular regions, and counts the grey level histogram feature of annular region;
The annular region grey level histogram feature of standard of comparison Prototype drawing and online figure in real time, completes image deflects detection;
Index sexually revises step-size in search method and comprised the following steps:
Adaptive threshold binaryzation is carried out to standard form figure and online figure in real time;
Choose the interior arbitrfary point of circle as a reference point, determine 360 degree of directions of search;
The initial value of step-size in search is determined, index change is carried out, the upper point coordinates of circle is obtained.
2. a kind of real-time circular printing image defect detection method according to claim 1, it is characterised in that:The search Direction is four, the upper and lower, left and right direction of search.
3. a kind of real-time circular printing image defect detection method according to claim 1, it is characterised in that:The index Property change procedure is:
When meeting index increase condition, the increase of step-size in search exponentially;
When being unsatisfactory for index increase condition, step-size in search exponentially reduces.
4. a kind of real-time circular printing image defect detection method according to claim 3, it is characterised in that:The index Increase condition is:
First, current point is in image range;
Secondly, the gray value of current point meets the condition of point in circle;
Finally, between current point and reference point in somewhat middle circle the shared ratio of point be more than credible threshold value.
5. a kind of real-time circular printing image defect detection method according to claim 1, it is characterised in that:The annular Region and the border circular areas center of circle are concentric.
CN201310639612.0A 2013-11-30 2013-11-30 A kind of real-time circular printing image defect detection method Active CN104680509B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310639612.0A CN104680509B (en) 2013-11-30 2013-11-30 A kind of real-time circular printing image defect detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310639612.0A CN104680509B (en) 2013-11-30 2013-11-30 A kind of real-time circular printing image defect detection method

Publications (2)

Publication Number Publication Date
CN104680509A CN104680509A (en) 2015-06-03
CN104680509B true CN104680509B (en) 2017-09-15

Family

ID=53315506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310639612.0A Active CN104680509B (en) 2013-11-30 2013-11-30 A kind of real-time circular printing image defect detection method

Country Status (1)

Country Link
CN (1) CN104680509B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105303565A (en) * 2015-09-30 2016-02-03 广州超音速自动化科技股份有限公司 Product appearance LOGO detection method
CN105844621A (en) * 2016-03-17 2016-08-10 阜阳市飞扬印务有限公司 Method for detecting quality of printed matter
CN106056597B (en) * 2016-05-26 2019-07-09 广州视源电子科技股份有限公司 Object visible detection method and device
CN106204534B (en) * 2016-06-28 2019-02-26 西安理工大学 A kind of printed matter image characteristic region extraction method without handmarking
CN108022232B (en) * 2016-11-01 2021-06-01 中国科学院沈阳自动化研究所 Aircraft surface rivet detection method
CN107179324B (en) * 2017-05-17 2019-01-01 珠海格力电器股份有限公司 The methods, devices and systems of testing product packaging
CN110046630A (en) * 2018-01-16 2019-07-23 上海电缆研究所有限公司 Defect mode identification method/the systems/devices and readable storage medium storing program for executing of object
CN108898594A (en) * 2018-06-27 2018-11-27 湖北工业大学 A kind of detection method of homogeneous panel defect
CN114332092B (en) * 2022-03-16 2022-07-26 北京中科慧眼科技有限公司 Defect image detection method, system, intelligent terminal and medium
CN116337878A (en) * 2023-05-05 2023-06-27 南京专注智能科技股份有限公司 Filter rod end face detection system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101718528A (en) * 2009-12-10 2010-06-02 北京科技大学 Digital image based rapid solving method of circle parameters
CN101858734A (en) * 2010-05-19 2010-10-13 山东明佳包装检测科技有限公司 Method and device for detecting PET bottleneck quality
CN102636490A (en) * 2012-04-12 2012-08-15 江南大学 Method for detecting surface defects of dustproof cover of bearing based on machine vision
CN102974551A (en) * 2012-11-26 2013-03-20 华南理工大学 Machine vision-based method for detecting and sorting polycrystalline silicon solar energy

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001304842A (en) * 2000-04-25 2001-10-31 Hitachi Ltd Method and device of pattern inspection and treatment method of substrate

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101718528A (en) * 2009-12-10 2010-06-02 北京科技大学 Digital image based rapid solving method of circle parameters
CN101858734A (en) * 2010-05-19 2010-10-13 山东明佳包装检测科技有限公司 Method and device for detecting PET bottleneck quality
CN102636490A (en) * 2012-04-12 2012-08-15 江南大学 Method for detecting surface defects of dustproof cover of bearing based on machine vision
CN102974551A (en) * 2012-11-26 2013-03-20 华南理工大学 Machine vision-based method for detecting and sorting polycrystalline silicon solar energy

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于圆心定位的瓶口三圆周快速缺陷检测算法;张燕,刘春;《计算机技术与发展》;20090630;第19卷(第6期);第243-245页 *

Also Published As

Publication number Publication date
CN104680509A (en) 2015-06-03

Similar Documents

Publication Publication Date Title
CN104680509B (en) A kind of real-time circular printing image defect detection method
CN105067638B (en) Tire fetal membrane face character defect inspection method based on machine vision
CN108961235A (en) A kind of disordered insulator recognition methods based on YOLOv3 network and particle filter algorithm
CN101799434B (en) Printing image defect detection method
CN111640157B (en) Checkerboard corner detection method based on neural network and application thereof
CN103617625B (en) Image matching method and image matching device
CN104200210B (en) A kind of registration number character dividing method based on component
CN111598856B (en) Chip surface defect automatic detection method and system based on defect-oriented multipoint positioning neural network
CN109883654B (en) Checkerboard graph for OLED (organic light emitting diode) sub-pixel positioning, generation method and positioning method
CN106407981A (en) License plate recognition method, device and system
CN114998355B (en) Production defect identification method and device for sealing rubber ring
CN103439348B (en) Remote controller key defect detection method based on difference image method
CN109767445B (en) High-precision PCB defect intelligent detection method
CN107192716A (en) A kind of workpiece, defect quick determination method based on contour feature
CN104268538A (en) Online visual inspection method for dot matrix sprayed code characters of beverage cans
CN105046252A (en) Method for recognizing Renminbi (Chinese currency yuan) crown codes
CN111079518B (en) Ground-falling abnormal behavior identification method based on law enforcement and case handling area scene
CN113724231A (en) Industrial defect detection method based on semantic segmentation and target detection fusion model
CN116993744B (en) Weld defect detection method based on threshold segmentation
CN109712123A (en) A kind of spot detection method
CN115063620B (en) Bit layering based Roots blower bearing wear detection method
CN107480678A (en) A kind of chessboard recognition methods and identifying system
CN114926671A (en) NLED/QLED/OLED pixel defect positioning method and system based on template matching
CN104463896B (en) Image corner point detection method and system based on kernel similar region distribution characteristics
CN114359276B (en) Steel die blanking optimization scheme obtaining method based on pockmark defects

Legal Events

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