CN103593664A - Preprocessing method for distorted image of QR (Quick Response) code - Google Patents

Preprocessing method for distorted image of QR (Quick Response) code Download PDF

Info

Publication number
CN103593664A
CN103593664A CN201310634178.7A CN201310634178A CN103593664A CN 103593664 A CN103593664 A CN 103593664A CN 201310634178 A CN201310634178 A CN 201310634178A CN 103593664 A CN103593664 A CN 103593664A
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.)
Granted
Application number
CN201310634178.7A
Other languages
Chinese (zh)
Other versions
CN103593664B (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

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a preprocessing method for a distorted image of a QR code, belonging to the field of image processing. The method comprises that sample points of a normal image of the QR code are used as input values in the learning process of neural network, sample points of the distorted image of the QR code are used as output values in the learning process of the neural network, and the BP (Back Propagation) neural network is learned; a distortion function is fitted; and an image of the target QR code is determined via bilinear interpolation after function exchange. The QR code with severe distortion or image loss can be well identified via the method, and especially the QR code with low identification rate or the QR code incapable of being identified, which is printed in an article whose surface is easy to wrinkle, can be more accurately identified via the method. The identification rate of the QR code image is improved under the special condition, and an increase in the identification rate broadens the application range of the QR code to a large extent; and the thus, the method of the invention can popularize application of the QR code in a wider range.

Description

A kind of preprocess method of QR code fault image
Technical field
The invention belongs to image processing field, particularly relate to a kind of preprocess method of QR code fault image.
Background technology
QR code is as a kind of outstanding Quick Response Code, generally its density is that tens of bar code arrives hundred times, this means that QR code can express more information in limited space, we just can all store product information in a QR code like this.Want the information of checking product not need prior building database, really realized the description to " article " by bar code.In view of such advantage, can imagine, the application of QR code in trade mark must be the general trend of development.In prior art, to image in 2 D code generally, can well identify, but relatively serious or image section disappearance is particularly printed on that Quick Response Code discrimination above the article that surface easily produces fold is very low not to be identified in other words at all to those distortion.
Summary of the invention
Because the above-mentioned defect of prior art, technical matters to be solved by this invention is to provide a kind of preprocess method that can improve the QR code fault image of distortion Quick Response Code discrimination.
For achieving the above object, the invention provides a kind of preprocess method of QR code fault image, carry out according to the following steps:
Step 1, choose QR code normal picture sample point, at QR code fault image, choose the sample point corresponding with described QR code normal picture position;
Step 2, the input value using the sample point of QR code normal picture in neural network learning process, the output valve using the sample point with QR code fault image in neural network learning process, carry out BP neural network learning;
Step 3, choose sample point in pending QR code fault image as the input value of the neural network that study obtains through step 2, obtain one group of output valve, this group output valve is carried out to Function Fitting, determine the distortion mode of image, then by all pixels in QR code fault image to be corrected, all pass through this function and carry out functional transformation;
Step 4, utilize bilinear interpolation to determine the pixel value of the QR code fault image sample point that target QR code image correspondence is to be corrected, obtain target QR code image.
Further, also comprise the step that target QR code image that the inverse process with perspective projection transformation obtains step 4 is processed.
Preferably, described in step 3, after functional transformation, pixel point values all in QR code fault image are filled to white; Then by the pixel value assignment of former each sample point of QR code fault image, give the QR code fault image after filling.
Preferably, described in step 1, choose QR code normal picture sample point, at QR code fault image, choose the sample point corresponding with described QR code normal picture position and all carry out according to the following steps:
A1, find out four summits in QR code image as the first sample point;
Four sample points that A2, the steps A 1 of take obtain form the first quadrilateral as summit, getting cornerwise intersection point is the second sample point;
In A3, the quadrilateral that obtains in steps A 2, get the mid point of any two adjacent edges respectively as the 3rd sample point and the 4th sample point, add that the intersection point on these two limits and the second sample point taking out form the second quadrilateral above, getting its diagonal line intersection point is the 5th sample point;
A4, return execution step A1.
Further, described in step 1, choose QR code normal picture sample point, at QR code fault image, to choose the sample point corresponding with described QR code normal picture position further comprising the steps of:
QR code image is done to Hough transformation and process, find out the boundary contour of image, by the intersection point of outline line, obtain four apex coordinates of image.
Preferably, in described step 2, adopt Minimum Mean Square Error to carry out error analysis to BP neural network learning.
Preferably, in described step 2, adopt speed gradient descent method as the learning strategy of BP neural network learning.
Preferably, described bilinear interpolation carries out according to the following steps:
B1, the coordinate of setting QR code fault image sample point be (i, j), by reflection method backward, obtain it at floating-point coordinate (i+u, j+v) corresponding to QR code fault image, i wherein, and j is nonnegative integer, u, v is the floating number in [0,1] interval;
B2, the pixel value of setting described floating-point coordinate (i+u, j+v) are f (i+u, j+v), (i+1, j), (i, j+1), (i+1, j+1) are the coordinate in QR code fault image, calculate 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) is the pixel value of coordinate (i, j), described f (i, j+1) be the pixel value of coordinate (i, j+1), described f (i+1, j) is coordinate (i+1, j) pixel value, described f (i+1, j+1) is the pixel value of coordinate (i+1, j+1).
The invention has the beneficial effects as follows: the present invention can well identify the QR code that those distortion are relatively more serious or image section lacks.Particularly be printed on the very low QR code image of at all identify in other words of QR code discrimination above the article that surface easily produces fold, employing the present invention can identify more accurately.Owing to having improved the in particular cases discrimination of QR code image, and the raising of discrimination can be promoted the range of application of QR code to a great extent, adopts thus the application of the popularization QR code that the present invention can be wider.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the embodiment of the present invention one.
Embodiment
Below in conjunction with drawings and Examples, the invention will be further described, and the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has the element of identical or similar functions from start to finish.Below by the embodiment being described with reference to the drawings, be exemplary, only for explaining the present invention, and can not be interpreted as limitation of the present invention.
Embodiment mono-, as shown in Figure 1, a kind of preprocess method of QR code fault image, carries out according to the following steps:
Step 1, QR code image is done to Hough transformation process, find out the boundary contour of image, by the intersection point of outline line, obtain four apex coordinates of image.
Step 2, choose QR code normal picture sample point, at QR code fault image, choose the sample point corresponding with described QR code normal picture position.
The sample point of the described QR of choosing code normal picture, at QR code fault image, choose the sample point corresponding with described QR code normal picture position and all carry out according to the following steps:
A1, find out four summits in QR code image as the first sample point;
Four sample points that A2, the steps A 1 of take obtain form the first quadrilateral as summit, getting cornerwise intersection point is the second sample point;
In A3, the quadrilateral that obtains in steps A 2, get the mid point of any two adjacent edges respectively as the 3rd sample point and the 4th sample point, add that the intersection point on these two limits and the second sample point taking out form the second quadrilateral above, getting its diagonal line intersection point is the 5th sample point;
A4, return execution step A1.
In the present embodiment, first QR code image being done to Hough transformation processes, find out the boundary contour of image, by the intersection point of outline line, obtain four apex coordinate A, B, C, the D of image, asked the straight line AC and the intersection point E that crosses the straight line BD of some B, D of some A, C, ask respectively again mid point F and the G of AB and AD, obtain the cornerwise intersecting point coordinate H of quadrilateral with A, F, E, 4 compositions of G; Adopt such method that quadrilateral is constantly dwindled, in little quadrilateral, use the same method and ask sample point, finally obtain 25 points as the sample point of study.
Step 3, the input value using the sample point of QR code normal picture in neural network learning process, the output valve using the sample point with QR code fault image in neural network learning process, adopt Minimum Mean Square Error to carry out error analysis to BP neural network learning, adopt speed gradient descent method as the learning strategy of BP neural network learning, carry out BP neural network learning, to form a learning machine.
Step 4, pending QR code fault image is got to sample point as the input value of neural network, the learning machine obtaining by step 3 is learnt, obtain one group of output valve, according to this group output valve, QR code distortion figure is carried out to Function Fitting, after obtaining fitting function, all pixels in QR code fault image are all passed through to this functional transformation.
Step 5, utilize bilinear interpolation to determine the pixel value of the sample point of the QR code fault image that target QR code image correspondence is to be corrected, obtain target QR code image.
Described bilinear interpolation carries out according to the following steps:
B1, the coordinate of setting QR code fault image sample point be (i, j), by reflection method backward, obtain it at floating-point coordinate (i+u, j+v) corresponding to QR code fault image, i wherein, and j is nonnegative integer, u, v is the floating number in [0,1] interval;
B2, the pixel value of setting described floating-point coordinate (i+u, j+v) are f (i+u, j+v), (i+1, j), (i, j+1), (i+1, j+1) are the coordinate in QR code fault image, calculate 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) is the pixel value of coordinate (i, j), described f (i, j+1) be the pixel value of coordinate (i, j+1), described f (i+1, j) is coordinate (i+1, j) pixel value, described f (i+1, j+1) is the pixel value of coordinate (i+1, j+1).
Step 6, with the target QR code image that the inverse process of perspective projection transformation obtains step 5, process.
Through processing above, can obtain a QR code image, likely there is perspective phenomenon in this image, so will carry out the inverse process of perspective projection transformation, processes.The image that replaces occurring perspective with quadrilateral ABCD, S is camera position, due to the position of S, causing the QR code image of shooting is with an irregular quadrilateral ABCD.Quadrilateral A ' B ' C ' D ' is quadrilateral ABCD in the projection of positive screen orientation, and it is a square.
In computation process, first find out the position on tetra-summits of quadrilateral ABCD, ask the process on these four summits to use conventional Hough transformation in image processing, obtain 4 boundary lines of QR code, by the intersection point of straight line between two, just can obtain A, B, C, D tetra-point coordinate, the coordinate of A ', B ', C ', D ' can provide suitable value as required.
If P is any point in ABCD, with homogeneous coordinates be expressed as (x, y, 1) ', in projected image A ' B ' C ' D ', exist 1 unique P ' corresponding with P, its homogeneous coordinates are (x h, y h, h) '.Projective transformation matrix T, meets 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 The coordinate of representative point 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 The coordinate of representative point 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 ) ;
T wherein 22for scale factor, in the present embodiment, be taken as 1.
Can find out, as long as obtain the unknown number in (1) and (2), just can determine projective transformation matrix T.
Bring respectively A ', B ', C ', D ' coordinate in the perspective view of A, B, C, tetra-apex coordinates of D and correspondence into (1) and (2) two formulas, can obtain 8 equations, can solve thus 8 unknown numbers in matrix, thereby obtain transformation matrix T.Points all in quadrilateral ABCD is all passed through to projective transformation matrix T and convert, just can obtain quadrilateral ABCD at projection A ' B ' C ' D ' of positive screen orientation, the image finally obtaining is exactly the target QR code image recovering.
Embodiment bis-: the flow process of the present embodiment and embodiment mono-are basic identical, and difference is: described in step 4, after functional transformation, pixel point values all in QR code fault image are filled to white; Then by the pixel value assignment of former each sample point of QR code fault image, give the QR code fault image after filling.
In the description of this instructions, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or example in conjunction with specific features, structure, material or the feature of this embodiment or example description.In this manual, the schematic statement of above-mentioned term is not necessarily referred to identical embodiment or example.And the specific features of description, structure, material or feature can be with suitable mode combinations in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, those having ordinary skill in the art will appreciate that: in the situation that not departing from principle of the present invention and aim, can carry out multiple variation, modification, replacement and modification to these embodiment, scope of the present invention is limited by claim and equivalent thereof.

Claims (8)

1. a preprocess method for QR code fault image, is characterized in that carrying out according to the following steps:
Step 1, choose QR code normal picture sample point, at QR code fault image, choose the sample point corresponding with described QR code normal picture position;
Step 2, the input value using the sample point of QR code normal picture in neural network learning process, the output valve using the sample point with QR code fault image in neural network learning process, carry out BP neural network learning;
Step 3, choose sample point in pending QR code fault image as the input value of the neural network that study obtains through step 2, obtain one group of output valve, this group output valve is carried out to Function Fitting, determine the distortion mode of image, then by all pixels in QR code fault image to be corrected, all pass through this function and carry out functional transformation;
Step 4, utilize bilinear interpolation to determine the pixel value of the QR code fault image sample point that target QR code image correspondence is to be corrected, obtain target QR code image.
2. the preprocess method of a kind of QR code fault image as claimed in claim 1, is characterized in that: also comprise the step that target QR code image that the inverse process with perspective projection transformation obtains step 4 is processed.
3. the preprocess method of a kind of QR code fault image as claimed in claim 1 or 2, is characterized in that: described in step 3, after functional transformation, pixel point values all in QR code fault image are filled to white; Then by the pixel value assignment of former each sample point of QR code fault image, give the QR code fault image after filling.
4. the preprocess method of a kind of QR code fault image as claimed in claim 1, is characterized in that: described in step 1, choose QR code normal picture sample point, at QR code fault image, choose the sample point corresponding with described QR code normal picture position and all carry out according to the following steps:
A1, find out four summits in QR code image as the first sample point;
Four sample points that A2, the steps A 1 of take obtain form the first quadrilateral as summit, getting cornerwise intersection point is the second sample point;
In A3, the quadrilateral that obtains in steps A 2, get the mid point of any two adjacent edges respectively as the 3rd sample point and the 4th sample point, add that the intersection point on these two limits and the second sample point taking out form the second quadrilateral above, getting its diagonal line intersection point is the 5th sample point;
A4, return execution step A1.
5. the preprocess method of a kind of QR code fault image as claimed in claim 4, is characterized in that: described in step 1, choose QR code normal picture sample point, at QR code fault image, to choose the sample point corresponding with described QR code normal picture position further comprising the steps of:
QR code image is done to Hough transformation and process, find out the boundary contour of image, by the intersection point of outline line, obtain four apex coordinates of image.
6. the preprocess method of a kind of QR code fault image as claimed in claim 1, is characterized in that: in described step 2, adopt Minimum Mean Square Error to carry out error analysis to BP neural network learning.
7. the preprocess method of a kind of QR code fault image as described in claim 1 or 4, is characterized in that: in described step 2, adopt speed gradient descent method as the learning strategy of BP neural network learning.
8. the preprocess method of a kind of QR code fault image as claimed in claim 1, is characterized in that: described bilinear interpolation carries out according to the following steps:
B1, the coordinate of setting QR code fault image sample point be (i, j), by reflection method backward, obtain it at floating-point coordinate (i+u, j+v) corresponding to QR code fault image, i wherein, and j is nonnegative integer, u, v is the floating number in [0,1] interval;
B2, the pixel value of setting described floating-point coordinate (i+u, j+v) are f (i+u, j+v), (i+1, j), (i, j+1), (i+1, j+1) are the coordinate in QR code fault image, calculate 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) is the pixel value of coordinate (i, j), described f (i, j+1) be the pixel value of coordinate (i, j+1), described f (i+1, j) is coordinate (i+1, j) pixel value, described f (i+1, j+1) is the pixel value of coordinate (i+1, j+1).
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 true CN103593664A (en) 2014-02-19
CN103593664B 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)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909869A (en) * 2017-02-27 2017-06-30 浙江华睿科技有限公司 A kind of sampling grid partitioning method and device of matrix two-dimensional code
CN107133913A (en) * 2017-05-08 2017-09-05 重庆邮电大学 A kind of image split-joint method of automatic flattening
CN108416412A (en) * 2018-01-23 2018-08-17 浙江瀚镪自动化设备股份有限公司 A kind of logistics compound key recognition methods based on multitask deep learning
CN109165538A (en) * 2018-07-18 2019-01-08 北京飞搜科技有限公司 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 (3)

* 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
US20110085732A1 (en) * 2009-10-09 2011-04-14 Ting-Yuan Cheng Qr code processing method and apparatus thereof
CN102231187A (en) * 2011-07-12 2011-11-02 四川大学 Computer vision detection technology-based method for detecting and identifying QR (Quick Response) code

Patent Citations (3)

* 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
US20110085732A1 (en) * 2009-10-09 2011-04-14 Ting-Yuan Cheng Qr code processing method and apparatus thereof
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 图像复原技术", 《计算机辅助设计与图形学学报》, 31 August 2007 (2007-08-31) *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909869A (en) * 2017-02-27 2017-06-30 浙江华睿科技有限公司 A kind of sampling grid partitioning method and device of matrix two-dimensional code
CN106909869B (en) * 2017-02-27 2020-04-03 浙江华睿科技有限公司 Sampling grid division method and device for matrix type two-dimensional code
CN107133913A (en) * 2017-05-08 2017-09-05 重庆邮电大学 A kind of image split-joint method of automatic flattening
CN107133913B (en) * 2017-05-08 2020-12-01 重庆邮电大学 Automatic-straightening image splicing method
CN108416412A (en) * 2018-01-23 2018-08-17 浙江瀚镪自动化设备股份有限公司 A kind of logistics compound key recognition methods based on multitask deep learning
CN109165538A (en) * 2018-07-18 2019-01-08 北京飞搜科技有限公司 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
CN112580379B (en) * 2019-09-29 2024-06-14 阿里巴巴集团控股有限公司 Data processing system and method, electronic device, and computer-readable storage medium

Also Published As

Publication number Publication date
CN103593664B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN103593664A (en) Preprocessing method for distorted image of QR (Quick Response) code
CN103942824B (en) Linear feature extracting method for three-dimensional point cloud
CN102175261A (en) Visual measuring system based on self-adapting targets and calibrating method thereof
CN202702247U (en) Rapid and accurate positioning system used for indoor mobile robot
CN102760285A (en) Image restoration method
CN106600647A (en) Binocular visual multi-line projection structured light calibration method
CN104850851A (en) ORB feature point matching method with scale invariance
CN104732539A (en) Projector calibration method
CN105096298A (en) Grid feature point extraction method based on fast line extraction
CN112697071B (en) Three-dimensional measurement method for color structured light projection based on DenseNet shadow compensation
CN104809724A (en) Automatic precise registration method for multiband remote sensing images
CN102930548A (en) Method for linearly solving camera inner parameter by using two identical intersected ellipses
CN104616247A (en) Method for aerial photography map splicing based on super-pixels and SIFT
CN105139355A (en) Method for enhancing depth images
CN103854271B (en) A kind of planar pickup machine scaling method
CN110415304A (en) A kind of vision calibration method and system
CN103413319A (en) Industrial camera parameter on-site calibration method
CN103839081A (en) Across-viewing-angle gait recognition method based on topology expression
Feng et al. Semi-automatic 3d reconstruction of piecewise planar building models from single image
CN103017749B (en) Method, apparatus and navigator for converting narrow and long water system surface element into line element
CN100383810C (en) Distorted QR code image correction method
CN104133874B (en) Streetscape image generating method based on true color point cloud
Hubery Notes on the octahedral axiom
CN101840575B (en) Method for converting De Bruijn color structure light image into weighted and directed diagraph model and simplifying weighted and directed diagraph model
CN103955929B (en) Image local edge pattern and non-edge mode judging method and judgment means

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