CN105718979A - Method for generating two-dimensional code picture - Google Patents

Method for generating two-dimensional code picture Download PDF

Info

Publication number
CN105718979A
CN105718979A CN201610022985.7A CN201610022985A CN105718979A CN 105718979 A CN105718979 A CN 105718979A CN 201610022985 A CN201610022985 A CN 201610022985A CN 105718979 A CN105718979 A CN 105718979A
Authority
CN
China
Prior art keywords
code
point
picture
quick response
background picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610022985.7A
Other languages
Chinese (zh)
Other versions
CN105718979B (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.)
Ximen Na Wei Information Technology Co Ltd
Original Assignee
Ximen Na Wei Information Technology Co Ltd
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 Ximen Na Wei Information Technology Co Ltd filed Critical Ximen Na Wei Information Technology Co Ltd
Priority to CN201610022985.7A priority Critical patent/CN105718979B/en
Publication of CN105718979A publication Critical patent/CN105718979A/en
Application granted granted Critical
Publication of CN105718979B publication Critical patent/CN105718979B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record 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/06009Record 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/06046Constructional details
    • G06K19/06103Constructional 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)
  • Editing Of Facsimile Originals (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention discloses a method for generating a two-dimensional code picture. The size of a background picture is read, then the size of a code point display area is calculated according to the quantity of code points, and thus it is ensured that a finally formed PNG picture carrying two-dimensional code information is consistent with the background picture in terms of size. When the transparent PNG picture is formed, the size and the shape of the code points are not restricted as long as the code points completely fall into the code point display area, and a concept of fixed size does not exist, the code points present stereo perception and are not confused with background picture color, codes are more easily distinguished, the code point scanning error rate is reduced, the decoding efficiency is higher, by use of the tolerable error rate of a two-dimensional code, two-dimensional code points affecting the display effect of the background picture are partially erased, under the condition that the function of the two-dimensional code is not affected, the background picture can be completely presented, the visual effect of the two-dimensional code is better enhanced, and the application function and the scope of the two-dimensional code can be further expanded.

Description

A kind of method generating two-dimension code image
Technical field
The invention belongs to Computer Applied Technology field and digital image processing field, particularly relate to a kind of method generating two-dimension code image.
Background technology
As it is shown in figure 1, Quick Response Code to be fused is also known as QR code (QuickResponse quickly responds Quick Response Code), it is the chequered with black and white graphic recording data symbol information being distributed in plane (on two-dimensional directional) according to certain rules with certain specific geometric figure;Coding utilizes the concept of " 0 ", " 1 " bit stream constituting computer-internal logical foundations dexterously, use several geometrical bodies corresponding with binary system to represent word numerical information, automatically processed to realize information by image input device or photoelectric scanning device automatically identifying and reading: it has some general character of barcode technology, every kind of code system has its specific character set, each character occupies certain width, there is certain verifying function, also there is the information automatic identification function to different rows and process the function of the rotationally-varying point of figure.
Quick Response Code to be fused includes attribute information district and data field, and the information in attribute information district and data field all represents with the form of code element.Wherein data field is for storing the data of coding, and attribute information district is for storing the attribute information of Quick Response Code to be fused, and this attribute information is the necessary information identifying Quick Response Code to be fused.Attribute information district includes position sensing figure, position sensing figure marker space, location figure, correction graph, format information and version information etc..When a code element in the first region to be fused of Quick Response Code to be fused is positioned at the attribute information district of Quick Response Code to be fused, can determine that the code element that this code element is the attribute information representing Quick Response Code to be fused.
Although Quick Response Code storage information is very capable, but by after encoded for information acquisition Quick Response Code, user just cannot directly know any information of this Quick Response Code, it is necessary to uses special Quick Response Code scanning software to scan this Quick Response Code and just can know the information wherein recorded.In order to improve the ability of Quick Response Code expressing information, conventional art exists a kind of means merged with Quick Response Code by image, utilizes the serious forgiveness of Quick Response Code to add to after image down in Quick Response Code, be commonly added to the middle position of Quick Response Code.
Since the DensoWave company by Japan in 1994 invents, Quick Response Code is widely used in the industries such as inventory tracking, traffic, manufacture, retail as a kind of recognition methods.Due to popularizing of smart mobile phone, and Quick Response Code has and can quickly decode and access online resource and have the characteristics such as high power capacity, Quick Response Code is used to various application program, such as access website, download personal credit card information, the social networks released news, starts phone, replicating video or open text document.This multifunctionality makes them be all a valuable instrument in any industry.But the shape of Quick Response Code and color tolerance are limited, incorporate billboard design or printing material is subject to drastic delimitations.
Existing there is also some color 2 D codes, such as wechat personal information Quick Response Code, Alipay personal information Quick Response Code etc., these color 2 D codes do not significantly change the structure of original " trellis " code block of Quick Response Code, simply stiff Quick Response Code after dyeing is imbedded in picture, or stiff for picture little scope is imbedded in Quick Response Code, both are not organically combined, and pattern is single.
Summary of the invention
It is an object of the invention to provide a kind of method generating two-dimension code image, Quick Response Code is made organically to be combined with background picture to be fused in a transparent manner, neither affect the function of Quick Response Code, also background picture intactly can be presented, increase the visual effect of Quick Response Code better, use function and the scope of Quick Response Code can be expanded further.
A kind of method generating two-dimension code image of the present invention, specifically includes following steps:
Step 1, information user inputted generate the corresponding Quick Response Code matrix M*M being made up of 0 or 1 code according to the generated code rule of Quick Response Code;
Step 2, acquisition background picture are adjusted to square and obtain hem width pixel value;
Step 3, the hem width pixel value of background picture is counted M divided by Quick Response Code square matrix code, calculate the max pixel value N of each code-point, it is thus achieved that code-point viewing area N*N;
Step 4, in each code-point viewing area, stamp the code-point of arbitrary size and shape, it is thus achieved that the transparent PNG picture with 2 D code information of and background picture formed objects:
Step 41, according to Quick Response Code matrix, if code-point color is black in code-point viewing area, then in code-point viewing area, first stamps the shape size background color block slightly larger than code-point shape, adopt the contrast color of black;
Step 42, the background color block in code-point viewing area is done Vitrification management;
Step 43, in this undercolor region formed a black code-point that shape is smaller and transparence value is 0, this code-point with stereoeffect can be arbitrary shape;
Step 44, repetition step 41 are to step 43 until stamping code-point in each code-point viewing area;
Step 5, transparent PNG picture and background picture being overlapped makes two pictures be completely superposed;
Step 6, the two-dimension code image that two stacking is exported webpage is shown;
Step 7, determine that by two regions that surround of figures, location in two-dimension code image be operable area, user, in the scope that Quick Response Code serious forgiveness allows, utilizes plug-in unit JQUERY to carry out selective erase for the Quick Response Code code-point affecting background picture display effect on transparent PNG picture;
When step 8, preservation, two figure are scanned pixel-by-pixel simultaneously, when scanning, if pixel value can be got from the PNG picture of upper strata, then use its pixel value, if not having, then by the pixel value of background picture, one new two-dimension code image of scanned generation.
A kind of method generating two-dimension code image of the present invention, by reading the size of background picture, then calculates the size of code-point viewing area according to the quantity of code-point, it is ensured that the PNG picture with 2 D code information ultimately formed is in the same size with background picture;When forming transparent PNG picture, code-point size, shape are not intended to, as long as falling completely within code-point viewing area, there is no the concept of fixed size, and allow code-point present third dimension, be unlikely to confuse with base map color contamination, distinguishing code to be easier, reduce barcode scanning point error rate, decoding efficiency is higher;And utilize the serious forgiveness of Quick Response Code, the Quick Response Code code-point affecting background picture display effect is carried out selective erase, under the function premise not affecting Quick Response Code, background picture intactly can be presented, increase the visual effect of Quick Response Code better, use function and the scope of Quick Response Code can be expanded further.
Accompanying drawing explanation
Fig. 1 is Quick Response Code composition schematic diagram;
Fig. 2 is code-point viewing area of the present invention schematic diagram;
White or the schematic diagram of black background color block are stamped in the code-point viewing area of Fig. 3 A and Fig. 3 B respectively present invention;
The background color block of Fig. 4 A and Fig. 4 B respectively Fig. 3 A and Fig. 3 B makees the effect schematic diagram of Vitrification management;
The background color block of Fig. 5 A and Fig. 5 B respectively Fig. 4 A and Fig. 4 B is stamped the effect schematic diagram of code-point;
Fig. 6 is the schematic diagram that code-point does not do that stereoeffect processes;
Fig. 7 is the two-dimension code image that the present invention merges the figure that has powerful connections.
Below in conjunction with drawings and Examples, the invention will be further described.
Detailed description of the invention
A kind of method generating two-dimension code image, specifically includes following steps:
Step 1, information user inputted generate the corresponding Quick Response Code matrix M*M being made up of 0 or 1 code according to the generated code rule of Quick Response Code;
Step 2, acquisition background picture are adjusted to square and obtain hem width pixel value, and this background picture can be colour picture;
Step 3, the hem width pixel value of background picture is counted M divided by Quick Response Code square matrix code, calculate the max pixel value N of each code-point, it is thus achieved that code-point viewing area N*N, as shown in Figure 2;
Step 4, in each code-point viewing area, stamp the code-point of arbitrary size and shape, it is thus achieved that the transparent PNG picture with 2 D code information of and background picture formed objects:
Step 41, according to Quick Response Code matrix, if code-point color is black in code-point viewing area, then first in code-point viewing area, stamp the shape size background color block slightly larger than code-point shape, it is possible to be the contrast color of black, for instance white or light, as shown in Figure 3A, assume that code-point is black triangle, then stamp the undercolor region of a white triangles shape more bigger than code-point shape in code-point viewing area, if code-point is white triangles shape, then undercolor region is black, as shown in Figure 3 B;
Step 42, the background color block in code-point viewing area is done Vitrification management, namely set the transparence value of background color block as threshold value, see Fig. 4 A and Fig. 4 B;
Step 43, in this undercolor region formed a black code-point that shape is smaller and transparence value is 0, this place's code-point is high-contrast, high transparency and the arbitrary shape having stereoeffect;
Step 44, repetition step 41 are to step 43 until stamping code-point in each code-point viewing area;
Step 5, transparent PNG picture and background picture being overlapped makes two pictures be completely superposed;
Step 6, the two-dimension code image that two stacking is exported webpage is shown;
Step 7, as shown in Figure 1, determine that the region surrounded by two location figures in two-dimension code image is operable area, user is in the scope that Quick Response Code serious forgiveness allows, plug-in unit JQUERY is utilized to carry out selective erase for the Quick Response Code code-point affecting background picture display effect on transparent PNG picture, it is for stacking upper strata PNG picture during due to operation, therefore without influence on lower floor's color background picture;
When step 8, preservation, two figure are scanned pixel-by-pixel simultaneously, when scanning, if pixel value can be got from the PNG picture of upper strata, then use its pixel value, if not having, then by the pixel value of background picture, one new two-dimension code image of scanned generation.
The present invention focuses on: by reading the size of background picture, then calculate the size of code-point viewing area according to the quantity of code-point, it is ensured that the PNG picture with 2 D code information ultimately formed is in the same size with background picture;When forming transparent PNG picture, code-point size, shape are not intended to, as long as falling completely within code-point viewing area, there is no the concept of fixed size, and allow code-point present third dimension, and it being unlikely to confuse with base map color contamination, the code-point in Fig. 6 does not do stereoeffect and processes, white code-point is own through having been merged bad differentiation by background, the code-point of the present invention has done stereoeffect process, is easier as it is shown in fig. 7, distinguish code, reducing barcode scanning point error rate, decoding efficiency is higher;And utilize the serious forgiveness of Quick Response Code, the Quick Response Code code-point affecting background picture display effect is carried out selective erase, under the function premise not affecting Quick Response Code, background picture intactly can be presented, increase the visual effect of Quick Response Code better, use function and the scope of Quick Response Code can be expanded further.
The above, it it is only present pre-ferred embodiments, not the technical scope of the present invention is imposed any restrictions, therefore every any trickle amendment, equivalent variations and modification above example made according to the technical spirit of the present invention, all still fall within the scope of technical solution of the present invention.

Claims (1)

1. the method generating two-dimension code image, it is characterised in that comprise the steps:
Step 1, information user inputted generate the corresponding Quick Response Code matrix M*M being made up of 0 or 1 code according to the generated code rule of Quick Response Code;
Step 2, acquisition background picture are adjusted to square and obtain hem width pixel value;
Step 3, the hem width pixel value of background picture is counted M divided by Quick Response Code square matrix code, calculate the max pixel value N of each code-point, it is thus achieved that code-point viewing area N*N;
Step 4, in each code-point viewing area, stamp the code-point of arbitrary size and shape, it is thus achieved that the transparent PNG picture with 2 D code information of and background picture formed objects:
Step 41, according to Quick Response Code matrix, if code-point color is black in code-point viewing area, then in code-point viewing area, first stamps the shape size background color block slightly larger than code-point shape, adopt the contrast color of black;
Step 42, the background color block in code-point viewing area is done Vitrification management;
Step 43, in this undercolor region formed a black code-point that shape is smaller and transparence value is 0, this code-point with stereoeffect can be arbitrary shape;
Step 44, repetition step 41 are to step 43 until stamping code-point in each code-point viewing area;
Step 5, transparent PNG picture and color background picture being overlapped makes two pictures be completely superposed;
Step 6, the two-dimension code image that two stacking is exported webpage is shown;
Step 7, determine that by two regions that surround of figures, location in two-dimension code image be operable area, user, in the scope that Quick Response Code serious forgiveness allows, utilizes plug-in unit JQUERY to carry out selective erase for the Quick Response Code code-point affecting background picture display effect on transparent PNG picture;
When step 8, preservation, two figure are scanned pixel-by-pixel simultaneously, when scanning, if pixel value can be got from the PNG picture of upper strata, then use its pixel value, if not having, then by the pixel value of background picture, one new two-dimension code image of scanned generation.
CN201610022985.7A 2016-01-14 2016-01-14 A method of generating two-dimension code image Expired - Fee Related CN105718979B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610022985.7A CN105718979B (en) 2016-01-14 2016-01-14 A method of generating two-dimension code image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610022985.7A CN105718979B (en) 2016-01-14 2016-01-14 A method of generating two-dimension code image

Publications (2)

Publication Number Publication Date
CN105718979A true CN105718979A (en) 2016-06-29
CN105718979B CN105718979B (en) 2019-06-25

Family

ID=56147054

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610022985.7A Expired - Fee Related CN105718979B (en) 2016-01-14 2016-01-14 A method of generating two-dimension code image

Country Status (1)

Country Link
CN (1) CN105718979B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106778998A (en) * 2016-11-28 2017-05-31 北京慧眼智行科技有限公司 The generation method and device of a kind of color 2 D code
CN106779001A (en) * 2016-12-12 2017-05-31 张国炜 A kind of preparation method of gradual change Quick Response Code
CN106991462A (en) * 2017-03-13 2017-07-28 三维码(厦门)网络科技有限公司 Three-dimensional code generating method
CN107172259A (en) * 2017-04-11 2017-09-15 捷开通讯(深圳)有限公司 Terminal and its information interacting method, storage device based on Quick Response Code
WO2018014774A1 (en) * 2016-07-22 2018-01-25 深圳棒棒帮科技有限公司 Method for generating micro-graph group for information mapping and method for recognizing micro-graph group
CN108197687A (en) * 2017-12-27 2018-06-22 江苏集萃智能制造技术研究所有限公司 A kind of webpage two-dimensional code generation method
CN110909843A (en) * 2019-11-21 2020-03-24 程烨 Method, device, server and storage medium for modeling coded image
CN111160501A (en) * 2019-12-25 2020-05-15 北京亮亮视野科技有限公司 Construction method and device of two-dimensional code training data set
CN117744695A (en) * 2024-02-06 2024-03-22 浙江码尚科技股份有限公司 Automatic generation method and system for fusion two-dimensional code

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101059833A (en) * 2006-04-19 2007-10-24 At信息株式会社 Two-dimensional code with a logo
CN105009146A (en) * 2012-06-26 2015-10-28 艾克尼特有限公司 Image mask providing a machine-readable data matrix code
CN105117760A (en) * 2015-09-15 2015-12-02 牛建伟 Method for generating color image two-dimensional code through fusion of two-dimensional code with color image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101059833A (en) * 2006-04-19 2007-10-24 At信息株式会社 Two-dimensional code with a logo
CN105009146A (en) * 2012-06-26 2015-10-28 艾克尼特有限公司 Image mask providing a machine-readable data matrix code
CN105117760A (en) * 2015-09-15 2015-12-02 牛建伟 Method for generating color image two-dimensional code through fusion of two-dimensional code with color image

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018014774A1 (en) * 2016-07-22 2018-01-25 深圳棒棒帮科技有限公司 Method for generating micro-graph group for information mapping and method for recognizing micro-graph group
CN106778998A (en) * 2016-11-28 2017-05-31 北京慧眼智行科技有限公司 The generation method and device of a kind of color 2 D code
CN106779001A (en) * 2016-12-12 2017-05-31 张国炜 A kind of preparation method of gradual change Quick Response Code
CN106779001B (en) * 2016-12-12 2019-12-17 张国炜 Manufacturing method of gradient two-dimensional code
CN106991462A (en) * 2017-03-13 2017-07-28 三维码(厦门)网络科技有限公司 Three-dimensional code generating method
CN107172259A (en) * 2017-04-11 2017-09-15 捷开通讯(深圳)有限公司 Terminal and its information interacting method, storage device based on Quick Response Code
CN108197687A (en) * 2017-12-27 2018-06-22 江苏集萃智能制造技术研究所有限公司 A kind of webpage two-dimensional code generation method
CN110909843A (en) * 2019-11-21 2020-03-24 程烨 Method, device, server and storage medium for modeling coded image
CN110909843B (en) * 2019-11-21 2021-05-14 程烨 Method, device, server and storage medium for modeling coded image
CN111160501A (en) * 2019-12-25 2020-05-15 北京亮亮视野科技有限公司 Construction method and device of two-dimensional code training data set
CN117744695A (en) * 2024-02-06 2024-03-22 浙江码尚科技股份有限公司 Automatic generation method and system for fusion two-dimensional code
CN117744695B (en) * 2024-02-06 2024-05-03 浙江码尚科技股份有限公司 Automatic generation method and system for fusion two-dimensional code

Also Published As

Publication number Publication date
CN105718979B (en) 2019-06-25

Similar Documents

Publication Publication Date Title
CN105718979B (en) A method of generating two-dimension code image
CN105117760B (en) A kind of method that Quick Response Code is merged to generation color image Quick Response Code with color image
CN105718980A (en) Method for generating two-dimensional code picture
EP3457327B1 (en) Method and apparatus for generating two-dimensional code picture having dynamic effect
EP3605398B1 (en) Method and device for generating and identifying identification code
CN103218595B (en) The recognition methods of a kind of terminal and Quick Response Code
US11797810B2 (en) Machine-readable label generator
Kato et al. Pervasive 2D barcodes for camera phone applications
CN103400099B (en) Terminal and two-dimensional code identification method
Sutheebanjard et al. QR-code generator
EP2898451B1 (en) Information obtaining method and apparatus
WO2021169502A1 (en) A pixel image as well as its processing method and application system
CN106599758A (en) Image quality processing method and terminal
CN105701529A (en) Method of realizing color picture display on two-dimension code
CN106874818B (en) A kind of Digital Object Unique Identifier DOI recognition methods and device
CN103632724A (en) Nonvolatile storage chip sin burning method and system
CN101859398B (en) Two-dimensional array code
CN111222611B (en) Color-based stacked three-dimensional code encoding method, encoding device, decoding method, decoding device and storage medium
Liu et al. Embedded media markers: marks on paper that signify associated media
CN106067054A (en) A kind of Quick Response Code based on QR code
CN108256610A (en) A kind of word is around the generation system and generation method of Quick Response Code
CN112884101A (en) Graphic code, graphic code encoding method and graphic code decoding method
CN109685186A (en) Extensive content customization method based on two-dimentional idle bit
CN106339907A (en) Data tracing interaction method
CN106779001B (en) Manufacturing method of gradient two-dimensional code

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190625

Termination date: 20200114