Movatterモバイル変換


[0]ホーム

URL:


CN106156684B - A kind of two-dimensional code identification method and device - Google Patents

A kind of two-dimensional code identification method and device
Download PDF

Info

Publication number
CN106156684B
CN106156684BCN201610514040.7ACN201610514040ACN106156684BCN 106156684 BCN106156684 BCN 106156684BCN 201610514040 ACN201610514040 ACN 201610514040ACN 106156684 BCN106156684 BCN 106156684B
Authority
CN
China
Prior art keywords
dimensional code
code
fitting
edge
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.)
Active
Application number
CN201610514040.7A
Other languages
Chinese (zh)
Other versions
CN106156684A (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.)
Nanjing University of Science and Technology
Original Assignee
Nanjing University of Science and Technology
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 Nanjing University of Science and TechnologyfiledCriticalNanjing University of Science and Technology
Priority to CN201610514040.7ApriorityCriticalpatent/CN106156684B/en
Publication of CN106156684ApublicationCriticalpatent/CN106156684A/en
Application grantedgrantedCritical
Publication of CN106156684BpublicationCriticalpatent/CN106156684B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明涉及一种二维码识别方法及装置,方法包括:通过两个摄像头从不同角度同时采集二维码图片;对采集的两张二维码图片进行预处理;对预处理后的二维码图片进行二维码分割处理,提取出二维码;根据两张二维码的边缘扭曲情况对二维码所处的贴面进行判定与计算,获得校正公式,使用校正公式对二维码进行图像校正,将其还原为标准形状的二维码;记录两张标准形状二维码编码区信息,根据其中一个编码区中黑像素点对另一个编码区进行补充处理,得到可识别二维码;提取可识别二维码中的二维码信息。本发明可以在二维码扭曲变形、光照不均情况下较好的还原出图像并提取出二维码信息,极大的提高了对二维码的读取能力。

The invention relates to a two-dimensional code identification method and device. The method includes: simultaneously collecting two-dimensional code pictures from different angles through two cameras; preprocessing the two collected two-dimensional code pictures; The two-dimensional code segmentation process is performed to extract the two-dimensional code; the veneer where the two-dimensional code is located is judged and calculated according to the edge distortion of the two two-dimensional codes, the correction formula is obtained, and the image correction of the two-dimensional code is performed using the correction formula. Restore it to a standard-shaped two-dimensional code; record the encoding area information of two standard-shaped two-dimensional codes, and supplement the other encoding area according to the black pixels in one encoding area to obtain a recognizable two-dimensional code; Identify the QR code information in the QR code. The invention can restore the image and extract the information of the two-dimensional code under the condition of distortion and uneven illumination of the two-dimensional code, which greatly improves the reading ability of the two-dimensional code.

Description

A kind of two-dimensional code identification method and device
Technical field
The present invention relates to two dimensional code identification technology, especially a kind of two-dimensional code identification method and device.
Background technique
Two dimensional code (dimensional barcode), also known as two-dimensional bar code, are expanded on the basis of bar codeIt is a kind of with readable bar code, be distributed on planar direction according to certain rules with certain specific geometric figure it is blackWhite alternate graphic recording data symbol information utilizes " 0 ", " 1 " for constituting computer-internal logical foundations in code compilationThe concept of bit stream indicates text numerical information using several geometrical bodies corresponding with binary system, defeated by imageEnter equipment or photoelectric scanning device automatically identifying and reading to realize automatic processing of information.
Common two dimensional code code system has Data Matrix, Maxi Code, Aztec, QR Code etc., wherein QR Code(Quick Response Code, quick response coding) square matrix code is presently the most popular code system, it has information capacityGreatly, high reliablity, can indicate Chinese character and image kinds of words information, the advantages that security and antiforge purpose is strong.QR code is square, black and whiteDichromatism, three corners are printed on the square pattern of " returning " word, wherein and the square pattern for being printed on " returning " word is the alignment code of QR code,A QR code can be positioned using three alignment codes.
Existing Some Enterprises have used product two dimensional code way to manage, and two dimensional code is corresponding with each station, and each station is completedSemi-finished product afterwards carry out patch code and flow into production line to use for the latter in specified region.After the completion of multistation, to specified regionMultiple two dimensional codes are identified, multiple two-dimensional barcode informations are selectively integrated into a two dimensional code and attach or be sprayed on productOr in outer packing, used for other internal departments or consumer.
Existing two-dimensional code identification method uses single camera, and two-dimension code recognition device is single camera device, in faceWhen to two dimensional code uneven illumination, two dimensional code can not be identified, the phenomenon could be solved by needing artificially to adjust light source or two-dimentional code position.Equally, when facing two-dimension code image torsional deformation, existing two-dimensional code identification method and device can only identify that deformation is smallerTwo dimensional code, two dimensional code can not be identified if deformation is excessive.
Summary of the invention
The purpose of the present invention is to provide one kind to read in the case where two-dimension code image torsional deformation, uneven illuminationThe two-dimensional code identification method and device of two-dimensional barcode information out.
Realize the technical solution of the object of the invention are as follows: a kind of two-dimensional code identification method, comprising the following steps:
Two-dimension code image is acquired simultaneously from different perspectives by two cameras;
Two two-dimension code images of acquisition are pre-processed;
Two dimensional code dividing processing is carried out to pretreated two-dimension code image, extracts two dimensional code;
According to the edge distorting event of two two dimensional codes to two dimensional code locating for veneer determined and calculated, correctedFormula carries out image rectification to two dimensional code using updating formula, is reduced to the two dimensional code of standard shape;
Two standard shape two dimensional code code area information are recorded, according to pixel black in one of code area to anotherCode area carries out supplement process, obtains can recognize two dimensional code;
Extract the two-dimensional barcode information that can recognize in two dimensional code.
A kind of two-dimension code recognition device, comprising:
Two cameras, for acquiring two-dimension code image simultaneously from different perspectives;
Image pre-processing module is pre-processed for two two-dimension code images to acquisition;
Two dimensional code dividing processing module is extracted for carrying out two dimensional code dividing processing to pretreated two-dimension code imageTwo dimensional code out;
Two dimensional code correction module, for according to the edge distorting event of two two dimensional codes to two dimensional code locating for veneer carry outDetermine and calculate, obtain updating formula, image rectification is carried out to two dimensional code using updating formula, is reduced to standard shapeTwo dimensional code;
Two dimensional code complementation module, for recording two standard shape two dimensional code code area information, according to one of codingBlack pixel carries out supplement process to another code area in area, obtains can recognize two dimensional code;
Two-dimensional barcode information extraction module, for extracting the two-dimensional barcode information in recognizable two dimensional code.
Compared with prior art, remarkable advantage of the invention are as follows:
(1) present invention can restore preferable image when uneven illumination occurs for two dimensional code and extract two dimensional code letterBreath;
(2) prior art only can identify two-dimensional barcode information in the lesser situation of two dimensional code deformation, when two dimensional code occur compared withIt can not then identify that two-dimensional barcode information, the present invention can preferably restore image when two dimensional code is distorted and deforms when big deformationAnd extract two-dimensional barcode information.
Detailed description of the invention
Fig. 1 is the flow chart of recognition methods of the present invention.
Fig. 2 is the module map of identification device of the present invention.
Specific embodiment
To facilitate the understanding of the present invention, below with reference to the module map of the flow chart of recognition methods and identification device, to thisInvention is described in detail.
In conjunction with Fig. 1, a kind of two-dimensional code identification method of the invention, comprising the following steps:
Two-dimension code image is acquired simultaneously from different perspectives by two cameras;
Two two-dimension code images of acquisition are pre-processed;
Two dimensional code dividing processing is carried out to pretreated two-dimension code image, extracts two dimensional code;
According to the edge distorting event of two two dimensional codes to two dimensional code locating for veneer determined and calculated, correctedFormula carries out image rectification to two dimensional code using updating formula, is reduced to the two dimensional code of standard shape;
Two standard shape two dimensional code code area information are recorded, according to pixel black in one of code area to anotherCode area carries out supplement process, obtains can recognize two dimensional code;
Extract the two-dimensional barcode information that can recognize in two dimensional code.
Further, pretreatment includes image gray processing processing, image binaryzation processing and image denoising processing.
Further, the process of dividing processing are as follows:
Three position sensing figures on two dimensional code are detected, determine two dimension code position;
Vacancy filling is carried out to two dimensional code, makes two dimensional code in same connected domain;
Edge detection is carried out, two dimensional code is extracted.
Further, correction process process is
Detect two dimensional code key point;
Two dimensional code edge fitting and the fitting of two dimensional code veneer are carried out according to two dimensional code key point;
It determines updating formula, and two dimensional code is corrected by updating formula, obtain the two dimensional code of standard shape.
In conjunction with Fig. 2, the present invention also provides a kind of two-dimension code recognition devices, comprising:
Two cameras, for acquiring two-dimension code image simultaneously from different perspectives;
Image pre-processing module is pre-processed for two two-dimension code images to acquisition;
Two dimensional code dividing processing module is extracted for carrying out two dimensional code dividing processing to pretreated two-dimension code imageTwo dimensional code out;
Two dimensional code correction module, for according to the edge distorting event of two two dimensional codes to two dimensional code locating for veneer carry outDetermine and calculate, obtain updating formula, image rectification is carried out to two dimensional code using updating formula, is reduced to standard shapeTwo dimensional code;
Two dimensional code complementation module, for recording two standard shape two dimensional code code area information, according to one of codingBlack pixel carries out supplement process to another code area in area, obtains can recognize two dimensional code;
Two-dimensional barcode information extraction module, for extracting the two-dimensional barcode information in recognizable two dimensional code.
The pretreatment includes image gray processing processing, image binaryzation processing and image denoising processing.
The segmentation process of the two dimensional code dividing processing module are as follows:
Three position sensing figures on two dimensional code are detected, determine two dimension code position;
Vacancy filling is carried out to two dimensional code, makes two dimensional code in same connected domain;
Edge detection is finally carried out, two dimensional code is extracted.
The present invention is further explained in the light of specific embodiments.
Embodiment
As shown in Figure 1, the two-dimensional code identification method of the present embodiment the following steps are included:
The first step acquires two-dimension code image
It is shot from different perspectives using two cameras and two dimensional code is shot, two cameras difference of the present embodimentAt positive and negative 20 degree away from two dimensional code plane normal.
Second step, pretreatment
After obtaining the picture containing two dimensional code, image preprocessing is carried out to two-dimension code image, image preprocessing includesImage gray processing processing, image binaryzation processing and image denoising processing.
Image containing two dimensional code is shown in the form of color image.However, actual two-dimension code area is only handed over by the depthWrong module composition, color image do not have special significance.The meter that image after gray processing and binary conversion treatment needsEvaluation time and calculating space are less, can greatly improve processing speed.Image denoising processing can reduce picture noise, make two dimensionCode picture becomes more smooth, can be significantly convenient for below to the dividing processing of two dimensional code and to the recognition work of two dimensional codeEnhance the recognition capability to two dimensional code.
Image preprocessing is prepared for the extraction work of two dimensional code, which is conducive to improve the processing speed of deviceDegree and enhancement device are to the recognition capability of two dimensional code.
Third step, dividing processing
Two dimensional code dividing processing is carried out to pretreated two-dimension code image, is mainly comprised the processes of
Three position sensing figures on two dimensional code are detected first, determine two dimension code position;
Then vacancy filling is carried out to two dimensional code, makes two dimensional code in same connected domain;
Edge detection is finally carried out, two dimensional code is extracted.
The effect of dividing processing is to be split two dimensional code from picture according to the edge of two dimensional code, is directed to convenient for subsequentTwo dimensional code is handled.
4th step, correction process
After two dimensional code is opened in acquisition two, first determine whether two dimensional code has the appearance of the case where torsional deformation, if two-dimentionalCode is not rectangle, then processing will be corrected to two dimensional code, according to the edge distorting event of two two-dimension code images to twoVeneer locating for dimension code is determined and is calculated, and updating formula is obtained further according to calculated result, using formula to two dimensional codeImage rectification is carried out, the two dimensional code of specification is reduced to.Detailed process is as follows:
Firstly, the key point of two two dimensional codes of detection, key point includes two dimensional code edge angle point and position sensing figure anglePoint.
The detection method of two dimensional code edge angle point are as follows: because scalloping makes the scaling of image in 2 D code each sectionIt changes, the distance between three position sensing figures change ratio also can not be identical, finds out and visits at a distance of longest two positionsThe connection of mapping shape is in alignment, and finds out the slope of straight line, with the straight line parallel two straight lines and vertical two directlyLine approaches two-dimension code area from four direction respectively, until straight line is tangent with two dimensional code, finds out four straight lines and two-dimension code areaPoint of contact, as two dimensional code edge angle point.
The detection method of position sensing figure angle point are as follows: using the center of position sensing figure as seed point, increased using regionLong algorithm finds out the connection threshold where the position sensing centre of figure, and enables the region for white;Then using central point as seedPoint finds out the connection threshold where the position sensing centre of figure using region growing algorithm, and enabling the region is black;Again withCentral point is seed point, using region growing algorithm, finds out the connection threshold where the position sensing centre of figure to get to onePosition sensing figure to get arrive position sensing figure angle point.
Then carry out two dimensional code edge fitting, above oneself found two dimensional code key point, then intended with least square method curveThe key point in each edge is closed, edge fitting line is obtained, two dimensional code edge extracting is gone out.
Two dimensional code veneer fitting is carried out again, includes: by the key point on above-mentioned two groups of distortion two dimensional codes that we find outTwo dimensional code edge angle point, the matched curve of the angle point and four edges of position sensing figure fit two dimensional code veneer shape.
Updating formula is determined again, and the image that we will obtain is known as ideograph, first with the method for integral, finds out fitting patchOn face on same side the adjacent key point of every two distance, it is cumulative to obtain the length of four matched curves, since two dimensional code is sent outRaw non-linear deformation, the deformation size of each edge is not identical, we are using the mean value of four edges as the side length of ideograph, according to reasonThe side length L for thinking figure finds out the coefficient of dilatation k of distortion two dimensional code each edget=L/Lt, t=1,2,3,4.LtFor four matched curvesLength;The key point on veneer will be fitted as the corresponding points of ideograph, the key point found out on fitting veneer is bent in fittingThe length on each side of distance on face, the corresponding points on corresponding ideograph are found out by coefficient of dilatation again.It is assumed that the point in ideograph(x ', y '), respective coordinates are (x, y) in fitting veneer, the mapping relations between (x, y) and (x ', y ') are as follows:It is image abscissa maximum value that wherein i, which takes 0 to m, j to take 0 to n, m, and n is ordinate maximum value, kFor variable, m >=k >=i, (x, y) is the point being fitted on veneer, uij、vijFor the correction parameter of coordinate points (x, y), it is based on this n pairsCorresponding point data least squares identification goes out the correction parameter in formula, so that it is determined that updating formula.
Two dimensional code is corrected finally by updating formula, coordinate mapping is carried out to two dimensional code according to the shape of two dimensional code veneer and is becomeIt changes, two dimensional code key point is first corrected to normal place, then correct two dimensional code other parts again.
Above-mentioned correction process allows the present invention to restore preferable image simultaneously in the case where two dimensional code is distorted deformationExtract two-dimensional barcode information.
5th step, supplement process
Two standard shape two dimensional code code area information are recorded, according to pixel black in one of code area to anotherCode area carries out supplement process, obtains can recognize two dimensional code;Assuming that the even phenomenon of uneven illumination occurs in two-dimension code image, occur anti-Bright spot from different perspectives shoots two dimensional code by two cameras, acquires the two dimensional code of two different illumination patternsPicture goes to fill up the picture using the two-dimensional barcode information at the same position of another two-dimension code image, obtain a quality compared withGood identifiable two-dimension code image.The processing step goes back apparatus of the present invention when uneven illumination occurs for two dimensional codeOriginal goes out preferable image and extracts two-dimensional barcode information.
6th step extracts two-dimensional barcode information from recognizable two dimensional code obtained in the previous step.

Claims (6)

Translated fromChinese
1.一种二维码识别方法,其特征在于,包括以下步骤:1. a two-dimensional code identification method, is characterized in that, comprises the following steps:通过两个摄像头从不同角度同时采集二维码图片;Simultaneously capture QR code images from different angles through two cameras;对采集的两张二维码图片进行预处理;Preprocess the collected two QR code images;对预处理后的二维码图片进行二维码分割处理,提取出二维码;The preprocessed two-dimensional code image is processed by two-dimensional code segmentation, and the two-dimensional code is extracted;根据两张二维码的边缘扭曲情况对二维码所处的贴面进行判定与计算,获得校正公式,使用校正公式对二维码进行图像校正,将其还原为标准形状的二维码;Determine and calculate the veneer where the two-dimensional code is located according to the edge distortion of the two two-dimensional codes, obtain a correction formula, use the correction formula to correct the image of the two-dimensional code, and restore it to a standard-shaped two-dimensional code;记录两张标准形状二维码编码区信息,根据其中一个编码区中黑像素点对另一个编码区进行补充处理,得到可识别二维码;Record the coding area information of two standard-shaped QR codes, and perform supplementary processing on the other coding area according to the black pixels in one coding area to obtain a recognizable QR code;提取可识别二维码中的二维码信息;Extract the QR code information in the identifiable QR code;其中,校正处理过程为:Among them, the correction process is as follows:(1)检测二维码关键点,关键点包括二维码边缘角点及位置探测图形角点;(1) Detect the key points of the two-dimensional code, and the key points include the corner points of the edge of the two-dimensional code and the corner points of the position detection pattern;二维码边缘角点的检测方法为:找出相距最长的两个位置探测图形连接成一条直线,并求出直线的斜率,用与该直线平行的两条直线和垂直的两条直线分别从四个方向逼近二维码区域,直到直线与二维码相切,求出四条直线与二维码区域的切点,即为二维码边缘角点;The detection method of the edge corner point of the QR code is: find out the two positions with the longest distance between the detection patterns and connect them into a straight line, and find the slope of the straight line. Approach the two-dimensional code area from four directions until the straight line is tangent to the two-dimensional code, and find the tangent point between the four straight lines and the two-dimensional code area, which is the corner point of the two-dimensional code edge;位置探测图形角点的检测方法为:以位置探测图形的中心为种子点,利用区域增长算法,求出该位置探测图形中心所在的连通阈,并令该区域为白色;然后以中心点为种子点,利用区域增长算法,求出该位置探测图形中心所在的连通阈,并令该区域为黑色;再以中心点为种子点,利用区域增长算法,求出该位置探测图形中心所在的连通阈,即得到一个位置探测图形,即得到位置探测图形角点;The detection method of the corner point of the position detection graph is: take the center of the position detection graph as the seed point, use the region growth algorithm to find the connectivity threshold where the center of the position detection graph is located, and make the area white; then take the center point as the seed point, use the region growth algorithm to find the connectivity threshold where the center of the detection graph of this position is located, and make the region black; then take the center point as the seed point, and use the region growth algorithm to find the connectivity threshold where the center of the detection graph of this position is located , that is, a position detection graph is obtained, that is, the corner points of the position detection graph are obtained;(2)根据二维码关键点进行二维码边缘拟合和二维码贴面拟合;(2) According to the key points of the two-dimensional code, the edge fitting of the two-dimensional code and the surface fitting of the two-dimensional code are performed;进行二维码边缘拟合,用最小二乘法曲线拟合每条边上的关键点,得到边缘拟合线,将二维码边缘提取出;Carry out edge fitting of the QR code, fit the key points on each edge with the least squares curve, obtain the edge fitting line, and extract the edge of the QR code;进行二维码贴面拟合,通过二维码边缘角点、位置探测图形角点及四条边的拟合曲线,拟合出二维码贴面形状;Fitting the QR code veneer, and fitting the QR code veneer shape through the corner points of the edge of the QR code, the corner points of the position detection graph and the fitting curve of the four sides;(3)确定校正公式;(3) Determine the correction formula;将要得到的图像称为理想图,先用积分的方法,求出拟合贴面上同一条边上每两个相邻关键点的距离,累加得到四条拟合曲线的长度,将四条边的均值作为理想图的边长,根据理想图的边长L,求出扭曲二维码每条边的伸缩系数kt=L/Lt,t=1,2,3,4, Lt为四条拟合曲线的长度;将拟合贴面上的关键点作为理想图的对应点,求出拟合贴面上的关键点在拟合曲面上距离各边的长度,通过伸缩系数再求出相应的理想图上的对应点;假定理想图中的点(x’,y’),在拟合贴面中对应坐标为(x,y),(x,y)与(x’,y’)之间的映射关系为:其中i取0到m,j取0到n,m为图像横坐标最大值,n为纵坐标最大值,k为变量,m≥k≥i,(x,y)为拟合贴面上的点,uij、vij为坐标点(x,y)的校正参数,基于这n对对应点数据用最小二乘法辨识出式中的校正参数,从而确定校正公式;The image to be obtained is called an ideal graph. First, use the integral method to find the distance between every two adjacent key points on the same edge on the fitted veneer, accumulate the lengths of the four fitting curves, and calculate the average value of the four edges. As the side length of the ideal graph, according to the side length L of the ideal graph, obtain the expansion coefficient kt =L/Lt of each side of the distorted two-dimensional code, t=1, 2, 3, 4, Lt is the four The length of the fitting curve; take the key points on the fitting veneer as the corresponding points of the ideal graph, find the lengths of the key points on the fitting veneer from each side on the fitting surface, and then obtain the corresponding The corresponding point on the ideal map; assuming the point (x', y') in the ideal map, the corresponding coordinates in the fitting surface are (x, y), the sum of (x, y) and (x', y') The mapping relationship between them is: Where i takes 0 to m, j takes 0 to n, m is the maximum value of the abscissa of the image, n is the maximum value of the ordinate, k is a variable, m≥k≥i, (x, y) is the fitting surface point, uij , vij are the correction parameters of the coordinate point (x, y), based on the n pairs of corresponding point data, the correction parameters in the formula are identified by the least squares method, so as to determine the correction formula;(4)通过校正公式校正二维码,根据二维码贴面的形状对二维码进行坐标映射变换,先将二维码关键点校正到标准位置,然后再校正二维码其他部分。(4) Correct the two-dimensional code by the correction formula, perform coordinate mapping transformation on the two-dimensional code according to the shape of the two-dimensional code veneer, first correct the key points of the two-dimensional code to the standard position, and then correct other parts of the two-dimensional code.2.根据权利要求1所述的二维码识别方法,其特征在于,预处理包括图像灰度化处理、图像二值化处理和图像去噪处理。2 . The two-dimensional code identification method according to claim 1 , wherein the preprocessing includes image grayscale processing, image binarization processing, and image denoising processing. 3 .3.根据权利要求1所述的二维码识别方法,其特征在于,分割处理的过程为:3. two-dimensional code identification method according to claim 1, is characterized in that, the process of segmentation processing is:检测二维码上的三个位置探测图形,确定二维码位置;Detect three position detection patterns on the QR code to determine the position of the QR code;对二维码进行图像孔洞填充,使二维码在同一连通域内;Fill the image holes in the two-dimensional code, so that the two-dimensional code is in the same connected domain;进行边缘检测,提取出二维码。Perform edge detection and extract the QR code.4.一种二维码识别装置,其特征在于,包括:4. A two-dimensional code identification device, characterized in that, comprising:两个摄像头,用于从不同角度同时采集二维码图片;Two cameras are used to simultaneously capture QR code pictures from different angles;图像预处理模块,用于对采集的两张二维码图片进行预处理;The image preprocessing module is used to preprocess the two two-dimensional code images collected;二维码分割处理模块,用于对预处理后的二维码图片进行二维码分割处理,提取出二维码;The two-dimensional code segmentation processing module is used to perform two-dimensional code segmentation processing on the preprocessed two-dimensional code picture, and extract the two-dimensional code;二维码校正模块,用于根据两张二维码的边缘扭曲情况对二维码所处的贴面进行判定与计算,获得校正公式,使用校正公式对二维码进行图像校正,将其还原为标准形状的二维码;具体为:The two-dimensional code correction module is used to determine and calculate the veneer where the two-dimensional code is located according to the edge distortion of the two two-dimensional codes, obtain the correction formula, use the correction formula to correct the image of the two-dimensional code, and restore it to the standard The QR code of the shape; specifically:(1)检测二维码关键点,关键点包括二维码边缘角点及位置探测图形角点;(1) Detect the key points of the two-dimensional code, and the key points include the corner points of the edge of the two-dimensional code and the corner points of the position detection pattern;二维码边缘角点的检测方法为:找出相距最长的两个位置探测图形连接成一条直线,并求出直线的斜率,用与该直线平行的两条直线和垂直的两条直线分别从四个方向逼近二维码区域,直到直线与二维码相切,求出四条直线与二维码区域的切点,即为二维码边缘角点;The detection method of the edge corner point of the QR code is: find out the two positions with the longest distance between the detection patterns and connect them into a straight line, and find the slope of the straight line. Approach the two-dimensional code area from four directions until the straight line is tangent to the two-dimensional code, and find the tangent point between the four straight lines and the two-dimensional code area, which is the corner point of the two-dimensional code edge;位置探测图形角点的检测方法为:以位置探测图形的中心为种子点,利用区域增长算法,求出该位置探测图形中心所在的连通阈,并令该区域为白色;然后以中心点为种子点,利用区域增长算法,求出该位置探测图形中心所在的连通阈,并令该区域为黑色;再以中心点为种子点,利用区域增长算法,求出该位置探测图形中心所在的连通阈,即得到一个位置探测图形,即得到位置探测图形角点;The detection method of the corner point of the position detection graph is: take the center of the position detection graph as the seed point, use the region growth algorithm to find the connectivity threshold where the center of the position detection graph is located, and make the area white; then take the center point as the seed point, use the region growth algorithm to find the connectivity threshold where the center of the detection graph of this position is located, and make the area black; then take the center point as the seed point, and use the region growth algorithm to find the connectivity threshold where the center of the detection graph of this position is located , that is, a position detection graph is obtained, that is, the corner points of the position detection graph are obtained;(2)根据二维码关键点进行二维码边缘拟合和二维码贴面拟合;(2) According to the key points of the two-dimensional code, the edge fitting of the two-dimensional code and the surface fitting of the two-dimensional code are performed;进行二维码边缘拟合,用最小二乘法曲线拟合每条边上的关键点,得到边缘拟合线,将二维码边缘提取出;Carry out edge fitting of the QR code, fit the key points on each edge with the least squares curve, obtain the edge fitting line, and extract the edge of the QR code;进行二维码贴面拟合,通过二维码边缘角点、位置探测图形角点及四条边的拟合曲线,拟合出二维码贴面形状;Fitting the QR code veneer, and fitting the QR code veneer shape through the corner points of the edge of the QR code, the corner points of the position detection graph and the fitting curve of the four sides;(3)确定校正公式;(3) Determine the correction formula;将要得到的图像称为理想图,先用积分的方法,求出拟合贴面上同一条边上每两个相邻关键点的距离,累加得到四条拟合曲线的长度,将四条边的均值作为理想图的边长,根据理想图的边长L,求出扭曲二维码每条边的伸缩系数kt=L/Lt,t=1,2,3,4, Lt为四条拟合曲线的长度;将拟合贴面上的关键点作为理想图的对应点,求出拟合贴面上的关键点在拟合曲面上距离各边的长度,通过伸缩系数再求出相应的理想图上的对应点;假定理想图中的点(x’,y’),在拟合贴面中对应坐标为(x,y),(x,y)与(x’,y’)之间的映射关系为:其中i取0到m,j取0到n,m为图像横坐标最大值,n为纵坐标最大值,k为变量,m≥k≥i,(x,y)为拟合贴面上的点,uij、vij为坐标点(x,y)的校正参数,基于这n对对应点数据用最小二乘法辨识出式中的校正参数,从而确定校正公式;The image to be obtained is called an ideal graph. First, use the integral method to find the distance between every two adjacent key points on the same edge on the fitted veneer, accumulate the lengths of the four fitting curves, and calculate the average value of the four edges. As the side length of the ideal graph, according to the side length L of the ideal graph, obtain the expansion coefficient kt =L/Lt of each side of the distorted two-dimensional code, t=1, 2, 3, 4, Lt is the four The length of the fitting curve; take the key points on the fitting veneer as the corresponding points of the ideal graph, find the lengths of the key points on the fitting veneer from each side on the fitting surface, and then obtain the corresponding The corresponding point on the ideal map; assuming the point (x', y') in the ideal map, the corresponding coordinates in the fitting surface are (x, y), the sum of (x, y) and (x', y') The mapping relationship between them is: Where i takes 0 to m, j takes 0 to n, m is the maximum value of the abscissa of the image, n is the maximum value of the ordinate, k is a variable, m≥k≥i, (x, y) is the fitting surface point, uij , vij are the correction parameters of the coordinate point (x, y), based on the n pairs of corresponding point data, the correction parameters in the formula are identified by the least squares method, so as to determine the correction formula;(4)通过校正公式校正二维码,根据二维码贴面的形状对二维码进行坐标映射变换,先将二维码关键点校正到标准位置,然后再校正二维码其他部分;(4) Correct the two-dimensional code by the correction formula, perform coordinate mapping transformation on the two-dimensional code according to the shape of the surface of the two-dimensional code, first correct the key points of the two-dimensional code to the standard position, and then correct other parts of the two-dimensional code;二维码互补模块,用于记录两张标准形状二维码编码区信息,根据其中一个编码区中黑像素点对另一个编码区进行补充处理,得到可识别二维码;The two-dimensional code complementary module is used to record the coding area information of two standard-shaped two-dimensional codes, and perform supplementary processing on the other coding area according to the black pixels in one of the coding areas to obtain an identifiable two-dimensional code;二维码信息提取模块,用于提取可识别二维码中的二维码信息。The two-dimensional code information extraction module is used to extract the two-dimensional code information in the identifiable two-dimensional code.5.根据权利要求4所述的二维码识别装置,其特征在于,预处理包括图像灰度化处理、图像二值化处理和图像去噪处理。5 . The two-dimensional code identification device according to claim 4 , wherein the preprocessing includes image grayscale processing, image binarization processing, and image denoising processing. 6 .6.根据权利要求4所述的二维码识别装置,其特征在于,所述二维码分割处理模块的分割处理过程为:6. The two-dimensional code identification device according to claim 4, wherein the division processing process of the two-dimensional code division processing module is:检测二维码上的三个位置探测图形,确定二维码位置;Detect three position detection patterns on the QR code to determine the position of the QR code;对二维码进行图像孔洞填充,使二维码在同一连通域内;Fill the image holes in the two-dimensional code, so that the two-dimensional code is in the same connected domain;最后进行边缘检测,提取出二维码。Finally, edge detection is performed to extract the QR code.
CN201610514040.7A2016-06-302016-06-30A kind of two-dimensional code identification method and deviceActiveCN106156684B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610514040.7ACN106156684B (en)2016-06-302016-06-30A kind of two-dimensional code identification method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610514040.7ACN106156684B (en)2016-06-302016-06-30A kind of two-dimensional code identification method and device

Publications (2)

Publication NumberPublication Date
CN106156684A CN106156684A (en)2016-11-23
CN106156684Btrue CN106156684B (en)2019-01-18

Family

ID=57349766

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610514040.7AActiveCN106156684B (en)2016-06-302016-06-30A kind of two-dimensional code identification method and device

Country Status (1)

CountryLink
CN (1)CN106156684B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107145810A (en)*2017-04-262017-09-08南京理工大学 An all-round barcode recognition device and method
CN107180216B (en)*2017-06-072020-06-30福州觉感视觉软件科技有限公司Two-dimensional code generation and identification method
CN107679432A (en)*2017-09-272018-02-09努比亚技术有限公司A kind of scan method, terminal and storage medium
CN107818283A (en)*2017-11-022018-03-20深圳天珑无线科技有限公司Quick Response Code image pickup method, mobile terminal and computer-readable recording medium
CN108197521A (en)*2017-12-312018-06-22南京理工大学A kind of leggy Quick Response Code obtains identification device and method
CN108563972B (en)*2018-03-092021-11-16Oppo广东移动通信有限公司Graphic code identification method and device, mobile terminal and storage medium
CN109190436A (en)*2018-07-302019-01-11努比亚技术有限公司A kind of two-dimensional code identification method, mobile terminal and storage medium
CN109492451B (en)*2018-10-302022-08-16维沃移动通信有限公司Coded image identification method and mobile terminal
CN110309687B (en)*2019-07-052020-06-05华中科技大学 A two-dimensional code image correction method and correction device
CN112069852B (en)*2020-09-072023-12-12凌云光技术股份有限公司Low-quality two-dimensional code information extraction method and device based on run-length coding

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1334544A (en)*2000-04-062002-02-06精工爱普生株式会社Two-dimension code reading method, information recording medium and two-dimension code reading device
EP1770604A1 (en)*2004-07-222007-04-04Matsushita Electric Industrial Co., Ltd.Multicolored two-dimensional barcode, image display apparatus thereof, information terminal apparatus, display method, decoding method, information communication system, and information communication method
CN103400131A (en)*2013-08-162013-11-20徐宁Correction device and method for image identification
CN204967989U (en)*2015-10-102016-01-13南京比邻软件有限公司High -speed dynamic optical wand of twin -lens
CN105701434A (en)*2015-12-302016-06-22广州卓德信息科技有限公司Image correction method for two-dimensional code distorted image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1334544A (en)*2000-04-062002-02-06精工爱普生株式会社Two-dimension code reading method, information recording medium and two-dimension code reading device
EP1770604A1 (en)*2004-07-222007-04-04Matsushita Electric Industrial Co., Ltd.Multicolored two-dimensional barcode, image display apparatus thereof, information terminal apparatus, display method, decoding method, information communication system, and information communication method
CN103400131A (en)*2013-08-162013-11-20徐宁Correction device and method for image identification
CN204967989U (en)*2015-10-102016-01-13南京比邻软件有限公司High -speed dynamic optical wand of twin -lens
CN105701434A (en)*2015-12-302016-06-22广州卓德信息科技有限公司Image correction method for two-dimensional code distorted image

Also Published As

Publication numberPublication date
CN106156684A (en)2016-11-23

Similar Documents

PublicationPublication DateTitle
CN106156684B (en)A kind of two-dimensional code identification method and device
CN105069394B (en)Quick Response Code weighted average gray level method coding/decoding method and system
CN102629322B (en)Character feature extraction method based on stroke shape of boundary point and application thereof
CN111768452B (en)Non-contact automatic mapping method based on deep learning
CN106056020B (en)A kind of bar code detection recognition method and system based on NI Vision Builder for Automated Inspection
CN104424457A (en)Method for identifying two-dimensional code under the condition of nonlinear distortion
CN105488492B (en) A color image preprocessing method, road recognition method and related device
CN108694393A (en)A kind of certificate image text area extraction method based on depth convolution
CN105260694B (en)A kind of two-dimension code area localization method based on multistage key extraction with analysis
CN106651831B (en)Bamboo block defect detection method and system
CN104657728B (en)Processing in Barcode Recognizing System based on computer vision
CN110223310B (en) A deep learning-based detection method for centerline and box edge of line-structured light
CN108416355A (en)A kind of acquisition method of the industry spot creation data based on machine vision
CN104778701A (en) A local image description method based on RGB-D sensor
CN102147867B (en)Method for identifying traditional Chinese painting images and calligraphy images based on subject
CN107301420A (en)A kind of thermal infrared imagery object detection method based on significance analysis
CN106023173B (en)A kind of number slip recognition methods based on support vector machines
CN106446925A (en)Dolphin identity recognition method based on image processing
CN109886935A (en)A kind of road face foreign matter detecting method based on deep learning
CN109146859A (en)A kind of pavement crack detection system based on machine vision
CN106682678A (en)Image angle point detection and classification method based on support domain
CN106503694A (en)Digit recognition method based on eight neighborhood feature
CN103116890B (en)A kind of intelligent search matching process based on video image
CN102938074B (en)Self-adaptive extraction method of badminton field or tennis field in virtual advertising system during sports live broadcast
CN107463939A (en)A kind of image key line detection method

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp