WO2018095149A1 - 嵌入有视觉图像的二维码的生成系统和方法以及读取系统 - Google Patents

嵌入有视觉图像的二维码的生成系统和方法以及读取系统 Download PDF

Info

Publication number
WO2018095149A1
WO2018095149A1 PCT/CN2017/105376 CN2017105376W WO2018095149A1 WO 2018095149 A1 WO2018095149 A1 WO 2018095149A1 CN 2017105376 W CN2017105376 W CN 2017105376W WO 2018095149 A1 WO2018095149 A1 WO 2018095149A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
module
dimensional code
modulation
information
Prior art date
Application number
PCT/CN2017/105376
Other languages
English (en)
French (fr)
Inventor
陈昌盛
周保建
Original Assignee
深圳大学
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 深圳大学 filed Critical 深圳大学
Publication of WO2018095149A1 publication Critical patent/WO2018095149A1/zh

Links

Images

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

Definitions

  • the present invention relates to a system and method for generating a two-dimensional code embedded with a visual image, and a reading system.
  • a two-dimensional code is a machine-readable data tag (barcode) that can carry various information including an object number, a network address, and the like.
  • the most common two-dimensional code is the quick response code (QR code). Since the QR code has a large data storage capacity, in addition to storing the product identification number, the QR code can also store the manufacturer's contact information, E-mail address, hyperlink to the website, and the like.
  • QR codes are widely used in mobile advertising as a tool to attract the attention of potential customers.
  • QR codes such as QR codes
  • QR codes usually consist of black squares and white squares, which are visually appealing and meaningful to humans, affecting the effectiveness of the QR code for promotional activities.
  • some product developers have realized the importance of human-readable information in two-dimensional codes, so various types of two-dimensional code technology with image information have appeared on the market.
  • These technologies embed the company's logo (logo), product images, portraits, landscape images, etc. in the two-dimensional code, making the QR code more intuitive to humans, and making the overall advertising effect more beautiful, thus increasing the number two.
  • FIG. 1 is a schematic diagram showing a conventional two-dimensional code 102, 104 including image information.
  • the two-dimensional code 102 represents a result obtained by directly embedding an image into a QR code.
  • the two-dimensional code 104 represents a result obtained by embedding image information into a two-dimensional code by a watermark operation.
  • the visual effect of the two-dimensional code 102 is improved compared to the conventional black-and-white QR code, and the human can understand the content of the two-dimensional code through the embedded image information.
  • the error correction capability of the QR code is limited, the number and range of free cells are also quite limited, and some bright color modules inevitably appear in the dark image area, thereby affecting the overall visual effect.
  • the QR code is inherent. The positioning image cannot be embedded in the visual image. These intrinsic patterns inevitably cover the content of some images and affect the display of visual effects.
  • U.S. Patent No. 8,894,445 to MOW et al. discloses a novel two-dimensional code 104 (see Fig. 1) in which image information is embedded, in which image information is embedded into two dimensions by a watermark operation.
  • the code in which image information is embedded, in which image information is embedded into two dimensions by a watermark operation.
  • the fusion effect of the picture and the two-dimensional code disclosed in the above U.S. patent does not achieve a satisfactory effect.
  • the reason is mainly that in the encoding process of the two-dimensional code, two fixed gray image-based watermark operations in the two-dimensional code unit block, so that the brightness in each unit is normalized to four limited brightnesses. The value will eventually be converted to a color image using the shading module, which causes the embedded image information to be distorted in each unit and an unnatural connection between the unit and the unit.
  • the present invention describes various systems, methods and apparatus that facilitate the generation and reading of two-dimensional codes embedded with visual images. According to these systems, methods and devices, on the one hand, the quality of an image embedded in a two-dimensional code can be maintained; on the other hand, even if there is distortion in the image, the two-dimensional code and the two-dimensional code can still be detected in a specific environment. In decoding.
  • One aspect of the invention describes a system for generating a two-dimensional code embedded with a visual image.
  • the system includes: a processor; a memory that stores at least a target message and an original image; an encoding module that converts the target message into bit data according to a prescribed encoding algorithm; and a modulation module that presets the tile
  • the pattern is modulated with the bit data to obtain a modulation template, and the modulation template is fused with the original image to generate a modulated image.
  • Corresponding methods and computer readable devices are also described in this specification.
  • Another aspect of the invention describes a system for reading a two-dimensional code embedded with a visual image.
  • the system includes: a graphic positioning module, determining a position of the positioning identifier from the acquired image including the two-dimensional code, and a separating module, extracting an image block representing the bit data by using the position of the positioning identifier, and extracting the image
  • the block is demodulated to separate the represented bit data; and the decoding module extracts the target message from the two-dimensional code based on the bit data obtained from the separation module and a predetermined decoding algorithm.
  • Corresponding methods and computer readable devices are also described in this specification.
  • FIG. 1 is a schematic diagram of two types of two-dimensional codes including image content used in the prior art
  • FIG. 2 is a schematic diagram of a two-dimensional code embedded with different visual images, in accordance with an embodiment of the present invention
  • FIG. 3 is an exemplary and non-limiting schematic diagram of a generation system of a two-dimensional code embedded with a visual image, in accordance with an embodiment of the present invention
  • FIG. 4A is an exemplary and non-limiting schematic diagram of a tile pattern used in a generation system of a two-dimensional code according to an embodiment of the present invention
  • FIG. 4B is a structure of a tile of a tile pattern shown in FIG. 4A.
  • 5A and 5B are schematic views of two specific examples of the tile of the tile pattern shown in FIG. 4B;
  • FIG. 6 is an exemplary and non-limiting schematic diagram of a modulation module in a two-dimensional code generation system in accordance with an embodiment of the present invention
  • FIG. 7 is an exemplary and non-limiting schematic diagram of a setting module of the modulation module shown in FIG. 6;
  • FIG. 8 is an exemplary and non-limiting schematic diagram of two different finder patterns in accordance with an embodiment of the present invention.
  • FIG. 9 is an exemplary and non-limiting schematic diagram of a system for detecting a two-dimensional code embedded with a visual image, in accordance with an embodiment of the present invention.
  • Figure 10 is an exemplary and non-limiting schematic diagram of the binary module shown in Figure 9;
  • FIG. 11 is an exemplary and non-limiting schematic diagram of a positioning module for locating a location identifier in a binary image, in accordance with an embodiment of the present invention
  • FIG. 12 is an exemplary and non-limiting flow diagram of a method of detecting a two-dimensional code embedded with a visual image, in accordance with an embodiment of the present invention
  • FIG. 13 is an exemplary and non-limiting flow diagram of a method of reducing noise in a two-dimensional code image to detect a two-dimensional code in the image, in accordance with an embodiment of the present invention
  • FIG. 14 is an exemplary and non-limiting flow diagram of a method of finding a location identification, in accordance with an embodiment of the present invention.
  • 15 is an exemplary and non-limiting schematic diagram of a system for decoding a message compiled in a two-dimensional code, in accordance with an embodiment of the present invention
  • 16 is an exemplary and non-limiting schematic diagram of a decoding module that decodes messages in a two-dimensional code, in accordance with an embodiment of the present invention
  • 17 is an exemplary and non-limiting flow diagram of a method of decoding a message compiled in a two-dimensional code, in accordance with an embodiment of the present invention
  • 18 and 19 are schematic, and non-limiting, flow diagrams, respectively, of a method of separating an image from a two-dimensional code, in accordance with an embodiment of the present invention.
  • the present invention generally relates to a visually appealing two-dimensional code embedded with a visual image.
  • the system or method described herein enhances the attractiveness of a two-dimensional code to humans by embedding high quality visual images.
  • a two-dimensional code 106 and a two-dimensional code 108 in which a visual image is embedded according to an embodiment of the present invention are shown.
  • the two-dimensional codes 106 and 108 are significantly more visually appealing and more reliable than the examples in the prior art two-dimensional codes 102 and 104.
  • the two-dimensional codes 106 and 108 retain most of the visual image, are visually easy to recognize, and therefore more visually appealing.
  • the embodiments of the present invention are mainly divided into three parts of encoding (generation), detection, and decoding (reading) of a two-dimensional code embedded with a visual image.
  • Encoding generally refers to generating a two-dimensional code with a visual image (hereinafter sometimes referred to as "image two-dimensional code” or “two-dimensional code”, such as the two-dimensional code 106 shown in FIG. 2).
  • Detection generally refers to acquiring (for example, photographing) an image (photograph or the like) containing an image two-dimensional code (for example, two-dimensional code 106) in an actual use environment, and identifying an image two-dimensional code in the image (for example, 106) )s position.
  • Decoding generally refers to obtaining relevant information (such as web page links or contact information) from an image of a two-dimensional code of an image of a determined location.
  • modules can be taken Use a variety of modules, applications, services, systems, and so on.
  • application can be a processor, a process running on a processor, an object, an executable, or a storage device and/or a computer.
  • application running on the server and the server can be modules.
  • One or more modules may reside in a process, and the modules may be arranged in one computer and/or distributed between two or more computers.
  • systems and methods for encoding (generating) a two-dimensional code (sometimes referred to as "image two-dimensional code” or “two-dimensional code") embedded with a visual image can generally be implemented by a computing device. Additionally, to facilitate coding, these systems and methods can employ a programming environment. In general, any programming language and environment that is easy to code can be used.
  • FIG. 3 is a schematic diagram showing a system 200 for generating a two-dimensional code in which a visual image is embedded, according to an embodiment of the present invention.
  • system 200 may include an encoding module 206 and a modulation module 208.
  • Encoding module 206 may encode target message 212 to generate bit data (ie, bitstream 216). That is, encoding module 206 can convert target message 212 into bit data in accordance with a specified encoding algorithm.
  • the modulation module 208 modulates the preset tile pattern with the generated bit data (bitstream 216) to obtain a modulation template, and fuses the modulation template with the original image to generate a modulated image.
  • system 200 can also include graphics module 210 that adds positioning identification 218 to the modulated image generated by modulation module 208.
  • system 200 can also generally include a memory 202 for storing instructions and the like, and a processor 204 for executing various instructions.
  • memory 202 and processor 204 can be a single computing device or a memory and processor of a computing device distributed throughout the network.
  • the processor 204 can control the execution of the encoding module 206, the modulation module 208, and the graphics module 210.
  • Memory 202 can store various results in the processing of processor 204. Additionally, memory 202 can store target message 212 and original image 214.
  • encoding module 206 can target message 212 according to a specified encoding algorithm. Encoding is performed to form a bitstream 216 (i.e., binarized information).
  • the target message 212 may be a text message input by a user who needs to create a two-dimensional code, for example, or a text message converted from other carriers (sound, video).
  • the text message may include characters such as letters, numbers, punctuation marks, or symbols. Due to the capacity limitations of the created QR code, the number of characters in the text message is limited to a certain range. In one example, the number of characters can be limited to less than 200. In another example, the number of characters can be limited to less than 100. In yet another example, the number of characters can be limited to less than 50.
  • the target message 212 may represent a related website, product, character, etc. of the company represented by the image embedded in the two-dimensional code.
  • the target message 212 may also represent information that provides a reward (eg, a discount or discount) to a person scanning the two-dimensional code of the image.
  • encoding module 206 can check if the length of the target message 212 is less than a limit amount of the number of characters of the two-dimensional code. If the length of the target message 212 is less than the limit of the number of characters, the target message 212 is converted to a binary data format, and the binary text information can be included in the header; if the length of the target message 212 is greater than the number of characters of the two-dimensional code The amount of restriction, you need to increase the size of the QR code.
  • the characters of the text message can be converted into another format defined by the character encoding library.
  • Different languages have their own coding schemes/standards.
  • ASCII American Standard Code for Information Interchange
  • UTF-8 Wide Text Markup Language
  • Other languages also have their own standards.
  • the characters of a text message can be converted to any other format defined by the character encoding library.
  • a character encoding library a single character within a text message can be encoded into a binary data codeword having a particular number of bits (eg, 8 bits).
  • the header can be placed at the front end of the encoded message.
  • the header may indicate the length of the character in the message and the encoding scheme employed in the decoding process (described later) of the image two-dimensional code.
  • the maximum number of characters allowed for the two-dimensional code according to the present embodiment is 34 characters. After converting it to binary form, the header occupies up to 6 binary bits.
  • the coding algorithm in the coding module 206 can be adopted. Error correction code to protect the data. Any error correction code that can detect and correct the error can be used. As an example, the error correction code of the present embodiment may employ a Reed-Solomon code.
  • Error correcting codes can detect and correct multiple character anomalies, including erasures and errors. Among them, erasure refers to an error symbol at a known location. An error is an error symbol at an unknown location.
  • the image two-dimensional code (for example, the image two-dimensional code 106 shown in FIG. 2) described herein has a visual image embedded in the two-dimensional code of the image, when the image is two-dimensionally detected in the two-dimensional code detection phase When the code is taken, the embedded image introduces additional interference in addition to the channel noise of the ordinary black and white two-dimensional code (for example, the QR code). Symbols of known locations that are corrupted by strong interference are likely to be erroneous and may be considered as erases, so both erase and error may occur. The number of errors and erasures that can be corrected (depending on the number of error correction symbols used) is given by:
  • t is the number of errors
  • e is the number of erasures
  • n is the number of total symbols
  • k is the number of data symbols
  • (n-k) is the number of error correction symbols.
  • the number of correctable erasures is twice the number of errors that can be corrected.
  • the maximum length N of the Reed-Solomon code is expressed by:
  • an 8-bit Reed-Solomon code it has 120 data symbols and 20 error correction symbols in order to correct up to 10 errors with a total length of less than 255. Therefore, 115 zeros can be padded to the data symbols so that 235 symbols are encoded. After the data is encoded, the padded zeros are removed and placed after the last data bit. When the data is decoded, the removed zeros are filled in the same way.
  • the modulation module 208 can modulate the bitstream 216 with the original image 214 to obtain a modulation template 412, described later.
  • the original image 214 may be a pre-stored image or an image input (photographed) by the user, and is not particularly limited. Additionally, the original image 214 can be of any type An image, such as a logo image, a cartoon character, or any other type of image.
  • the modulation template 412 output from the modulation module 208 is fused with the original image, thereby generating a modulated image 414 (see FIG. 6). In the present embodiment, the generated modulated image 414 can also be directly used as an image two-dimensional code.
  • the original image 214 may interfere with the reading process of the target message 212 in the final two-dimensional code.
  • the modulation amplitude and the like within the modulation module 208 can be increased to ultimately enable successful decoding.
  • the original image 214 can be in any format, including "bmp,” “gif,” “jpeg,” “tiff,” or any other form of image.
  • modulation module 208 can modulate a predetermined tile pattern with bitstream 216 to obtain a modulation template 412 (see FIG. 6) described later.
  • the tile pattern 300 can include a plurality of area blocks 302. As shown in FIG. 4B, each of the area blocks 302 has an edge area 3021 for identifying a neighboring area block and an information area 3022 containing bit information blocks.
  • the cell of the edge region 3021 is blank and is labeled "0".
  • each of the area blocks 302 in the tile pattern 300 can be identified by the edge area 3021.
  • the area block 302 may further include an information area 3022 including bit information blocks.
  • frequency information of a low frequency is preferably used to represent frequency information.
  • the high frequency information of the original image can be more retained, and thus, the image is two-dimensionally
  • the code can maintain more details of the original image (such as features such as image edges of high frequency components).
  • the low frequency frequency pattern does not require high processing of high frequency information (for example, the degree of sharpness corresponding to the image) during the reading of the subsequent image two-dimensional code, it can be applied to more imaging devices (for example, moving). Imaging device of a communication device).
  • the frequency pattern of the low frequency in the information area included in the area block 302 may be a two-dimensional Walsh-hadamard transform at the (1, 1) frequency.
  • the area of the remaining i ⁇ j unit cells (ie, the information area 3022) other than the edge area 3021 may be further divided into four areas (for example, four areas of the same size), and The unit cells of the two regions in the four regions are marked as '1', and the unit cells of the remaining two regions in the four regions are marked as '-1' (see FIG. 5A). . That is, in the information area 3022, bit information blocks are represented by different identifiers of the unit cells (for example, "0", "1", "-1"). In this case, it is possible to further ensure that most of the information of the modulated image described later remains at the low frequency, and therefore, subsequent decoding can be made easier and more stable.
  • the width or size of the area block 302, the edge area 3021, and the information area 3022 of the tile pattern 300 described above are all variable.
  • adjusting the size of the area block 302 of the tile pattern 300 can adjust the number of pixels occupied by the area block 302 of the tile pattern 300.
  • adjusting the width of the rim region 3021 and the size of the information region 3022 can adjust the visual effect and decoding stability. In general, the greater the width of the edge region 3021, the better the visual effect, but the decoding stability will be slightly worse.
  • the other unit cells (ie, the information area 3042) other than the unit cell of the edge area 3041 in the area block 304 are further divided into four areas (here, one area has one unit cell), and the four areas are made
  • the unit cells of the two regions in the diagonal are marked as '1', and the unit cells of the remaining two regions in the four regions are marked as '-1'.
  • the unit cell other than the unit cell of the edge area 3061 in the area block 306 is further uniformly divided into four areas (here, one area has 4 unit cells), and the four areas are in the right
  • the unit cells of the corner area are marked as '1', so that the unit cells of the remaining two areas of the four areas are marked as '-1'.
  • the preset tile pattern 300 is not particularly limited, and may be any predefined pattern, and the identifiers therein are not limited to "-1", “0", and “1".
  • the identification "-1", “0", “1” is only exemplary.
  • the logo used is not limited Integer.
  • the value can be any real number in the interval [-1, 1].
  • low-pass filtering includes, but is not limited to, Gaussian filtering, sinusoidal filtering, and the like. Low-pass filtering reduces the boundary effects of the modulated signal, thereby reducing discontinuities between adjacent modulated signals.
  • Modulation module 208 can include a corresponding module 402, a setup module 406, and a fusion module 408.
  • the corresponding module 402 can divide the original image 214 into a corresponding number of image blocks 404 according to a preset tile pattern (as described above by the region block) 300, and the image block 404 is from the original image 214.
  • a unit image block extracted from a feature component for example, a luminance component, which can represent information of a unit bit.
  • the setting module 406 can set the modulation template 412 based on the preset tile pattern 300 and the bit data (bit stream 216), and the amplitude of the modulation template 412 is obtained by the preset tile pattern 300 and the corresponding module 402. Image block 404 is determined.
  • the fusion module 408 can fuse the modulation template 412 with the original image 214 (specifically, the image block 404 of the original image 214) in accordance with the results of the settings module 406.
  • the fusion template 408 can fuse the modulation template 412 with the original image 214 according to the fusion rules such as addition and multiplication.
  • modulation module 208 can adjust raw image 214 to 225 pixels by 225 pixels.
  • Modulation module 208 can convert raw image 214 to a specified color space by a color space conversion step.
  • the color space includes, but is not limited to, YUV, YCbCr, HSL, HSV, and the like.
  • Modulation module 208 can modulate the feature components (e.g., luminance) in original image 214 with the bit information in bitstream 216.
  • Modulation module 208 can segment original image 214 (size 225 pixels x 225 pixels) into a plurality of image blocks representing a single piece of data.
  • the size of each image block may be 9 pixels x 9 pixels. As such, the total number of available image blocks is 625.
  • modulation is performed using the above-described predetermined tile pattern 300 (e.g., a tile pattern composed of the area block 302, the area block 304, or the area block 306).
  • FIG. 7 shows a schematic diagram of the setup module 406 in the modulation module 208.
  • the setting module 406 includes a bit modulation module 502, an amplitude scaling module 504, and a template value setting module 506.
  • the bit modulation module 502 can obtain bit information according to the input bit stream 216, and according to a preset modulation rule, such as a Binary phase-shift keying (BPSK) modulation rule, The acquired bit information "0" and “1" are mapped to the value E and respectively Where E is the modulation energy of BPSK, in this example, E can be set to 1. That is, the bit modulation module 502 can map the bit information in the bit data (bitstream 216) to the corresponding signal space point according to a preset modulation rule.
  • the amplitude scaling module 504 can scale the modulation amplitude of the modulation template 412 according to a predetermined scaling rule based on the modulated bit information.
  • the amplitude scaling module 504 can scale the modulation amplitude of the modulation template 412 according to the signal scaling point according to a predetermined scaling rule. Moreover, the template setting module 506 can determine the value on the modulation template 412 based on the modulation amplitude and/or tile pattern output by the amplitude scaling module 504.
  • the scaling rules can be linear or non-linear.
  • the value of the modulation template 412 is set according to the modulation amplitude of the output of the amplitude scaling module 504.
  • P ij is the corresponding value of the tile pattern 300 at the i, j coordinate point
  • M ij is the value of the modulation template 412 at the i, j coordinate point.
  • modulation module 208 During the processing of modulation module 208, the above modulation process is repeated until all of the bit data is fused with the corresponding image block. In addition, if there are any remaining image blocks, the process can add padding characters and modulate accordingly.
  • system 200 can also include graphics module 210.
  • graphics module 210 may add a location identification (sometimes a blank area may also be added) to the generated modulated image 414.
  • the positioning mark may be a rectangular frame (for example, a box) composed of a solid line portion and a broken line (dotted line) portion. In the reading of the image two-dimensional code described later, the positioning mark can be used to distinguish the two-dimensional code from the background. In the positioning identifier, the dotted line portion can be used to locate the coordinates of the block in the two-dimensional code and determine the physical size of the two-dimensional code.
  • the positioning identifier can be used to help locate the two-dimensional code position and the two-dimensional code. Any pattern whose size is measured during the detection as long as it has a mark on the boundary of the two-dimensional code.
  • the location identification 602 and location identification 604 shown in Figure 8 present two different location identifications. Wherein, the positioning mark 602 does not coincide with the embedded visual image, which facilitates saving the embedded high quality visual image.
  • the location identifier 604 may coincide with the three regions of the upper left, lower left, and upper right corners of the embedded visual image. The design of the positioning identifier facilitates identification that the region within the location identifier 604 is a scannable object.
  • the positioning indicator can also be used to minimize the error detection (or fault detection) of the QR code.
  • the number (or module) of blocks on the vertical and horizontal axes of the two-dimensional code positioning identifier described in the present embodiment is an odd number.
  • the blank area may be a blank area disposed around the positioning mark.
  • the location identification can help detect the two-dimensional code and transform it to the image at the correct location.
  • the setting of the blank area can further isolate the two-dimensional code from the external environment to suppress interference during reading of the two-dimensional code.
  • a typical positioning mark border width may be 4 pixels, and a blank area may have a width of 8 pixels.
  • detection and decoding of an image two-dimensional code are sometimes collectively referred to as "reading of an image two-dimensional code.”
  • the detection system and method for image two-dimensional code can generally be implemented by a mobile computing device.
  • the system and method can be programmed with one or more applications (eg, mobile applications) to receive images taken by a camera of the mobile computing device for ease of detection.
  • System 700 includes a memory 702 that can store instructions and the like.
  • System 700 also includes a processor 704 that executes instructions, various operations of the modules, or other various operations that facilitate operations associated with the instructions, modules, and the like.
  • Memory 702 and processor 704 can be a single computing device or a memory and processor of a computing device distributed throughout the network.
  • System 700 can include various modules for detecting a two-dimensional code.
  • detecting generally refers to acquiring a two-dimensional code in which a visual image is embedded in an actual environment.
  • system 700 can generate a binary image based on the image of the two-dimensional code in which the visual image is embedded.
  • the system 700 can look up the location identifier in the binary image and perform a perspective transformation of the binary image in the two-dimensional code based on the location identifier.
  • system 700 can include an image binarization module 706, a graphics positioning module 708, and a perspective transformation module 710.
  • the image binarization module 706 can generate a binary value having a binary signal based on the acquired image containing the two-dimensional code (eg, an image acquired by a camera on a mobile computing device), ie, the two-dimensional code image 804 shown in FIG. Image 806.
  • the graphics location module 708 can look up the location identification within the binary image 806.
  • the positioning indicator helps to find the position of the image two-dimensional code and is useful for determining the size of the image two-dimensional code.
  • the perspective transformation module 710 can perform a perspective transformation of the binary image 806 in the two-dimensional code to convert it into a square.
  • image binarization module 706 can convert the acquired image into a grayscale image.
  • the method of image binarization employed may generate a binary image 806 by a different algorithm, such as a global/local threshold algorithm.
  • image binarization module 706 can include a threshold module 802 that can convert two-dimensional code image 804 into binary image 806.
  • the two-dimensional code image 804 may be an image including a two-dimensional code.
  • the size of the two-dimensional code image 804 may be, for example, 400 pixels ⁇ 400 pixels, or may be other sizes.
  • threshold module 802 employs a local threshold algorithm to divide two-dimensional code image 804 into blocks of pixels that are 8 pixels by 8 pixels in size. After the pixel block is obtained, the contrast of the pixel block is calculated. If the contrast of the pixel block is less than 24, the average value of the block gray scale is "block gray scale sum / 64"; if the contrast is greater than or equal to 24, the average value of the block is set to "minimum gray value/2" . Therefore, when the contrast of the pixel block is lower than a certain value (24 in this example), the pixel block can be considered to be a full black area or an all white area.
  • these local averages are composed into a grid (for example, the grid size is 5 blocks ⁇ 5 blocks or 40 pixels ⁇ 40 pixels).
  • the average of the acquired values is calculated and used as a local threshold to eliminate additional image noise (eg, streaks caused by interference from the display). Since the location marker tends to have a lower gray value, this calculation can eliminate unwanted noise while preserving the grayscale within the location marker.
  • the location module 708 can look up the location identification in the binary image 806.
  • the positioning module 708 performs multiple detections per frame (eg, 3 times per frame). Among them, each time the detection fails, the initial size of the detection is increased, and the positioning identifier is tried again.
  • FIG. 11 shows an example of a graphical positioning module 708.
  • the graphics positioning module 708 can include an angle finding module 902, a verification module 904, and an expansion module 906.
  • the traverse module 902 can find the location of the location identification based on the two-dimensional code.
  • the angle finding module 902 can find the four corners of the intended location identification.
  • the four corners may be the first block in the upper left corner, the lower left corner, the upper right corner, and the lower right corner in the two-dimensional code image, respectively. These four corners can be represented by C tl , C bl , C tr and C br , respectively.
  • the number of data blocks on the upper, lower, left and right boundaries can be expressed as T t , T b , T l and T r .
  • T t , T b , T l and T r represent the number of data blocks extracted from the first row, the last row, the first column and the last column, respectively.
  • T t , T b , T l , T r 25. This is the basis for the verification module 904 to verify the accuracy of the angle finding module 902.
  • the number of data blocks can be detected using the boundaries in the location identifier (eg, the first row, the pixel from C tl to C tr ). If the gray level changes from a high brightness (for example, 255) gray level to a low brightness (for example, 0), or from a low brightness (for example, 0) to a high brightness (for example, 255), the stop position of the current data block is recorded and The starting position of the next data block. Detection continues until the end of the row of pixels is reached. Based on the number of high-brightness and low-brightness conversions at the pixel points of this row, the number of data blocks (T t ) in the X direction can be determined. Similarly, the value of T b can be obtained based on a horizontal row of pixels from C bl to C br on the horizontal border.
  • the number of data blocks in each column can be calculated in the same way in the Y-axis direction.
  • the vertical frame e.g., from C tr to a pixel C tr
  • the value of T l can be obtained based on a column of pixels from C tl to C bl on the vertical border.
  • the verification module 904 can verify the accuracy of the location of the location identification based on the characteristics of the location identification. That is, the verification module 904 can verify the correctness of the four corners of the location identification based on one or more constraints. In the example, verification based on two constraints can be performed. The first constraint guarantees that the difference between the number of data blocks between the left and upper sets of frames must be less than or equal to 1, ie
  • the extension module 906 may expand the initial search area or/and change the initial search location for relocation. If the corners pass validation, the four corners can be matched to the appropriate vertices.
  • the initial size of the detection frame can be set to a value (for example, 80 pixels ⁇ 80 pixels)
  • the expansion module 906 may increase the detection range of the search area (eg, 15 pixels by 15 pixels); the detected initial position is a specified point of the image (eg, the center of the image), and the expansion module 906 may increase the initial search area range (eg the lower left area of the image).
  • a two-dimensional perspective transformation can be performed to calibrate the captured data using the decoding process described later.
  • the perspective transformation module 710 can perform a perspective transformation on the binary image 806 in the two-dimensional code based on the location identification. Through perspective transformation, the distortion of the binary image 806 can be corrected, and the binary image 806 is transformed into a square to reduce the non-uniformity of the binary image 806 in the X-Y axis direction.
  • 12 to 14 illustrate a method of detecting a two-dimensional code in which an image is embedded.
  • the method (or algorithm) described and illustrated is described as a series of acts. It should be understood that the various embodiments are not limited to the illustrated acts or acts. For example, the acts may occur in various orders and/or concurrently (or with other acts described herein).
  • step 1002 a binary image is generated based on the acquired image containing the two-dimensional code (eg, a two-dimensional code image recorded by a camera). If the image is a color image, it must be converted to a grayscale image before it is converted to a binary image.
  • the binary image can be generated based on a local threshold algorithm.
  • step 1004 the location of the location identification is sought within the binary image.
  • the location of the location identification may include the coordinates of the four corners of the location identification.
  • step 1006 a two-dimensional perspective transformation of the binary image is performed according to the positioning identifier.
  • the shape of the binary image is transformed into a square using the coordinates of the positioning identifier.
  • the size of the square is 400 pixels by 400 pixels. The transformation can reduce the X-axis and Y-axis direction non-uniformity and the non-uniformity of the mesh.
  • step 1102 the two-dimensional code image is divided into image blocks and the contrast of the image block is calculated. If the contrast is less than 24, the average of the gray levels of the image blocks is the sum of the block gray levels /64. If the contrast is greater than or equal to 24, the average value of the image block is set to "block minimum gray value/2". Therefore, when the contrast of the image block is below a certain value (24 in this example), the image block is a complete black area or an all white area.
  • step 1104 image blocks (which may also be considered “data blocks”) may be combined into Grid (for example, 5 blocks x 5 blocks).
  • noise can be removed from the mesh using, for example, mean filtering.
  • step 1108 noise such as near the location identification can be removed from the grid by lowering the threshold of the grid. In this step, since the positioning mark tends to have a lower gray value, the calculation for removing the unwanted noise (noise) still retains the gray level in the positioning mark.
  • step 1202 the four corners of the possible location identification are sought, that is, the corners of the location identification (sometimes referred to as the "positioning graphics") are located.
  • the four corners may be, for example, the first block in the upper left corner, the lower left corner, the upper right corner, and the lower right corner in the two-dimensional code image.
  • step 1204 the corner position (corner) of the location identification is verified according to the constraints.
  • the verification can be based on two constraints. The first constraint guarantees that the difference in the number of modules between the left and upper sets of frames must be less than or equal to 1; the second condition ensures that the difference in the number of modules between the right and upper sets of frames must be less than or equal to 1.
  • Verification based on the location of the four corners of the location identification ensures that no faults are detected.
  • the verification action of step 1202 and the verification action of step 1204 are repeated until the corner passes verification.
  • the size of the detection frame can be increased to try to find the location identification.
  • step 1206 if the corner points pass verification, the position of the corners is matched to the appropriate vertex.
  • Systems and methods for decoding a two-dimensional image of an image can generally be implemented by a mobile computing device (eg, a tablet or smart phone).
  • the system and method can be programmed with one or more applications (eg, mobile applications) to receive images that are detected by the mobile computing device and preprocessed (according to the detection algorithm described above) for decoding.
  • applications eg, mobile applications
  • System 1300 includes a memory 1302 that can store instructions, modules, and the like.
  • System 1300 also includes a processor 1304.
  • the processor 1304 can execute instructions, modules, or other various operations related to instructions, modules, and the like.
  • Memory 1302 and processor 1304 can be a single computing device or a memory and processor of a computing device distributed over a network.
  • System 1300 can include various modules for a data decoding process for a two-dimensional code.
  • System 1300 can separate the bitstream from the two-dimensional code. After separation, system 1300 can decode the content within the two-dimensional code using a Reed-Solomon detection algorithm.
  • system 1300 can include a separation module 1306 and a decoding module 1310 that can perform or facilitate the operations of separation module 1306 and decoding module 1310.
  • Separation module 1306 can separate bitstream 1308 from the two-dimensional code.
  • the decoding module 1310 can perform data decoding on the content of the two-dimensional code using a Reed Solomon detection algorithm.
  • the two-dimensional code image Before the separation module 1306 separates the bitstream 1308 from the image of the two-dimensional code, the two-dimensional code image must be converted to a specified color space (eg, YUV, YCbCr, HSL, HSV, etc.) and the specified luminance component is extracted ( For example, Y in YUV and YCbCr color space, L in HSL color space, V in HSV color space, etc.).
  • a specified color space eg, YUV, YCbCr, HSL, HSV, etc.
  • the coordinates of the data block can be detected in the X direction and the Y direction along the X axis and the Y axis, respectively.
  • the boundary records the stop position of the current data block and the start position of the next data block.
  • the test continues until the final X coordinate is reached.
  • the position of the data block in the X direction can be determined, or the start position and the end position of the coordinates of each column can be collected.
  • the number of columns of blocks stored in the X direction can be detected. If there is no column with a T t number, it is considered an error.
  • the resulting data block can sometimes result in the inability to obtain the correct data due to inaccurate corner position and perspective transformation. In this case, it can be considered that the decoding failed.
  • the coordinates of the image block can be detected in the Y-axis direction in the same manner.
  • the obtained image block coordinates are recorded in the image block storage in the Y direction.
  • the size of the image block is adjusted to a standard size (for example, 9 pixels x 9 pixels) before the bit stream 1308 is acquired.
  • Each of the extracted blocks is matched with the tile pattern 300, and the matching manner includes but not Limited to Matched Filtering, Correlation, and the like.
  • the tile pattern 300 and the extracted image block may be first normalized into blocks having the same size (for example, 9 pixels ⁇ 9 pixels) and the average value is 0, and then the tile pattern 300 is further Multiplies the position corresponding to the image block and accumulates the final result. which is,
  • i, j are the X and Y coordinates of the image block and the tile pattern, versus These are the tile patterns and image blocks after the values and sizes are normalized, and R is the matching response.
  • the binary data value carried by the image block can be obtained based on the value of the matching response. Wherein, when the matching response R>0, the acquired binary data is “0”; when the matching response R ⁇ 0, the acquired binary data is “1”. After the carried bit information is separated from the image block, the decoding module 1310 can decode the bit stream 1308.
  • the decoding module 1310 is shown in more detail in FIG.
  • the decoding module 1310 includes a Reed-Solomon decoding module 1402 and a message decoding module 1404.
  • the Reed-Solomon decoding module 1402 can receive the bitstream 1308 and perform error and erase correction (or error and erase correction decoding).
  • error and erase correction decoding improves the accuracy of QR code detection compared to techniques that only apply error correction.
  • Errors and erasure correction algorithms can be implemented on the two-dimensional code embedded in the visual image, since noise is introduced through the environment or the channel from which the image is acquired, thereby damaging the data and causing the decoder to fail to decode.
  • the error and erasure correction algorithm can be any algorithm capable of detecting errors and erasing and correcting errors and erasures.
  • the error detection algorithm can overcome the noise caused by embedding in a two-dimensional code image based on Reed-Solomon error and erasure correction codes.
  • the number of corrective errors and erasures is given by:
  • t is the number of errors
  • e is the number of erasures
  • n is the number of total characters
  • k is the number of data symbols
  • (n-k) is the number of error correction symbols.
  • the number of erasures that can be corrected is twice the number of errors that can be corrected.
  • message decoding module 1404 can decode target message 1406. After being decoded by the decoding module 1404, the target message can be displayed. For example, the target message can be displayed on the screen of the mobile computing device.
  • 17 to 19 illustrate an example of a method of decoding a two-dimensional code of an embedded image.
  • the method (or algorithm) described and illustrated is described as a series of acts. It is to be understood and appreciated that the embodiments are not limited to the illustrated acts or acts. For example, the acts can occur in various orders or simultaneously (or with other acts not described in this specification).
  • 17 is an exemplary and non-limiting flow diagram of a method 1500 of decoding a target message compiled in a two-dimensional code, in accordance with an embodiment of the present invention.
  • the modulated bit stream can be separated from the two-dimensional code.
  • the content represented by the two-dimensional code is decoded, that is, the separated bit stream is decoded.
  • the passed target element 1506 of the decoded target message in step 1504 is displayed.
  • the target message can be displayed with the image.
  • the original image and the target message can be displayed together on the screen of the tablet computing device or mobile phone.
  • 18 and 19 are exemplary, non-limiting, flow diagrams of methods 1600 and 1700 for separating target messages from a two-dimensional code, in accordance with an embodiment of the present invention.
  • Figure 18 shows the demodulation of the bitstream from the original image.
  • an image including a two-dimensional code embedded with a visual image is converted to a designated color space (eg, YUV, YCbCr, HSL, HSV, etc.).
  • the bit stream may be demodulated from a luminance component specified in the two-dimensional code image (eg, Y in YUV and YCbCr color space, L in HSL color space, V in HSV color space, etc.), that is, Demodulate the bit stream from the two-dimensional code.
  • Fig. 19 is an illustration of demodulating a bit stream from a binary image.
  • an image including a two-dimensional code embedded with a visual image may be converted into a binary image.
  • the coordinates of the image block may be acquired from the binary image (eg, using the boundaries of the positioning image) The coordinates at the start of the light and dark change of each block in the X-axis direction and the Y-axis direction).
  • the corresponding image block is obtained from the specified luminance component of the two-dimensional code image by using image block coordinates, and is separated from the modulated bit target message, that is, demodulated from the two-dimensional code by using image block coordinates. Bit stream.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

本发明提供了一种嵌入有视觉图像的二维码的生成系统,其包括:处理器;存储器,其至少存储目标消息和原始图像;编码模块,其根据规定的编码算法将目标消息转换成比特数据;以及调制模块,其将预设的平铺图案与比特数据进行调制以获得调制模板,并且将调制模板与原始图像进行融合,从而生成调制图像。本发明嵌入的视觉图像能够使人类能够从直观上理解二维码内在的目标消息,且并不妨碍读取设备对二维码进行解码。此外,本发明所提供的各种系统、方法和设备有利于将高质量的视觉图像嵌入到二维码中,使得人类能够对这类二维码有直观的感受。

Description

嵌入有视觉图像的二维码的生成系统和方法以及读取系统 技术领域
本发明涉及嵌入有视觉图像的二维码的生成系统和方法、以及读取系统。
背景技术
二维码是一种机器可读的数据标签(条形码),其可以携带包含物件编号、网络地址等各种信息。目前,最为常见的二维码是快速反应码(QR码)。由于QR码具有较大的数据存储容量,因此在QR码中除了存储产品标识编号,还可以存储生产商的联系信息、E-mail地址、网站的超级链接等。当前,QR码被广泛应用于移动广告中作为吸引潜在客户的注意力的工具。
然而,QR码等现有的二维码通常由黑色方块和白色方块组成,这些方块对于人类而言在视觉上的吸引力和意义比较弱,影响了二维码用于宣传活动的有效性。近年来,一些产品开发者意识到人类可读信息在二维码中的重要性,因此市面上出现了各类带图像信息二维码技术。这些技术在二维码内嵌入企业的标识(logo)、产品图片、人像、风景图像等,使二维码变得对人类而言更加直观,并且让整体广告效果变得更美观,从而增加二维码的被消费者扫描的可能性。
例如,图1是示出了现有的包含有图像信息的二维码102、104的示意图。其中,二维码102表示直接将图像嵌入到QR码而得到的结果。另外,二维码104表示通过水印操作使图像信息嵌入到二维码中所得到的结果。
如图1所示,与传统的黑白QR码相比,这种二维码102的视觉效果有所提升,并且人类可通过所嵌入的图像信息来理解二维码的内容。然而,由于QR码的纠错能力是有限的,空闲单元的数量与范围也是相当有限,一些亮色的模块无可避免地出现在了暗色的图像区域,从而影响了整体视觉效果。最后,为了保证解码的稳定性,QR码固有 的定位图像不能嵌入视觉图像,这些固有的图案无可避免地遮盖了部分图片的内容,并影响了视觉效果的展示。
另外,MOW等人美国专利第8948445号专利公开了一种全新的嵌入了图像信息的二维码104(参见图1),在这种二维码中,通过水印操作使图像信息嵌入到二维码中。然而,上述美国专利所公开的图片与二维码的融合效果并未达到令人满意的效果。其原因主要在于,在二维码的编码过程中,该二维码单元块内两种固定的基于灰度图像的水印操作,使每个单元内的亮度都被归一到四个有限的亮度值,最终再将用着色模块将灰度图像转换为彩色图像,这导致所嵌入的图像信息在每个单元产生了失真,而且单元与单元之间出现不自然的衔接。
发明内容
本发明描述了各种便于生成和读取嵌入有视觉图像的二维码的系统、方法和装置。根据这些系统、方法和装置,一方面能够保持嵌入到二维码中的图像的质量;另一方面,即使有图像存在失真,也仍然可以在特定的环境中检测二维码和从二维码中解码。
本发明的一方面描述了生成嵌入有视觉图像的二维码的系统。该系统包括:包括:处理器;存储器,其至少存储目标消息和原始图像;编码模块,其根据规定的编码算法将所述目标消息转换成比特数据;以及调制模块,其将预设的平铺图案与所述比特数据进行调制以获得调制模板,并且将所述调制模板与原始图像进行融合,从而生成调制图像。本说明书中还描述了相应的方法和计算机可读设备。
本发明的另一方面描述了读取嵌入有视觉图像的二维码的系统。该系统包括:图形定位模块,从所获取的包含二维码的图像中确定定位标识的位置,分离模块,通过所述定位标识的位置,提取出表示比特数据的图像块,并将所述图像块进行解调,以分离出所表示的比特数据;以及解码模块,基于从所述分离模块得到的所述比特数据、以及规定的解码算法,从所述二维码中提取出目标消息。本说明书中还描述了相应方法和计算机可读设备。
下面的描述和附图阐述了本说明书的某些方案。虽然这些方案是指示性的,但只是该说明书的各种实施方式可以采用的各种方法的一 小部分。当结合附图描述下述实施方式,本说明书的其他方案将变得清楚。
附图说明
以下,通过结合附图描述多个方案和实施方式,其中相同的附图标记指代相同的部件。
图1是现有技术中所使用的两种包含图像内容的二维码的示意图;
图2是根据本发明的实施方式的嵌入有不同视觉图像的二维码的示意图;
图3是根据本发明的实施方式的嵌入有视觉图像的二维码的生成系统的示例性且非限定性的示意图;
图4A是根据本发明的实施方式的二维码的生成系统中所使用的平铺图案的示例性且非限定性的示意图,图4B是图4A所示的平铺图案的区域块的结构的示例性且非限定性的示意图;
图5A和图5B是图4B所示的平铺图案的区域块的两个具体示例的示意图;
图6是根据本发明的实施方式的二维码的生成系统中的调制模块的示例性且非限定性的示意图;
图7是图6所示的调制模块的设置模块的示例性且非限定性的示意图;
图8是根据本发明的实施方式的两种不同的定位标识(finder pattern)的示例性且非限定性的示意图;
图9是根据本发明的实施方式的检测嵌入有视觉图像的二维码的系统的示例性且非限定性的示意图;
图10是图9所示的二进制模块的示例性且非限定性的示意图;
图11是根据本发明的实施方式的定位二值图像中定位标识的定位模块的示例性且非限定性的示意图;
图12是根据本发明的实施方式的检测嵌入有视觉图像的二维码的方法的示例性且非限定性的流程示意图;
图13是根据本发明的实施方式的减少二维码图像中噪声以检测该图像中的二维码的方法的示例性且非限定性的流程示意图;
图14是根据本发明的实施方式的寻找定位标识的方法的示例性且非限定性的流程示意图;
图15是根据本发明的实施方式的对二维码中编译的消息进行解码的系统的示例性且非限定性的示意图;
图16是根据本发明的实施方式的对二维码中的消息进行解码的解码模块的示例性且非限定性的示意图;
图17是根据本发明的实施方式的对二维码中编译的消息进行解码的方法的示例性且非限定性的流程示意图;
图18和图19分别是根据本发明的实施方式的从二维码中分离图像的方法的示例性且非限定性的流程示意图。
具体实施方式
下面,参照附图对发明内容的各个方面或特征进行说明,在说明书中,相同的附图标记指代相同的元件。
本发明大体涉及有视觉吸引力的嵌入有视觉图像的二维码。本发明所描述的系统或方法通过嵌入高质量的视觉图像来提高二维码对于人类的吸引程度。
参见图2,图2中表示了本发明的实施方式所涉及的嵌入有视觉图像的二维码106和二维码108。如图2所示,二维码106和108与现有技术中的二维码102和104中的例子相比,明显更富有视觉吸引力,而且性能更加可靠。特别地,二维码106和108保留了大部分视觉图像,在视觉上容易被识别,因此,更具有视觉吸引力。
本发明所涉及的实施方案主要分为嵌入有视觉图像的二维码的编码(生成)、检测和解码(读取)三个部分。“编码”一般是指生成带视觉图像的二维码(以下有时也称为“图像二维码”或“二维码”,例如图2所示的二维码106)。“检测”一般是指在实际的使用环境中获取(例如拍摄)包含图像二维码(例如二维码106)的图像(照片等),并在该图像中识别出图像二维码(例如106)的位置。“解码”一般是指从已确定位置的图像二维码的图像中获得相关信息(例如网页链接或联系信息)。
本发明中的“编码”、“检测”和“解码”中的每一个均可以采 用各种模块、应用程序、服务、系统等。如本说明书所使用的,术语“应用程序”、“服务”、“系统”、“模块”等旨在指代计算机相关的实体、硬件、软件(例如,运行中的软件)和/或固件。例如,模块可以是处理器,也可以是在处理器上运行的进程、对象、可执行程序,还可以是存储装置和/或计算机。作为示例的方式,在服务器上运行的应用程序和服务器都可以是模块。一个或多个模块可以驻留在进程中,模块可以布置在一台计算机和/或分布在两台或多台计算机之间。
图像二维码的编码(生成)
在本发明中,嵌入有视觉图像的二维码(有时也称为“图像二维码”或“二维码”)的编码(生成)的系统和方法一般可以由计算设备实现。另外,为了便于编码,这些系统和方法可以采用编程环境。一般而言,任何便于编码的编程语言和环境都可以采用。
图3示出了本发明的实施方式所涉及的生成嵌入有视觉图像的二维码的系统200的示意图。
在本实施方式中,系统200(有时也称为“生成系统200”)可以包括编码模块206和调制模块208。编码模块206可以对目标消息212进行编码,生成比特数据(即比特流216)。也即,编码模块206可以根据规定的编码算法将目标消息212转换成比特数据。另外,调制模块208将预设的平铺图案与所生成的比特数据(比特流216)进行调制而得到调制模板,并且将该调制模板与原始图像进行融合,从而生成调制图像。
另外,为了便于后续对嵌入有视觉图像的二维码进行读取,系统200也可以包括将定位标识218添加到由调制模块208生成的调制图像的图形模块210。
此外,系统200通常还可以包括用于存储指令等的存储器202、以及用于执行各种指令的处理器204。这里,存储器202和处理器204可以是单个计算设备,也可以是分布在整个网络上的计算设备的内存和处理器。处理器204可以控制编码模块206、调制模块208和图形模块210的执行。存储器202可以存储处理器204运算过程中的各种结果。另外,存储器202可以存储目标消息212和原始图像214。
如上所述,编码模块206可以根据规定的编码算法对目标消息212 进行编码,形成比特流216(即二进制化的信息)。目标消息212可以是由例如需要创建二维码的用户输入的文本消息或者由其他载体(声音、视频)转化而成的文本消息。这里,文本消息可以包括字母、数字、标点符号或符号等字符。由于所创建的二维码的容量限制,文本消息的字符数会被限制在一定范围。在一个示例中,字符数可以被限制为小于200个。在另一个示例中,字符数可以被限制为小于100个。在又一个示例中,字符数可以被限制为小于50个。
作为一个示例,目标消息212可以表示嵌入到二维码中的图像所代表的公司的相关的网站、产品、字符等。作为另一个示例,目标消息212也可以表示向扫描该图像二维码的人提供奖赏(例如,优惠或折扣)的信息。
另外,作为一个示例,编码模块206可以检查该目标消息212的长度是否小于二维码的字符数的限制量。如果该目标消息212的长度小于字符数的限制量,则将该目标消息212转换为二进制数据格式,并且可以将二进制文本信息包含在报头内;如果目标消息212的长度大于二维码的字符数的限制量,则需要增加二维码的容量大小。
在本发明中,文本消息的字符可以转换成由字符编码库所定义的另一种格式。不同的语言有自己的编码方案/标准。例如,对于英文字符,常用的标准是ASCII(美国信息交换标准码)。对于汉字,常用的标准是UTF-8(万国码)。其他语言也有自己的标准。文本消息的字符可以转换成由字符编码库所定义的任何其他格式。利用字符编码库,可以将文本消息内的单个字符编码成具有特定位数(例如,8位)的二进制数据码字。在文本消息被编码之后,可以将报头置于编码后的消息的前端。这里,报头可以指示图像二维码的解码过程(稍后描述)中消息中的字符长度和所采用的编码方案。
在一个示例中,本实施方式所涉及的二维码所允许的最大文本消息的字符数为34个。将其转换为二进制形式之后,报头占据最多6个二进制位。
此外,可以预见,在二维码传输过程中可能会引入错误(例如由于环境或信道的原因),这将损坏数据并最终有可能导致对消息的解码失败。因此,在本实施方式中,编码模块206中的编码算法可以采用 纠错码以保护数据。任何可以检测并纠正错误的纠错码都可以采用。作为一个示例,本实施方式的纠错码可以采用里德-所罗门(Reed-Solomon)码。
纠错码可以检测和纠正多个字符的异常,包括擦除和错误。其中,擦除指的是在已知位置的错误符号。错误则是指在未知位置的错误符号。
由于这里所描述的图像二维码(例如,图2所示的图像二维码106)具有嵌入到该图像二维码内的视觉图像,因此,当在二维码检测阶段中对图像二维码进行拍摄时,所嵌入的图像会引入除了普通黑白二维码(例如QR二维码)的信道噪声之外的额外干扰。被强干扰破坏的已知位置的符号很可能是错误的,并可能被认为是擦除,因此擦除和错误都可能发生。能够被纠正的错误和擦除的数量(取决于使用的错误校正符号的个数)由下式给出:
2t+e≤n-k
其中,t为错误个数,e是擦除个数,n是总的符号的数量,k是数据符号的数量,(n-k)是误差校正符号的数量。可纠正的擦除的数量是可以被纠正的错误的数量的两倍。
里德-所罗门码的最大长度N由下式表示:
N=2m-1
其中,m是每个符号的比特数。例如,如果m=8,则最大长度N=28-1=255。由于二维码不一定能容纳全部255个符号,因此在纠错码编码前,可以将零填充到二维码中使其总长度为255。
例如,对于一个8位的里德-所罗门码,其具有120个数据符号和20个纠错符号,目的是校正多达10个错误,其总长度小于255。因此,可以将115个零填充到数据符号,从而235个符号被编码。在数据被编码后,除去填充的零并将其放置在最末的数据比特之后。当数据被解码时,以同样的方式填充除去的零。
在目标消息212被编码模块206编码之后,调制模块208可以将比特流216与原始图像214进行调制以获得稍后描述的调制模板412。这里,原始图像214可以是预先存储的图像,也可以是用户输入(拍摄)的图像,没有特别限制。另外,原始图像214可以是任何类型的 图像,例如标识(Logo)图像、卡通人物或任何其他类型的图像。此外,在本实施方式中,从调制模块208输出的调制模板412与原始图像进行融合,从而生成调制图像414(参见图6)。在本实施方式中,所生成的调制图像414也可以直接作为图像二维码使用。
如果原始图像214具有复杂的形状或有许多边的形状时,原始图像214可能会妨碍最终二维码中的目标消息212的读取过程。在这种情况下,可以增加调制模块208内的调制幅度等,以便最终能够成功解码。原始图像214可以是任何格式的,包括“bmp”、“gif”、“jpeg”、“tiff”或任何其它图像形式。
如上所述,在系统200中,调制模块208可以将预设的平铺图案与比特流216进行调制以获得稍后描述的调制模板412(参见图6)。
在一个示例中,如图4A所示,平铺图案300可以包括多个区域块302。如图4B所示,各个区域块302具有用于识别相邻区域块的边沿区3021和包含比特信息块的信息区3022。
平铺图案300的各个区域块302的大小为(i+1)×(j+1)个单位格Mij(这里,例如i=j=0、1、2、3……)。边沿区3021是靠近平铺图案300的区域块302的外沿(部分边沿)的区域(例如M0j=0和Mi0=0)(参见图4B)。在一个示例中,令边沿区3021的单位格为空白,并标示为“0”。在这种情况下,在后述的调制模块208的调制过程中,便可以通过边沿区3021来识别平铺图案300中的各个区域块302。
另外,如图4A所示,区域块302还可以包括包含比特信息块的信息区3022。特别地,在该信息区3022中,优选使用低频的频率图案来表示频率信息。在这种情况下,在稍后描述的利用平铺图案和比特数据(比特流)来对原始图像进行调制过程中,可以更多地保留原始图像的高频信息,因此,这样的图像二维码能够更多地保持原始图像的细节(例如高频分量的图像边缘等特征)。另外,由于低频的频率图案在后续的图像二维码的读取过程中对高频信息(例如对应于图像的锐利程度)的处理要求不高,因此能够应用于更多的成像装置(例如移动通信设备的成像装置)。
另外,更优选地,区域块302所包括的信息区中的低频的频率图案可以是二维沃尔什-哈达玛(walsh-hadamard)变换在(1,1)频率 点上的频率图案。作为一个示例,具体而言,可以将除去边沿区3021以外的剩余的i×j个单位格的区域(即信息区3022)进一步分为4个区域(例如4个大小相同的区域),并且令该4个区域中处于对角线的两个区域的单位格均标示为‘1’,令该4个区域中的剩余的两个区域的单位格均标示为‘-1’(参见图5A)。也即,在信息区3022中,利用单位格的不同标识(例如“0”、“1”、“-1”)来表示比特信息块。在这种情况下,能够进一步确保稍后描述的调制图像的大部分信息保留在低频处,因此,能够使后续的解码更加容易和稳定。
另外,上述平铺图案300的区域块302、边沿区3021和信息区3022的宽度或大小均是可变的。一般而言,调节平铺图案300的区域块302的大小可以调节平铺图案300的区域块302所占的像素数。另外,调节边沿区3021的宽度和信息区3022的大小可以调节视觉效果与解码稳定性。一般而言,边沿区3021的宽度越大,视觉效果越佳,但解码稳定性会稍微差些。
作为一个示例,参见图5A,平铺图案300的区域块304(即区域块302的一个示例)的大小为3×3个单位格,边沿区3041(共5个单位格)为空白(M0j=0,Mi0=0,其中,i=j=0、1、2)。区域块304中的除了边沿区3041的单位格以外的其他单位格(即信息区3042)被进一步划分为4个区域(这里,1个区域有1个单位格),并且令该4个区域中处于对角线的两个区域的单位格均标示为‘1’,令该4个区域中的剩余两个区域的单位格均标示为‘-1’。
在另一个示例中,参见图5B,平铺图案300的区域块306(即区域块302的另一个示例)的大小为5×5个单位格,边沿区(共9个单位格)为空白(M0j=0,Mi0=0,其中,i=j=0、1、2、3、4)。同样地,区域块306中的除了边沿区3061的单位格以外的单位格被进一步均匀地划分为4个区域(这里,1个区域有4个单位格),并且令该4个区域中处于对角线的区域的单位格均标示为‘1’,令该4个区域中的剩余两个区域的单位格均标示为‘-1’。
在本实施方式中,预设的平铺图案300并没有特别限制,其可以是任何预定义的图案,当中的标识也不仅局限于“-1”,“0”,“1”。标识“-1”,“0”,“1”仅起示例性作用。另外,所使用的标识也不局限于 整数。通过对平铺图案进行平滑操作(smoothing),如低通滤波,当中的数值可以是在[-1,1]区间内的任意实数。其中,低通滤波包括但不局限于高斯滤波,正弦滤波等。低通滤波可以减少调制信号所带来的边界效应,从而减少相邻的调制信号之间的不连续性。
图6中示出了调制模块208的示例。调制模块208可以包括对应模块402、设置模块406和融合模块408。
在调制模块208中,对应模块402可以根据预设的平铺图案(如上所述,由区域块构成)300将原始图像214分成对应数量的图像块404,并且该图像块404是从原始图像214的特征分量(例如亮度分量)中提取出的单位图像块,其可以表示单位比特的信息。
另外,设置模块406可以基于预设的平铺图案300以及比特数据(比特流216)设置调制模板412,并且该调制模板412的幅度由上述预设的平铺图案300和从对应模块402得到的图像块404确定。
融合模块408可以依据设置模块406的结果来将调制模板412与原始图像214(具体而言是原始图像214的图像块404)进行融合。在本实施方式中,融合模板408可以按照加法、乘法等融合规则将调制模板412与原始图像214进行融合。
在一个示例中,调制模块208可以将原始图像214调整为225像素×225像素。调制模块208可以通过颜色空间转换步骤将原始图像214转换至指定的颜色空间。这里,颜色空间包括但不局限于YUV,YCbCr,HSL,HSV等。调制模块208可以将原始图像214中的特征分量(例如亮度)与比特流216中的比特信息进行调制。调制模块208可以将原始图像214(尺寸为225像素×225像素)分割成多个表示单个数据的图像块。例如,各个图像块的尺寸可以是9像素×9像素。如此,可用的图像块的总数为625。对于每个图像块与每一比特信息,使用上述预设的平铺图案300(例如,由区域块302、区域块304或区域块306构成的平铺图案)进行调制。
图7示出了调制模块208中的设置模块406的示意图。如图7所示,设置模块406包括比特调制模块502、幅度缩放模块504和模板值设置模块506。
在一个示例中,比特调制模块502可以根据所输入的比特流216 来获取比特信息,并根据预设的调制规则例如二进制相移键控(Binary phase-shift keying,BPSK)的调制规则,将所获取的比特信息“0”和“1”分别映射到值E和
Figure PCTCN2017105376-appb-000001
其中E为BPSK的调制能量,在此示例中,E可设置为1。也即,比特调制模块502可以根据预设的调制规则将比特数据(比特流216)中的比特信息映射到相应的信号空间点上。幅度缩放模块504可以根据经过调制的比特信息,按预定的缩放规则缩放调制模板412的调制幅度。也即,幅度缩放模块504可以根据该信号空间点,按预定的缩放规则缩放调制模板412的调制幅度。此外,模板设置模块506可以根据幅度缩放模块504输出的调制幅度和/或平铺图案等来决定调制模板412上的值。
在幅度缩放模块504中,缩放规则可以为线性或者非线性。在一个示例中,缩放规则可以为:Aij=αγ×bm。其中,i,j为平铺图案300上的坐标(i、j=0、1、2、3……),bm为经过映射的比特信息,α,γ均为实数,Aij为在i,j坐标点上对应的调制幅度。在一个示例中,α=15,γ=1,即Aij=15×bm
在模板值设置模块506中,根据幅度缩放模块504的输出的调制幅度,设置调制模板412的值。例如设置规则为:Mij=Aij×Pij。其中,Pij为在i,j坐标点上平铺图案300相应的值,Mij为在i,j坐标点上调制模板412的值。
在调制模块208的处理过程中,重复以上的调制过程,直到所有的比特数据与对应的图像块都进行了融合。另外,如果有任何剩余的图像块,则该过程可以加入填充字符,并进行相应的调制。
再参见图3,如图3所示,系统200还可以包括图形模块210。如上所述,比特流216与原始图像214经过调制模块208调制后,生成了调制图像414。接着,图形模块210可以将定位标识(有时也可以增加空白区)添加到所生成的调制图像414。在本实施方式中,定位标识可以是由实线部分和虚线(点线)部分组成的矩形框(例如方框)。在后述的图像二维码的读取中,定位标识可以用于将二维码与背景区分开。在定位标识中,虚线部分可以用于定位二维码中的块的坐标和判断二维码的物理尺寸。
如图8所示,定位标识可以是有助于定位二维码位置和在二维码 检测过程中测量其尺寸的任何图案,只要其在二维码的边界上具有标记即可。图8所示的定位标识602和定位标识604呈现了两种不同的定位标识。其中,定位标识602与所嵌入的视觉图像不重合,这便于保存所嵌入的高质量的视觉图像。另外,定位标识604则可能会与所嵌入的视觉图像的左上、左下以及右上角三个区域有重合,这种定位标识的设计便于识别定位标识604内的区域是可扫描的对象。
另外,定位标识也可以用来尽量减少二维码的错误检测(或故障检测)。本实施方式中所描述的二维码定位标识的垂直和水平轴上的块的个数(或模块)为奇数。
空白区可以是设置在定位标识的周围的空白区域。在解码之前,定位标识可以有助于检测二维码并将其变换到正确的位置的图像。而空白区的设置可以使二维码进一步与外部环境隔离,以抑制二维码读取期间的干扰。在本实施方式中,典型的定位标识边框宽度可以是4个像素,空白区的宽度可以是8个像素。
图像二维码的检测和解码(读取)
在本说明书中,有时将图像二维码的检测和解码统称为“图像二维码的读取”。图像二维码的检测系统和方法一般可以由移动计算设备实现。该系统和方法可以采用一个或多个应用程序(例如,移动应用程序)编程,以接收由移动计算设备的照相机拍摄的图像,以方便检测。
图9是根据本发明的实施方式的检测嵌入有视觉图像的二维码的系统700的示例性且非限定性的示意图。系统700包括可以存储指令等的存储器702。系统700还包括处理器704,处理器704执行指令、模块的各种操作,或者有利于与指令、模块等相关的其他各种操作的实施。存储器702和处理器704可以是单个计算设备或分布在整个网络上的计算设备的内存和处理器。
系统700可以包括用于检测二维码的各种模块。这里,“检测”一般指获取在一个实际的环境中嵌入有视觉图像的二维码。在获取包含二维码的图像之后,系统700可以基于嵌入有视觉图像的二维码的图像生成二值图像。接着,系统700可以寻找该二值图像中的定位标识,并基于定位标识进行二维码中二值图像的透视变换。
例如,如图9所示,系统700可以包括图像二值化模块706、图形定位模块708和透视变换模块710。图像二值化模块706可以基于所获取的包含二维码的图像(例如通过移动计算设备上的摄像机获取的图像)即图10所示的二维码图像804,生成具有二值信号的二值图像806。图形定位模块708可以寻找二值图像806内的定位标识。定位标识有助于寻找图像二维码的位置,并有利于测定图像二维码的尺寸。透视变换模块710可以将二维码中的二值图像806进行透视变换,以将其转换成正方形。
另外,图像二值化模块706可以将所获取的图像转化为灰度图。所采用的图像二值化的方法可以通过不同的算法例如全局/局部阈值算法来生成二值图像806。如图10所示,图像二值化模块706可以包括阈值模块802,该阈值模块802可以将二维码图像804转化为二值图像806。
在实施方式中,二维码图像804只要是包含二维码的图像即可。该二维码图像804的大小例如可以是400像素×400像素,也可以是其他尺寸。在一个示例中,阈值模块802采用局部阈值算法,将二维码图像804划分成大小为8像素×8像素的像素块。获得像素块后,计算该像素块的对比度。如果该像素块的对比度小于24,则块灰度的平均值是“块灰度总和/64”;如果对比度大于或等于24时,则该块的平均值设为“最小灰度值/2”。因此,当该像素块的对比度低于某个值(在本例中为24)时,可以认为该像素块是全黑色区域或全白色区域。
在计算出二维码图像的局部平均值后,这些局部平均值被组成网格(例如网格大小为5块×5块或40像素×40像素)。在这些网格内,计算所获取数值的平均值,并以此作为局部阈值,以消除额外的图像噪声(如,显示器的干扰造成的条纹)。由于定位标识往往具有较低的灰度值,因此该计算能够在保留了定位标识内的灰度情况下消除多余的噪声。
在图像二值化模块706生成二值图像之后,定位模块708可以在二值图像806中寻找定位标识。定位模块708对每帧进行多次检测(例如,每帧3次)。其中,每次的检测失败后,会增加检测的初始尺寸,并再次尝试寻找定位标识。
图11示出图形定位模块708的一个示例。图形定位模块708可以包括寻角模块902、验证模块904和扩展模块906。
寻角模块902可以基于二维码寻找定位标识的位置。具体而言,寻角模块902可以找到预期的定位标识的四个角。这四个角可以分别是二维码图像内的位于左上角、左下角、右上角以及右下角的第一块。这四个角可以分别以Ctl、Cbl、Ctr和Cbr来表示。
上、下、左与右边界上的数据块的数量可表示为Tt、Tb、Tl和Tr。其中,Tt、Tb、Tl和Tr分别表示从第一行、最后一行,第一列以及最后一列中提取的数据块的数量。在示例中,Tt,Tb,Tl,Tr=25。这是验证模块904验证寻角模块902准确度的依据。
数据块的数量可以利用定位标识中的边界(如第一行,从Ctl到Ctr的像素点)来检测。如果灰度级从高亮度(例如255)的灰度级变化到低亮度(例如0),或从低亮度(例如0)变换到高亮度(例如255),则记录当前数据块的停止位置和下一个数据块的起始位置。检测继续下去,直到达到这一排像素的最末尾。基于在此行像素点上高亮度与低亮度转换的次数,可以确定X方向上的数据块的数量(Tt)。同理,基于水平边框上从Cbl到Cbr的一排水平方向上的像素可获取Tb的值。
同理,可以用相同的方式在Y轴方向上计算得到每一列中数据块的数量。不同的是,将垂直的边框(如,从Ctr到Ctr的一列像素点)作为了检测Tr对象。同样地,基于垂直的边框上从Ctl到Cbl的一列像素点,可获取Tl的值。
验证模块904可以基于所述定位标识的特征,验证所述定位标识的位置的准确性。也即,验证模块904可以基于一个或多个约束条件来验证定位标识的四个角的正确性。在示例中,可进行基于两个约束条件的验证。第一个约束条件保证左-上两组边框间的数据块数量之差必须小于或者等于1,即|Tt-Tt|≤1;第二个条件则保证右-下两组边框间的数据块数量之差必须小于或等于1,即|Tr-Tb|≤1。
当基于预设的约束条件验证定位标识失败时,扩展模块906可以扩大初始搜索区域或/和改变初始搜索位置,以进行重新定位。如果边角通过验证,四个角可以被匹配到适当的顶点。在初始化阶段,检测帧的初始尺寸可以设置为一个值(例如,80像素×80像素),扩展模块 906可以增加搜索区域的检测范围(例如,15像素×15像素的尺寸);检测的初始位置为图像的一个指定的点(例如,图像的正中央),扩展模块906可以增加初始的搜索区域范围(例如图像的左下区域)。
在定位标识的四个角的坐标被检测之后,可以进行二维透视变换,以利用后述的解码过程中校准所捕获的数据。透视变换模块710可以基于定位标识对二维码中的二值图像806进行透视变换。经过透视变换,可以纠正二值图像806的畸变,将二值图像806变换为正方形,以减小二值图像806在X-Y轴方向的不均匀性。
图12至图14示出检测嵌有图像的二维码的方法。为了简化说明,描述和说明的方法(或算法)描述为一系列行为。应该理解,各实施方式并不限于所示的行为或动作的顺序。例如,行为可以以各种顺序发生和/或同时发生(或者伴随本说明书所述的其他行为)。
图12是根据本发明的实施方式的检测嵌入有视觉图像的二维码的方法1000的示例性且非限定性的流程示意图。在步骤1002中,基于所获取的包含二维码的图像(例如由相机记录的二维码图像)产生二值图像。如果该图像是彩色图像,在图像被转换为二值图像前,必须将其转化为灰度图。二值图像可以基于局部阈值算法而产生。
在步骤1004中,在二值图像内寻找定位标识的位置。定位标识的位置可以包括定位标识的四个角的坐标。步骤1006中,根据定位标识进行二值图像的二维透视变换。在此步骤中,利用定位标识的坐标,将二值图像的形状变换为正方形。在一个示例中,正方形的大小为400像素×400像素。变换后可减小X轴与Y轴方向不均匀性和网格的非均匀性。
图13是根据本发明的实施方式的减少图像中噪声以检测该图像中的二维码的方法1100的示例性且非限定性的流程示意图。在步骤1102中,将二维码图像划分成图像块,并计算图像块的对比度。如果对比度小于24,则图像块灰度的平均值是块灰度总和/64。如果对比度大于或等于24时,则该图像块的平均值设为“块最小灰度值/2”。因此,当该图像块的对比度是低于某个值(在本例中为24)时,该图像块是一个完全的黑色区域或全白色区域。
在步骤1104中,图像块(也可以视为“数据块”)可以被组合成 网格(例如,5块×5块)。在步骤1106中,可以利用例如均值滤波法从网格去除噪点。另外,在步骤1108中,可以进一步通过降低网格的阈值以从网格中去除例如定位标识附近的噪点。在该步骤中,由于定位标识往往具有较低的灰度值,因此去除多余噪点(噪声)的计算仍然保留了定位标识内的灰度。
图14是根据本发明的实施方式的寻找定位标识的方法1200的示例性且非限定性的流程示意图。在步骤1202中,寻找可能的定位标识的四个角,也即对定位标识(有时也称“定位图形”)的角落进行定位。这四个角例如可以为二维码图像内的位于左上角、左下角、右上角以及右下角的第一块。
在步骤1204中,根据约束条件验证定位标识的边角位置(角落)。在实施方式中,验证可以基于两个约束条件。其中,第一个约束条件保证左-上两组边框间的模块数量差别必须小于或者等于1;第二个条件则保证右-上两组边框间的模块数量差别必须小于或者等于1。
基于定位标识的四个角的位置的验证能够确保没有检测到故障。在一个示例中,通过重复步骤1202的定位动作和步骤1204的验证动作,直至角落通过验证。对于每次重复,可以增加检测框的尺寸以尝试寻找定位标识。在步骤1206中,如果角点通过验证,将边角的位置匹配到适当的顶点。
图像二维码的解码的系统和方法一般都可以由移动计算设备(例如,平板电脑备或智能电话)实现。该系统和方法可以采用一个或多个应用程序(例如,移动应用程序)编程,以接收由移动计算设备检测和(根据上述检测算法)预加工的图像,以便于解码。
图15是嵌入有视觉图像的二维码解码的系统1300的示例性且非限定性的示意图。系统1300包括可以存储指令、模块等的存储器1302。系统1300还包括处理器1304。处理器1304可以执行指令、模块或便于执行与指令、模块等相关的其他各种操作。存储器1302和处理器1304可以是单个计算设备或分布在网络上的计算设备的内存和处理器。
系统1300可以包括用于二维码的数据解码过程的各种模块。系统1300可以从二维码中分离出比特流。在分离之后,系统1300可以用里德-所罗门检测算法对二维码内的内容进行解码。
例如,系统1300可以包括分离模块1306和解码模块1310,处理器1304可以执行或便于执行分离模块1306和解码模块1310的操作。分离模块1306可以从二维码中分离出比特流1308。分离之后,解码模块1310可以利用里德索罗门检测算法对该二维码的内容进行数据解码。
在分离模块1306从二维码的图像中分离出比特流1308之前,二维码图像须被转换至指定的颜色空间(例如YUV,YCbCr,HSL,HSV等),并且提取出指定的亮度分量(例如YUV与YCbCr颜色空间中的Y,HSL颜色空间中的L,HSV颜色空间中的V等)。
根据定位标识中的黑/白块图案的位置,可以分别沿着X轴和Y轴在X方向和Y方向上检测数据块(有时也称为“图像块”)的坐标。数据块的Y坐标可以利用定位标识中的边界(例如第一行,始于x=400,y=1的一排水平方向上的像素)来检测。如果灰度级从高亮度(例如255)的灰度级变化到低亮度(例如0),或从低亮度(例如0)变换到高亮度(例如255),即找到两列数据块之间的边界,记录当前数据块的停止位置和下一个数据块的起始位置。检测继续下去,直到达到最终的X坐标。检测后,可以确定X方向上的数据块的位置,或收集每一列的坐标的开始位置和终止位置。可以检测存储在X方向上的块的列的数量。如果没有Tt数量的列,则视为出现错误。然后该检测的开始点可以移动到下一行(如x=399,y=1),继而重新开始数据块数量的检测,直到找到该数量的列(Tt)。所获得的数据块有时由于不准确的角点位置和透视变换,会导致不能获得正确的数据。在这种情况下,可以视为解码失败。
同理,可以用相同的方式在Y轴方向上检测图像块的坐标。不同的是,垂直的边框(例如,始于x=1,y=400的一列像素)作为检测图像块坐标的对象。在检测之后,所获得的图像块坐标被记录在的Y方向上的图像块存储中。
由于因使用者不同而成像设备(例如摄像机)与二维码图像之间有可能存在不同摄像距离,因此,在获得二维码图像时,所拍摄的图像有可能会产生不同的尺寸。因此,在获取比特流1308之前,图像块的尺寸被调整到标准的尺寸(例如,9像素×9像素)。
将提取的每个块与平铺图案300进行匹配,匹配的方式包括但不 限于匹配滤波(Matched Filtering)、相关性检测(Correlation)等。例如,对于匹配滤波方法,可以分别先将平铺图案300与所提取的图像块归一化为有同样大小(例如,9像素×9像素)且均值为0的块,再将平铺图案300与图像块对应的位置相乘,并将最后结果累加。即,
Figure PCTCN2017105376-appb-000002
其中i,j为图像块与平铺图案的X和Y坐标,
Figure PCTCN2017105376-appb-000003
Figure PCTCN2017105376-appb-000004
分别为在数值与大小都被归一化后的平铺图案与图像块,R为匹配响应。
图像块所携带的二进制数据值,可基于匹配响应的值来获取。其中,当匹配响应R>0时,获取的二进制数据是“0”;当匹配响应R<0时,获取的二进制数据是“1”。从图像块中分离出所携带的比特信息后,解码模块1310可以对比特流1308进行解码。
在图16中更详细展示出了解码模块1310。解码模块1310包括里德-索罗门解码模块1402和消息解码模块1404。里德-索罗门解码模块1402可以接收比特流1308,并进行错误和擦除校正(或者错误和擦除纠正解码)。与仅适用错误校正的技术相比,使用错误和擦除纠正解码改进了二维码检测的准确性。
由于在传输过程通过环境或获取图像的信道会引入噪声,从而损坏数据并导致解码器解码失败,因此可以对嵌入视觉图像的二维码实施错误和擦除纠正算法。错误和擦除校正算法可以是能够检测出错误与擦除并纠正错误与擦除的任意的算法。例如,错误检测算法可以基于里德-所罗门错误和擦除校正码来克服在二维码图像嵌入所带来的噪声。
在一个示例中,纠正错误和擦除的数量由下式给出:
2t+e≤n-k
其中,t为错误数,e是擦除数,n是总的字符的数量,k是数据符号的数量,(n-k)是错误校正符号的数量。能够修正的擦除的数量是能够修正的错误的数量的两倍。
里德-所罗门码的最大长度是:
N=2m-1,
其中m是每个符号的比特数。例如,如果m=8,最大长度N=28-1=255。由于这两个二维码不能放置全部255个符号,因此在纠 错编码前,可以将零填充到两个二维码中,以使总长度为255。
例如,对于一个8位的里德-所罗门码,其具有120个数据符号和20个纠错符号,以校正10个错误,其总长小于255。因此,可以将115个零填充到数据符号,从而编码235个符号。在数据被编码后,除去填充的零并将其放置在最末的数据比特之后。当数据被解码时,以同样的方式填充除去的零。
在校正后,消息解码模块1404可以解码出目标消息1406。在被解码模块1404解码之后,该目标消息可以被显示。例如,该目标消息可以显示在移动计算设备的屏幕上。
图17至图19示出对嵌入图像的二维码进行解码的方法的示例。为了简化说明,描述和说明的方法(或算法)被描述为一系列行为。可以理解和明白的是,各实施方式并不限于示出的行为或动作的顺序。例如,行为可以以各种顺序或同时(或者伴随本说明书所未述的其他行为)发生。图17是根据本发明的实施方式的对二维码中编译的目标消息进行解码的方法1500的示例性且非限定性的流程示意图。步骤1502中,可以从二维码中分离出调制的比特流。步骤1504中,对二维码表示的内容进行解码,也即对分离出的比特流进行解码。在步骤1506中,在步骤1504中解码得到的目标消息的通过元件1506来显示。例如,目标消息可以与图像一起显示。例如,原始图像和目标消息可以一起显示在平板计算设备或移动电话的屏幕上。
图18和19是根据本发明的实施方式的从二维码中分离目标消息的方法1600和1700的示例性且非限定性的流程示意图。
图18示出了从原始图像解调出比特流。在步骤1602中,将包括嵌入有视觉图像的二维码的图像转换至指定的颜色空间(例如YUV,YCbCr,HSL,HSV等)。在步骤1604中,可以从二维码图像中指定的亮度分量(例如YUV与YCbCr颜色空间中的Y,HSL颜色空间中的L,HSV颜色空间中的V等)解调出比特流,也即,从二维码中解调出比特流。
图19是从二值图像解调出比特流的说明。在步骤1702中,可以将包括嵌入有视觉图像的二维码的图像转换为二值图像。在步骤1704中,可以从二值图像获取图像块的坐标(例如,利用定位图像的边界 在X轴方向和Y轴方向上的每个块的亮暗变化开始处的坐标)。在步骤1706中,利用图像块坐标从二维码图像的指定亮度分量中取得对应的图像块,并分离出于所调制的比特目标消息,也即利用图像块坐标从二维码中解调出比特流。
虽然以上结合附图和实施例对本发明进行了具体说明,但是可以理解,上述说明不以任何形式限制本发明。本领域技术人员在不偏离本发明的实质精神和范围的情况下可以根据需要对本发明进行变形和变化,这些变形和变化均落入本发明的范围内。

Claims (13)

  1. 一种嵌入有视觉图像的二维码的生成系统,其中,
    包括:
    处理器;
    存储器,其至少存储目标消息和原始图像;
    编码模块,其根据规定的编码算法将所述目标消息转换成比特数据;以及
    调制模块,其将预设的平铺图案与所述比特数据进行调制以获得调制模板,并且将所述调制模板与所述原始图像进行融合,从而生成调制图像。
  2. 根据权利要求1所述的生成系统,其中,
    所述平铺图案包括多个区域块,
    所述区域块包括用于识别相邻区域块的边沿区、以及包含比特信息块的信息区。
  3. 根据权利要求1或2所述的生成系统,其中,
    在所述信息区中,使用低频的频率图案来表示频率信息。
  4. 根据权利要求3所述的生成系统,其中,
    所述低频的频率图案是二维沃尔什-哈达玛(walsh-hadamard)变换在(1,1)频率点上的频率图案。
  5. 根据权利要求1所述的生成系统,其中,
    还包括将定位标识添加至所述调制图像的图形模块。
  6. 根据权利要求1所述的生成系统,其中,
    所述调制模块包括:
    对应模块,其将所述原始图像划分成多个图像块并映射到相应的点阵码;
    设置模块,其根据所述比特数据和所述多个图像块来设置包含调 制幅度的调制模板;以及
    融合模块,其将所述调制模板与所述原始图像的像素值进行融合,使所述多个图像块携带相应的比特信息并生成所述调制图像。
  7. 根据权利要求6所述的生成系统,其中,
    所述融合模块将所述原始图像与所述调制模板以加法或乘法进行融合。
  8. 根据权利要求6所述的生成系统,其中,
    所述设置模块包括:
    比特调制模块,其根据预设的调制规则将所述比特数据中的比特信息映射到相应的信号空间点上;
    幅度缩放模块,其根据所述信号空间点,按预定的缩放规则缩放所述调制模板的调制幅度;以及
    模板值设置模块,其根据所述幅度缩放模块输出的调制幅度以及所述平铺图案来决定调制模板的值。
  9. 一种嵌入有视觉图像的二维码的生成方法,其中,
    包括:
    根据规定的编码算法将目标消息转换成比特数据;并且
    将预设的平铺图案与所述比特数据进行调制以获得调制模板,并且将所述调制模板与原始图像进行融合,从而生成调制图像,
    所述平铺图案包括多个区域块,所述区域块包括用于识别相邻区域块的边沿区以及包含比特信息块的信息区,
    在所述信息区中,使用低频的频率图案来表示频率信息。
  10. 根据权利要求9所述的生成方法,其中,
    所述低频的频率图案是二维沃尔什-哈达玛(walsh-hadamard)变换在(1,1)频率点上的频率图案。
  11. 一种嵌入有视觉图像的二维码的读取系统,其中,
    包括:
    图形定位模块,从所获取的包含二维码的图像中确定定位标识的位置,
    分离模块,通过所述定位标识的位置,提取出表示比特数据的图像块,并将所述图像块进行解调,以分离出所表示的比特数据;以及
    解码模块,基于从所述分离模块得到的所述比特数据、以及规定的解码算法,从所述二维码中提取出目标消息。
  12. 根据权利要求11所述的读取系统,其中,
    所述图形定位模块包括:
    寻角模块,基于所述二维码,寻找所述定位标识的位置;以及
    验证模块,基于所述定位标识的特征,验证所述定位标识的位置的准确性。
  13. 根据权利要求11所述的系统,其中,
    所述分离模块包括:
    匹配模块,将提取的各个图像块与预设的平铺图案进行匹配。
PCT/CN2017/105376 2016-11-28 2017-10-09 嵌入有视觉图像的二维码的生成系统和方法以及读取系统 WO2018095149A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611066667.7A CN106778996B (zh) 2016-11-28 2016-11-28 嵌入有视觉图像的二维码的生成系统和方法以及读取系统
CN201611066667.7 2016-11-28

Publications (1)

Publication Number Publication Date
WO2018095149A1 true WO2018095149A1 (zh) 2018-05-31

Family

ID=58904741

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105376 WO2018095149A1 (zh) 2016-11-28 2017-10-09 嵌入有视觉图像的二维码的生成系统和方法以及读取系统

Country Status (2)

Country Link
CN (1) CN106778996B (zh)
WO (1) WO2018095149A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826033A (zh) * 2018-08-14 2020-02-21 浙江大学 水印嵌入和水印提取方法、装置及设备和数据处理方法
CN111711819A (zh) * 2020-08-19 2020-09-25 长沙像素码科技有限公司 一种多元混进制的运算方法及其所得图像的应用系统
CN113506276A (zh) * 2021-07-15 2021-10-15 广东工业大学 一种测量结构位移的标志物及方法
CN113688645A (zh) * 2021-08-11 2021-11-23 广州爱格尔智能科技有限公司 一种识别方法、系统及设备
CN115310572A (zh) * 2022-08-05 2022-11-08 蚂蚁区块链科技(上海)有限公司 一种图形码的生成方法和图形码校验方法
CN116700637A (zh) * 2023-05-17 2023-09-05 国能龙源催化剂江苏有限公司 催化剂产品二维码打印方法、装置和电子设备

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106778996B (zh) * 2016-11-28 2019-05-14 深圳大学 嵌入有视觉图像的二维码的生成系统和方法以及读取系统
TWI684134B (zh) * 2017-07-24 2020-02-01 國立臺灣師範大學 圖像化二維條碼製作裝置及製作方法
CN108174217B (zh) * 2017-12-06 2021-01-19 广州索答信息科技有限公司 一种图像码的生成与解析方法、电子设备及存储介质
WO2020032930A1 (en) 2018-08-07 2020-02-13 Hewlett-Packard Development Company, L.P. Combination of image and machine readable graphic code
WO2020036605A1 (en) 2018-08-17 2020-02-20 Hewlett-Packard Development Company, L.P. Combined images and machine readable graphic codes
CN109100738B (zh) * 2018-08-20 2023-01-03 武汉理工大学 一种基于多传感器信息融合的可靠定位系统及方法
CN110874734A (zh) * 2018-08-31 2020-03-10 北京意锐新创科技有限公司 动态二维码生成方法和装置
CN109886380B (zh) * 2019-01-16 2021-08-31 王诗会 图像信息融合方法及系统
US11328202B2 (en) * 2019-07-22 2022-05-10 Rakuten Group, Inc. Information processing system, information code generating system, information processing method, and information code generating method
CN112183150B (zh) * 2020-10-16 2022-11-08 上海了物网络科技有限公司 图像二维码及其制备方法、解析装置和解析方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5313564A (en) * 1990-07-11 1994-05-17 Fontech Ltd. Graphic matter and process and apparatus for producing, transmitting and reading the same
CN102890787A (zh) * 2011-07-21 2013-01-23 顾泽苍 一种新型二维条码的构成方法
CN102887003A (zh) * 2011-07-21 2013-01-23 天津阿波罗电子有限公司 一种新型二维条码的激光刻印方法
CN103035032A (zh) * 2011-10-09 2013-04-10 天津市阿波罗信息技术有限公司 一种公共场所入场票的生成方法
CN106778996A (zh) * 2016-11-28 2017-05-31 深圳大学 嵌入有视觉图像的二维码的生成系统和方法以及读取系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5313564A (en) * 1990-07-11 1994-05-17 Fontech Ltd. Graphic matter and process and apparatus for producing, transmitting and reading the same
CN102890787A (zh) * 2011-07-21 2013-01-23 顾泽苍 一种新型二维条码的构成方法
CN102887003A (zh) * 2011-07-21 2013-01-23 天津阿波罗电子有限公司 一种新型二维条码的激光刻印方法
CN103035032A (zh) * 2011-10-09 2013-04-10 天津市阿波罗信息技术有限公司 一种公共场所入场票的生成方法
CN106778996A (zh) * 2016-11-28 2017-05-31 深圳大学 嵌入有视觉图像的二维码的生成系统和方法以及读取系统

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110826033A (zh) * 2018-08-14 2020-02-21 浙江大学 水印嵌入和水印提取方法、装置及设备和数据处理方法
CN111711819A (zh) * 2020-08-19 2020-09-25 长沙像素码科技有限公司 一种多元混进制的运算方法及其所得图像的应用系统
CN113506276A (zh) * 2021-07-15 2021-10-15 广东工业大学 一种测量结构位移的标志物及方法
CN113506276B (zh) * 2021-07-15 2023-06-02 广东工业大学 一种测量结构位移的标志物及方法
CN113688645A (zh) * 2021-08-11 2021-11-23 广州爱格尔智能科技有限公司 一种识别方法、系统及设备
CN115310572A (zh) * 2022-08-05 2022-11-08 蚂蚁区块链科技(上海)有限公司 一种图形码的生成方法和图形码校验方法
CN115310572B (zh) * 2022-08-05 2024-04-16 蚂蚁区块链科技(上海)有限公司 一种图形码的生成方法和图形码校验方法
CN116700637A (zh) * 2023-05-17 2023-09-05 国能龙源催化剂江苏有限公司 催化剂产品二维码打印方法、装置和电子设备
CN116700637B (zh) * 2023-05-17 2024-04-19 国能龙源催化剂江苏有限公司 催化剂产品二维码打印方法、装置和电子设备

Also Published As

Publication number Publication date
CN106778996B (zh) 2019-05-14
CN106778996A (zh) 2017-05-31

Similar Documents

Publication Publication Date Title
WO2018095149A1 (zh) 嵌入有视觉图像的二维码的生成系统和方法以及读取系统
US11675985B2 (en) Systems and methods for generating and reading intrinsic matrixed bar codes
US10817971B2 (en) System and method for embedding of a two dimensional code with an image
US8948445B2 (en) Embedding visual information in a two-dimensional bar code
US7950589B2 (en) Program, information storage medium, two-dimensional code generation system, image generation system and printed material
US8447122B2 (en) Animated image code, apparatus for generating/decoding animated image code, and method thereof
TWI528293B (zh) QR code
TWI543083B (zh) 產生二維條碼之方法
US10885411B2 (en) Machine-readable image encoding data
US10863202B2 (en) Encoding data in a source image with watermark image codes
JP4557866B2 (ja) 混合コード、及び、混合コードの生成方法と装置、記録媒体
US8009862B2 (en) Embedding data in images
Chen et al. PiCode: A new picture-embedding 2D barcode
TW201432576A (zh) 二維碼、二維碼之作成系統及解析程式
JP2007531094A (ja) カメラ写真から得られる画像から原データを抽出する方法
AU2007254619B2 (en) Barcode removal
US20140267369A1 (en) Image encoding and decoding using color space
Chen et al. RA code: A robust and aesthetic code for resolution-constrained applications
CN101359360A (zh) 一种图文融合的电子票编解码方法
US8243981B2 (en) Identifying embedded data in an image
US9129346B2 (en) Image fragmentation for distortion correction of color space encoded image
US8243985B2 (en) Bit pattern design for visible watermarking
JP5145833B2 (ja) 2次元コード読み取り装置、2次元コード読み取り方法、2次元コード読み取りプログラム及び記録媒体
US9014473B2 (en) Frame of color space encoded image for distortion correction
JP4874706B2 (ja) Qrコード読取装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17874273

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17/09/2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17874273

Country of ref document: EP

Kind code of ref document: A1