CN103593664B - A kind of preprocess method of QR code fault image - Google Patents

A kind of preprocess method of QR code fault image Download PDF

Info

Publication number
CN103593664B
CN103593664B CN201310634178.7A CN201310634178A CN103593664B CN 103593664 B CN103593664 B CN 103593664B CN 201310634178 A CN201310634178 A CN 201310634178A CN 103593664 B CN103593664 B CN 103593664B
Authority
CN
China
Prior art keywords
code
image
sample point
fault image
point
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
CN201310634178.7A
Other languages
Chinese (zh)
Other versions
CN103593664A (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.)
Chongqing University
Original Assignee
Chongqing 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 Chongqing University filed Critical Chongqing University
Priority to CN201310634178.7A priority Critical patent/CN103593664B/en
Publication of CN103593664A publication Critical patent/CN103593664A/en
Application granted granted Critical
Publication of CN103593664B publication Critical patent/CN103593664B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses the preprocess method of a kind of QR code fault image, belong to image processing field, using the sample point of QR code normal picture as the input value during neural network learning, using the sample point with QR code fault image as the output valve during neural network learning, carry out BP neural network learning matching distortion function;Utilizing bilinear interpolation to determine target QR code image after carrying out functional transformation, the present invention can well identify that those distortion are than the more serious or QR code of image section disappearance.Particularly it is printed on surface and easily produces the lowest QR code image at all not identified in other words of the QR code discrimination above the article of fold, use the present invention to identify more accurately.Owing to improve the discrimination of in particular cases QR code image, and the range of application of QR code can be largely promoted in the raising of discrimination, thus uses the present invention can the application of larger range of popularization QR code.

Description

A kind of preprocess method of QR code fault image
Technical field
The invention belongs to image processing field, particularly relate to the preprocess method of a kind of QR code fault image.
Background technology
QR code as a kind of outstanding Quick Response Code, under normal circumstances its density be bar code tens to hundreds of Times, it means that QR code can express more information in limited space, and so we are the most permissible Product information is all stored in a QR code.Want the information checking product to need not in advance and set up data Storehouse, is truly realized with the bar code description to " article ".In view of such advantage, it is envisaged that QR code The general trend that application in trade mark necessarily develops.To image in 2 D code generally in prior art Can well identify, but those distortion are particularly printed on table than more serious or image section disappearance Face is easily generated that the Quick Response Code discrimination above the article of fold is the lowest not to be identified in other words at all.
Summary of the invention
Because the drawbacks described above of prior art, the technical problem to be solved is to provide one can Improve the preprocess method of the QR code fault image of distortion Quick Response Code discrimination.
For achieving the above object, the invention provides the preprocess method of a kind of QR code fault image, by following Step is carried out:
Step one, choose the sample point of QR code normal picture, choose and described QR code at QR code fault image The sample point that normal picture position is corresponding;
Step 2, using the sample point of QR code normal picture as the input value during neural network learning, general With the sample point of QR code fault image as the output valve during neural network learning, carry out BP nerve net Network learns;
Step 3, the sample point chosen in pending QR code fault image obtain as through step 2 study The input value of neutral net, obtain one group of output valve, this group output valve carried out Function Fitting, determines The distortion mode of image, then by all of pixel in QR code fault image to be corrected, all passes through this letter Number carries out functional transformation;
Step 4, bilinear interpolation is utilized to determine the QR code distortion figure that target QR code image correspondence is to be corrected As the pixel value of sample point, obtain target QR code image.
Further, target QR code image step 4 obtained with the inverse process of perspective projection transformation is also included Carry out the step processed.
It is also preferred that the left described in step 3 after functional transformation, in QR code fault image, all of pixel point value is filled Become white;Then the pixel value of the former QR each sample point of code fault image is assigned to the QR code distortion after filling Image.
It is also preferred that the left choose the sample point of QR code normal picture described in step one, select at QR code fault image Take the sample point corresponding with described QR code normal picture position all to sequentially include the following steps:
A1, four summits found out in QR code image are as the first sample point;
A2, four sample points obtained with step A1 form the first tetragon for summit, take cornerwise intersection point It it is the second sample point;
A3, in the tetragon that step A2 obtains, take the midpoint of any two articles of adjacent edges respectively as the 3rd sample This point and the 4th sample point, the intersection point adding these two articles of limits and the second sample point composition the two or four taken out above Limit shape, taking its diagonal intersection point is the 5th sample point;
A4, return perform step A1.
Further, the sample point of QR code normal picture is chosen described in step one, at QR code fault image Choose the sample point corresponding with described QR code normal picture position further comprising the steps of:
QR code image does Hough transformation process, find out the boundary contour of image, by the intersection point of contour line Obtain four apex coordinates of image.
It is also preferred that the left described step 2 uses Minimum Mean Square Error BP neural network learning is carried out error analysis.
It is also preferred that the left described step 2 uses the most quick gradient descent method as of BP neural network learning Practise strategy.
It is also preferred that the left described bilinear interpolation sequentially includes the following steps:
B1, set the coordinate of QR code fault image sample point as (i j), obtains it by reflection method backward At the floating-point coordinate (i+u, j+v) that QR code fault image is corresponding, wherein i, j are nonnegative integer, u, v For the floating number that [0,1] is interval;
B2, the pixel value setting described floating-point coordinate (i+u, j+v) they are f (i+u, j+v), (i+1, j), (i, j+1), (i+1, j+1) they are the coordinate in QR code fault image, calculating f (i+u, j+v)=(1-u) × (1-v) × f (i, j)+(1-u) × v × f (i, j+1)+u × (1-v) × f (i+1, j)+u × v × f(i+1,j+1);Draw the pixel value of described floating-point coordinate (i+u, j+v);Described f (i, j) be coordinate (i, J) pixel value, described f (i, j+1) is the pixel value of coordinate (i, j+1), and (i+1 j) is coordinate to described f (described f (i+1, j+1) is the pixel value of coordinate (i+1, j+1) for i+1, pixel value j).
The invention has the beneficial effects as follows: the present invention can well identify that those distortion are than more serious or image The QR code of excalation.Particularly it is printed on surface and easily produces the QR code discrimination above the article of fold The lowest QR code image at all not identified in other words, uses the present invention to identify more accurately.Due to Improve the discrimination of in particular cases QR code image, and the raising of discrimination can largely be promoted The range of application of QR code, thus uses the present invention can the application of larger range of popularization QR code.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the embodiment of the present invention one.
Detailed description of the invention
The invention will be further described with embodiment below in conjunction with the accompanying drawings, and the example of described embodiment is at accompanying drawing Shown in, the most same or similar label represent same or similar element or have identical or The element of similar functions.The embodiment described below with reference to accompanying drawing is exemplary, is only used for explaining this Invention, and be not considered as limiting the invention.
Embodiment one, as it is shown in figure 1, the preprocess method of a kind of QR code fault image, is entered according to the following steps OK:
Step one, QR code image is done Hough transformation process, find out the boundary contour of image, pass through profile The intersection point of line obtains four apex coordinates of image.
Step 2, choose the sample point of QR code normal picture, choose and described QR code at QR code fault image The sample point that normal picture position is corresponding.
The sample point of the described QR of choosing code normal picture, choose at QR code fault image normal with described QR code The corresponding sample point in picture position all sequentially includes the following steps:
A1, four summits found out in QR code image are as the first sample point;
A2, four sample points obtained with step A1 form the first tetragon for summit, take cornerwise intersection point It it is the second sample point;
A3, in the tetragon that step A2 obtains, take the midpoint of any two articles of adjacent edges respectively as the 3rd sample This point and the 4th sample point, the intersection point adding these two articles of limits and the second sample point composition the two or four taken out above Limit shape, taking its diagonal intersection point is the 5th sample point;
A4, return perform step A1.
In the present embodiment, first QR code image is done Hough transformation and processes, find out the boundary contour of image, Obtained four apex coordinates A, B, C, D of image by the intersection point of contour line, seek the straight line of some A, C AC and the intersection point E of straight line BD crossing some B, D, then seek midpoint F and G of AB and AD respectively, obtain with A, Tetragon cornerwise intersecting point coordinate H of F, E, G 4 composition;Use such method that tetragon is continuous Reduce, in little tetragon, seek sample point by same method, finally obtain 25 points as study Sample point.
Step 3, using the sample point of QR code normal picture as the input value during neural network learning, general With the sample point of QR code fault image as the output valve during neural network learning, use Minimum Mean Square Error BP neural network learning is carried out error analysis, uses the most quick gradient descent method as BP neutral net The learning strategy of study, carries out BP neural network learning, to form a learning machine.
Step 4, pending QR code fault image is taken the sample point input value as neutral net, by step Rapid three learning machines obtained learn, and obtain one group of output valve, according to this group output valve to QR code distortion figure Shape carries out Function Fitting, after obtaining fitting function, all passes through all pixels in QR code fault image This functional transformation.
Step 5, bilinear interpolation is utilized to determine the QR code distortion figure that target QR code image correspondence is to be corrected The pixel value of the sample point of picture, obtains target QR code image.
Described bilinear interpolation sequentially includes the following steps:
B1, set the coordinate of QR code fault image sample point as (i j), obtains it by reflection method backward At the floating-point coordinate (i+u, j+v) that QR code fault image is corresponding, wherein i, j are nonnegative integer, u, v For the floating number that [0,1] is interval;
B2, the pixel value setting described floating-point coordinate (i+u, j+v) they are f (i+u, j+v), (i+1, j), (i, j+1), (i+1, j+1) they are the coordinate in QR code fault image, calculating f (i+u, j+v)=(1-u) × (1-v) × f (i, j)+(1-u) × v × f (i, j+1)+u × (1-v) × f (i+1, j)+u × v × f(i+1,j+1);Draw the pixel value of described floating-point coordinate (i+u, j+v);Described f (i, j) be coordinate (i, J) pixel value, described f (i, j+1) is the pixel value of coordinate (i, j+1), and (i+1 j) is coordinate to described f (described f (i+1, j+1) is the pixel value of coordinate (i+1, j+1) for i+1, pixel value j).
Step 6, the target QR code image obtained step 5 with the inverse process of perspective projection transformation process.
Can obtain a QR code image through process above, this image there may exist perspective phenomenon, So the inverse process of perspective projection transformation to be carried out processes.The image that perspective occurs is replaced with tetragon ABCD, S is camera position, owing to the position of S causes the QR code image shot to be with irregular four limits Shape ABCD.Tetragon A ' B ' C ' D ' is the tetragon ABCD projection at positive screen orientation, and it is a square.
During calculating, first find out the position on tetra-summits of tetragon ABCD, ask the process on these four summits to use Hough transformation conventional in image procossing, obtains 4 boundary lines of QR code, by the intersection point of straight line two-by-two Just can obtain A, B, C, D tetra-point coordinates, A ', B ', C ', the coordinate of D ' then can be given as required Go out suitably value.
If P is any point in ABCD, with homogeneous coordinates be expressed as (x, y, 1) ', then at projection as A ' B ' C ' D ' 1 P ' of middle existence anduniquess is corresponding with P, and its homogeneous coordinates are (xh,yh,h)′.Then projective transformation matrix T is full Foot P '=TP;
x h y h h = t 00 t 01 t 02 t 10 t 11 t 12 t 20 t 21 t 22 x y 1 ;
Here x h y h h Representing the coordinate of some P ', h is a scale factor, t 00 t 01 t 02 t 10 t 11 t 12 t 20 t 21 t 22 Represent matrix T, x y 1 Represent the coordinate of some P.
Above formula abbreviation, the common coordinate of invocation point P ' is:
x ′ = x h h = t 00 x + t 01 y + t 02 t 20 x + t 21 y + t 22 - - - ( 1 ) ;
y ′ = y h h = t 10 x + t 11 y + t 12 t 20 x + t 21 y + t 22 - - - ( 2 ) ;
Wherein t22For scale factor, the present embodiment is taken as 1.
As long as it can be seen that the unknown number obtained in (1) and (2), it is possible to determine projective transformation matrix T.
A ' in the projection of tetra-apex coordinates of A, B, C, D and correspondence, B ', C ', D ' coordinate are divided Do not bring (1) and (2) two formulas into, available 8 equations, thus can solve 8 unknown numbers in matrix, Thus obtain transformation matrix T.Point all of in tetragon ABCD is all become through projective transformation matrix T Change, it is possible to obtaining the tetragon ABCD projection A ' B ' C ' D ' at positive screen orientation, the image finally obtained is exactly The target QR code image recovered.
Embodiment two: the flow process of the present embodiment is essentially identical with embodiment one, except that: in step 4 After described functional transformation, in QR code fault image, all of pixel point value fills into white;Then by former QR code The pixel value of each sample point of fault image is assigned to the QR code fault image after filling.
In the description of this specification, reference term " embodiment ", " some embodiments ", " example ", The description of " concrete example " or " some examples " etc. means to combine the concrete spy of this embodiment or example description Levy, structure, material or feature are contained at least one embodiment or the example of the present invention.In this explanation In book, the schematic representation of above-mentioned term is not necessarily referring to identical embodiment or example.And, retouch Specific features, structure, material or the feature stated can be in any one or more embodiments or example Combine in an appropriate manner.
Although an embodiment of the present invention has been shown and described, it will be understood by those skilled in the art that: These embodiments can be carried out in the case of without departing from the principle of the present invention and objective multiple change, amendment, Replacing and modification, the scope of the present invention is limited by claim and equivalent thereof.

Claims (8)

1. the preprocess method of a QR code fault image, it is characterised in that sequentially include the following steps:
Step one, choose the sample point of QR code normal picture, choose and described QR code at QR code fault image The sample point that normal picture position is corresponding;
Step 2, using the sample point of QR code normal picture as the input value during neural network learning, general With the sample point of QR code fault image as the output valve during neural network learning, carry out BP nerve net Network learns;
Step 3, the sample point chosen in pending QR code fault image obtain as through step 2 study The input value of neutral net, obtain one group of output valve, this group output valve carried out Function Fitting, determines The distortion mode of image, then by all of pixel in QR code fault image to be corrected, all passes through this letter Number carries out functional transformation;
Step 4, bilinear interpolation is utilized to determine the QR code distortion figure that target QR code image correspondence is to be corrected As the pixel value of sample point, obtain target QR code image.
The preprocess method of a kind of QR code fault image the most as claimed in claim 1, is characterized in that: also The step processed including target QR code image step 4 obtained with the inverse process of perspective projection transformation.
The preprocess method of a kind of QR code fault image the most as claimed in claim 1 or 2, is characterized in that: Described in step 3 after functional transformation, in QR code fault image, all of pixel point value fills into white;Then The pixel value of the former QR each sample point of code fault image is assigned to the QR code fault image after filling.
The preprocess method of a kind of QR code fault image the most as claimed in claim 1, is characterized in that: step Choose the sample point of QR code normal picture described in rapid one, with described QR code just choose at QR code fault image The sample point that often picture position is corresponding all sequentially includes the following steps:
A1, four summits found out in QR code image are as the first sample point;
A2, four sample points obtained with step A1 form the first tetragon for summit, take cornerwise intersection point It it is the second sample point;
A3, in the tetragon that step A2 obtains, take the midpoint of any two articles of adjacent edges respectively as the 3rd sample This point and the 4th sample point, the intersection point adding these two articles of limits and the second sample point composition the two or four taken out above Limit shape, taking its diagonal intersection point is the 5th sample point;
A4, return perform step A1.
The preprocess method of a kind of QR code fault image the most as claimed in claim 4, is characterized in that: step Choose the sample point of QR code normal picture described in rapid one, with described QR code just choose at QR code fault image The sample point that often picture position is corresponding is further comprising the steps of:
QR code image does Hough transformation process, find out the boundary contour of image, by the intersection point of contour line Obtain four apex coordinates of image.
The preprocess method of a kind of QR code fault image the most as claimed in claim 1, is characterized in that: institute State and step 2 uses Minimum Mean Square Error BP neural network learning is carried out error analysis.
7. the preprocess method of a kind of QR code fault image as described in claim 1 or 4, is characterized in that: Described step 2 use the most quick gradient descent method as the learning strategy of BP neural network learning.
The preprocess method of a kind of QR code fault image the most as claimed in claim 1, is characterized in that: institute State bilinear interpolation to sequentially include the following steps:
B1, set the coordinate of QR code fault image sample point as (i j), obtains it by reflection method backward At the floating-point coordinate (i+u, j+v) that QR code fault image is corresponding, wherein i, j are nonnegative integer, u, v For the floating number that [0,1] is interval;
B2, the pixel value setting described floating-point coordinate (i+u, j+v) they are f (i+u, j+v), (i+1, j), (i, j+1), (i+1, j+1) they are the coordinate in QR code fault image, calculating f (i+u, j+v)=(1-u) × (1-v) × f (i, j)+(1-u) × v × f (i, j+1)+u × (1-v) × f (i+1, j)+u × v × f(i+1,j+1);Draw the pixel value of described floating-point coordinate (i+u, j+v);Described f (i, j) be coordinate (i, J) pixel value, described f (i, j+1) is the pixel value of coordinate (i, j+1), and (i+1 j) is coordinate to described f (described f (i+1, j+1) is the pixel value of coordinate (i+1, j+1) for i+1, pixel value j).
CN201310634178.7A 2013-11-29 2013-11-29 A kind of preprocess method of QR code fault image Expired - Fee Related CN103593664B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310634178.7A CN103593664B (en) 2013-11-29 2013-11-29 A kind of preprocess method of QR code fault image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310634178.7A CN103593664B (en) 2013-11-29 2013-11-29 A kind of preprocess method of QR code fault image

Publications (2)

Publication Number Publication Date
CN103593664A CN103593664A (en) 2014-02-19
CN103593664B true CN103593664B (en) 2016-08-17

Family

ID=50083796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310634178.7A Expired - Fee Related CN103593664B (en) 2013-11-29 2013-11-29 A kind of preprocess method of QR code fault image

Country Status (1)

Country Link
CN (1) CN103593664B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909869B (en) * 2017-02-27 2020-04-03 浙江华睿科技有限公司 Sampling grid division method and device for matrix type two-dimensional code
CN107133913B (en) * 2017-05-08 2020-12-01 重庆邮电大学 Automatic-straightening image splicing method
CN108416412B (en) * 2018-01-23 2021-04-06 浙江瀚镪自动化设备股份有限公司 Logistics composite code identification method based on multitask deep learning
CN109165538B (en) * 2018-07-18 2021-10-22 苏州飞搜科技有限公司 Bar code detection method and device based on deep neural network
CN111597846A (en) * 2019-02-20 2020-08-28 中科院微电子研究所昆山分所 Fold two-dimensional code recovery method, device and equipment and readable storage medium
CN112580379A (en) * 2019-09-29 2021-03-30 阿里巴巴集团控股有限公司 Data processing system and method, electronic device, and computer-readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504716A (en) * 2009-03-13 2009-08-12 重庆大学 QR two-dimension bar code recognition method and system based on field programmable gate array
CN102231187A (en) * 2011-07-12 2011-11-02 四川大学 Computer vision detection technology-based method for detecting and identifying QR (Quick Response) code

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201113815A (en) * 2009-10-09 2011-04-16 Primax Electronics Ltd QR code processing method and apparatus thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504716A (en) * 2009-03-13 2009-08-12 重庆大学 QR two-dimension bar code recognition method and system based on field programmable gate array
CN102231187A (en) * 2011-07-12 2011-11-02 四川大学 Computer vision detection technology-based method for detecting and identifying QR (Quick Response) code

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
散焦模糊的畸变QR barcode 图像复原技术;明安龙等;《计算机辅助设计与图形学学报》;20070831;1080-1084 *

Also Published As

Publication number Publication date
CN103593664A (en) 2014-02-19

Similar Documents

Publication Publication Date Title
CN103593664B (en) A kind of preprocess method of QR code fault image
CN105303615A (en) Combination method of two-dimensional stitching and three-dimensional surface reconstruction of image
CN103235947B (en) A kind of Handwritten Numeral Recognition Method and device
CN108171249A (en) A kind of local description learning method based on RGBD data
CN105976382A (en) TFT-LCD Mura defect detection algorithm based on defect area prognosis and level set
CN102831427A (en) Texture feature extraction method fused with visual significance and gray level co-occurrence matrix (GLCM)
CN106845314B (en) A kind of method for rapidly positioning of two dimensional code
CN110473216A (en) The detection method and device of object in a kind of image
CN103295019B (en) A kind of Chinese fragment self-adaptive recovery method based on probability-statistics
CN104750837A (en) Visualization method and system for growth type time series data
CN104396225B (en) To the device and method and the device and method of the embedded data of extraction of object embedding data
CN115049619A (en) Efficient flaw detection method for complex scene
CN102117266A (en) Method and device for processing character pitch
Bekos et al. Planar octilinear drawings with one bend per edge
CN106997473A (en) A kind of image-recognizing method based on neutral net
CN111161228A (en) Button surface defect detection method based on transfer learning
CN102567946B (en) Generation method of computer oil painting and system thereof
CN103558702B (en) The detection method of color membrane substrates and pick-up unit
CN107527319A (en) Image shrinking method and device
CN106845550A (en) A kind of image-recognizing method based on multi-template
CN104408437A (en) Road detecting method based on synthetic aperture radar
CN104394300B (en) A kind of video scaling method and its system
Dougherty et al. On 2-dimensional Dijkgraaf-Witten theory with defects
CN105989806A (en) Display panel and driving method thereof
JPH0285978A (en) Method for processing hidden-surface of solid

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for 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

Granted publication date: 20160817

Termination date: 20201129

CF01 Termination of patent right due to non-payment of annual fee