CN110033068A - A kind of two-dimensional code generation method and equipment containing background image - Google Patents
A kind of two-dimensional code generation method and equipment containing background image Download PDFInfo
- Publication number
- CN110033068A CN110033068A CN201910306850.7A CN201910306850A CN110033068A CN 110033068 A CN110033068 A CN 110033068A CN 201910306850 A CN201910306850 A CN 201910306850A CN 110033068 A CN110033068 A CN 110033068A
- Authority
- CN
- China
- Prior art keywords
- dimensional code
- background image
- data
- color
- binary matrix
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06037—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/06009—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
- G06K19/06046—Constructional details
- G06K19/06103—Constructional details the marking being embedded in a human recognizable image, e.g. a company logo with an embedded two-dimensional code
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
The present invention relates to field of data recognition, especially planar bar code technology.The present invention proposes a kind of two-dimensional code generation method containing background image, comprising: step 1: acquisition information data and background image;Step 2: being binary matrix data by the information data coding;Step 3: color matrices are obtained according to two-dimensional code data matrix;Step 4: according to binary matrix data and color matrices, forming the two dimensional code containing background image.The present invention solves pixel interference of the existing technology greatly, and the technical problem of parsing time length realizes that recognition success rate is high, recognition speed is fast, the full clean and tidy technical effect of background image.
Description
Technical field
The present invention relates to field of data recognition, especially planar bar code technology.
Background technique
Two dimensional code especially needs to carry out efficiently article in hi-tech industry, storage transport service, wholesale and retail industry etc.
The industry of beacon information is widely used.Now in the art, the two dimensional code method for drafting with picture background, generally directly will be two-dimentional
Code is stacked to picture, then forms the two dimensional code with background, or the size of adjustment background picture by two dimensional code size screenshot,
It makes it possible to just stack with two dimensional code, forms background two dimensional code.In appearance, the prior art has been realized in band background really
Two-dimension code pattern.But the dark point in possible background may be dry to the generation of the light pixel of two dimensional code in the prior art
It disturbs, this will lead to, and two dimensional code can not parse or two dimensional code parses the problems such as taking long time.If the ratio of interference is lower, due to
Two dimensional code it is fault-tolerant, parsing two dimensional code is possible, but the required parsing time is longer.
Summary of the invention
The present invention is big to solve pixel interference of the existing technology, and the technical problem of parsing time length proposes one kind
The two-dimensional code generation method and equipment containing background image that success rate is high, recognition speed is fast.
To achieve the above object, the present invention provides a kind of two-dimensional code generation method containing background image, comprising:
Step 1: acquisition information data and background image;
Step 2: being binary matrix data by the information data coding;
Step 3: color matrices are obtained according to two-dimensional code data matrix arrangement;
Step 4: according to binary matrix data and color matrices, forming the two dimensional code containing background image.
Preferably, the background image of the step 1 are as follows:
Picture photo, logo, text, signature, seal.
Preferably, the information data of the step 1 are as follows:
Number, character, symbol.
Preferably, the step 3 is pre-processed including background image, the background image pretreatment mode are as follows:
Figure identical with two dimensional code size is intercepted on background image;
Or, background image is zoomed to identical as two dimensional code size.
Preferably, the color matrices forming method of the step 3 are as follows:
Step 3.1: obtaining the binary matrix data of information data
A11, A12..., A1m,
A21, A22..., A2m,
...,
An1, An2..., Anm;
Step 3.2: obtaining the color-values that background image corresponds to the pixel of binary matrix data;
Step 3.3: forming color matrices according to the color-values of the pixel
B11, B12..., B1m,
B21, B22..., B2m,
...,
Bn1, Bn2..., Bnm。
Preferably, the step 4 includes:
If pixel A in binary matrixxyIt is 0, then draws next pixel;
If pixel A in binary matrixxyIt is 1, then carries out judgement process;
Circulation draws all pixels point in two dimensional code matrix, forms the two dimensional code containing background image.
Preferably, the judgement process are as follows:
If BxyFor black or dark color, then B is drawnxy,
If BxyFor white, then by BxyIt is plotted as grey.
A kind of two dimensional code generating device containing background image, comprising:
Acquisition unit, for acquiring information data and background image;
Coding unit, for being binary matrix data by the information data coding;
Drawing unit, for obtaining color matrices according to two-dimensional code data matrix, and according to binary matrix data and color
Color matrix forms the two dimensional code containing background image.
Preferably, the drafting process of the drawing unit are as follows: if pixel A in binary matrixxyIt is 0, then draws next
Pixel;If pixel A in binary matrixxyIt is 1, then carries out judgement process;
Circulation draws all pixels point in two dimensional code matrix, forms the two dimensional code containing background image.
Preferably, the drawing unit further includes judgment sub-unit, and the judgment sub-unit is for judging binary data
The data of corresponding pixel points in matrix and color matrices,
If BxyFor black or dark color, then B is drawnxy,
If BxyFor white, then by BxyIt is plotted as grey.
Big to solve pixel interference of the existing technology, the technical problem of parsing time length is provided by the invention to contain
The two-dimensional code generation method of background image while may be implemented clearly to show two dimensional code background, improves analyzing efficiency.
Detailed description of the invention
Fig. 1 is a kind of flow chart of two-dimensional code generation method containing background image provided by the invention.
Specific embodiment
With reference to the attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete
Ground description, it is clear that the described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, belongs to the scope of the present invention.
It can not achieve quick, high success rate image in 2 D code parsing in view of existing method, the embodiment of the present invention provides
Two-dimensional code generation method and equipment of the kind containing background image.
Embodiment one
The present embodiment provides a kind of methods of fast resolving image in 2 D code, as shown in Figure 1.
Script two dimensional code light color point is not disturbed in order to prevent, and during realization, the present invention will not be to two dimensional code light color
Background process is done at point.The influence of Background is not will receive at two dimensional code light color point.Due to above-mentioned setting, in resolving
In, all points with color and the light point without color can be distinguished clearly after gray proces.It is all
In resolving, the case where being interfered, is substantially reduced, and analyzing efficiency improves.
Two dimensional code generally all have passed through the processing of mask plate, so dark color point is certainly much larger than shallow for two dimensional code itself
Color dot, even when being not processed to light color point, the pattern at dark point is also enough to show background.Therefore, background patterns is in
It is now without a doubt certainly.Special envoy is directed to for highdensity two dimensional code, its higher background patterns of density will be more complete
Obviously.The two dimensional code of above-specified high density refers to that the points of two dimensional code in per square centimeter reach 300 or more.
The method process is as follows:
Collecting data information and background picture:
Acquisition needs to be input to the data information in two dimensional code, and needs the background picture with two dimensional code integration.
Above-mentioned background picture may include picture photo, logo, text, signature, seal etc..Background picture can be used for office
Portion's two dimensional code background, or whole two dimensional code backgrounds.A part of background picture can also be taken as two dimensional code background.
Data information is converted into coded data:
Data information is usually to have number, character, symbol composition.It needs for data information to be converted into be used directly for shape
At the binary coded data of two dimensional code.
According to background image and two dimensional code size, color matrices are obtained:
The size of two dimensional code can be by preset fixed dimension, and be also possible to be determined according to coded data can be with
Accommodate the size of the two dimensional code of all data.
Background picture is pre-processed, and treatment process can be through two dimensional code size, in any position of background picture
Set the figure for intercepting identical size.It is also possible to zoom in and out background picture to adapt to two dimensional code size.
By the background picture after processing, then corresponding two dimensional code matrix, the corresponding each pixel of two dimensional code matrix is obtained
The color-values of point, finally form color matrices.It is noted herein that if the position put on two dimensional code matrix corresponds to background
Color on picture is needed by the point record of the position in color matrices or labeled as light gray for white.
According to encoded information and color matrices, the two dimensional code with background is formed.
During forming the two dimensional code with background, if coded data is 1, corresponding data point is original on two dimensional code
It should be black or dark color, but in the present invention, the color needs of the point are determined according to the color of corresponding points in color matrices
It is fixed.If coded data is 0, next point is directly drawn.It, will when due to being white point in previous step, on background picture
Point in color matrices is labeled as light gray.So when coded data be 1, and the corresponding background picture of point be white point when,
In final two dimensional code is drawn, which is light gray.The setting can be to avoid dark data points are influenced due to background
For white data point, two dimensional code parsing time-consuming or failure are eventually led to.
Relative to the mode for directly putting background base map under two dimensional code, the two dimensional code background patterns that this method is formed will more
Add full, effect is cleaner and tidier.
In conclusion the method and device for the fast resolving image in 2 D code that the embodiment of the present invention provides, has following
The utility model has the advantages that
(1) processing mode of the background picture in the present invention, it is possible to reduce the pollution of data point on two dimensional code improves two dimension
Code analyzing efficiency;
(2) the two dimensional code background forming method in the present invention, so that image seems fuller clean and tidy.
Particular embodiments described above, to the purpose of the present invention, technical scheme and beneficial effects have been carried out further in detail
Describe in detail it is bright, it should be understood that above is only a specific embodiment of the present invention, the protection model being not intended to limit the present invention
It encloses, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should be included in the present invention
Protection scope within.
Claims (10)
1. a kind of two-dimensional code generation method containing background image characterized by comprising
Step 1: acquisition information data and background image;
Step 2: being binary matrix data by the information data coding;
Step 3: color matrices are obtained according to two-dimensional code data matrix arrangement;
Step 4: according to binary matrix data and color matrices, forming the two dimensional code containing background image.
2. one kind is as described in claim 1 containing the two-dimensional code generation method of background image, which is characterized in that the back of the step 1
Scape image are as follows:
Picture photo, logo, text, signature, seal.
3. one kind is as described in claim 1 containing the two-dimensional code generation method of background image, which is characterized in that the letter of the step 1
Cease data are as follows:
Number, character, symbol.
4. one kind is as described in claim 1 containing the two-dimensional code generation method of background image, which is characterized in that the step 3 includes
Background image pretreatment, the background image pretreatment mode are as follows:
Figure identical with two dimensional code size is intercepted on background image;
Or, background image is zoomed to identical as two dimensional code size.
5. one kind is as described in claim 1 containing the two-dimensional code generation method of background image, which is characterized in that the color of the step 3
Color matrix forming method are as follows:
Step 3.1: obtaining the binary matrix data of information data
A11, A12..., A1m,
A21, A22..., A2m,
...,
An1, An2..., Anm;
Step 3.2: obtaining the color-values that background image corresponds to the pixel of binary matrix data;
Step 3.3: forming color matrices according to the color-values of the pixel
B11, B12..., B1m,
B21, B22..., B2m,
...,
Bn1, Bn2..., Bnm。
6. one kind is as described in claim 1 containing the two-dimensional code generation method of background image, which is characterized in that the step 4 includes:
If pixel A in binary matrixxyIt is 0, then draws next pixel;
If pixel A in binary matrixxyIt is 1, then carries out judgement process;
Circulation draws all pixels point in two dimensional code matrix, forms the two dimensional code containing background image.
7. one kind is as claimed in claim 6 containing the two-dimensional code generation method of background image, which is characterized in that the judgement process
Are as follows:
If BxyFor black or dark color, then B is drawnxy,
If BxyFor white, then by BxyIt is plotted as grey.
8. a kind of two dimensional code generating device containing background image characterized by comprising
Acquisition unit, for acquiring information data and background image;
Coding unit, for being binary matrix data by the information data coding;
Drawing unit, for obtaining color matrices according to two-dimensional code data matrix, and according to binary matrix data and color square
Battle array forms the two dimensional code containing background image.
9. a kind of two dimensional code generating device containing background image as claimed in claim 8, which is characterized in that the drawing unit
Draw process are as follows: if pixel A in binary matrixxyIt is 0, then draws next pixel;If pixel A in binary matrixxy
It is 1, then carries out judgement process;
Circulation draws all pixels point in two dimensional code matrix, forms the two dimensional code containing background image.
10. a kind of two dimensional code generating device containing background image as claimed in claim 8, which is characterized in that the drawing unit
It further include judgment sub-unit, the judgment sub-unit is for judging corresponding pixel points in binary matrix data and color matrices
Data,
If BxyFor black or dark color, then B is drawnxy,
If BxyFor white, then by BxyIt is plotted as grey.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910306850.7A CN110033068A (en) | 2019-04-17 | 2019-04-17 | A kind of two-dimensional code generation method and equipment containing background image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910306850.7A CN110033068A (en) | 2019-04-17 | 2019-04-17 | A kind of two-dimensional code generation method and equipment containing background image |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110033068A true CN110033068A (en) | 2019-07-19 |
Family
ID=67238656
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910306850.7A Pending CN110033068A (en) | 2019-04-17 | 2019-04-17 | A kind of two-dimensional code generation method and equipment containing background image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110033068A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040035935A1 (en) * | 2002-05-30 | 2004-02-26 | Sadao Takahashi | 2-Dimensional code pattern, 2-dimensional code pattern supporting medium, 2-dimensional code pattern generating method, and 2-dimensional code reading apparatus and method |
CN105701529A (en) * | 2016-01-14 | 2016-06-22 | 厦门纳纬信息技术有限公司 | Method of realizing color picture display on two-dimension code |
CN107563476A (en) * | 2017-07-25 | 2018-01-09 | 浙江惠码科技有限公司 | A kind of Quick Response Code beautifies false proof method |
-
2019
- 2019-04-17 CN CN201910306850.7A patent/CN110033068A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040035935A1 (en) * | 2002-05-30 | 2004-02-26 | Sadao Takahashi | 2-Dimensional code pattern, 2-dimensional code pattern supporting medium, 2-dimensional code pattern generating method, and 2-dimensional code reading apparatus and method |
CN105701529A (en) * | 2016-01-14 | 2016-06-22 | 厦门纳纬信息技术有限公司 | Method of realizing color picture display on two-dimension code |
CN107563476A (en) * | 2017-07-25 | 2018-01-09 | 浙江惠码科技有限公司 | A kind of Quick Response Code beautifies false proof method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6595714B2 (en) | Method and apparatus for generating a two-dimensional code image having a dynamic effect | |
CN108229234B (en) | Scannable image generation method fusing digital coding | |
JP2004527042A5 (en) | ||
CN110516554A (en) | A kind of more scene multi-font Chinese text detection recognition methods | |
CN113592735A (en) | Text page image restoration method and system, electronic equipment and computer readable medium | |
CN104268615A (en) | Encoding method and decoding method for color two-dimensional code | |
US20220237397A1 (en) | Identifying handwritten signatures in digital images using ocr residues | |
CN112949455A (en) | Value-added tax invoice identification system and method | |
CN102411701A (en) | Two-dimensional code array image scanning and identifying method and system for value-added tax special invoice | |
CN101877057A (en) | Method and device for identifying barcodes | |
CN104424498A (en) | Method and device for transforming two-dimensional codes at high speed | |
JP2004272798A (en) | Image reading device | |
CN113095992A (en) | Novel bar code screenshot steganography traceability combined algorithm | |
CN110717397A (en) | Online translation system based on mobile phone camera | |
CN105809157A (en) | Answer sheet modeling method and device | |
CN114399670A (en) | Control method for extracting characters in pictures in 5G messages in real time | |
CN110321893A (en) | A kind of scene text identification network focusing enhancing | |
CN110033068A (en) | A kind of two-dimensional code generation method and equipment containing background image | |
CN117648681B (en) | OFD format electronic document hidden information extraction and embedding method | |
CN110516202B (en) | Document generator acquisition method, document generation device and electronic equipment | |
CN113177556A (en) | Text image enhancement model, training method, enhancement method and electronic equipment | |
CN113112567A (en) | Method and device for generating editable flow chart, electronic equipment and storage medium | |
CN110175661A (en) | The generation method and device in two dimensional code sharing path | |
CN109977720A (en) | A kind of method and device of fast resolving image in 2 D code | |
CN215072565U (en) | Image processing accelerating scanner and image processing rod |
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 | ||
CB03 | Change of inventor or designer information | ||
CB03 | Change of inventor or designer information |
Inventor after: Liu Shaolei Inventor after: Zhu Zhehai Inventor after: Shen Yi Inventor after: Luo Nianqing Inventor after: Bi Xinye Inventor before: Bi Xinye Inventor before: Liu Shaolei Inventor before: Shen Yi Inventor before: Luo Nianqing Inventor before: Zhu Zhehai |