CN103413291B - A kind of image position method - Google Patents

A kind of image position method Download PDF

Info

Publication number
CN103413291B
CN103413291B CN201310223376.4A CN201310223376A CN103413291B CN 103413291 B CN103413291 B CN 103413291B CN 201310223376 A CN201310223376 A CN 201310223376A CN 103413291 B CN103413291 B CN 103413291B
Authority
CN
China
Prior art keywords
image
product
template
template image
element region
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.)
Expired - Fee Related
Application number
CN201310223376.4A
Other languages
Chinese (zh)
Other versions
CN103413291A (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.)
Xihua University
Original Assignee
Xihua University
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 Xihua University filed Critical Xihua University
Priority to CN201310223376.4A priority Critical patent/CN103413291B/en
Publication of CN103413291A publication Critical patent/CN103413291A/en
Application granted granted Critical
Publication of CN103413291B publication Critical patent/CN103413291B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a kind of method of framing, described method comprises: the standard picture of acquisition is called template image, the testing image obtained is called product image, template image selects rectangle positioning area and element region, has a rectangular figures in selected positioning area at least; First processing template framing district image, obtain described rectangular figures contour code, described chain code following is judged, find adjacent level line and perpendicular line, two lines going cross each other and intersection point not on pattern edge and template image anchor point, and according to level, vertical turnover sequential definition turnover type codes; Before location, product image adopts positioning area and the element region of template image, equally, finds product framing point and turnover type codes with said method; The coordinate offset amount of calculation template framing point and product framing point, and complete each element region location of product image according to each element region coordinate of this offset correction product image.

Description

A kind of image position method
Technical field
The invention belongs to technical field of image processing, the method for specifically a kind of framing.
Background technology
Framing technology is the gordian technique during image detects always, be usually used in printing, in the product automation detection system of the industries such as printed board, standard form image generally mates with the collection image of actual product by current printing quality checking system, by comparing to determine whether product conforms to quality requirements, such as printed matter, the quality testing etc. in the fields such as circuit board, but the skew of the image that production line gathers and standard picture Existential Space position, do not eliminate this skew, product image just cannot detect with standard form images match, therefore precision height and fireballing image orientation and matching algorithm is needed, ensure the precision that image detects and speed.
Framing algorithm general is at present a lot, such as, adopt center relevant information, grey level histogram information, Hough transform to carry out positioning image, but these methods exist positioning precision is low, calculated amount is large shortcoming.
Summary of the invention
The object of the invention is, overcomes the defect of conventional images location technology, and provide a kind of automatically, precision is high, speed is fast, easy and simple to handle image position method.
The object of the invention to solve the technical problems realizes by the following technical solutions.According to a kind of image position method that the present invention proposes, it comprises:
The standard picture obtained is called template image, and the testing image of acquisition is called product image, and template image selects rectangle positioning area and element region, has a rectangular figures at least, as cross or square in selected positioning area;
Carry out image in template image positioning area processing the contour code obtaining described rectangular figures, described chain code following is judged, 8 neighborhood relationships of adjacent 2 in chain code are defined as the direction code of every bit on chain code, to adjacent in described chain code and direction code is horizontal or vertical series of points is linked to be perpendicular line or horizontal line, find adjacent level line and perpendicular line, adjacent level line and perpendicular line intersect and intersection point not on pattern edge is described template image anchor point (x1, y1), order is moved towards again with chain code, and according to level, the turnover sequential definition turnover type codes n1 of perpendicular line,
Before location, product image adopts positioning area and the element region of template image, finds product framing point (x2, y2) and the type codes n2 that transfers with template image same procedure;
The skew of product image opposite formwork image is Δ x=x2-x1, Δ y=y2-y1;
Before location, product image component district top left co-ordinate (ξ 1, η 1), lower right corner coordinate (ξ 2, η 2), element region top left co-ordinate (ξ 1+ Δ x after the calibration of location, η 1+ Δ y), lower right corner coordinate (ξ 2+ Δ x, η 2+ Δ y).
Described chain code following determination methods is innovation of the present invention, according to the contour code of the rectangular figures found, according to the direction code of every bit on the 8 neighborhood relationships definition chain codes of adjacent 2 in contour code; To adjacent in described chain code and direction code is horizontal or vertical series of points is linked to be perpendicular line or horizontal line, adjacent horizontal line and perpendicular line intersect and intersection point not on pattern edge may be just just anchor point, order is moved towards, according to level, vertical turnover sequential definition turnover type codes with chain code.
Accompanying drawing explanation
Fig. 1 is method flow diagram of the present invention;
Fig. 2 is one embodiment of the invention template image parts of images schematic diagram (before adding rectangle frame);
Fig. 3 is one embodiment of the invention template image parts of images schematic diagram (after adding rectangle frame);
Fig. 4 is one embodiment of the invention template image parts of images schematic diagram (after anchor point algorithm);
Fig. 5 is one embodiment of the invention product image section image schematic diagram (after adding template image rectangle frame);
Fig. 6 is one embodiment of the invention product image section image schematic diagram (anchor point algorithm is rear with calibration);
Fig. 7 is 8 neighborhood direction code figure in the present invention;
Fig. 8 is chain code of the present invention turnover sequential definition figure;
Fig. 9 is edge image and the intersection point of one embodiment of the invention template image positioning area;
1, the figure containing right angle in positioning area on template image; 2, the resistive element on template image; 3, the capacity cell on template image; 4, positioning area on template image; 5, a resistive element district on template image, its top left co-ordinate (ξ 1, η 1), lower right corner coordinate (ξ 2, η 2), this coordinate is the coordinate using the whole template image upper left corner as initial point; 6, the anchor point (x1, y1) template image found, this coordinate is the coordinate using the upper left corner, Template Location district 4 as initial point; 7, the anchor point (x2, y2) product image found, this coordinate is the coordinate using the upper left corner, Template Location district 4 as initial point equally; 8, a resistive element district of the rear product image of calibration, its top left co-ordinate (ξ 1+12, η 1+5), lower right corner coordinate (ξ 2+12, η 2+5), this coordinate is the coordinate using the whole template image upper left corner as initial point equally; A capacity cell district of product image after 9 calibrations; 10, a capacity cell district on template image;
Embodiment
As shown in Figure 1, image position method flow process of the present invention.
Enforcement order of the present invention is:
The first step: as shown in Figure 2, selects errorless microelectronic circuit image, does template image, can see the figure 1 and resistive element 2, capacity cell 3 that there are band right angle in Fig. 2.
Second step: as shown in Figure 3, adds the positioning area 4 of rectangle frame selection with rectangular figures 1, and with element 2 element region 5.
3rd step: the image of the positioning area 4 in template image as shown in Figure 9, utilizing conventional images treatment technology to find the contour code of rectangular figures 1 in positioning area 4, is B->A->F->E-Gre atT.GreaT.GTD->C->B.
4th step:
(1) according to the contour code found in the 3rd step, start with arbitrfary point the direction code finding every bit on chain code according to 8 neighborhood relationships of adjacent 2, direction code definition as shown in Figure 7; Be linked to be perpendicular line or horizontal line to adjacent in described chain code and that direction code is vertical (namely direction code is 1 or 5) or level (namely direction code is 3 or 7) series of points, as in Fig. 9, perpendicular line has: BA, FE, DC, and horizontal line has: AF, ED, CB.Find intersection point according to adjacent horizontal line and perpendicular line again, as BA and AF intersection point A, turnover type codes is 0, and the definition of turnover type codes as shown in Figure 8, in like manner finds intersection point F, E, D, C, B, and turnover type codes is respectively 1,2,3,5,3; Get rid of intersection point A, F, E, D, the B on pattern edge, remaining C point is template image anchor point 6, and coordinate is (109,77), and turnover type codes is 5, and this coordinate is the coordinate using the upper left corner, Template Location district 4 as initial point;
(2), before location, product image adopts the positioning area 4 identical with template image and element region 5;
(3) same, (1) the described method of employing finds product framing point 7, coordinate is (121,82), this coordinate is the coordinate using the upper left corner, Template Location district 4 as initial point equally, and turnover type codes is 5, because template image anchor point 6 and product framing point 7 are transferred, type codes is identical, so can judge that 6 and 7 as same point in kind, the skew of product image opposite formwork image is Δ x=121-109=12, Δ y=82-77=5;
(4) as shown in Figure 6, the top left co-ordinate of template image element region 5 is (ξ 1, η 1), lower right corner coordinate is (ξ 2, η 2), passes through translation, just top left co-ordinate (the ξ 1+12 locating element region 8 on the rear product image of calibration can be obtained, η 1+5), lower right corner coordinate (ξ 2+12, η 2+5);
(5) as having multiple element region in fruit product image, then adopt above-mentioned identical method, complete the location of product image, as another capacity cell 3, be element region 10 before its location, the element region after the calibration of location is 9.
The above, it is only a kind of embodiment of the present invention, not any pro forma restriction is done to the present invention, any those skilled in the art, do not departing within the scope of technical solution of the present invention, make a little change when the technology contents of above-mentioned announcement can be utilized or be modified to the Equivalent embodiments of equivalent variations, in every case be the content not departing from technical solution of the present invention, the any simple modification done above embodiment according to technical spirit of the present invention, equivalent variations and modification, all still belong in the scope of technical solution of the present invention.

Claims (1)

1. a method for framing, its feature comprises: the method comprises the following steps:
(1) standard picture obtained is called template image, and the testing image of acquisition is called product image, and template image selects rectangle positioning area and element region, has a rectangular figures in selected positioning area at least;
(2) carry out processing the contour code obtaining described rectangular figures to image in template image positioning area, described chain code following is judged, 8 neighborhood relationships of adjacent 2 in chain code are defined as the direction code of every bit on chain code, to adjacent in described chain code and direction code is horizontal or vertical series of points is linked to be perpendicular line or horizontal line, find adjacent level line and perpendicular line, adjacent level line and perpendicular line intersect and intersection point not on pattern edge is described template image anchor point (x1, y1), order is moved towards again with chain code, and according to level, the turnover sequential definition turnover type codes n1 of perpendicular line,
(3) before location, product image adopts positioning area and the element region of template image, finds product framing point (x2, y2) and the type codes n2 that transfers with template image same procedure;
(4) skew of product image opposite formwork image is Δ x=x2-x1, Δ y=y2-y1;
(5) before location, product image component district top left co-ordinate (ξ 1, η 1), lower right corner coordinate (ξ 2, η 2), element region top left co-ordinate (ξ 1+ Δ x after the calibration of location, η 1+ Δ y), lower right corner coordinate (ξ 2+ Δ x, η 2+ Δ y).
CN201310223376.4A 2013-06-07 2013-06-07 A kind of image position method Expired - Fee Related CN103413291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310223376.4A CN103413291B (en) 2013-06-07 2013-06-07 A kind of image position method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310223376.4A CN103413291B (en) 2013-06-07 2013-06-07 A kind of image position method

Publications (2)

Publication Number Publication Date
CN103413291A CN103413291A (en) 2013-11-27
CN103413291B true CN103413291B (en) 2016-04-20

Family

ID=49606296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310223376.4A Expired - Fee Related CN103413291B (en) 2013-06-07 2013-06-07 A kind of image position method

Country Status (1)

Country Link
CN (1) CN103413291B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105404900B (en) * 2015-12-22 2017-12-19 广州视源电子科技股份有限公司 A kind of localization method and device of diode side by side
CN108961212B (en) * 2018-05-29 2020-12-18 歌尔光学科技有限公司 Product positioning detection method and device and electronic equipment
CN108961347B (en) * 2018-06-26 2020-09-01 北京大学 Two-dimensional target boundary expression method based on regular triangle mesh chain codes
CN109840499B (en) * 2019-01-31 2021-03-02 闽江学院 Method for rapidly detecting printing and binding quality of printed matter
CN109901804B (en) * 2019-03-12 2022-06-14 天津大学 Method for automatically correcting page of manuscript before printing

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102637252A (en) * 2011-02-11 2012-08-15 汉王科技股份有限公司 Calling card positioning method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100855020B1 (en) * 2007-06-18 2008-08-28 성균관대학교산학협력단 Apparatus and method for generating chain code

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102637252A (en) * 2011-02-11 2012-08-15 汉王科技股份有限公司 Calling card positioning method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A Modified 2D Chain Code Algorithm for Object Segmentation and Contour Tracing;Walid Shahab et al.;《The International Arab Journal of Information Technology》;20090731;第6卷(第3期);第250-257页 *
基于直角矢量限定方法的模板自动配板技术;何林 等;《计算机应用研究》;20130331;第30卷(第3期);第803-805页,第828页 *

Also Published As

Publication number Publication date
CN103413291A (en) 2013-11-27

Similar Documents

Publication Publication Date Title
CN103413291B (en) A kind of image position method
EP3309704A1 (en) Two-dimensional code partitioning and decoding method and system
US9087253B2 (en) Method and system for determining edge line in QR code binary image
CN103729632B (en) A kind of localization method of Circular Mark point based on connected region filtering
CN104268857A (en) Rapid sub pixel edge detection and locating method based on machine vision
US9449210B2 (en) Method and system for detecting a correction pattern in a QR code
CN105117677A (en) QR code feature detection method and system
CN105894521A (en) Sub-pixel edge detection method based on Gaussian fitting
CN105096299A (en) Polygon detection method and device
CN103745221A (en) Two-dimensional code image correction method
US20120320433A1 (en) Image processing method, image processing device and scanner
WO2019001164A1 (en) Optical filter concentricity measurement method and terminal device
CN104966089A (en) Two-dimensional code image edge detection method and device
CN105354816B (en) A kind of electronic units fix method and device
CN106709952A (en) Automatic calibration method of display screen
Zhang et al. A new algorithm for accurate and automatic chessboard corner detection
CN102854195A (en) Method for detecting defect coordinates on color filter
CN104949621B (en) A kind of boundary alignment method of grating scale striped
CN111429437B (en) Image non-reference definition quality detection method for target detection
CN103630070A (en) Detection method for image detector and image detector
CN103854271A (en) Plane type camera calibration method
CN104881663A (en) Method and device for discriminating selected result of check box
CN110490887B (en) 3D vision-based method for quickly identifying and positioning edges of rectangular packages
CN103177416B (en) A kind of QR code image position method based on least square method
CN104951755B (en) A kind of Intelligent file image block detection method based on EMD

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160420

Termination date: 20170607