CN107292212B - Two-dimensional code positioning method under low signal-to-noise ratio environment - Google Patents
Two-dimensional code positioning method under low signal-to-noise ratio environment Download PDFInfo
- Publication number
- CN107292212B CN107292212B CN201710283532.4A CN201710283532A CN107292212B CN 107292212 B CN107292212 B CN 107292212B CN 201710283532 A CN201710283532 A CN 201710283532A CN 107292212 B CN107292212 B CN 107292212B
- Authority
- CN
- China
- Prior art keywords
- image
- target
- dimensional code
- low signal
- small line
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000009466 transformation Effects 0.000 claims abstract description 7
- 238000005286 illumination Methods 0.000 claims description 6
- 230000000694 effects Effects 0.000 claims description 5
- 239000011159 matrix material Substances 0.000 claims description 4
- 238000000605 extraction Methods 0.000 claims description 3
- 238000001914 filtration Methods 0.000 claims description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005260 corrosion Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/1439—Methods for optical code recognition including a method step for retrieval of the optical code
- G06K7/1443—Methods for optical code recognition including a method step for retrieval of the optical code locating of the code in an image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/14—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
- G06K7/1404—Methods for optical code recognition
- G06K7/1408—Methods for optical code recognition the method being specifically adapted for the type of code
- G06K7/1417—2D bar codes
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Electromagnetism (AREA)
- General Health & Medical Sciences (AREA)
- Toxicology (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention provides a two-dimensional code positioning method under a low signal-to-noise ratio environment, which introduces small line transformation, has strong anti-noise capability, can accurately identify the line characteristics of a target in strong noise, improves the purity of an edge image, and provides a foundation for decoding a two-dimensional code under the low signal-to-noise ratio environment.
Description
Technical Field
The invention relates to the field of two-dimension code processing, in particular to a two-dimension code positioning method under a low signal-to-noise ratio environment.
Background
The two-dimensional code is a graphic symbol which is arranged on a two-dimensional plane by using a specific geometric model according to a specified coding mode to realize information storage. The two-dimensional code can be printed on the surfaces of different objects and read by image acquisition equipment or a photoelectric scanning instrument, so that the information can be quickly processed. There are many two-dimensional code systems on the market, and common two-dimensional codes include QR code, PDF417, Data matrix, lobel code, Maxi code, and the like. The QR code has the characteristics of large information storage capacity, high reliability, capability of representing Chinese characters and images, strong confidentiality and anti-counterfeiting performance and the like, and is applied in China.
With the recent upgrade of communication networks in China, the popularization of smart phones and the development of internet of things, two-dimensional codes are widely applied to various industries. The two-dimensional code has the characteristics of anti-counterfeiting property, low manufacturing cost and strong fault-tolerant capability, and has wide application prospect in industry. The two-dimensional code can be directly printed on the surface of the metal part through a needle type, a laser, an electro-corrosion and the like, and the information of the part is stored in the two-dimensional code, so that the uniqueness and the permanence of the part identification are realized.
There are various extreme light environments in industrial environments that are not available in other fields, such as multiple light source interference, strong light, weak light or no light, and in addition, there may be interference of various electric waves in industrial environments. Because the performance of a CMOS chip carried by the two-dimensional code scanner is limited, the CMOS chip is easily interfered by noise under the extreme environments, and the target edge is submerged by the noise. Extracting the edge information of the two-dimensional code is the key point of the two-dimensional code positioning. The current common method is based on morphology and edge positioning of edge operators such as canny operator and Sobel operator, but these operators introduce noise information, which causes positioning failure. In order to solve the problems, the patent provides a two-dimensional code identification method based on small line transformation, and the identification capability of a scanner in a low signal-to-noise ratio environment is improved.
Disclosure of Invention
The invention provides a two-dimensional code positioning method under the environment with low signal-to-noise ratio, which has high positioning precision and high speed.
In order to achieve the technical effects, the technical scheme of the invention is as follows:
a two-dimensional code positioning method under the environment with low signal to noise ratio comprises the following steps:
s1: shooting a color image of a target by using handheld equipment, and converting the original color image into a pseudo-gray image;
s2: carrying out brightness enhancement on the gray level image by using a homomorphic filtering method;
s3: performing line extraction on the gray level image by using small line transformation to obtain an edge information image of the target;
s4: projecting and positioning the extracted edge information to obtain the coordinates of the region where the target is located, and intercepting the region with the same coordinates on the gray level image to obtain the image of the target;
s5: and carrying out binarization on the target image obtained in the last step by using the Otsu method, and outputting a positioning effect.
Further, the process of step S1 is as follows:
the image collected by the shooting equipment is a three-channel RGB image, and the RGB image is converted into a gray image according to a formula S of 0.299R + 0.587G + 0.114B, so that the storage space is saved, and the calculation speed is accelerated.
Further, the process of step S2 is:
the illumination estimate of the original image is obtained by convolving the original image with a gaussian kernel, and the estimate of the reflection image is obtained by subtracting the illumination image from the original image:
R0=I0-I0*G0
wherein R is0Is a reflection image, I0Is an input image, G0Is a normalized gaussian convolution kernel.
Further, the process of step S3 is:
s31: divide the input image equally into 2JSmall blocks, J is the scale;
s32: generating a small line base with corresponding scale, wherein the small line base is a set of line segments formed by connecting any two points on different edges of a small block, recording the coordinates and the length of the line segments without any bar in the small line base, and generating a small line dictionary B according to the small line baseb(x,y);
S33: from the input image, the amplitude of the noise and the noise information r (x, y) are estimated, and the input image I (x, y) can be represented as:
I(x,y)=A*Bb(x,y)+*r(x,y) 0≤x,y≤n
if the matrix B corresponds to the position of the small line base B and has the line segment characteristic, A is 0, and the relevant information of B is reserved at the position corresponding to B; otherwise, when A is larger than 0, deleting b at the position corresponding to b in the wireless characteristic;
s34: by using the obtained b set, the edge map of the target image can be obtained by reconstructing the image.
Further, the process of step S4 is:
and carrying out projection positioning on the obtained edge image, setting a threshold value as T, firstly calculating the sum of each row vector of the edge image, finding out a minimum interval [ y1, y2] of which the median of the sum group is greater than the threshold value T, then calculating the sum of each column vector, finding out a minimum interval [ x1, x2] of which the median of the sum group is greater than the threshold value, wherein in the gray level image, the region coordinates of the two-dimensional code are (x1: x2, y1: y2), and intercepting the region to obtain a target image target.
Further, the process of step S5 is:
and (3) solving the optimal threshold value of the target image by using the Otsu method, binarizing the target image according to the threshold value, separating the foreground and the background, and outputting a binary image.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
the small line transformation introduced by the method has strong anti-noise capability, can accurately identify the line characteristics of the target in strong noise, improves the purity of the edge image, and provides a foundation for decoding the two-dimensional code in the low signal-to-noise ratio environment.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the patent;
for the purpose of better illustrating the embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product;
it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The technical solution of the present invention is further described below with reference to the accompanying drawings and examples.
Example 1
As shown in fig. 1, a two-dimensional code positioning method in a low signal-to-noise ratio environment includes the following steps:
s1: shooting a color image of a target by using handheld equipment, and converting the original color image into a pseudo-gray image;
s2: carrying out brightness enhancement on the gray level image by using a homomorphic filtering method;
s3: performing line extraction on the gray level image by using small line transformation to obtain an edge information image of the target;
s4: projecting and positioning the extracted edge information to obtain the coordinates of the region where the target is located, and intercepting the region with the same coordinates on the gray level image to obtain the image of the target;
s5: and carrying out binarization on the target image obtained in the last step by using the Otsu method, and outputting a positioning effect.
The process of step S1 is as follows:
the image collected by the shooting equipment is a three-channel RGB image, and the RGB image is converted into a gray image according to a formula S of 0.299R + 0.587G + 0.114B, so that the storage space is saved, and the calculation speed is accelerated.
The process of step S2 is:
the illumination estimate of the original image is obtained by convolving the original image with a gaussian kernel, and the estimate of the reflection image is obtained by subtracting the illumination image from the original image:
R0=I0-I0*G0
wherein R is0Is a reflection image, I0Is an input image, G0Is a normalized gaussian convolution kernel.
The process of step S3 is:
s31: divide the input image equally into 2JSmall blocks, J is the scale;
s32: generating a small line base with corresponding scale, wherein the small line base is a set of line segments formed by connecting any two points on different edges of a small block, recording the coordinates and the length of the line segments without any bar in the small line base, and generating a small line dictionary B according to the small line baseb(x,y);
S33: from the input image, the amplitude of the noise and the noise information r (x, y) are estimated, and the input image I (x, y) can be represented as:
I(x,y)=A*Bb(x,y)+*r(x,y) 0≤x,y≤n
if the matrix B corresponds to the position of the small line base B and has the line segment characteristic, A is 0, and the relevant information of B is reserved at the position corresponding to B; otherwise, when A is larger than 0, deleting b at the position corresponding to b in the wireless characteristic;
s34: by using the obtained b set, the edge map of the target image can be obtained by reconstructing the image.
The process of step S4 is:
and carrying out projection positioning on the obtained edge image, setting a threshold value as T, firstly calculating the sum of each row vector of the edge image, finding out a minimum interval [ y1, y2] of which the median of the sum group is greater than the threshold value T, then calculating the sum of each column vector, finding out a minimum interval [ x1, x2] of which the median of the sum group is greater than the threshold value, wherein in the gray level image, the region coordinates of the two-dimensional code are (x1: x2, y1: y2), and intercepting the region to obtain a target image target.
The process of step S5 is:
and (3) solving the optimal threshold value of the target image by using the Otsu method, binarizing the target image according to the threshold value, separating the foreground and the background, and outputting a binary image.
In a traditional two-dimensional code positioning method, edge operators are used for extracting edge information, and in a low signal-to-noise ratio environment, a large amount of noise information is introduced into the edge detection operators such as canny, sobel, robot and the like. A large amount of noise information can seriously interfere with the effect of projection positioning, causing inaccurate positioning and even failure of positioning. The small line transformation introduced by the invention has strong anti-noise capability, can accurately identify the line characteristics of the target in strong noise, improves the purity of the edge image and provides a foundation for decoding the two-dimensional code in the low signal-to-noise ratio environment.
The same or similar reference numerals correspond to the same or similar parts;
the positional relationships depicted in the drawings are for illustrative purposes only and are not to be construed as limiting the present patent;
it should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.
Claims (3)
1. A two-dimensional code positioning method under the environment with low signal to noise ratio is characterized by comprising the following steps:
s1: shooting a color image of a target by using handheld equipment, and converting the original color image into a pseudo-gray image;
s2: carrying out brightness enhancement on the gray level image by using a homomorphic filtering method;
s3: performing line extraction on the gray level image by using small line transformation to obtain an edge information image of the target;
s4: projecting and positioning the extracted edge information to obtain the coordinates of the region where the target is located, and intercepting the region with the same coordinates on the gray level image to obtain the image of the target;
s5: carrying out binarization on the target image obtained in the last step by using the Otsu method, and outputting a positioning effect;
the process of step S1 is as follows: the image collected by the shooting equipment is a three-channel RGB image according to the formula: the RGB map is converted into a gray map by S0.299R + 0.587G + 0.114B, so that the storage space is saved, and the calculation speed is accelerated;
the process of step S2 is:
the illumination estimate of the original image is obtained by convolving the original image with a gaussian kernel, and the estimate of the reflection image is obtained by subtracting the illumination image from the original image:
R0=I0-I0*G0
wherein R is0Is a reflection image, I0Is an input image, G0Is a normalized gaussian convolution kernel;
the process of step S3 is:
s31: divide the input image equally into 2JSmall blocks, J is the scale;
s32: generating small line bases with corresponding sizes, wherein the small line bases are any two on different edges of a small blockThe coordinates and length of the segment without point in the small line base are recorded, and a small line dictionary B is generated according to the small line baseb(x,y);
S33: from the input image, the amplitude of the noise and the noise information r (x, y) are estimated, and the input image I (x, y) can be represented as:
I(x,y)=A*Bb(x,y)+*r(x,y)0≤x,y≤n
if the matrix B corresponds to the position of the small line base B and has the line segment characteristic, A is 0, and the relevant information of B is reserved at the position corresponding to B; otherwise, when A is larger than 0, deleting b at the position corresponding to b in the wireless characteristic;
s34: by using the obtained b set, the edge map of the target image can be obtained by reconstructing the image.
2. The two-dimensional code positioning method under the environment with low signal-to-noise ratio as claimed in claim 1, wherein the process of step S4 is:
and carrying out projection positioning on the obtained edge image, setting a threshold value as T, firstly calculating the sum of each row vector of the edge image, finding out a minimum interval [ y1, y2] of which the median of the sum group is greater than the threshold value T, then calculating the sum of each column vector, finding out a minimum interval [ x1, x2] of which the median of the sum group is greater than the threshold value, wherein in the gray level image, the region coordinates of the two-dimensional code are (x1: x2, y1: y2), and intercepting the region to obtain a target image target.
3. The two-dimensional code positioning method in low signal-to-noise ratio environment according to claim 2, wherein the step S5 is performed by:
and (3) solving the optimal threshold value of the target image by using the Otsu method, binarizing the target image according to the threshold value, separating the foreground and the background, and outputting a binary image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710283532.4A CN107292212B (en) | 2017-04-26 | 2017-04-26 | Two-dimensional code positioning method under low signal-to-noise ratio environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710283532.4A CN107292212B (en) | 2017-04-26 | 2017-04-26 | Two-dimensional code positioning method under low signal-to-noise ratio environment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107292212A CN107292212A (en) | 2017-10-24 |
CN107292212B true CN107292212B (en) | 2020-10-23 |
Family
ID=60093880
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710283532.4A Active CN107292212B (en) | 2017-04-26 | 2017-04-26 | Two-dimensional code positioning method under low signal-to-noise ratio environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107292212B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107862314B (en) * | 2017-10-25 | 2021-04-20 | 武汉楚锐视觉检测科技有限公司 | Code spraying identification method and device |
CN108345816A (en) * | 2018-01-29 | 2018-07-31 | 广州中大微电子有限公司 | A kind of Quick Response Code extracting method and system in the case where uneven illumination is even |
CN108512614B (en) * | 2018-03-06 | 2020-07-03 | 北京邮电大学 | Method and device for identifying low signal-to-noise ratio electromagnetic signal |
CN109167977B (en) * | 2018-10-28 | 2020-10-23 | 广州中元软件有限公司 | Bionic long-term storage method for surveillance video |
CN117057377B (en) * | 2023-10-11 | 2024-01-12 | 青岛冠成软件有限公司 | Code identification matching method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103914675A (en) * | 2014-03-17 | 2014-07-09 | 东华大学 | Garment QD code recognition method |
-
2017
- 2017-04-26 CN CN201710283532.4A patent/CN107292212B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103914675A (en) * | 2014-03-17 | 2014-07-09 | 东华大学 | Garment QD code recognition method |
CN103914675B (en) * | 2014-03-17 | 2016-11-16 | 东华大学 | A kind of 2 D code of quick response matrix recognition methods of clothing |
Non-Patent Citations (2)
Title |
---|
基于小线变换的多尺度几何分析方法;刘晓玲;《厦门大学硕士学位论文》;20061231;22-33页 * |
基于边缘增强的二维码区域快速检测定位算法;刘家昕;《计算机工程》;20120630;第38卷(第12期);136-137页 * |
Also Published As
Publication number | Publication date |
---|---|
CN107292212A (en) | 2017-10-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107292212B (en) | Two-dimensional code positioning method under low signal-to-noise ratio environment | |
CN110046529B (en) | Two-dimensional code identification method, device and equipment | |
CN105260693A (en) | Laser two-dimensional code positioning method | |
WO2014044159A1 (en) | Method and device for batch scanning 2d barcodes | |
CN108717744B (en) | Method and device for identifying seal serial number on financial document and terminal equipment | |
Liu et al. | Automatic recognition algorithm of quick response code based on embedded system | |
WO2002048952A1 (en) | Structure-guided image processing and image feature enhancement | |
Bodnár et al. | Improving barcode detection with combination of simple detectors | |
CN110009615B (en) | Image corner detection method and detection device | |
CN106845314B (en) | A kind of method for rapidly positioning of two dimensional code | |
Jain et al. | A systematic literature review on qr code detection and pre-processing | |
CN112163443A (en) | Code scanning method, code scanning device and mobile terminal | |
CN110532825A (en) | A kind of bar code identifying device and method based on artificial intelligence target detection | |
CN111311497B (en) | Bar code image angle correction method and device | |
CN108877030B (en) | Image processing method, device, terminal and computer readable storage medium | |
CN104346596A (en) | Identification method and identification device for QR (Quick Response) code | |
Bodnár et al. | A novel method for barcode localization in image domain | |
CN113221696A (en) | Image recognition method, system, equipment and storage medium | |
CN111222355A (en) | Method and system for positioning bar code on PCB | |
Li et al. | The research of QR code image correction based on image gray feature | |
Lin et al. | Multi-symbology and multiple 1d/2d barcodes extraction framework | |
CN110532826A (en) | A kind of bar code identifying device and method based on artificial intelligence semantic segmentation | |
CN115410191A (en) | Text image recognition method, device, equipment and storage medium | |
CN114219760A (en) | Reading identification method and device of instrument and electronic equipment | |
CN111768384B (en) | Cell counting method and system based on three-dimensional scanning imaging |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |