JP2020046878A - Two-dimensional code generation method and electronic apparatus - Google Patents
Two-dimensional code generation method and electronic apparatus Download PDFInfo
- Publication number
- JP2020046878A JP2020046878A JP2018174199A JP2018174199A JP2020046878A JP 2020046878 A JP2020046878 A JP 2020046878A JP 2018174199 A JP2018174199 A JP 2018174199A JP 2018174199 A JP2018174199 A JP 2018174199A JP 2020046878 A JP2020046878 A JP 2020046878A
- Authority
- JP
- Japan
- Prior art keywords
- inclination
- dimensional code
- reading surface
- mobile terminal
- reading
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
Description
本発明の実施形態は、二次元コード生成方法及び電子機器に関する。 An embodiment of the present invention relates to a two-dimensional code generation method and an electronic device.
QRコード(登録商標)などの二次元コードが普及している。二次元コードは、様々なシーンで用いられている。
二次元コードの印刷された普通乗車券も実用化されている。
Two-dimensional codes such as QR codes (registered trademark) are widely used. Two-dimensional codes are used in various scenes.
An ordinary ticket with a printed two-dimensional code is also in practical use.
しかしながら、ユーザが読取装置の読取面に対して二次元コードを傾けて翳すと、読取装置は、二次元コードが歪んだ状態の画像を取得する。読取装置は、二次元コードが歪んだ状態の画像から二次元コードを読み取るのは難しい。二次元コードの中には、歪みを修正する機能が盛り込まれたものも存在する。しかしながら、この機能によって修正できる歪みの大きさには限界がある。 However, when the user tilts and holds the two-dimensional code over the reading surface of the reading device, the reading device obtains an image in which the two-dimensional code is distorted. It is difficult for a reader to read a two-dimensional code from an image in which the two-dimensional code is distorted. Some two-dimensional codes include a function for correcting distortion. However, there is a limit to the amount of distortion that can be corrected by this function.
本発明の実施形態は、読取装置による読取精度を向上させるように電子機器に二次元コードを表示することを目的とする。 An object of an embodiment of the present invention is to display a two-dimensional code on an electronic device so as to improve the reading accuracy of a reading device.
実施形態に係る二次元コード生成方法は、水平な仮想面に対する携帯端末の傾きを示す情報を取得することと、水平な仮想面に対する読取装置の読取面の傾きを示す情報を取得することと、前記携帯端末の傾きと前記読取面の傾きとを比較することと、前記読取装置で読み取られる二次元コードであって、前記携帯端末の傾きと前記読取面の傾きとの比較結果に応じて異なる形の二次元コードを生成することと、前記携帯端末の表示部に前記二次元コードを表示することとを備える。 The two-dimensional code generation method according to the embodiment acquires information indicating the inclination of the portable terminal with respect to the horizontal virtual surface, and acquires information indicating the inclination of the reading surface of the reading device with respect to the horizontal virtual surface, Comparing the inclination of the mobile terminal with the inclination of the reading surface, and a two-dimensional code read by the reading device, the two-dimensional code being different depending on a comparison result between the inclination of the mobile terminal and the inclination of the reading surface. Generating a two-dimensional code of a shape; and displaying the two-dimensional code on a display unit of the mobile terminal.
以下、実施形態について図面を参照して説明する。
携帯端末1の構成について説明する。
Hereinafter, embodiments will be described with reference to the drawings.
The configuration of the mobile terminal 1 will be described.
図1は、携帯端末1の構成を例示するブロック図である。
携帯端末1は、二次元コードを表示する電子機器の一例である。
FIG. 1 is a block diagram illustrating the configuration of the mobile terminal 1.
The mobile terminal 1 is an example of an electronic device that displays a two-dimensional code.
携帯端末1は、CPU(Central Processing Unit)101、ROM(Read Only Memory)102、RAM(Random Access Memory)103、記憶部104、入力部105、表示部106、バッテリ107及びセンサ108を備える。 The mobile terminal 1 includes a CPU (Central Processing Unit) 101, a ROM (Read Only Memory) 102, a RAM (Random Access Memory) 103, a storage unit 104, an input unit 105, a display unit 106, a battery 107, and a sensor 108.
CPU101は、携帯端末1の各要素を制御するプロセッサである。CPU101は、処理部の一例である。CPU101は、ROM102または記憶部104が記憶するプログラムを実行することにより各種の処理を実行する。例えば、CPU101は、二次元コード生成用アプリケーションプログラムを実行し、二次元コード生成処理を実行する。二次元コード生成処理については後述する。 The CPU 101 is a processor that controls each element of the mobile terminal 1. The CPU 101 is an example of a processing unit. The CPU 101 executes various processes by executing a program stored in the ROM 102 or the storage unit 104. For example, the CPU 101 executes a two-dimensional code generation application program to execute a two-dimensional code generation process. The two-dimensional code generation processing will be described later.
ROM102は、CPU101が実行するプログラム及び制御データなどを記憶する。ROM102は、二次元コード生成用アプリケーションプログラムを記憶していてもよい。
RAM103は、ワーキングメモリである。
The ROM 102 stores programs executed by the CPU 101, control data, and the like. The ROM 102 may store a two-dimensional code generation application program.
The RAM 103 is a working memory.
記憶部104は、書換え可能な不揮発性のメモリである。記憶部104は、CPU101が実行するプログラム及び各種データなどを記憶する。例えば、記憶部104は、二次元コード生成用アプリケーションプログラムを記憶していてもよい。 The storage unit 104 is a rewritable nonvolatile memory. The storage unit 104 stores programs executed by the CPU 101, various data, and the like. For example, the storage unit 104 may store a two-dimensional code generation application program.
入力部105は、ユーザ操作による入力指示を受け付ける入力デバイスである。例えば、入力部105は、キーボードまたは表示部106に積層されたタッチパッドである。
表示部106は、各種画面を表示するデバイスである。例えば、表示部106は、液晶ディスプレイである。
The input unit 105 is an input device that receives an input instruction by a user operation. For example, the input unit 105 is a keyboard or a touchpad stacked on the display unit 106.
The display unit 106 is a device that displays various screens. For example, the display unit 106 is a liquid crystal display.
バッテリ107は、携帯端末1の各要素に電力を供給する要素である。例えば、バッテリ107は、リチウムイオン電池であるが、これに限定されない。 Battery 107 is an element that supplies power to each element of portable terminal 1. For example, the battery 107 is a lithium ion battery, but is not limited to this.
センサ108は、水平な仮想面に対する携帯端末1の傾きを連続的に検出するセンサである。センサ108は、検出部の一例である。センサ108は、携帯端末1の傾きの検出に応じて、携帯端末1の傾きを示す情報をCPU101へ連続的に出力する。携帯端末1の傾きを示す情報は、携帯端末1の傾き情報ともいう。携帯端末1の傾きについては後述する。例えば、センサ108は、ジャイロセンサであるが、これに限定されない。 The sensor 108 is a sensor that continuously detects the inclination of the mobile terminal 1 with respect to a horizontal virtual plane. The sensor 108 is an example of a detection unit. The sensor 108 continuously outputs information indicating the inclination of the mobile terminal 1 to the CPU 101 in response to the detection of the inclination of the mobile terminal 1. Information indicating the tilt of the mobile terminal 1 is also referred to as tilt information of the mobile terminal 1. The tilt of the mobile terminal 1 will be described later. For example, the sensor 108 is a gyro sensor, but is not limited to this.
図2は、携帯端末1の外観を例示する図である。
携帯端末1は、表面11側に表示部106を備える。第1端部111は、携帯端末1の長手方向の一端部である。第2端部112は、携帯端末1の長手方向の他端部である。表示部106は、CPU101の制御により、二次元コードCを表示する。例えば、二次元コードCは、乗車券であるが、これに限定されない。
FIG. 2 is a diagram illustrating an appearance of the portable terminal 1.
The mobile terminal 1 includes a display unit 106 on the front surface 11 side. The first end 111 is one end of the mobile terminal 1 in the longitudinal direction. The second end 112 is the other end in the longitudinal direction of the mobile terminal 1. The display unit 106 displays the two-dimensional code C under the control of the CPU 101. For example, the two-dimensional code C is a ticket, but is not limited to this.
二次元コードCは、四つの辺で構成される四角形である。二次元コードCは、矩形を基本形とする。辺C1及び辺C2は、二次元コードCを構成する辺である。辺C1は、表示部106の第1端部111側に表示される辺である。辺C1は、第1の辺の一例である。辺C2は、辺C1と対向する辺であり、表示部106の第2端部112側に表示される辺である。辺C2の長さは、辺C1の長さと等しい。辺C2は、第2の辺の一例である。 The two-dimensional code C is a rectangle composed of four sides. The two-dimensional code C has a basic shape of a rectangle. The sides C1 and C2 are sides forming the two-dimensional code C. The side C1 is a side displayed on the first end 111 side of the display unit 106. The side C1 is an example of a first side. The side C2 is a side facing the side C1, and is a side displayed on the second end 112 side of the display unit 106. The length of the side C2 is equal to the length of the side C1. The side C2 is an example of a second side.
次に、携帯端末1の傾きについて説明する。
図3は、携帯端末1の使用例を示す図である。
ユーザは、携帯端末1の表示部106に表示されている二次元コードCを用いてゲート2を通過する。
Next, the inclination of the mobile terminal 1 will be described.
FIG. 3 is a diagram illustrating a usage example of the mobile terminal 1.
The user passes through the gate 2 using the two-dimensional code C displayed on the display unit 106 of the mobile terminal 1.
例えば、ゲート2は、改札機である。ゲート2は、読取装置21を備える。読取装置21は、読取面211を備える。読取面211は、平面または略平面である。読取装置21は、読取面211に翳された二次元コードCの画像を取得する。例えば、読取装置21は、CMOS(Complimentary Metal Oxide Semiconductor)センサにより画像を取得する。読取装置21は、画像から二次元コードCを読み取り、二次元コードCに格納されている情報を取得する。 For example, the gate 2 is a ticket gate. The gate 2 includes a reading device 21. The reading device 21 has a reading surface 211. The reading surface 211 is a flat surface or a substantially flat surface. The reading device 21 acquires an image of the two-dimensional code C held on the reading surface 211. For example, the reading device 21 acquires an image using a CMOS (Complementary Metal Oxide Semiconductor) sensor. The reading device 21 reads the two-dimensional code C from the image, and acquires information stored in the two-dimensional code C.
ユーザは、ゲート2を通過する際に、携帯端末1の表示部106に表示されている二次元コードCを読取装置21の読取面211に翳す。二次元コードCは、読取装置21で読み取られる。CPU101は、センサ108から携帯端末1の傾き情報を連続的に取得する。CPU101は、携帯端末1の傾き情報を二次元コード生成用アプリケーションプログラムへ通知する。RAM103または記憶部104は、携帯端末1の傾き情報を記憶する。例えば、携帯端末1の傾き情報は、携帯端末1を所持するユーザの進行方向に沿う第1の方向の携帯端末1の第1の傾きθ1を示す情報を含む。 When passing through the gate 2, the user holds the two-dimensional code C displayed on the display unit 106 of the mobile terminal 1 over the reading surface 211 of the reading device 21. The two-dimensional code C is read by the reading device 21. The CPU 101 continuously obtains tilt information of the mobile terminal 1 from the sensor 108. The CPU 101 notifies the inclination information of the mobile terminal 1 to the two-dimensional code generation application program. The RAM 103 or the storage unit 104 stores tilt information of the mobile terminal 1. For example, the tilt information of the mobile terminal 1 includes information indicating a first tilt θ1 of the mobile terminal 1 in a first direction along the traveling direction of the user having the mobile terminal 1.
記憶部104は、水平な仮想面に対する読取装置21の読取面211の傾きを示す情報を予め記憶している。読取面211の傾きを示す情報は、読取面211の傾き情報ともいう。例えば、読取面211の傾き情報は、読取装置21を備えるゲート2の延在方向に沿う第2の方向の読取面211の第2の傾きθ2を示す情報を含む。例えば、第2の傾きθ2は、約10°であるが、これに限定されない。 The storage unit 104 stores in advance information indicating the inclination of the reading surface 211 of the reading device 21 with respect to the horizontal virtual surface. Information indicating the inclination of the reading surface 211 is also referred to as inclination information of the reading surface 211. For example, the tilt information of the reading surface 211 includes information indicating a second tilt θ2 of the reading surface 211 in a second direction along the extending direction of the gate 2 including the reading device 21. For example, a second inclination theta 2 is about 10 °, but is not limited thereto.
なお、図3では、携帯端末1を所持するユーザの進行方向に沿う第1の方向とゲート2の延在方向に沿う第2の方向が一致しているが、一致していなくてもよい。また、図3では、携帯端末1の表面11は、読取面211と平行である。そのため、携帯端末1の第1の傾きθ1は、読取面211の第2の傾きθ2と等しい。 In FIG. 3, the first direction along the traveling direction of the user holding the mobile terminal 1 and the second direction along the extending direction of the gate 2 match, but they do not have to match. In FIG. 3, the front surface 11 of the mobile terminal 1 is parallel to the reading surface 211. Therefore, the first inclination theta 1 of the portable terminal 1 is equal to the second inclination theta 2 of the reading surface 211.
なお、携帯端末1の傾き情報は、水平な仮想面において第1の方向と直交する第3の方向の携帯端末1の第3の傾きを示す情報を含んでいてもよい。読取面211の傾き情報は、水平な仮想面において第2の方向と直交する第4の方向の読取面211の第4の傾きを示す情報を含んでいてもよい。 Note that the tilt information of the mobile terminal 1 may include information indicating a third tilt of the mobile terminal 1 in a third direction orthogonal to the first direction on a horizontal virtual plane. The tilt information of the reading surface 211 may include information indicating a fourth tilt of the reading surface 211 in a fourth direction orthogonal to the second direction on the horizontal virtual surface.
図4は、携帯端末1の別の使用例を示す図である。
携帯端末1の表面11は、第1端部111と読取面211との間隔が第2端部112と読取面211との間隔よりも大きくなるように読取面211と対向している。図4に示す状態の携帯端末1の第1の傾きθ1の大きさは、図3に示す状態の携帯端末1の第1の傾きθ1の大きさよりも大きい。そのため、図3に示す状態では、携帯端末1の第1の傾きθ1は、読取面211の第2の傾きθ2よりも大きい。
FIG. 4 is a diagram illustrating another usage example of the mobile terminal 1.
The front surface 11 of the mobile terminal 1 faces the reading surface 211 such that the distance between the first end 111 and the reading surface 211 is larger than the distance between the second end 112 and the reading surface 211. First inclination theta size of 1 of the portable terminal 1 in the state shown in FIG. 4 is greater than the magnitude of the first inclination theta 1 of the portable terminal 1 in the state shown in FIG. Therefore, in the state shown in FIG. 3, the first inclination theta 1 of the portable terminal 1 is larger than the second inclination theta 2 of the reading surface 211.
次に、読取装置21が取得する二次元コードCの画像について説明する。
ここでは、表示部106は、図2に示すように、基本形となる矩形の二次元コードCを表示しているものとする。
Next, an image of the two-dimensional code C acquired by the reading device 21 will be described.
Here, it is assumed that the display unit 106 displays a rectangular two-dimensional code C as a basic form, as shown in FIG.
まず、図3に示すように、携帯端末1の表面11が読取面211と平行であるとする。この場合、二次元コードCの各辺を表示する表示部106の各位置と読取面211との間隔は、互いに等しい。そのため、読取装置21は、表示部106に表示される二次元コードCの形と相似である矩形の二次元コードCの画像を取得する。読取装置21は、二次元コードCに格納されている情報を取得することができる。 First, it is assumed that the front surface 11 of the mobile terminal 1 is parallel to the reading surface 211 as shown in FIG. In this case, the distance between each position of the display unit 106 that displays each side of the two-dimensional code C and the reading surface 211 is equal to each other. Therefore, the reading device 21 acquires a rectangular two-dimensional code C image similar to the shape of the two-dimensional code C displayed on the display unit 106. The reading device 21 can acquire information stored in the two-dimensional code C.
次に、図4に示すように、携帯端末1の表面11が読取面211に対して傾いて対向しているとする。図5は、この状態において読取装置21が取得する二次元コードCの画像を例示する図である。この場合、二次元コードCを構成する辺C1を表示する表示部106の位置と読取面211との間隔は、辺C2を表示する表示部106の位置と読取面211との間隔よりも大きい。そのため、読取装置21は、辺C1の長さ(大きさ)が辺C2の長さ(大きさ)よりも短い(小さい)形の二次元コードCの画像を取得する。例えば、読取装置21は、表示部106に表示される矩形の二次元コードCの形とは異なる台形の二次元コードCの画像を取得する。二次元コードCの形は矩形から大きく歪んでいるので、読取装置21は、二次元コードCに格納されている情報を取得することができない。 Next, as shown in FIG. 4, it is assumed that the front surface 11 of the portable terminal 1 is inclined and faces the reading surface 211. FIG. 5 is a diagram exemplifying an image of the two-dimensional code C acquired by the reading device 21 in this state. In this case, the distance between the position of the display unit 106 that displays the side C1 constituting the two-dimensional code C and the reading surface 211 is larger than the distance between the position of the display unit 106 that displays the side C2 and the reading surface 211. Therefore, the reading device 21 acquires an image of the two-dimensional code C in which the length (size) of the side C1 is shorter (smaller) than the length (size) of the side C2. For example, the reading device 21 acquires an image of the trapezoidal two-dimensional code C different from the shape of the rectangular two-dimensional code C displayed on the display unit 106. Since the shape of the two-dimensional code C is greatly distorted from the rectangle, the reading device 21 cannot acquire the information stored in the two-dimensional code C.
このように、読取面211に対する携帯端末1の表面11の傾きに応じて、読取装置21は、異なる形の二次元コードCの画像を取得する。 As described above, the reading device 21 acquires an image of the two-dimensional code C having a different shape according to the inclination of the front surface 11 of the mobile terminal 1 with respect to the reading surface 211.
次に、携帯端末1の傾きに応じて表示部106に表示される二次元コードCの形について説明する。
図6は、図4に示すように携帯端末1の表面11が読取面211に対して傾いて対向している状態で、表示部106に表示される二次元コードCを例示する図である。
Next, the shape of the two-dimensional code C displayed on the display unit 106 according to the inclination of the mobile terminal 1 will be described.
FIG. 6 is a diagram illustrating a two-dimensional code C displayed on the display unit 106 in a state where the front surface 11 of the portable terminal 1 is inclined and opposed to the reading surface 211 as shown in FIG.
CPU101は、以下に例示するように、表示部106に表示する二次元コードCを生成する。 The CPU 101 generates a two-dimensional code C to be displayed on the display unit 106 as exemplified below.
まず、CPU101は、センサ108から携帯端末1の傾き情報を取得する。CPU101は、記憶部104から読取面211の傾き情報を取得する。次に、CPU101は、携帯端末1の傾き情報及び読取面211の傾き情報に基づいて、携帯端末1の傾きと読取面211の傾きとを比較する。例えば、CPU101は、携帯端末1の第1の傾きと読取面211の第2の傾きとを比較する。CPU101は、携帯端末1の第1の傾きと読取面211の第2の傾きとの比較により、読取面211に対する携帯端末1の傾き度合を導き出す。 First, the CPU 101 acquires the tilt information of the mobile terminal 1 from the sensor 108. The CPU 101 acquires the inclination information of the reading surface 211 from the storage unit 104. Next, the CPU 101 compares the tilt of the mobile terminal 1 with the tilt of the reading surface 211 based on the tilt information of the mobile terminal 1 and the tilt information of the reading surface 211. For example, the CPU 101 compares the first inclination of the portable terminal 1 with the second inclination of the reading surface 211. The CPU 101 derives the degree of inclination of the portable terminal 1 with respect to the reading surface 211 by comparing the first inclination of the portable terminal 1 with the second inclination of the reading surface 211.
次に、CPU101は、携帯端末1の傾きと読取面211の傾きとの比較結果に応じて異なる形の二次元コードCを生成する。これにより、CPU101は、読取装置21が矩形または略矩形の二次元コードCの画像を取得することができるように、適切な形の二次元コードCを生成することができる。 Next, the CPU 101 generates a different two-dimensional code C according to the comparison result between the inclination of the mobile terminal 1 and the inclination of the reading surface 211. Accordingly, the CPU 101 can generate a two-dimensional code C having an appropriate shape so that the reading device 21 can acquire an image of the rectangular or substantially rectangular two-dimensional code C.
例えば、CPU101は、携帯端末1の第1の傾きと読取面211の第2の傾きとの比較結果に応じて異なる形の二次元コードCを生成する。ここでは、CPU101は、第1の方向と交わる辺C1及び辺C2のうちの少なくとも何れか一方の長さを変更することで、異なる形の二次元コードCを生成する。 For example, the CPU 101 generates a different form of the two-dimensional code C according to a comparison result between the first inclination of the portable terminal 1 and the second inclination of the reading surface 211. Here, the CPU 101 generates a different shape of the two-dimensional code C by changing at least one of the side C1 and the side C2 intersecting the first direction.
これにより、CPU101は、ユーザの進行方向に沿う第1の方向とゲート2の延在方向に沿う第2の方向が一致する場合に、適切な形の二次元コードCを生成することができる。 Thus, when the first direction along the traveling direction of the user and the second direction along the extending direction of the gate 2 match, the CPU 101 can generate a two-dimensional code C having an appropriate shape.
CPU101は、携帯端末1の傾きが読取面211の傾きと同じであることを示す比較結果に応じて、基本形となる矩形の二次元コードCを生成する。例えば、CPU101は、携帯端末1の第1の傾きが読取面211の第2の傾きと同じであることを示す比較結果に応じて、辺C1の長さとC2の長さが同じになるように二次元コードCを生成する。 The CPU 101 generates a basic rectangular two-dimensional code C according to a comparison result indicating that the inclination of the portable terminal 1 is the same as the inclination of the reading surface 211. For example, according to a comparison result indicating that the first inclination of the portable terminal 1 is the same as the second inclination of the reading surface 211, the CPU 101 sets the lengths of the sides C1 and C2 to be the same. Generate a two-dimensional code C.
他方、CPU101は、携帯端末1の傾きが読取面211の傾きと異なることを示す比較結果に応じて、対向する2辺の長さが異なるように二次元コードCを生成する。例えば、CPU101は、携帯端末1の第1の傾きが読取面211の第2の傾きと異なることを示す比較結果に応じて、辺C1の長さとC2の長さが異なるように二次元コードCを生成する。 On the other hand, the CPU 101 generates the two-dimensional code C such that the lengths of two opposing sides are different according to a comparison result indicating that the inclination of the portable terminal 1 is different from the inclination of the reading surface 211. For example, according to a comparison result indicating that the first inclination of the portable terminal 1 is different from the second inclination of the reading surface 211, the CPU 101 sets the two-dimensional code C so that the lengths of the sides C1 and C2 are different. Generate
これにより、CPU101は、携帯端末1の傾きが読取面211の傾きと異なる場合に、適切な形の二次元コードCを生成することができる。 Accordingly, when the inclination of the portable terminal 1 is different from the inclination of the reading surface 211, the CPU 101 can generate a two-dimensional code C having an appropriate shape.
典型例では、CPU101は、辺C1と辺C2を、二次元コードCが表示部106に表示された際に読取面211から遠い辺または読取面211から近い辺のいずれかに分類する。CPU101は、読取面211から遠い辺の長さを読取面211から近い辺の長さよりも長くするように二次元コードCを生成する。図6に示す例では、辺C1は、辺C2よりも読取面211から遠い辺である。そのため、CPU101は、辺C1の長さを辺C2の長さよりも長くする。 In a typical example, the CPU 101 classifies the side C1 and the side C2 as either a side far from the reading surface 211 or a side near the reading surface 211 when the two-dimensional code C is displayed on the display unit 106. The CPU 101 generates the two-dimensional code C such that the length of the side far from the reading surface 211 is longer than the length of the side near the reading surface 211. In the example illustrated in FIG. 6, the side C1 is a side farther from the reading surface 211 than the side C2. Therefore, the CPU 101 makes the length of the side C1 longer than the length of the side C2.
これにより、CPU101は、二次元コードCを構成する適切な辺の長さを調整することで、適切な形の二次元コードCを生成することができる。 Thus, the CPU 101 can generate an appropriate shape of the two-dimensional code C by adjusting an appropriate length of the side constituting the two-dimensional code C.
さらに、CPU101は、読取面211の傾きに対する携帯端末1の傾きの差の大きさに応じて、読取面211から遠い辺の長さと読取面211から近い辺の長さとの差を変更してもよい。例えば、CPU101は、読取面211の第2の傾きに対する携帯端末1の第1の傾きの差の大きさに応じて、読取面211から遠い辺の長さと読取面211から近い辺の長さとの差を変更する。 Further, the CPU 101 may change the difference between the length of the side far from the reading surface 211 and the length of the side near the reading surface 211 according to the magnitude of the difference between the tilt of the reading surface 211 and the tilt of the mobile terminal 1. Good. For example, the CPU 101 determines the length of the side far from the reading surface 211 and the length of the side near the reading surface 211 according to the magnitude of the difference between the first tilt of the mobile terminal 1 and the second tilt of the reading surface 211. Change the difference.
図6に示す例では、CPU101は、読取面211の第2の傾きに対する携帯端末1の第1の傾きの差が大きくなるに応じて、辺C1の長さと辺C2の長さとの差を大きくする。CPU101は、辺C2の長さを固定した状態で辺C1の長さを変更することで、辺C1の長さと辺C2の長さとの差を大きくしてもよい。これに代えて、CPU101は、辺C1と辺C2の両方の長さを変更することで、辺C1の長さと辺C2の長さとの差を大きくしてもよい。 In the example illustrated in FIG. 6, the CPU 101 increases the difference between the length of the side C1 and the length of the side C2 as the difference between the second inclination of the reading surface 211 and the first inclination of the portable terminal 1 increases. I do. The CPU 101 may increase the difference between the length of the side C1 and the length of the side C2 by changing the length of the side C1 with the length of the side C2 fixed. Instead, the CPU 101 may increase the difference between the length of the side C1 and the length of the side C2 by changing the length of both the side C1 and the side C2.
これにより、CPU101は、読取面211の傾きに対する携帯端末1の傾きの差が大きくなったとしても、適切な形の二次元コードCを生成することができる。 Accordingly, the CPU 101 can generate an appropriate two-dimensional code C even if the difference between the inclination of the reading surface 211 and the inclination of the portable terminal 1 becomes large.
なお、CPU101は、所定の閾値を用いて読取面211の傾きに対する携帯端末1の傾きを評価し、対向する2辺の長さが異なるように二次元コードCを生成してもよい。所定の閾値は、読取面211の傾きに対する携帯端末1の傾きの差に相当する値である。所定の閾値は、携帯端末1が読取面211に対して傾いていたとしても、読取装置21が二次元コードCを読み取ることができる値である。所定の閾値は、任意に設定可能である。 Note that the CPU 101 may evaluate the inclination of the portable terminal 1 with respect to the inclination of the reading surface 211 using a predetermined threshold, and generate the two-dimensional code C such that the lengths of the two opposing sides are different. The predetermined threshold value is a value corresponding to a difference between the inclination of the reading surface 211 and the inclination of the portable terminal 1. The predetermined threshold is a value that allows the reading device 21 to read the two-dimensional code C even when the mobile terminal 1 is inclined with respect to the reading surface 211. The predetermined threshold can be set arbitrarily.
この例では、CPU101は、読取面211の傾きに対する携帯端末1の傾きの差を所定の閾値と比較する。CPU101は、読取面211の傾きに対する携帯端末1の傾きの差が所定の閾値以下であることを示す比較結果に応じて、基本形となる矩形の二次元コードCを生成する。他方、CPU101は、読取面211の傾きに対する携帯端末1の傾きの差が所定の閾値を超えることを示す比較結果に応じて、二次元コードCを構成する対向する2辺の長さが異なるように二次元コードCを生成する。 In this example, the CPU 101 compares a difference between the inclination of the reading surface 211 and the inclination of the portable terminal 1 with a predetermined threshold. The CPU 101 generates a basic rectangular two-dimensional code C according to a comparison result indicating that the difference between the inclination of the reading surface 211 and the inclination of the portable terminal 1 is equal to or smaller than a predetermined threshold. On the other hand, according to the comparison result indicating that the difference between the inclination of the reading surface 211 and the inclination of the portable terminal 1 exceeds the predetermined threshold, the CPU 101 determines that the lengths of the two opposite sides forming the two-dimensional code C are different. To generate a two-dimensional code C.
例えば、CPU101は、読取面211の第2の傾きに対する携帯端末1の第1の傾きの差が所定の閾値を超えることを示す比較結果に応じて、辺C1の長さとC2の長さが異なるように二次元コードCを生成する。 For example, the CPU 101 determines that the length of the side C1 is different from the length of the side C2 in accordance with a comparison result indicating that the difference between the second inclination of the reading surface 211 and the first inclination of the portable terminal 1 exceeds a predetermined threshold. The two-dimensional code C is generated as follows.
これにより、CPU101は、読取面211の傾きに対する携帯端末1の傾きの差が所定の閾値を超える場合に、適切な形の二次元コードCを生成することができる。CPU101は、読取面211の傾きに対する携帯端末1の傾きの差が所定の閾値を超えるまでは二次元コードCの形を変更しないので、処理負荷を軽減することができる。 Accordingly, when the difference between the inclination of the reading surface 211 and the inclination of the portable terminal 1 exceeds the predetermined threshold, the CPU 101 can generate a two-dimensional code C having an appropriate shape. Since the CPU 101 does not change the shape of the two-dimensional code C until the difference between the inclination of the reading surface 211 and the inclination of the portable terminal 1 exceeds a predetermined threshold, the processing load can be reduced.
なお、CPU101は、携帯端末1の第1の傾きと読取面211の第2の傾きとの比較結果に応じて異なる形の二次元コードCを生成しているが、これに限定されない。CPU101は、携帯端末1の第3の傾きと読取面211の第4の傾きとを比較してもよい。CPU101は、上述の例と同様に、携帯端末1の第3の傾きと読取面211の第4の傾きとの比較結果に応じて異なる形の二次元コードCを生成してもよい。 Note that the CPU 101 generates the two-dimensional code C having a different shape according to the comparison result between the first tilt of the mobile terminal 1 and the second tilt of the reading surface 211, but is not limited thereto. The CPU 101 may compare the third inclination of the portable terminal 1 with the fourth inclination of the reading surface 211. The CPU 101 may generate a different two-dimensional code C according to the comparison result between the third inclination of the portable terminal 1 and the fourth inclination of the reading surface 211, as in the above-described example.
例えば、ユーザは、自身の右側にある読取装置21に対して左手に持った携帯端末1を翳すこともある。携帯端末1は、読取面211に対して一方向ではなく、複数方向に傾くことがある。CPU101は、携帯端末1が読取面211に対して複数方向に傾いていても、適切な形の二次元コードCを生成することができる。 For example, the user may hold the mobile terminal 1 held in his left hand over the reading device 21 on his right side. The mobile terminal 1 may be inclined not in one direction but in a plurality of directions with respect to the reading surface 211. The CPU 101 can generate the appropriate two-dimensional code C even when the mobile terminal 1 is inclined in a plurality of directions with respect to the reading surface 211.
また、CPU101は、携帯端末1の第1の傾きと読取面211の第2の傾きとの比較結果及び携帯端末1の第3の傾きと読取面211の第4の傾きとの比較結果の両方に基づいて異なる形の二次元コードCを生成してもよい。 The CPU 101 also compares both the comparison result of the first inclination of the portable terminal 1 with the second inclination of the reading surface 211 and the comparison result of the third inclination of the portable terminal 1 and the fourth inclination of the reading surface 211. May be generated based on the two-dimensional code C.
CPU101は、表示部106に二次元コードCを表示する。図6に示す例では、CPU101は、図5に示す二次元コードCの形とは対称となる形の二次元コードCを表示部106に表示する。そのため、表示部106は、読取装置21による読取精度を向上させるように形を変更した二次元コードCを表示することができる。 The CPU 101 displays the two-dimensional code C on the display unit 106. In the example illustrated in FIG. 6, the CPU 101 displays the two-dimensional code C having a shape symmetric to the shape of the two-dimensional code C illustrated in FIG. Therefore, the display unit 106 can display the two-dimensional code C whose shape has been changed so as to improve the reading accuracy of the reading device 21.
これにより、読取装置21は、表示部106に表示される台形の二次元コードCの形とは異なる矩形または略矩形の二次元コードCの画像を取得することができる。ユーザが読取面211に対して傾けて携帯端末1を翳したとしても、読取装置21は、矩形または略矩形の二次元コードCの画像を取得することができる。その結果、読取装置21は、画像から二次元コードCを読み取り、二次元コードCに格納されている情報を取得することができる。 Accordingly, the reading device 21 can obtain an image of the rectangular or substantially rectangular two-dimensional code C different from the trapezoidal two-dimensional code C displayed on the display unit 106. Even if the user tilts the mobile terminal 1 with respect to the reading surface 211, the reading device 21 can acquire a rectangular or substantially rectangular two-dimensional code C image. As a result, the reading device 21 can read the two-dimensional code C from the image and acquire the information stored in the two-dimensional code C.
なお、CPU101は、センサ108から携帯端末1の傾き情報を連続的に取得するので、携帯端末1の傾きの変化に応じて、二次元コードの形を連続的に変更する。これにより、表示部106は、携帯端末1の傾きの変化に応じて、二次元コードの形を連続的に変更しながら二次元コードを表示することができる。 Since the CPU 101 continuously obtains the tilt information of the mobile terminal 1 from the sensor 108, the CPU 101 continuously changes the shape of the two-dimensional code according to the change in the tilt of the mobile terminal 1. Thereby, the display unit 106 can display the two-dimensional code while continuously changing the shape of the two-dimensional code according to the change in the inclination of the mobile terminal 1.
次に、携帯端末1による二次元コード生成処理について説明する。
図7は、携帯端末1における二次元コード生成処理を例示するフローチャートである。
Next, a two-dimensional code generation process by the mobile terminal 1 will be described.
FIG. 7 is a flowchart illustrating a two-dimensional code generation process in the mobile terminal 1.
CPU101は、二次元コード生成アプリケーションプログラムを起動する(ステップS101)。ステップS101では、CPU101は、ユーザによる入力部105での起動操作に基づいて、二次元コード生成アプリケーションプログラムを起動する。 The CPU 101 starts a two-dimensional code generation application program (step S101). In step S101, the CPU 101 starts a two-dimensional code generation application program based on a start operation by the user on the input unit 105.
CPU101は、傾き情報を取得する(ステップS102)。ステップS102では、CPU101は、センサ108から携帯端末1の傾き情報を取得する。CPU101は、記憶部104から読取面211の傾き情報を取得する。 The CPU 101 acquires the inclination information (step S102). In step S102, the CPU 101 acquires the tilt information of the mobile terminal 1 from the sensor 108. The CPU 101 acquires the inclination information of the reading surface 211 from the storage unit 104.
CPU101は、二次元コードを生成する(ステップS103)。ステップS103では、CPU101は、携帯端末1の傾き情報及び読取面211の傾き情報に基づいて、携帯端末1の傾きと読取面211の傾きとを比較する。CPU101は、上述のように、携帯端末1の傾きと読取面211の傾きとの比較結果に応じて、異なる形の二次元コードを生成する。CPU101は、携帯端末1の傾きの変化に応じて二次元コードCの形を逐次変更する。 The CPU 101 generates a two-dimensional code (step S103). In step S103, the CPU 101 compares the tilt of the mobile terminal 1 with the tilt of the reading surface 211 based on the tilt information of the mobile terminal 1 and the tilt information of the reading surface 211. As described above, the CPU 101 generates a different two-dimensional code according to the comparison result between the inclination of the mobile terminal 1 and the inclination of the reading surface 211. The CPU 101 sequentially changes the shape of the two-dimensional code C according to a change in the inclination of the mobile terminal 1.
CPU101は、表示部106に二次元コードを表示する(ステップ104)。ステップS104では、CPU101は、携帯端末1の傾きの変化に応じて二次元コードCの形を変更しながら表示部106に表示する。 The CPU 101 displays the two-dimensional code on the display unit 106 (Step 104). In step S104, the CPU 101 displays the two-dimensional code C on the display unit 106 while changing the shape of the two-dimensional code C according to the change in the inclination of the mobile terminal 1.
CPU101は、二次元コード生成アプリケーションプログラムを終了するか否かを判断する(ステップS105)。ステップS105では、CPU101は、ユーザによる入力部105での終了操作に基づいて、二次元コード生成アプリケーションプログラムの終了を判断する。 The CPU 101 determines whether to terminate the two-dimensional code generation application program (Step S105). In step S105, the CPU 101 determines the termination of the two-dimensional code generation application program based on a termination operation of the input unit 105 by the user.
CPU101は、二次元コード生成アプリケーションプログラムを終了すると判断した場合(ステップS105、Yes)、二次元コード生成処理を終了する。CPU101は、二次元コード生成アプリケーションプログラムを終了しないと判断した場合(ステップS105、No)、ステップS102に戻って処理を繰り返す。 When the CPU 101 determines that the two-dimensional code generation application program is to be ended (step S105, Yes), the two-dimensional code generation processing ends. When the CPU 101 determines that the two-dimensional code generation application program is not to be ended (No at Step S105), the process returns to Step S102 and repeats the processing.
なお、ゲート2は、改札機を例にして説明したが、これに限定されない。ゲート2は、空港の搭乗ゲートなど、人が通過するゲートであればよい。 Although the gate 2 has been described using a ticket gate as an example, the gate 2 is not limited to this. The gate 2 may be a gate through which people pass, such as a boarding gate at an airport.
なお、読取装置21は、ゲート2に設けられているものとして説明したが、これに限定されない。読取装置21は、ゲート2以外に設けられていてもよい。例えば、読取装置21は、精算機に設けられていてもよい。この場合、携帯端末1は、精算用のアプリケーションプログラムで精算機に設けられている読取装置21の読取面211の傾き情報を管理すればよい。 The reading device 21 has been described as being provided in the gate 2, but is not limited to this. The reading device 21 may be provided other than the gate 2. For example, the reading device 21 may be provided in a checkout machine. In this case, the mobile terminal 1 may manage the inclination information of the reading surface 211 of the reading device 21 provided in the checkout machine using the checkout application program.
本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれると同様に、特許請求の範囲に記載された発明とその均等の範囲に含まれるものである。 Although several embodiments of the present invention have been described, these embodiments are provided by way of example and are not intended to limit the scope of the invention. These embodiments can be implemented in other various forms, and various omissions, replacements, and changes can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and gist of the invention, and are also included in the invention described in the claims and equivalents thereof.
1…携帯端末、2…ゲート、11…表面、21…読取装置、101…CPU、102…ROM、103…RAM、104…記憶部、105…入力部、106…表示部、107…バッテリ、108…センサ、111…第1端部、112…第2端部、211…読取面、C…二次元コード、C1…辺、C2…辺。 DESCRIPTION OF SYMBOLS 1 ... Portable terminal, 2 ... Gate, 11 ... Surface, 21 ... Reading device, 101 ... CPU, 102 ... ROM, 103 ... RAM, 104 ... Storage part, 105 ... Input part, 106 ... Display part, 107 ... Battery, 108 ... Sensor, 111 ... First end, 112 ... Second end, 211 ... Reading surface, C ... 2D code, C1 ... side, C2 ... side.
Claims (8)
水平な仮想面に対する読取装置の読取面の傾きを示す情報を取得することと、
前記携帯端末の傾きと前記読取面の傾きとを比較することと、
前記読取装置で読み取られる二次元コードであって、前記携帯端末の傾きと前記読取面の傾きとの比較結果に応じて異なる形の二次元コードを生成することと、
前記携帯端末の表示部に前記二次元コードを表示することと、
を備える二次元コード生成方法。 Obtaining information indicating the inclination of the mobile terminal with respect to the horizontal virtual plane;
Acquiring information indicating the inclination of the reading surface of the reading device with respect to the horizontal virtual surface;
Comparing the inclination of the portable terminal and the inclination of the reading surface;
Generating a two-dimensional code that is a two-dimensional code that is read by the reading device and that has a different shape in accordance with a comparison result between the inclination of the portable terminal and the inclination of the reading surface;
Displaying the two-dimensional code on a display unit of the mobile terminal;
A two-dimensional code generation method comprising:
前記読取面の傾きを示す情報は、前記読取装置を備えるゲートの延在方向に沿う第2の方向の前記読取面の第2の傾きを示す情報を含み、
前記携帯端末の傾きと前記読取面の傾きとを比較することは、前記第1の傾きと前記第2の傾きとを比較することを含む、
請求項1に記載の二次元コード生成方法。 The information indicating the tilt of the mobile terminal includes information indicating a first tilt of the mobile terminal in a first direction along a traveling direction of a user having the mobile terminal,
The information indicating the inclination of the reading surface includes information indicating a second inclination of the reading surface in a second direction along an extending direction of the gate including the reading device,
Comparing the inclination of the portable terminal and the inclination of the reading surface includes comparing the first inclination with the second inclination.
The method for generating a two-dimensional code according to claim 1.
前記読取面の傾きを示す情報は、水平な仮想面において前記第2の方向と直交する第4の方向の前記読取面の第4の傾きを示す情報を含み、
前記携帯端末の傾きと前記読取面の傾きとを比較することは、前記第3の傾きと前記第4の傾きとを比較することを含む、
請求項6に記載の二次元コード生成方法。 The information indicating the inclination of the mobile terminal includes information indicating a third inclination of the mobile terminal in a third direction orthogonal to the first direction on a horizontal virtual plane,
The information indicating the inclination of the reading surface includes information indicating a fourth inclination of the reading surface in a fourth direction orthogonal to the second direction on a horizontal virtual surface,
Comparing the inclination of the portable terminal and the inclination of the reading surface includes comparing the third inclination with the fourth inclination.
The two-dimensional code generation method according to claim 6.
水平な仮想面に対する読取装置の読取面の傾きを示す情報を記憶する記憶部と、
前記携帯端末の傾きと前記読取面の傾きとを比較し、前記読取装置で読み取られる二次元コードであって、前記携帯端末の傾きと前記読取面の傾きとの比較結果に応じて異なる形の二次元コードを生成する処理部と、
前記二次元コードを表示する表示部と、
を備える電子機器。 A detection unit that detects a tilt of the mobile terminal with respect to a horizontal virtual surface,
A storage unit that stores information indicating the inclination of the reading surface of the reading device with respect to the horizontal virtual surface,
Comparing the inclination of the portable terminal and the inclination of the reading surface, a two-dimensional code read by the reading device, and having a different shape according to a comparison result between the inclination of the portable terminal and the inclination of the reading surface. A processing unit for generating a two-dimensional code,
A display unit for displaying the two-dimensional code,
Electronic equipment provided with.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018174199A JP2020046878A (en) | 2018-09-18 | 2018-09-18 | Two-dimensional code generation method and electronic apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018174199A JP2020046878A (en) | 2018-09-18 | 2018-09-18 | Two-dimensional code generation method and electronic apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2020046878A true JP2020046878A (en) | 2020-03-26 |
Family
ID=69901524
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018174199A Pending JP2020046878A (en) | 2018-09-18 | 2018-09-18 | Two-dimensional code generation method and electronic apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2020046878A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012155371A (en) * | 2011-01-21 | 2012-08-16 | Toshiba Corp | Automatic ticket gate system and automatic ticket gate machine |
JP2016110634A (en) * | 2014-12-05 | 2016-06-20 | 株式会社デンソーウェーブ | Portable information code display device |
-
2018
- 2018-09-18 JP JP2018174199A patent/JP2020046878A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012155371A (en) * | 2011-01-21 | 2012-08-16 | Toshiba Corp | Automatic ticket gate system and automatic ticket gate machine |
JP2016110634A (en) * | 2014-12-05 | 2016-06-20 | 株式会社デンソーウェーブ | Portable information code display device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11194982B2 (en) | QR code positioning method and apparatus | |
US8693785B2 (en) | Image matching devices and image matching methods thereof | |
US10452953B2 (en) | Image processing device, image processing method, program, and information recording medium | |
CN110660066A (en) | Network training method, image processing method, network, terminal device, and medium | |
CN110032314B (en) | Long screen capture method and device, storage medium and terminal equipment | |
US20150178903A1 (en) | Image correction apparatus for correcting distortion of an image | |
US9165176B2 (en) | Method, apparatus, and computer-readable recording medium for recognizing fingerprint | |
CN101201462A (en) | Apparatus and method for correcting shake of image photographing device | |
CN104657709B (en) | Facial image recognition method, device and server | |
KR20130025346A (en) | Object tracking device | |
US9111165B2 (en) | Method and system for filtering detection patterns in a QR code | |
CN112991178B (en) | Image splicing method, device, equipment and medium | |
KR20220008738A (en) | An electronic device comprising an expandable display | |
JP2014170488A (en) | Estimated face generation device, face collation device, estimated face generation method, and estimated face generation program | |
US9317904B2 (en) | Image processing system and image processing method | |
US9412057B2 (en) | Electronic device, method of displaying two-dimensional code, and recording medium with program recorded thereon | |
US20130259384A1 (en) | Apparatus and method for recognizing hand shape using finger pattern | |
JP5482327B2 (en) | Imaging apparatus, imaging method, and imaging program | |
JP2020046878A (en) | Two-dimensional code generation method and electronic apparatus | |
KR102239588B1 (en) | Image processing method and apparatus | |
CN110989880B (en) | Interface element processing method and device and readable storage medium | |
WO2016012655A1 (en) | Method, apparatus and electronic device for detecting object in an image | |
CN112348025A (en) | Character detection method and device, electronic equipment and storage medium | |
EP3474133B1 (en) | Filter processing apparatus and control method thereof | |
CN107480710B (en) | Feature point matching result processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20210902 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20220630 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20220705 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20230105 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20230110 |