The invention relates to two-dimensional bar codes, and more specifically relates to two-dimensional bar codes that transmit a non-confidential primary message (such as a website address) and a confidential secondary message (such as a website user ID and/or password). In its most immediate sense, the invention relates to QR codes that can transmit the secondary message only to a video camera that is close to a video screen on which the QR code is displayed.
When a user enters a secure website (such as an email account or bank account) with his smartphone or tablet computer it is usually necessary to input a non-secure primary message (such as a website address) and a secure secondary message (such as a User ID and/or password) into a computer system. This is often done by inputting the secondary message on the keyboard of the smartphone or tablet computer. While this allows the user to enter the website, the secondary message can be obtained by a remotely located third party who trains a video camera on the keyboard or on the user's hands.
It would be advantageous to provide a user of a cellphone or a tablet computer with a way to enter a primary and a secondary message into a computer system while maintaining the security of the secondary message from a video camera trained on the screen of the cellphone or tablet computer.
One object of the invention is to provide a user of a cellphone or tablet computer with a way to input a primary and a secondary message into a computer system without the need to type on a keyboard.
Another object of the invention is to provide a way for such a user to input a primary and a secondary message into a computer system without making an electrical connection with the computer system.
Still another object of the invention is to provide a way for such a user to input a primary and a secondary message into a computer system by displaying encoded versions of the primary and secondary messages on the screen of the cellphone or tablet computer and bringing the screen near a video camera that is operatively connected to the computer system.
The invention proceeds from the realization that a two-dimensional bar code, and specifically a conventional QR code can be modified to permit a video camera located close to a video screen to capture both the primary and secondary messages, while preventing a remotely located video camera from capturing the secondary message. The modification involved is the use of an elongated colored marker (advantageously, an elliptical black dot) instead of the square black marker used in two-dimensional bar codes, including QR codes. The area of the marker is less than the area of the module in which the marker is located. Even though the video screen does not display the marker with high resolution, a video camera located close to the video screen can detect the orientation of the marker within its module. But, if the video camera is spaced far apart from the video screen, this detection cannot be reliably made. Hence, in accordance with the invention, elongated colored markers do double duty. The positions of the markers represent the primary message, and the orientations of the markers represent the secondary message.
In accordance with the invention, the primary message is encoded into the locations of the markers (the markers are “intensity-modulated” because a marker is either present or absent from each module in the bar code) and the secondary message is encoded into the orientation of the markers (the markers are also “orientation-modulated”). In the presently preferred embodiment, the intensity modulation occurs first and the orientation modulation happens afterward, using the intensity-modulated representation of the primary message as an input.
The secondary message is unreadable by a remote video camera because the markers are not captured by the remote cameras with high resolution. At a remotely located video camera, the orientation of a marker within a module is indiscernible, even though it may be feasible to identify the presence or absence of a marker within the module, as is done for a two-dimensional bar code. But if the camera is close to the video screen on which the marker is displayed, the orientation of the marker is evident, thereby permitting the secondary message to be decoded.
The maximum spacing between the video screen and the video camera at which the secondary message can be reliably decoded is determined by the size of the marker relative to the distance to the video marker. If the marker is relatively tiny, the camera and screen must be close to each other. If the marker is relatively large, the camera and screen can be placed further apart.
Significantly, the encoded primary message can be decoded using bar code decoders. This is because a non-blank marker-containing module is sufficiently dark that a conventional bar code decoder will read it as a square that is substantially darker than blank modules that do not contain a marker.
Advantageously, the markers are elliptical. In one embodiment, all the markers have the same shape and size. In another embodiment, the eccentricity of each marker is maintained while varying the size in accordance with the orientation of the marker. This improves decodability.
The patent or application file contains at least one drawing executed in color. Copies of this patent or patent application publication with color drawing(s) will be provided by the Office upon request and payment of the necessary fee.
The invention will be better understood in correction with the exemplary and non-limiting drawings, in which:
As a preliminary matter, the below-described preferred embodiment is a type of QR code. This is because of the ubiquity with which QR codes are used. However, persons skilled in the art know that a QR code is merely a specific type of two-dimensional bar code that is square in shape and has a predefined format. Other two-dimensional bar codes exist. For example, an Aztec code is a two-dimensional bar code commonly used for transportation applications such as airline tickets, a Datamatrix code is a two-dimensional bar code used for small items, goods, and documents, and a PDF417 code is a two-dimensional bar code used to store large quantities of data. A conventional two-dimensional bar code is made up of a multiplicity of square regions (“modules”), which may be left entirely blank or marked entirely black with a square black marker. While the herein-described preferred embodiment is a type of QR code, a person skilled in the art will understand that the invention can be implemented in any type of two-dimensional bar code, specifically including Aztec, Datamatrix, and PDF417 codes. A QR bar code format is not required to practice the invention.
The preferred embodiment described in the following detailed description is described as a dual-modulated QR code, or DMQR. This is because the preferred embodiment has the format of a QR code but is both intensity-modulated and orientation-modulated. Furthermore, the marker described below is consistently identified as a black dot in the shape of an ellipse. This is presently preferred, but is not required. Other colors can be used instead, provided that the coloration is sufficiently intense, and the marker shape need not be elliptical or a dot, but rather need only be elongated. Advantageously, the size of each dot can be determined by the orientation of the dot; dots that are oriented other than horizontally or vertically can have larger sizes than dots that are oriented horizontally and vertically. This improves decodability. Additionally, the herein-described application runs on a cellphone and the cellphone optically communicates with a laptop webcam. Although this is presently preferred, neither a cellphone nor a laptop webcam is necessary for the practice of the invention. Any electronic device with a video screen (e.g. a tablet computer or a video monitor) can be used to display a code in accordance with the invention and any electronic device with a video camera can be used to receive a code in accordance with the invention.
DMQR codes in accordance with the invention use intensity and orientation modulation to embed primary and secondary data, respectively.
The top half of
The primary message embedding procedure for DMQR codes is analogous to and compatible with conventional QR code encoding. In particular, synchronization patterns, alignment patterns, and the geometry of data carrying modules are all identical to those in traditional QR codes. In
The procedure for embedding the secondary message involves modulating the orientation of the black elliptical dots resulting from the primary data modulation within their corresponding NB modules. First, the secondary message ms undergoes error correction encoding, which adds redundancy to allow for error recovery, and yields (encoded) secondary data cs. The secondary data cs is represented as a string of NB M-ary symbols cs,1, cs,2, . . . , cs,N
Specifically, if Δ denotes the length of either side of the square modules and (χ0i, ζ0i) denote the coordinates of the center of the ith module i, the region satisfying the constraint
is rendered as the black elliptical dot within the extent of the module, which is defined by (χ0i−Δ/2)≤χ≤(χ0i+Δ/2) and (ζ0i−Δ/2)≤ζ≤(ζ0i+Δ/2). Note that the length of the major axis of the ellipse matches the width/height Δ of the modules and is oriented along the angle ϕc
As an example,
As illustrated in
The embedded primary and secondary messages are decoded from the synchronized captured DMQR code image I(χ,ζ) using the procedure shown in the bottom half of
The primary message is decoded using a conventional QR code decoder. The reader performs intensity demodulation, i.e., estimates a (0/1) bit value for each data carrying module based on whether the module is blank or dark, i.e., whether the module contains a black elliptical dot. By XORing with the binary pattern used for the encoding, an estimate ĉp of the encoded primary data is first obtained. An error correction decoder corresponding to the error correction code used at the encoder decodes the message ĉp to recover an estimate of the primary message, {circumflex over (m)}p.
Additional secondary symbol synchronization is performed first by estimating which modules contained black elliptical dots, i.e. which modules were not blank. Specifically, using the decoded primary message {circumflex over (m)}p, the decoder can estimate the locations of the dot carrying modules by replicating the process used at the encoder for the primary message to identify the modules i, i=1, 2, . . . NB that (purportedly) carry the oriented black elliptical dots. Once secondary symbol synchronization is achieved, for simplicity of implementation, we use a version of the efficient heuristic orientation demodulation scheme proposed in Bulan, O., and Sharma, G. 2011. “High Capacity Color Barcodes: Per Channel Data Encoding via Orientation Modulation in Elliptical Dot Arrays.” IEEE Trans. Image Proc. 20 (5): 1337-50.
The I(χ,ζ) is binarized (at proximal distances, for which the secondary message can be reliably decoded, we observe very similar performance when decoding from either the binarized image or the captured grayscale image) to obtain (χ,ζ) and one-dimensional image moments are computed along the M orientation modulation angles. Specifically, for j=0, 1, . . . (M−1), the image moment along the orientation angle ϕj=πj/M is computed as
corresponds to the abscissa for the coordinate system obtained by rotating the coordinates (χ,ζ) counter-clock-wise by the angle ϕj, and
is the coordinate of the abscissa for the center of mass of the binarized image Ī(χ,ζ) in the rotated coordinate space. The angle ϕj that maximizes μji determines an estimated symbol ĉs,i, which can be mathematically expressed as
Finally, an error correction decoder corresponding to the code used to encode the secondary message decodes the demodulated secondary data ĉs to obtain an estimate {circumflex over (m)}s of the secondary message.
Apart from parameters inherited from the underlying QR code construction (e.g. module size, error correction level, etc.), DMQR codes have two additional parameters, M, the number of orientations used and ∈, which controls the eccentricity of the elliptical dots used. The number of orientations M impacts the reliability with which individual secondary modulated symbols can be detected, as is standard in most multi-level modulation schemes for digital communications. The eccentricity parameter ∈, which ranges between 0 and 1, impacts the modulation for both the primary and secondary data as illustrated in
Furthermore, the size of the dots can be varied with the orientations of the dots. The modulation for DMQR codes can be improved by using black oriented elliptical dots with different sizes for each modulation orientation such that each dot covers the maximum possible area of a square module without exceeding its boundaries. Specifically, as shown in
Consider the placement of an elliptical dot within its square module in the DMQR code. Specifically, let (χ,ζ) denote a 2D orthogonal coordinate system for the DMQR code and consider the region (χ0
χ(t)=a cos t cos ϕi+b sin t sin ϕi+χ0
ζ(t)=a cos t sin ϕi−b sin t cos ϕi+ζ0
The parameter ∈=a/b determines the eccentricity of the elliptical dots and the orientation ϕi=πcs,i/M is defined by the ith M-ary valued secondary data symbol cs,i (from the M possible orientations 0, n/M, . . . (M−1)π/M). To avoid inter-module interference, the length a of the semi-major axis should be chosen so as to ensure that the elliptical dot is contained fully within its module. The horizontal and vertical modulation orientations pose the most stringent constraints on a, and based on these, one could use a fixed value of a=Δ/2. While this constraint ensures that the elliptical dots are contained fully within the modules, the dots for orientations other than horizontal and vertical do not extend to the module boundaries and the modulation is therefore sub-optimal for both the primary data, where larger dots would make the modules darker and better distinguished from the white modules, and for the secondary data, where the different orientations are also better distinguished. To optimize the modulation, we therefore also choose a based on the modulation angle ϕi. Specifically, it can be readily seen that, subject to the aforementioned constraint, the largest possible length of the semi-major axis for the jth modulation orientation angle πj/M, for j=0,1, . . . (M−1), is
where θj=π/2 for M/4<j<3M/4 and θj=0 otherwise.
DMQR codes were created using the encoding process described above with the primary message mp as a URL and the secondary message as a secure password obtained from a strong password generator website (https://passwordsgenerator.net/). Values M=2, 4, 8 were used for embedding the secondary data. Error correction encoding of the primary and secondary messages was performed using, respectively, the level M error correction ISO/IEC. 2006. “Information Technology—Automatic Identification and Data Capture Techniques—QR Code 2005 Bar Code Symbology Specification.” http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=43655 (a Reed-Solomon code capable of correcting approx. 15% errors) for conventional QR codes and a rate 1/2 convolutional code Wilson, S. G. 1996. Digital Modulation and Coding. Upper Saddle River, N.J., USA: Prentice Hall. We note that to maintain compatibility with conventional QR code decoders, the error correction code for the primary data also needs to be compatible with the QR code standard ISO/IEC. 2006. “Information Technology—Automatic Identification and Data Capture Techniques—QR Code 2005 Bar Code Symbology Specification.” http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=43655, however, error correction for secondary data is not similarly constrained and can be chosen independently from among the many available options. (Another choice for error correction for secondary data is discussed below.) Convolutional codes were chosen in this implementation because they are readily available and the lack of a block-length constraint makes it easy to handle the variable length of the secondary data without having to switch codes. To facilitate synchronization, a uniform blank border 15% of the size S of the DMQR code along each dimension was added. For accomplishing localization and synchronization, and for decoding the primary data, we used ZXing “ZXing C++ Port.” https://github.com/glassechidna/zxing-cpp, an open source QR code decoder, that handles the intensity demodulation and error correction decoding of ĉp. Additional implementation details can be found in Appendix A.
It will be noted that error correction need not be (and advantageously should not be) carried out using convolutional codes such as those just described. Modern 5G cellphones utilize channel models and soft decision encoding, and utilizing this alternate error correction technique will improve results when using 5G cellphones without degrading results when using previous generations of cellphones.
For soft-decision decoding, instead of estimating the demodulated secondary data ĉs and then using in a binary input convolutional decoder, bit-wise log-likelihood ratios (LLRs) Λ can be obtained from the orientation demodulation that can be used in more powerful soft-decision decoders. We develop a statistical channel model for the moment based demodulator used for our secondary data, which enables use of state of the art error correction with soft-decision decoding. We express the statistical model for the channel as a conditional probability density function ƒr(r|ϕj), where r is a vector constituted by M image moments obtained from the moment based demodulator whose values depend on the rotation angle ϕj. The conditional density function ƒr(r|ϕj) can be represented in parametric form where the parameters are estimated at the decoder. For instance, deviations from the conditional means given the rotation angle rotation angle ϕj can be modeled as Gaussian or Laplacian distributions.
To increase secondary message decoding performance, soft-decoding is enabled by exploiting the proposed channel model. Specifically, considering gray coded constellations for the orientation modulation, the channel knowledge is provided as a soft measure for the error correction decoder by using bit-wise log-likelihood ratios (LLRs) Λ, specifically
where b is a vector of bits that represents a gray coded M-ary symbol, and bl is the lth bit of b, for l=0, 1, . . . (log2(M)−1). Note that the last expression was obtained by considering Bayes' theorem and equiprobable symbols. Furthermore, the notation ϕb is used instead of ϕj to show how the bit-wise LLRs Λ are computed, and indicate the use of gray coding, which can be handled by the DMQR code decoder without problem.
The decoders for Polar or LDPC codes from the 5G NR standard work with LLRs and the preceding computation of LLRs therefore allows us to encode the secondary message of a DMQR code using these codes (as well as alternative error correction codes that require LLRs for soft decoding).
To characterize performance, for both primary and secondary data we used two evaluation metrics: bit error rate (BER) which characterizes the performance at the modulation subsystem level and decoding success rate (DSR) for the messages, which quantifies the performance for the overall system. Specifically, the BER for the primary and secondary data indicates the percentage of erroneous bits, i.e., the percentage of bits in which cp differs with ĉp and cs differs with ĉs, respectively. Similarly, the DSR for the primary and secondary messages indicates the percentage of barcodes from which the messages mp and ms, respectively, are successfully recovered after error correction decoding.
The simulations allow us to effectively explore the system performance for different choices of M and the aforementioned trade-off between primary and secondary data modulation robustness over a wide range of values for the eccentricity parameter ∈, without being overly burdensome in terms of time requirements, and without being impacted by sources of experimental variation (though the simulations do include noise). Specifically, through the simulations, we investigated the performance of DMQR codes for M=2, 4, 8 orientations and values of ∈=0.1, 0.2, . . . , 1.0.
The set-up shown in
The experiments used three different smartphones for displaying the DMQR/QR codes and to capture the images of these barcodes for decoding, we use three laptop webcams and a tablet's front facing camera. The specifications for the capture/display devices are listed in Table 1. The captured images were then used for decoding the DMQR/QR codes using our decoder implementation described earlier.
In addition to the BER, the DSR was also evaluated in the experiments both for the DMQR codes and conventional QR codes.
For the DMQR codes, the URL https://labsites.rochester.edu/gsharma/ was used as the primary message mp and the secure passwords g5r[GRw}{circumflex over ( )}Gu*kk{circumflex over ( )}c:Q)s, g5r[GRw}{circumflex over ( )}Gu*kk{circumflex over ( )}c:Q)s/:Sys7q?cgvA5rCM: !s %, and wUXk_}K7ygV!(5{circumflex over ( )}b\backslash.N8y7,wpK-aT} E-RnQ3>k8G}XtfT4yrbKJdGtu(g5r) served as the secondary messages ms for M=2, 4 and 8, respectively. The intensity modulated cp yields an encoded Ĩ0(χ, with 29 modules in the horizontal and vertical directions; thus, Ĩ0(χ,ζ) has 29×29=841 modules from which NB=330 (number of modules with ellipses). Error correction for the secondary data utilized a rate 1/2 maximum free distance binary convolutional code from (Cioffi, n.d. Table 10.1, pp. 160), which was first presented in (Johannesson and Zigangirov 1999). The specific code used the generator polynomials specified in octal by [457,755], which has a constraint length of 9 bits (corresponding to 29-1=256 states in the decoder trellis) and a free distance of 12 bits.
As stated above, although the preferred embodiment has been implemented in the format of a QR code, the invention can be implemented in any two-dimensional bar code by encoding data into the bar code modules by using a colored elongated marker instead of a black square and orienting the markers in accordance with the secondary message. A QR code format is not required to practice the invention.
Although a preferred embodiment has been described above, the invention is limited only by the following claims:
This invention was made with government support under grant number EEC-1559970 awarded by the National Science Foundation. The government has certain rights in the invention.
Number | Date | Country | |
---|---|---|---|
63106472 | Oct 2020 | US |