JP4910822B2 - Bar code reader and program - Google Patents

Bar code reader and program Download PDF

Info

Publication number
JP4910822B2
JP4910822B2 JP2007082520A JP2007082520A JP4910822B2 JP 4910822 B2 JP4910822 B2 JP 4910822B2 JP 2007082520 A JP2007082520 A JP 2007082520A JP 2007082520 A JP2007082520 A JP 2007082520A JP 4910822 B2 JP4910822 B2 JP 4910822B2
Authority
JP
Japan
Prior art keywords
barcode
reading
movement
bar
data
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.)
Expired - Fee Related
Application number
JP2007082520A
Other languages
Japanese (ja)
Other versions
JP2008242829A (en
Inventor
哲也 黒松
隆雄 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2007082520A priority Critical patent/JP4910822B2/en
Priority to DE602008006482T priority patent/DE602008006482D1/en
Priority to EP08004739A priority patent/EP1975849B1/en
Priority to EP09008776.8A priority patent/EP2101281B1/en
Priority to US12/079,148 priority patent/US7832642B2/en
Publication of JP2008242829A publication Critical patent/JP2008242829A/en
Application granted granted Critical
Publication of JP4910822B2 publication Critical patent/JP4910822B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、バーコード読取装置及びプログラムに関する。   The present invention relates to a barcode reader and a program.

スキャナの読取範囲よりも幅が広いバーコードのデータを得るには、バーコード面に対してスキャナを移動させながらスキャンする必要がある。従来、このような幅の広いバーコードをスキャンしてバーコードデータを得るために、ユーザがスキャナをバーの配列方向に移動させながら所定のスキャン速度(例えば、100スキャン/秒)でバーコードをスキャンし、スキャンする度にバーコードのパターンマッチングを行い、一致した部分を基に少しずつ合成を行っていた(例えば、特許文献1参照)。
特開平7−57035号公報
In order to obtain barcode data having a width wider than the reading range of the scanner, it is necessary to scan while moving the scanner with respect to the barcode surface. Conventionally, in order to obtain barcode data by scanning such a wide barcode, the user scans the barcode at a predetermined scanning speed (for example, 100 scans / second) while moving the scanner in the bar arrangement direction. Scanning was performed, and barcode pattern matching was performed each time scanning was performed, and synthesis was performed little by little based on the matched portion (see, for example, Patent Document 1).
Japanese Unexamined Patent Publication No. 7-57035

しかしながら、従来は、スキャン毎にバーコードのパターンマッチングを行っていたため、各スキャンに対するスキャナの移動距離が短くなると、パターンマッチング及び合成処理を実施する回数が多くなり、処理効率が悪いという問題があった。   Conventionally, however, barcode pattern matching is performed for each scan. Therefore, if the scanner movement distance for each scan is shortened, the number of times pattern matching and synthesis processing is performed increases, resulting in poor processing efficiency. It was.

本発明の課題は、バーコードデータの合成処理の効率化を図ることである。   An object of the present invention is to improve the efficiency of barcode data synthesis processing.

請求項1に記載のバーコード読取装置は、バーコードに対する読取範囲の移動とともに当該バーコードを順次読み取ってバーコードデータを取得する読取手段と、前記読取手段により取得された各バーコードデータを記憶する記憶手段と、前記読取手段の3次元空間での移動状態を検出する検出手段と、前記検出手段により検出された移動状態に基づいて、バーコードデータの合成に必要な前記読取手段の移動量を算出する算出手段と、前記読取手段が前記算出された移動量分移動したか否かを判定する判定手段と、前記判定手段により前記読取手段が前記算出された移動量分移動したと判定された場合は、移動前に取得されたバーコードデータと、移動後に取得されたバーコードデータとを合成する合成手段と、前記合成手段により合成されたバーコードデータをデコードするデコード手段と、を備える。 The barcode reading apparatus according to claim 1 stores reading means for sequentially acquiring the barcode data by sequentially reading the barcode as the reading range of the barcode is moved, and storing each barcode data acquired by the reading means. Storage means, detection means for detecting the movement state of the reading means in a three-dimensional space, and the amount of movement of the reading means necessary for synthesizing the barcode data based on the movement state detected by the detection means Determining means for determining whether or not the reading means has moved by the calculated movement amount, and the determination means determines that the reading means has moved by the calculated movement amount. If the, and a bar code data obtained before the move, and combining means for combining the bar code data obtained after the movement, it is synthesized by the synthesizing means And and a decoding means for decoding the bar code data.

請求項2に記載の発明は、請求項1に記載のバーコード読取装置において、前記検出手段により検出された移動状態に基づいて、前記取得されたバーコードデータを補正する補正手段を備え、前記合成手段は、前記補正手段により補正されたバーコードデータを合成する。 According to a second aspect of the present invention, in the barcode reading apparatus according to the first aspect, the barcode reading device includes a correcting unit that corrects the acquired barcode data based on the movement state detected by the detecting unit, The synthesizing unit synthesizes the barcode data corrected by the correcting unit.

請求項3に記載の発明は、請求項1又は2に記載のバーコード読取装置において、前記検出手段は、ジャイロセンサを用いて前記移動状態を検出し、前記ジャイロセンサは、3次元空間での前記読取手段の加速度を検出する加速度センサと、3次元空間での前記読取手段の移動によって生じる当該読取手段の傾きを検出する傾きセンサと、を有する。   According to a third aspect of the present invention, in the barcode reading apparatus according to the first or second aspect, the detection means detects the moving state using a gyro sensor, and the gyro sensor is in a three-dimensional space. An acceleration sensor that detects an acceleration of the reading unit; and an inclination sensor that detects an inclination of the reading unit caused by the movement of the reading unit in a three-dimensional space.

請求項4に記載の発明は、請求項1乃至3のいずれかに記載のバーコード読取装置において、前記検出手段は、前記読取手段が前記バーコードに近づくように移動した移動状態あるいは前記読取手段が前記バーコードから遠ざかるように移動した移動状態のいずれかを検出し、前記補正手段は、前記読取手段が前記バーコードに近づくように移動した場合は、前記読取手段の移動距離に応じてバー幅が細くなるように前記バーコードイメージデータを補正し、前記読取手段が前記バーコード面から遠ざかるように移動した場合は、前記読取手段の移動距離に応じてバー幅が太くなるように前記バーコードイメージデータを補正する。
請求項5に記載の発明は、請求項1乃至4のいずれかに記載のバーコード読取装置において、前記検出手段は、前記読取手段が前記バーコードに対して傾斜して光を照射した移動状態を検出し、前記補正手段は、前記読取手段が前記バーコードに対して傾斜して光を照射した場合は、前記読取手段の傾斜角に応じてバーコードイメージデータのバー幅を補正する。
請求項6に記載の発明は、請求項1乃至5のいずれかに記載のバーコード読取装置において、前記検出手段は、前記読取手段が前記バーコードに対してバー配列方向に移動した移動状態を検出し、前記補正手段は、前記読取手段が前記バーコードに対してバー配列方向に移動した場合は、前記読取手段の移動距離に応じてバーコードイメージデータのスタートマージンの幅を補正する。
請求項7に記載の発明は、請求項1乃至6のいずれかに記載のバーコード読取装置において、前記検出手段は、前記読取手段が前記バーコードのバー配列方向に対して傾斜して光を照射した移動状態を検出し、前記補正手段は、前記読取手段が前記バーコードのバー配列方向に対して傾斜して光を照射した場合は、前記読取手段の前記バー配列方向に対する傾斜角に応じてバーコードイメージデータのバー幅を補正する。
請求項8に記載の発明は、コンピュータを、バーコードに対する読取範囲の移動とともに当該バーコードを順次読取手段により読み取らせ、バーコードデータを取得する手段、前記取得された各バーコードデータを記憶手段に記憶させる手段、前記読取手段の3次元空間での移動状態を検出する手段、前記検出された移動状態に基づいて、バーコードデータの合成に必要な前記読取手段の移動量を算出する手段、前記読取手段が前記算出された移動量分移動したか否かを判定する手段、前記読取手段が前記算出された移動量分移動したと判定された場合は、移動前に取得されたバーコードデータと、移動後に取得されたバーコードデータとを合成する手段、前記合成されたバーコードデータをデコードする手段、として機能させるためのプログラムである。
According to a fourth aspect of the present invention, in the barcode reading apparatus according to any one of the first to third aspects, the detection means is in a moving state in which the reading means moves closer to the barcode or the reading means. When the reading means moves so as to approach the bar code, the correction means detects the bar according to the moving distance of the reading means. When the barcode image data is corrected so that the width becomes narrower and the reading means moves away from the barcode surface, the bar width is increased so that the bar width increases according to the moving distance of the reading means. Correct the code image data.
According to a fifth aspect of the present invention, in the barcode reader according to any one of the first to fourth aspects, the detection means is a moving state in which the reading means is inclined with respect to the barcode and irradiated with light. The correction means corrects the bar width of the barcode image data according to the inclination angle of the reading means when the reading means is inclined with respect to the barcode and irradiated with light.
According to a sixth aspect of the present invention, in the barcode reading apparatus according to any one of the first to fifth aspects, the detection unit has a moving state in which the reading unit moves in the bar arrangement direction with respect to the barcode. When the reading means moves in the bar array direction with respect to the barcode, the correction means corrects the width of the start margin of the barcode image data according to the moving distance of the reading means.
A seventh aspect of the present invention is the barcode reading apparatus according to any one of the first to sixth aspects, wherein the detection means emits light with the reading means inclined with respect to the bar arrangement direction of the barcode. The irradiation movement state is detected, and the correction means responds to the inclination angle of the reading means with respect to the bar arrangement direction when the reading means is irradiated with light inclined with respect to the bar arrangement direction of the barcode. Correct the bar width of the barcode image data.
According to an eighth aspect of the present invention, the computer causes the barcode to be read sequentially by the reading means along with the movement of the reading range with respect to the barcode, the barcode data is obtained, and the obtained barcode data is stored. Means for storing, means for detecting a movement state of the reading means in a three-dimensional space, means for calculating a movement amount of the reading means necessary for synthesizing barcode data based on the detected movement state, Means for determining whether or not the reading means has moved by the calculated amount of movement; if it is determined that the reading means has moved by the calculated amount of movement, the barcode data acquired before the movement When a professional to function means for combining the bar code data obtained after the movement, means for decoding the bar code data to which the synthesized as, It is a lamb.

本発明によれば、読取手段の移動状態に基づいてバーコードの合成処理を実施することにより、合成処理の回数が大幅に削減され、バーコードデータの合成処理を効率化させることができる。   According to the present invention, by performing the barcode synthesis process based on the moving state of the reading means, the number of synthesis processes can be greatly reduced, and the barcode data synthesis process can be made more efficient.

以下、図面を参照して、本発明の実施形態を説明する。
本発明の実施形態に係るバーコード読取装置1は、ユーザがスキャナ部分を手に持ってバーコードを読み取らせる手持ち式であるものとする。また、本実施形態では、読取対象のバーコード全体の幅が、バーコード読取装置1が一回で読取可能な範囲よりも広いものとし、この読取範囲をバーの配列方向に連続的に移動させて、当該バーコード全体を読み取らせることを前提とする。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
The barcode reader 1 according to the embodiment of the present invention is assumed to be a hand-held type in which the user reads the barcode while holding the scanner portion in his hand. In the present embodiment, the width of the entire barcode to be read is wider than the range that the barcode reader 1 can read at one time, and this reading range is continuously moved in the bar arrangement direction. It is assumed that the entire barcode is read.

まず、本実施形態における構成を説明する。
図1に、本発明の実施形態に係るバーコード読取装置1の主要部構成を示す。バーコード読取装置1は、図1に示すように、CPU(Central Processing Unit)10、表示部11、入力部12、記憶部13、RAM(Random Access Memory)14、読取部15、ジャイロセンサ16を備え、各部はバス17を介して電気的に接続され、電源部18からの電力供給を受けている。
First, the configuration in the present embodiment will be described.
FIG. 1 shows a main part configuration of a barcode reading apparatus 1 according to an embodiment of the present invention. As shown in FIG. 1, the barcode reader 1 includes a CPU (Central Processing Unit) 10, a display unit 11, an input unit 12, a storage unit 13, a RAM (Random Access Memory) 14, a reading unit 15, and a gyro sensor 16. Each unit is electrically connected via the bus 17 and receives power supply from the power supply unit 18.

CPU10は、記憶部13に記憶された各種制御プログラムをRAM14に展開し、当該制御プログラムとの協働によって、各種の処理を行う。具体的にCPU10は、記憶部13に記憶された制御プログラムに従ってバーコード読取処理を行う(図2参照)。   The CPU 10 develops various control programs stored in the storage unit 13 in the RAM 14 and performs various processes in cooperation with the control programs. Specifically, the CPU 10 performs a barcode reading process according to a control program stored in the storage unit 13 (see FIG. 2).

表示部11は、LCD(Liquid Crystal Display)等のディスプレイを有し、CPU10から入力される表示制御信号に従って所要の表示処理を行う。   The display unit 11 includes a display such as an LCD (Liquid Crystal Display), and performs a required display process according to a display control signal input from the CPU 10.

入力部12は、バーコードの読み取りを開始させるためのトリガキー等の各種のキーや、表示部11の表示画面上を覆うように設けられたタッチパネルを有し、キー操作又はタッチパネルの操作による操作信号をCPU10に出力する。   The input unit 12 includes various keys such as a trigger key for starting barcode reading, and a touch panel provided so as to cover the display screen of the display unit 11, and an operation signal generated by key operation or touch panel operation. Is output to the CPU 10.

記憶部13は、CPU10により実行される各種制御プログラム及びこれらの制御プログラムの実行時に必要なデータを記憶している。   The storage unit 13 stores various control programs executed by the CPU 10 and data necessary for executing these control programs.

RAM14は、CPU10により実行される各種制御プログラムを展開するプログラム格納領域と、入力データ及び制御プログラムの実行時に生じる処理結果等のデータを一時的に格納するデータ格納領域とを有する。   The RAM 14 has a program storage area for developing various control programs executed by the CPU 10 and a data storage area for temporarily storing input data and data such as processing results generated when the control program is executed.

読取部15は、CMOS(Complementary Metal Oxide Semiconductor)イメージセンサ又はCCD(Charge Coupled Device)イメージセンサ、A/Dコンバータ等により構成される。読取部15は、CMOSイメージセンサ又はCCDイメージセンサにより、読取対象のバーコードに照射されたレーザ光の反射光によってバーコードを読み取り、読取により得られた光画像信号を光電変換により電気信号(アナログ信号)に変換し、A/Dコンバータにより、このアナログ信号をデジタル信号に変換し、バーコードデータを取得する。   The reading unit 15 includes a CMOS (Complementary Metal Oxide Semiconductor) image sensor, a CCD (Charge Coupled Device) image sensor, an A / D converter, or the like. The reading unit 15 uses a CMOS image sensor or a CCD image sensor to read a barcode with reflected light of a laser beam irradiated on the barcode to be read, and photoelectrically converts the optical image signal obtained by the reading into an electrical signal (analogue). Signal), and the analog signal is converted into a digital signal by an A / D converter to obtain barcode data.

読取部15で取得されるバーコードデータは、バーコードの白色又は黒色のバーの幅を示すカウンタ値として表される。例えば、バーの配列順に、白色の幅が60、黒色の幅が10、白色の幅が20、…のように表される。以下では、読取部15で取得されるバーコードデータを「バーデータ」と呼ぶことにする。   The barcode data acquired by the reading unit 15 is represented as a counter value indicating the width of the white or black bar of the barcode. For example, the white width is 60, the black width is 10, the white width is 20,... Hereinafter, the barcode data acquired by the reading unit 15 is referred to as “bar data”.

ジャイロセンサ16は、加速度センサ161及び傾きセンサ162を有し、3次元空間における読取部15の移動状態を検出する。加速度センサ161は、3次元空間で移動した読取部15の加速度、移動した時間、移動した方向を検出する。加速度センサ161により検出された情報によって、読取部15の移動距離を算出することができる。傾きセンサ162は、3次元空間での読取部15の動きによって生じた読取部15の傾きを検出する。傾きセンサ162で検出された傾きによって、バーコード面に対する光の照射角度を算出することができる。   The gyro sensor 16 includes an acceleration sensor 161 and an inclination sensor 162, and detects the movement state of the reading unit 15 in a three-dimensional space. The acceleration sensor 161 detects the acceleration of the reading unit 15 moved in the three-dimensional space, the time moved, and the direction moved. Based on the information detected by the acceleration sensor 161, the moving distance of the reading unit 15 can be calculated. The tilt sensor 162 detects the tilt of the reading unit 15 caused by the movement of the reading unit 15 in the three-dimensional space. Based on the inclination detected by the inclination sensor 162, the light irradiation angle with respect to the barcode surface can be calculated.

次に、本実施形態における動作を説明する。
まず、図2のフローチャートを参照して、バーコード読取装置1のCPU10の制御の下で実行されるバーコード読取処理について説明する。
Next, the operation in this embodiment will be described.
First, the barcode reading process executed under the control of the CPU 10 of the barcode reading apparatus 1 will be described with reference to the flowchart of FIG.

入力部12のトリガキーが押下されると、所定のスキャン速度(例えば、100スキャン/秒)で読取部15によりバーコードの読取が開始される(ステップS1)。トリガキーの押下後タイムアウトになる時間内であれば(ステップS2;NO)、バーコードの読取によってバーデータが取得され、RAM14に格納される(ステップS3)。   When the trigger key of the input unit 12 is pressed, reading of the barcode is started by the reading unit 15 at a predetermined scanning speed (for example, 100 scans / second) (step S1). If the time is within the time-out period after the trigger key is pressed (step S2; NO), the bar data is acquired by reading the bar code and stored in the RAM 14 (step S3).

次いで、ステップS3で取得されたバーデータに対してデコード処理が施される(ステップS4)。ステップS4でのデコード処理では、バーデータによって表される白色と黒色の配列が数値や文字の配列を表すデータに変換される。   Next, a decoding process is performed on the bar data acquired in step S3 (step S4). In the decoding process in step S4, the white and black arrays represented by the bar data are converted into data representing numerical values and character arrays.

デコード処理が終了すると、ステップS4のデコード処理において正常にデコードすることができたか否かが判定される(ステップS5)。ステップS5において、正常にデコードすることができたと判定された場合(ステップS5;YES)、バーデータの合成処理が「無効」に設定され(ステップS9)、本バーコード読取処理が終了する。   When the decoding process is completed, it is determined whether or not the decoding process can be normally performed in the decoding process of step S4 (step S5). If it is determined in step S5 that decoding has been performed normally (step S5; YES), the bar data combining process is set to “invalid” (step S9), and the barcode reading process ends.

ステップS5において、正常にデコードすることができなかったと判定された場合(ステップS5;NO)、ステップS3で取得されたバーデータの補正処理が行われ(ステップS6)、続いて、補正後のバーデータの合成処理が行われる(ステップS7)。ここで、バーデータの合成処理の前にバーデータの補正処理が行われるのは、ユーザの手のぶれ等に起因して、実際に取得されるバーデータが、予め設定された基準位置から読み取られた場合に取得されるバーデータと異なる可能性が高いためである。   If it is determined in step S5 that the data cannot be normally decoded (step S5; NO), the bar data acquired in step S3 is corrected (step S6), and then the corrected bar is displayed. Data synthesis processing is performed (step S7). Here, the correction processing of the bar data is performed before the combining processing of the bar data because the actually acquired bar data is read from the preset reference position due to the shake of the user's hand or the like. This is because there is a high possibility that the data is different from the bar data acquired when the data is received.

ステップS6の補正処理については、後に図5〜図22を参照して詳細に説明する。また、ステップS7の合成処理については、後に図3及び図4を参照して詳細に説明する。   The correction process in step S6 will be described in detail later with reference to FIGS. Further, the combining process in step S7 will be described in detail later with reference to FIGS.

ステップS7の合成処理では、バーデータの合成後に再度デコード処理が行われる。そして、ステップS7の終了後、合成されたバーデータを正常にデコードすることができたか否かが判定される(ステップS8)。   In the synthesizing process in step S7, the decoding process is performed again after synthesizing the bar data. Then, after completion of step S7, it is determined whether or not the synthesized bar data has been successfully decoded (step S8).

ステップS8において、合成されたバーデータを正常にデコードすることができなかったと判定された場合(ステップS8;NO)、ステップS2に戻り、タイムアウトになるまで、ステップS3以降の処理が繰り返される。   If it is determined in step S8 that the combined bar data has not been successfully decoded (step S8; NO), the process returns to step S2, and the processes in and after step S3 are repeated until time-out occurs.

一方、ステップS8において、合成されたバーデータを正常にデコードすることができたと判定された場合(ステップS8;YES)、以降のバーデータの合成処理が「無効」に設定され(ステップS9)、本バーコード読取処理が終了する。   On the other hand, if it is determined in step S8 that the combined bar data has been successfully decoded (step S8; YES), the subsequent bar data combining process is set to “invalid” (step S9). The barcode reading process ends.

次に、図3のフローチャート及び図4を参照して、バーデータの合成処理(図2のステップS7)について説明する。図3では、後に説明する補正処理が施された後のバーデータ(即ち、予め設定された基準位置から読み取られた場合に取得されるバーデータ)の合成処理を説明する。   Next, with reference to the flowchart of FIG. 3 and FIG. 4, the bar data composition processing (step S7 of FIG. 2) will be described. FIG. 3 illustrates a synthesis process of bar data (that is, bar data acquired when read from a preset reference position) after a correction process described later is performed.

まず、バーデータの合成処理が「有効」に設定されているか否かが判定される(ステップS11)。なお、バーコードの読取を開始する時点では、バーコードの合成処理が「無効」に設定されているものとする。   First, it is determined whether or not the bar data combining process is set to “valid” (step S11). It is assumed that the barcode synthesis process is set to “invalid” at the time of starting barcode reading.

ステップS11においてバーデータの合成処理が「有効」に設定されていない場合、即ち「無効」に設定されていると判定された場合(ステップS11;NO)、1回目の読取で取得されたバーデータからスタートコード又はストップコードが検出され(ステップS12)、スタートコード又はストップコードを検出することができたか否かが判定される(ステップS13)。   When the bar data composition processing is not set to “valid” in step S11, that is, when it is determined that it is set to “invalid” (step S11; NO), the bar data acquired by the first reading A start code or stop code is detected (step S12), and it is determined whether the start code or stop code has been detected (step S13).

ステップS13において、スタートコード又はストップコードを検出することができなかったと判定された場合(ステップS13;NO)、本合成処理が終了する。一方、ステップS13において、スタートコード又はストップコードを検出することができたと判定された場合(ステップS13;YES)、バーデータの合成処理が「有効」に設定される(ステップS14)。   In step S13, when it is determined that the start code or the stop code cannot be detected (step S13; NO), the synthesis process ends. On the other hand, if it is determined in step S13 that the start code or stop code has been detected (step S13; YES), the bar data composition processing is set to “valid” (step S14).

また、次回の合成に必要な移動距離を表す合成用移動距離が0に設定され(ステップS15)、ジャイロセンサ16において現在の位置情報がリセットされる(ステップS16)。更に、1回目の読取で取得されたバーデータがRAM14に格納され(ステップS17)、図2のステップS8に戻る。   In addition, the composition travel distance indicating the travel distance necessary for the next composition is set to 0 (step S15), and the current position information is reset in the gyro sensor 16 (step S16). Further, the bar data acquired by the first reading is stored in the RAM 14 (step S17), and the process returns to step S8 in FIG.

ステップS11において、バーコードの合成処理が「有効」に設定されていると判定された場合(ステップS11;YES)、合成用移動距離が0に設定されているか否かが判定される(ステップS18)。ステップS18において、合成用移動距離が0に設定されていると判定された場合(ステップS18;YES)、2回目の読取で取得されたバーデータからスタートコード又はストップコードが検出される(ステップS19)。   If it is determined in step S11 that the barcode combining process is set to “valid” (step S11; YES), it is determined whether the combining moving distance is set to 0 (step S18). ). If it is determined in step S18 that the composition moving distance is set to 0 (step S18; YES), a start code or a stop code is detected from the bar data acquired in the second reading (step S19). ).

次いで、ステップS19で検出されたスタートコード又はストップコードのパターンが、1回目の読取で検出されたスタートコード又はストップコードのパターンと一致するか否かが判定される(ステップS20)。   Next, it is determined whether or not the start code or stop code pattern detected in step S19 matches the start code or stop code pattern detected in the first reading (step S20).

ステップS20において、両パターンが一致しないと判定された場合(ステップS20;NO)、ステップS24に移行し、前回(1回目)取得されたバーデータがRAM14からクリアされ(ステップS24)、今回(2回目)取得されたバーデータがRAM14に格納され(ステップS25)、図2のステップS8に戻る。   If it is determined in step S20 that the two patterns do not match (step S20; NO), the process proceeds to step S24, and the previously acquired (first time) bar data is cleared from the RAM 14 (step S24), and this time (2 (Second time) The acquired bar data is stored in the RAM 14 (step S25), and the process returns to step S8 in FIG.

一方、ステップS20において、両パターンが一致すると判定された場合(ステップS20;YES)、ジャイロセンサ16により検出された移動距離が取得され(ステップS21)、この取得された移動距離に基づいて1カウンタ値の移動距離(1カウンタ値あたりの移動距離)が算出される(ステップS22)。   On the other hand, when it is determined in step S20 that both patterns match (step S20; YES), the moving distance detected by the gyro sensor 16 is acquired (step S21), and one counter is based on the acquired moving distance. A value movement distance (movement distance per counter value) is calculated (step S22).

図4に示すように、1回目、2回目の読取時のバーコード面における光の照射ライン(読取範囲)をそれぞれL1、L2とする。このとき、1回目、2回目の読取で取得されたバーコードの最初の黒色までのカウンタ値をそれぞれC1、C2とし、1回目と2回目の読取の間にジャイロセンサ16により検出された移動距離をΔX1とすると、1カウンタ値の移動距離ΔXは、式(1)のように算出される。
ΔX=ΔX1/(C1−C2) …(1)
As shown in FIG. 4, the light irradiation lines (reading ranges) on the barcode surface at the time of the first reading and the second reading are L1 and L2, respectively. At this time, the counter values until the first black of the bar code acquired in the first and second readings are C1 and C2, respectively, and the moving distance detected by the gyro sensor 16 between the first and second readings. Is ΔX1, the moving distance ΔX of one counter value is calculated as in equation (1).
ΔX = ΔX1 / (C1-C2) (1)

1カウンタ値の移動距離が算出されると、今回の読取で取得されたバーデータのカウンタ値の総計及び1カウンタ値の移動距離から、次回の合成までに必要な移動距離を表す合成用移動距離が算出される(ステップS23)。図4において、2回目に取得されたバーデータのカウンタ値の総計をCW1とすると、合成用移動距離ΔX2は、1カウンタ値の移動距離ΔXを用いて式(2)のように算出される。
ΔX2=CW1×ΔX …(2)
When the moving distance of one counter value is calculated, the moving distance for composition indicating the moving distance necessary until the next combining from the total of the counter values of the bar data acquired by the current reading and the moving distance of the one counter value. Is calculated (step S23). In FIG. 4, assuming that the total counter value of the bar data acquired for the second time is CW1, the composition moving distance ΔX2 is calculated as shown in the equation (2) using the moving distance ΔX of one counter value.
ΔX2 = CW1 × ΔX (2)

合成用移動距離の算出後、前回(1回目)取得されたバーデータがRAM14からクリアされ(ステップS24)、今回(2回目)取得されたバーデータがRAM14に格納され(ステップS25)、図2のステップS8に戻る。   After calculation of the moving distance for composition, the bar data acquired last time (first time) is cleared from the RAM 14 (step S24), and the bar data acquired this time (second time) is stored in the RAM 14 (step S25). Return to step S8.

ステップS18において、合成用移動距離が0ではないと判定された場合(ステップS18;NO)、ジャイロセンサ16により、読取部15が合成用移動距離分移動したことが検出されると(ステップS26;YES)、前回取得されたバーデータ(即ち合成用移動距離分移動する直前までに取得されたバーデータ)と、今回取得されたバーデータ(即ち合成用移動距離分移動した直後に取得されたバーデータ)とが合成される(ステップS27)。   If it is determined in step S18 that the composition travel distance is not 0 (step S18; NO), the gyro sensor 16 detects that the reading unit 15 has moved by the composition travel distance (step S26; YES), previously acquired bar data (i.e., bar data acquired immediately before moving for the moving distance for compositing), and bar data acquired this time (i.e., the bar acquired immediately after moving for the moving distance for compositing) Data) is synthesized (step S27).

ステップS27では、図4に示すように、2回目に取得されたバーデータ(合成用移動距離ΔX2分移動する直前に取得されたバーデータ)と、2回目の読取時から合成用移動距離ΔX2分移動した直後の照射ラインL3において取得されたバーデータとが結合される。なお、図4において、1回目、2回目、3回目、…とは、バーデータの合成のために最低限必要な読取回数を示すものであり、読取部15が実際に所定のスキャン速度で読み取った回数を示すものではない。   In step S27, as shown in FIG. 4, the bar data acquired for the second time (bar data acquired immediately before moving for the moving distance for combining ΔX2) and the moving distance for combining ΔX2 from the time of the second reading. The bar data acquired in the irradiation line L3 immediately after the movement is combined. In FIG. 4, “first time”, “second time”, “third time”,... Indicate the minimum number of readings required for synthesizing the bar data, and the reading unit 15 actually reads at a predetermined scanning speed. It does not indicate the number of times.

ステップS27での合成後、その合成されたバーデータに対してデコード処理が施される(ステップS28)。デコード処理が終了すると、ステップS28のデコード処理において正常にデコードすることができたか否かが判定される(ステップS29)。ステップS29において、正常にデコードすることができたと判定された場合(ステップS29;YES)、本合成処理が終了し、図2のステップS8へ戻る。   After the combining in step S27, the combined bar data is decoded (step S28). When the decoding process is completed, it is determined whether or not the decoding process can be normally performed in the decoding process of step S28 (step S29). In step S29, when it is determined that the decoding can be normally performed (step S29; YES), the synthesis process ends, and the process returns to step S8 in FIG.

一方、ステップS29において、正常にデコードすることができなかったと判定された場合(ステップS29;NO)、式(2)と同様に、今回の読取で取得されたバーデータのカウンタ値の総計に、ステップS22で算出された1カウンタ値の移動距離ΔXを乗算することにより、次回の合成に必要な移動距離を表す合成用移動距離が算出される(ステップS30)。ステップS30の終了後、ステップS27で合成されたバーデータがRAM14に格納され(ステップS31)、図2のステップS8へ戻る。   On the other hand, if it is determined in step S29 that the data could not be decoded normally (step S29; NO), as in equation (2), the total counter value of the bar data acquired in the current reading is By multiplying the movement distance ΔX of one counter value calculated in step S22, a composition movement distance representing a movement distance necessary for the next composition is calculated (step S30). After the end of step S30, the bar data synthesized in step S27 is stored in the RAM 14 (step S31), and the process returns to step S8 in FIG.

次に、図5のフローチャート及び図6〜図22を参照して、バーデータの補正処理(図2のステップS6)について詳細に説明する。   Next, the bar data correction process (step S6 in FIG. 2) will be described in detail with reference to the flowchart in FIG. 5 and FIGS.

本実施形態においてバーデータの補正処理とは、ジャイロセンサ16から取得される読取部15の3次元空間(x−y−z)における移動状態に基づいて、読取部15から実際に取得されたバーデータを、予め設定された基準位置から読み取られた場合に取得されるバーデータに補正する処理である。以下では、バーコード面の中心部分を直交座標系の原点Oとし、バーコード面に垂直な方向をx軸方向、バーコード面上の各バーが配列する方向をy軸方向として説明する。   In the present embodiment, the bar data correction process refers to a bar actually acquired from the reading unit 15 based on the movement state of the reading unit 15 in the three-dimensional space (xyz) acquired from the gyro sensor 16. This is a process of correcting the data to bar data acquired when the data is read from a preset reference position. In the following description, it is assumed that the central portion of the barcode surface is the origin O of the orthogonal coordinate system, the direction perpendicular to the barcode surface is the x-axis direction, and the direction in which each bar on the barcode surface is arranged is the y-axis direction.

本実施形態では、ジャイロセンサ16から取得される読取部15の3次元空間における移動状態を、読取部15の光源OSからの照射状態に基づいて以下の5通りに分類し、それぞれの移動状態に対応する補正処理(補正H1〜補正H5)について説明する。   In the present embodiment, the movement state in the three-dimensional space of the reading unit 15 acquired from the gyro sensor 16 is classified into the following five types based on the irradiation state from the light source OS of the reading unit 15, and the respective movement states are classified. A corresponding correction process (correction H1 to correction H5) will be described.

[1]バーコード面βに近づくように光を照射した状態(図6参照);
[2]バーコード面βから遠ざかるように光を照射した状態(図9参照);
[3]x−y平面内の基準方向(x軸方向に平行)に対して傾斜するように光を照射した状態(図12参照);
[4]バーコード面βに対してバーの配列方向(y軸方向)に移動するように光を照射した状態(図15参照);
[5]バーコード面β上の照射ラインがバーの配列方向(y軸方向)に対して傾斜するように光を照射した状態(図18参照).
[1] A state in which light is irradiated so as to approach the barcode surface β (see FIG. 6);
[2] A state of irradiating light away from the barcode surface β (see FIG. 9);
[3] A state in which light is irradiated so as to be inclined with respect to a reference direction (parallel to the x-axis direction) in the xy plane (see FIG. 12);
[4] A state in which light is irradiated so as to move in the bar array direction (y-axis direction) with respect to the barcode surface β (see FIG. 15);
[5] A state in which light is irradiated such that the irradiation line on the barcode surface β is inclined with respect to the bar arrangement direction (y-axis direction) (see FIG. 18).

なお、実際にジャイロセンサ16で検出される移動状態は、上記[1]〜[5]に対応する移動状態が複合されたものであるが、これらの複合された移動状態を上記[1]〜[5]に分離して、各々の移動状態に対する補正処理を行うことにより、最終的には複合された移動状態に対する補正処理と同等の結果が得られる。   Note that the movement state actually detected by the gyro sensor 16 is a combination of the movement states corresponding to the above [1] to [5], but these combined movement states are the above [1] to [1] to [5]. By performing the correction process for each moving state separately in [5], a result equivalent to the correction process for the combined moving state is finally obtained.

図5に示すバーデータの補正処理では、まず、ジャイロセンサ16から読取部15の移動状態が取得される(ステップS40)。そして、当該移動状態が、図6に示すようにバーコード面βに近づくように光を照射した状態(移動状態[1])又は図9に示すようにバーコード面βから遠ざかるように光を照射した状態(移動状態[2])を含むか否かが判定される(ステップS41)。   In the bar data correction process shown in FIG. 5, first, the movement state of the reading unit 15 is acquired from the gyro sensor 16 (step S40). Then, the light is emitted so that the moving state is irradiated with light so as to approach the barcode surface β as shown in FIG. 6 (moving state [1]) or away from the barcode surface β as shown in FIG. It is determined whether or not the irradiation state (movement state [2]) is included (step S41).

ステップS41において、ジャイロセンサ16から取得された移動状態が、移動状態[1]又は移動状態[2]を含むと判定された場合(ステップS41;YES)、以下の補正H1又は補正H2が行われる(ステップS42)。   If it is determined in step S41 that the movement state acquired from the gyro sensor 16 includes the movement state [1] or the movement state [2] (step S41; YES), the following correction H1 or correction H2 is performed. (Step S42).

[補正H1]
図6に示す移動状態[1]の場合、光源OSがバーコード面βに近づくにつれ、図7(a)に示すように、バーコード面βにおける光の照射ラインLの幅が狭くなる。よって、図7(b)に示すように、実際に読取部15が認識する各バーの幅は、図7(a)に示す元の幅よりも太くなる。図7(a)及び図7(b)において白色及び黒色それぞれに対応する「バー幅」は、バーの幅を表すカウンタ値である。以下の、図10、図13、図16、図19についても同様である。
[Correction H1]
In the moving state [1] shown in FIG. 6, as the light source OS approaches the barcode surface β, the width of the light irradiation line L on the barcode surface β becomes narrower as shown in FIG. Therefore, as shown in FIG. 7B, the width of each bar actually recognized by the reading unit 15 is larger than the original width shown in FIG. In FIG. 7A and FIG. 7B, “bar width” corresponding to each of white and black is a counter value representing the width of the bar. The same applies to the following FIG. 10, FIG. 13, FIG. 16, and FIG.

読取部15の光源OSの移動距離に応じてバー幅が太くなる割合は、読取部15で使用されるスキャナモジュールの特性により異なっており、移動距離の関数として予め設定されている。例えば、図8に示すように、1回目の読取で取得されるバー幅をB1、2回目の読取で取得されるバー幅をB2、ジャイロセンサ16から取得される光源OSの移動距離をΔD、移動距離に応じてバー幅が太くなる割合を補正係数f1とすると、補正H1での補正後のバー幅は、式(3)のように表される。
補正後のバー幅=補正前のバー幅×ΔD×f1 …(3)
The rate at which the bar width increases in accordance with the movement distance of the light source OS of the reading unit 15 varies depending on the characteristics of the scanner module used in the reading unit 15, and is set in advance as a function of the movement distance. For example, as shown in FIG. 8, the bar width acquired by the first reading is B1, the bar width acquired by the second reading is B2, the movement distance of the light source OS acquired from the gyro sensor 16 is ΔD, When the rate at which the bar width becomes thicker according to the movement distance is the correction coefficient f1, the bar width after the correction with the correction H1 is expressed as in Expression (3).
Bar width after correction = bar width before correction × ΔD × f1 (3)

[補正H2]
図9に示す移動状態[2]の場合、光源OSがバーコード面βから遠ざかるにつれ、図10(a)に示すように、バーコード面βにおける光の照射ラインLが広くなる。よって、図10(b)に示すように実際に読取部15が認識する各バーの幅は、図10(a)に示す元の幅よりも細くなる。
[Correction H2]
In the moving state [2] shown in FIG. 9, as the light source OS moves away from the barcode surface β, the light irradiation line L on the barcode surface β becomes wider as shown in FIG. Therefore, as shown in FIG. 10B, the width of each bar actually recognized by the reading unit 15 is narrower than the original width shown in FIG.

移動距離に応じてバー幅が細くなる割合は、読取部15で使用されるスキャナモジュールの特性により異なっており、予め設定されている。例えば、図11に示すように、1回目の読取で取得されるバー幅をB1、2回目の読取で取得されるバー幅をB2、ジャイロセンサ16から取得される光源OSの移動距離をΔD、移動距離に応じてバー幅が細くなる割合を補正係数f2とすると、補正H2での補正後のバー幅は、式(4)のように表される。
補正後のバー幅=補正前のバー幅×ΔD×f2 …(4)
The rate at which the bar width is reduced according to the moving distance varies depending on the characteristics of the scanner module used in the reading unit 15 and is set in advance. For example, as shown in FIG. 11, the bar width acquired by the first reading is B1, the bar width acquired by the second reading is B2, the movement distance of the light source OS acquired from the gyro sensor 16 is ΔD, When the rate at which the bar width is reduced according to the moving distance is the correction coefficient f2, the bar width after the correction with the correction H2 is expressed as in Expression (4).
Bar width after correction = bar width before correction × ΔD × f2 (4)

図5のステップS41において、ジャイロセンサ16から取得された移動状態が、移動状態[1]又は移動状態[2]の何れも含まないと判定された場合(ステップS41;NO)、又はステップS42の補正H1若しくは補正H2が終了すると、ジャイロセンサ16から取得された移動状態が、図12に示すように、x−y平面内において基準方向(x軸方向に平行)に対して傾斜するように光を照射した状態(移動状態[3])を含むか否かが判定される(ステップS43)。   When it is determined in step S41 in FIG. 5 that the movement state acquired from the gyro sensor 16 does not include either the movement state [1] or the movement state [2] (step S41; NO), or When the correction H1 or the correction H2 is completed, the movement state acquired from the gyro sensor 16 is light so as to be inclined with respect to the reference direction (parallel to the x-axis direction) in the xy plane as shown in FIG. It is determined whether or not the state (moving state [3]) is included (step S43).

ステップS43において、ジャイロセンサ16から取得された移動状態が移動状態[3]を含むと判定された場合(ステップS43;YES)、以下の補正H3が行われる(ステップS44)。   In step S43, when it is determined that the movement state acquired from the gyro sensor 16 includes the movement state [3] (step S43; YES), the following correction H3 is performed (step S44).

[補正H3]
図12に示すように、光の照射方向がx軸に対して傾斜している場合、図13(a)に示すバーコード面β上の照射ラインLは、バーの位置(y座標の値)によって光源OSからの距離が異なる。従って、図12に示す移動状態[3]の場合、図13(b)に示すように、y軸の正の方向に向かって光源OSからの距離が近くなるため、バー幅が太くなり、y軸の負の方向に向かって光源OSからの距離が遠くなるため、バー幅が細くなる。
[Correction H3]
As shown in FIG. 12, when the light irradiation direction is inclined with respect to the x-axis, the irradiation line L on the barcode surface β shown in FIG. 13A is the position of the bar (value of the y coordinate). Depending on the distance from the light source OS. Therefore, in the movement state [3] shown in FIG. 12, as shown in FIG. 13B, since the distance from the light source OS becomes closer to the positive direction of the y-axis, the bar width becomes thicker and y Since the distance from the light source OS increases toward the negative direction of the axis, the bar width becomes narrower.

図14に示すように、光の照射方向がx軸に対して傾斜角Θで傾斜している場合、バーの位置(y=Bd)に応じてバー幅が変化する割合は、読取部15で使用されるスキャナモジュールの特性により異なっており、バーの位置Bd、ジャイロセンサ16から取得される傾斜角Θの関数として予め設定されている。バー幅が変化する割合を補正係数f(Bd,Θ)とすると、補正H3での補正後のバー幅は、式(5)のように表される。
補正後のバー幅=補正前のバー幅×f(Bd,Θ) …(5)
As shown in FIG. 14, when the light irradiation direction is inclined with respect to the x axis at an inclination angle Θ, the rate at which the bar width changes according to the bar position (y = Bd) is determined by the reading unit 15. It differs depending on the characteristics of the scanner module used, and is preset as a function of the bar position Bd and the inclination angle Θ acquired from the gyro sensor 16. When the rate at which the bar width changes is the correction coefficient f (Bd, Θ), the bar width after the correction with the correction H3 is expressed as shown in Equation (5).
Bar width after correction = bar width before correction × f (Bd, Θ) (5)

図5のステップS43において、ジャイロセンサ16から取得された移動状態が、移動状態[3]を含まないと判定された場合(ステップS43;NO)、又はステップS44の補正H3が終了すると、ジャイロセンサ16から取得された移動状態が、図15に示すように、バーコード面βに対してy軸方向に移動するように光を照射した状態(移動状態[4])を含むか否かが判定される(ステップS45)。   When it is determined in step S43 in FIG. 5 that the movement state acquired from the gyro sensor 16 does not include the movement state [3] (step S43; NO), or when the correction H3 in step S44 ends, the gyro sensor As shown in FIG. 15, it is determined whether or not the movement state acquired from 16 includes a state (movement state [4]) in which light is irradiated so as to move in the y-axis direction with respect to the barcode surface β. (Step S45).

ステップS45において、ジャイロセンサ16から取得された移動状態が、移動状態[4]を含むと判定された場合(ステップS45;YES)、以下の補正H4が行われる(ステップS46)。   In step S45, when it is determined that the movement state acquired from the gyro sensor 16 includes the movement state [4] (step S45; YES), the following correction H4 is performed (step S46).

[補正H4]
図15に示す移動状態[4]の場合、図16(a)に示すバーコード面β上の照射ラインLは、バーの配列方向に移動するため、読取部15が認識するバーコードのスタートマージンの幅(又はエンドマージンの幅)は、図16(b)に示すように変化してしまう。そこで、補正H4では、1回目の読取で取得されたバーデータを基準として、2回目の読取で取得されたバーデータのスタートマージンの幅を、スタートコード等の特徴を有するバーデータに基づいて補正する。
[Correction H4]
In the case of the movement state [4] shown in FIG. 15, the irradiation line L on the barcode surface β shown in FIG. 16A moves in the bar arrangement direction, and therefore the barcode start margin recognized by the reading unit 15. The width (or the width of the end margin) changes as shown in FIG. Therefore, in the correction H4, the start margin width of the bar data acquired by the second reading is corrected based on the bar data having characteristics such as the start code, based on the bar data acquired by the first reading. To do.

図17に示すように、1回目、2回目の読取でのバーコードの最初の黒色までのカウンタ値をそれぞれc1、c2とすると、スタートマージンの幅を、cx=c1−c2の分だけ補正すればよい。即ち、補正後のスタートマージンの幅は、式(6)のように表される。
補正後のスタートマージンの幅=補正前のスタートマージンの幅+cx …(6)
As shown in FIG. 17, when the counter values up to the first black of the barcode in the first reading and the second reading are c1 and c2, respectively, the start margin width is corrected by cx = c1-c2. That's fine. That is, the width of the start margin after correction is expressed as Equation (6).
Width of start margin after correction = width of start margin before correction + cx (6)

図5のステップS45において、ジャイロセンサ16から取得された移動状態が、移動状態[4]を含まないと判定された場合(ステップS45;NO)、又はステップS46の補正H4が終了すると、ジャイロセンサ16から取得された移動状態が、図18に示すように、バーコード面β上の照射ラインがバーの配列方向(y軸方向)に対して傾斜するように光を照射した状態(移動状態[5])を含むか否かが判定される(ステップS47)。   When it is determined in step S45 in FIG. 5 that the movement state acquired from the gyro sensor 16 does not include the movement state [4] (step S45; NO), or when the correction H4 in step S46 is completed, the gyro sensor As shown in FIG. 18, the movement state acquired from 16 is a state in which light is irradiated so that the irradiation line on the barcode surface β is inclined with respect to the bar arrangement direction (y-axis direction) (movement state [ 5]) is included (step S47).

ステップS47において、ジャイロセンサ16から取得された移動状態が、移動状態[5]を含むと判定された場合(ステップS47;YES)、以下の補正H5が行われる(ステップS48)。   If it is determined in step S47 that the movement state acquired from the gyro sensor 16 includes the movement state [5] (step S47; YES), the following correction H5 is performed (step S48).

[補正H5]
図18に示す移動状態[5]では、図19(a)に示すように、バーコード面β上の照射ラインLがバーの配列方向(y軸方向)に対して傾斜しているため、図19(b)に示すように、各バーの幅は図19(a)に示す元の幅よりも太くなる。
[Correction H5]
In the moving state [5] shown in FIG. 18, as shown in FIG. 19A, the irradiation line L on the barcode surface β is inclined with respect to the bar arrangement direction (y-axis direction). As shown in FIG. 19 (b), the width of each bar is larger than the original width shown in FIG. 19 (a).

例えば、図20に示すように、1回目の読取方向がバーの配列方向と平行であり(バー幅B1)、2回目の読取方向がバーの配列方向に対して角度θ傾斜している場合、2回目の読取で得られるバー幅B2を補正したバー幅Bは式(7)のように表される。
B=B2・cosθ …(7)
For example, as shown in FIG. 20, when the first reading direction is parallel to the bar arrangement direction (bar width B1), and the second reading direction is inclined at an angle θ with respect to the bar arrangement direction, The bar width B obtained by correcting the bar width B2 obtained by the second reading is expressed as shown in Expression (7).
B = B2 · cosθ (7)

しかし、実際の読取では、1回目の読取が図20のようにバーの配列方向に平行になっているとは限らないため、図21に示すように、1回目の読取もバーの配列方向に対して傾斜している場合も含めてバー幅の補正値を算出すべきである。図21に示すように、1回目の読取で得られるバー幅をB1、2回目の読取で得られるバー幅をB2、1回目と2回目の読取の間にジャイロセンサ16から取得された傾斜角をθとする。この場合、図22に示すように、二辺の長さをB1、B2とし、両辺が挟む角度をθとした三角形において、角度θに対応する頂点から対辺(長さC)に下ろした垂線の長さBが、バー幅の補正値となる。   However, in actual reading, since the first reading is not always parallel to the bar arrangement direction as shown in FIG. 20, the first reading is also performed in the bar arrangement direction as shown in FIG. The correction value of the bar width should be calculated including the case where it is inclined. As shown in FIG. 21, the bar width obtained by the first reading is B1, the bar width obtained by the second reading is B2, and the inclination angle acquired from the gyro sensor 16 between the first and second readings. Is θ. In this case, as shown in FIG. 22, in a triangle in which the lengths of the two sides are B1 and B2 and the angle between both sides is θ, the perpendicular line extending from the vertex corresponding to the angle θ to the opposite side (length C) The length B is a bar width correction value.

図22の三角形において、長さCは式(8)のように算出される。

Figure 0004910822
この三角形の面積は(1/2)B・C=(1/2)B1・B2・sinθゆえ、補正後のバー幅Bは、式(9)のように算出される。
Figure 0004910822
In the triangle of FIG. 22, the length C is calculated as shown in Equation (8).
Figure 0004910822
Since the area of this triangle is (1/2) B · C = (1/2) B1 · B2 · sinθ, the corrected bar width B is calculated as shown in Equation (9).
Figure 0004910822

図5のステップS47において、ジャイロセンサ16から取得された移動状態が、移動状態[5]を含まないと判定された場合(ステップS47;NO)、又はステップS48の補正H5が終了すると、補正されたバーデータがRAM14に格納され(ステップS49)、本補正処理が終了する。   In Step S47 of FIG. 5, when it is determined that the movement state acquired from the gyro sensor 16 does not include the movement state [5] (Step S47; NO), or when the correction H5 in Step S48 is completed, the correction is performed. The bar data is stored in the RAM 14 (step S49), and the correction process is terminated.

以上のように、本実施形態のバーコード読取装置1によれば、幅の広いバーコードを読み取る場合、ジャイロセンサ16から最初に取得された移動距離ΔX1に基づいて算出された1カウンタの移動距離ΔXを用いて、バーデータの合成に必要な移動距離(合成用移動距離)を算出し、合成用移動距離分移動する前と後のバーデータを合成するようにしたことにより、合成する領域の重複部分が大幅に削減され、合成処理を実施する回数が大幅に削減される。これにより、バーデータの合成処理を効率化(最適化)させ、デコード処理の処理速度を向上させることができる。   As described above, according to the barcode reader 1 of this embodiment, when reading a wide barcode, the movement distance of one counter calculated based on the movement distance ΔX1 first obtained from the gyro sensor 16 By using ΔX to calculate the travel distance (composition travel distance) necessary for combining the bar data, and combining the bar data before and after moving by the compositing travel distance, The overlapping portion is greatly reduced, and the number of times of performing the synthesis process is greatly reduced. This makes it possible to improve (optimize) the synthesis processing of bar data and improve the processing speed of decoding processing.

また、ジャイロセンサ16から取得された移動状態に基づいて、読取部15により取得されたバーデータを、予め設定された基準位置から読み取った場合のバーデータに補正することにより、より精密な合成処理を行うことができる。   Further, based on the movement state acquired from the gyro sensor 16, the bar data acquired by the reading unit 15 is corrected to the bar data when it is read from a preset reference position. It can be performed.

なお、本実施形態における記述内容は、本発明の趣旨を逸脱しない範囲で適宜変更可能である。   Note that the description in the present embodiment can be changed as appropriate without departing from the spirit of the present invention.

例えば、上述の実施形態では、バーコード面βに対して光源OSが略x−y平面内を移動したときの補正処理を示したが、上記の移動状態[1]〜[5]に加えてz軸方向への移動を含めた移動状態に対応した補正処理を行うと、より精密な合成処理が可能となる。   For example, in the above-described embodiment, the correction processing when the light source OS moves in the substantially xy plane with respect to the barcode surface β has been described, but in addition to the movement states [1] to [5] described above. When correction processing corresponding to the movement state including movement in the z-axis direction is performed, more precise synthesis processing can be performed.

また、上述の実施形態では、合成用移動距離を読取部15による1回の読取で得られたバー幅の総計(カウンタ値の総計)に対応する値としたが、任意の幅に対応する距離に設定してもよい。   In the above-described embodiment, the moving distance for synthesis is a value corresponding to the total bar width (total counter value) obtained by one reading by the reading unit 15, but the distance corresponding to an arbitrary width. May be set.

また、上述の実施形態では、ジャイロセンサ16を用いて読取部15の移動状態を検出する場合を示したが、3次元空間での移動状態が検出可能なものであれば、他のセンサを用いてもよい。   In the above-described embodiment, the case where the moving state of the reading unit 15 is detected using the gyro sensor 16 has been described. However, if the moving state in the three-dimensional space can be detected, another sensor is used. May be.

本発明の実施形態に係るバーコード読取装置の主要部構成を示すブロック図。The block diagram which shows the principal part structure of the barcode reader which concerns on embodiment of this invention. 本実施形態のバーコード読取装置のCPUの制御の下で実行されるバーコード読取処理を示すフローチャート。6 is a flowchart showing a barcode reading process executed under the control of the CPU of the barcode reading apparatus according to the embodiment. 図2に示した合成処理の詳細を示すフローチャート。The flowchart which shows the detail of the synthetic | combination process shown in FIG. バーデータの合成方法を説明するための図。The figure for demonstrating the synthetic | combination method of bar data. 図2に示した補正処理の詳細を示すフローチャート。The flowchart which shows the detail of the correction | amendment process shown in FIG. バーコード面に対する光の照射状態を模式的に示す図であって、バーコード面に近づくように光を照射した状態を示す図。The figure which shows typically the irradiation state of the light with respect to a barcode surface, Comprising: The figure which shows the state irradiated with light so that a barcode surface may be approached. 読取対象のバーコードのイメージデータ及び光の照射ラインを示す図(a)と、図6に示す照射状態において読取部により認識されるバーコードのイメージデータを示す図(b)。The figure (a) which shows the barcode image data and light irradiation line of reading object, and the figure (b) which shows the barcode image data recognized by the reading part in the irradiation state shown in FIG. 図6に示す照射状態におけるバー幅の補正方法を説明するための図。The figure for demonstrating the correction method of the bar width in the irradiation state shown in FIG. バーコード面に対する光の照射状態を模式的に示す図であって、バーコード面から遠ざかるように光を照射した状態を示す図。The figure which shows typically the irradiation state of the light with respect to a barcode surface, Comprising: The figure which shows the state irradiated with light so that it may distance from a barcode surface. 読取対象のバーコードのイメージデータ及び光の照射ラインを示す図(a)と、図9に示す照射状態において読取部により認識されるバーコードのイメージデータを示す図(b)。The figure (a) which shows the barcode image data and light irradiation line of reading object, and the figure (b) which shows the barcode image data recognized by the reading part in the irradiation state shown in FIG. 図9に示す照射状態におけるバー幅の補正方法を説明するための図。The figure for demonstrating the correction method of the bar width in the irradiation state shown in FIG. バーコード面に対する光の照射状態を模式的に示す図であって、x−y平面内において基準方向(x軸方向に平行)から傾斜するように光を照射した状態を示す図。The figure which shows typically the irradiation state of the light with respect to a barcode surface, Comprising: The figure which shows the state irradiated with light so that it may incline from a reference direction (parallel to x-axis direction) in xy plane. 読取対象のバーコードのイメージデータ及び光の照射ラインを示す図(a)と、図12に示す照射状態において読取部により認識されるバーコードのイメージデータを示す図(b)。FIG. 13A is a diagram showing barcode image data to be read and light irradiation lines, and FIG. 13B is a diagram showing barcode image data recognized by the reading unit in the irradiation state shown in FIG. 図12に示す照射状態におけるバー幅の補正方法を説明するための図。The figure for demonstrating the correction method of the bar width in the irradiation state shown in FIG. バーコード面に対する光の照射状態を模式的に示す図であって、バーコード面に対してy軸方向に移動するように光を照射した状態を示す図。The figure which shows typically the irradiation state of the light with respect to a barcode surface, Comprising: The figure which shows the state irradiated with light so that it may move to a y-axis direction with respect to a barcode surface. 読取対象のバーコードのイメージデータ及び光の照射ラインを示す図(a)と、図15に示す照射状態において読取部により認識されるバーコードのイメージデータを示す図(b)。The figure (a) which shows the barcode image data and light irradiation line of reading object, and the figure (b) which shows the barcode image data recognized by the reading part in the irradiation state shown in FIG. 図15に示す照射状態におけるスタートマージン幅の補正方法を説明するための図。The figure for demonstrating the correction method of the start margin width | variety in the irradiation state shown in FIG. バーコード面に対する光の照射状態を模式的に示す図であって、バーコード面上の照射ラインがバーの配列方向(y軸方向)に対して傾斜するように光を照射した状態を示す図。The figure which shows typically the irradiation state of the light with respect to a barcode surface, Comprising: The figure which shows the state irradiated with the light so that the irradiation line on a barcode surface may incline with respect to the arrangement direction (y-axis direction) of a bar . 読取対象のバーコードのイメージデータ及び光の照射ラインを示す図(a)と、図18に示す照射状態の場合に読取部により認識されるバーコードのイメージデータを示す図(b)。FIG. 19A shows a barcode image data to be read and a light irradiation line, and FIG. 18B shows a barcode image data recognized by the reading unit in the irradiation state shown in FIG. 図18に示す照射状態におけるバー幅の補正方法を説明するための図。The figure for demonstrating the correction method of the bar width in the irradiation state shown in FIG. 図18に示す照射状態におけるバー幅の補正方法を説明するための図。The figure for demonstrating the correction method of the bar width in the irradiation state shown in FIG. 図18に示す照射状態におけるバー幅の補正方法を説明するための図。The figure for demonstrating the correction method of the bar width in the irradiation state shown in FIG.

符号の説明Explanation of symbols

1 バーコード読取装置
10 CPU
11 表示部
12 入力部
13 記憶部
14 RAM
15 読取部
16 ジャイロセンサ
161 加速度センサ
162 傾きセンサ
18 電源部
1 Bar code reader 10 CPU
11 Display unit 12 Input unit 13 Storage unit 14 RAM
15 Reading unit 16 Gyro sensor 161 Acceleration sensor 162 Tilt sensor 18 Power supply unit

Claims (8)

バーコードに対する読取範囲の移動とともに当該バーコードを順次読み取ってバーコードデータを取得する読取手段と、
前記読取手段により取得された各バーコードデータを記憶する記憶手段と、
前記読取手段の3次元空間での移動状態を検出する検出手段と、
前記検出手段により検出された移動状態に基づいて、バーコードデータの合成に必要な前記読取手段の移動量を算出する算出手段と、
前記読取手段が前記算出された移動量分移動したか否かを判定する判定手段と、
前記判定手段により前記読取手段が前記算出された移動量分移動したと判定された場合は、移動前に取得されたバーコードデータと、移動後に取得されたバーコードデータとを合成する合成手段と、
前記合成手段により合成されたバーコードデータをデコードするデコード手段と、
を備えるバーコード読取装置。
Reading means for sequentially acquiring the barcode data by sequentially reading the barcode along with the movement of the reading range with respect to the barcode;
Storage means for storing each barcode data acquired by the reading means;
Detecting means for detecting a movement state of the reading means in a three-dimensional space;
Calculation means for calculating a movement amount of the reading means necessary for synthesizing the barcode data based on the movement state detected by the detection means;
Determination means for determining whether or not the reading means has moved by the calculated movement amount;
When the determination unit determines that the reading unit has moved by the calculated movement amount, a combining unit that combines the barcode data acquired before the movement and the barcode data acquired after the movement ; ,
Decoding means for decoding the barcode data synthesized by the synthesis means;
A barcode reader.
前記検出手段により検出された移動状態に基づいて、前記取得されたバーコードデータを補正する補正手段を備え、
前記合成手段は、前記補正手段により補正されたバーコードデータを合成する請求項1に記載のバーコード読取装置。
Based on the movement state detected by the detection means, the correction means for correcting the acquired barcode data,
The barcode reading apparatus according to claim 1, wherein the combining unit combines the barcode data corrected by the correcting unit.
前記検出手段は、ジャイロセンサを用いて前記移動状態を検出し、
前記ジャイロセンサは、3次元空間での前記読取手段の加速度を検出する加速度センサと、3次元空間での前記読取手段の移動によって生じる当該読取手段の傾きを検出する傾きセンサと、を有する請求項1又は2に記載のバーコード読取装置。
The detection means detects the movement state using a gyro sensor,
The gyro sensor includes: an acceleration sensor that detects an acceleration of the reading unit in a three-dimensional space; and an inclination sensor that detects an inclination of the reading unit caused by the movement of the reading unit in a three-dimensional space. 3. The barcode reader according to 1 or 2.
前記検出手段は、前記読取手段が前記バーコードに近づくように移動した移動状態あるいは前記読取手段が前記バーコードから遠ざかるように移動した移動状態のいずれかを検出し、The detecting means detects either the moving state in which the reading means has moved closer to the barcode or the moving state in which the reading means has moved away from the barcode,
前記補正手段は、前記読取手段が前記バーコードに近づくように移動した場合は、前記読取手段の移動距離に応じてバー幅が細くなるように前記バーコードイメージデータを補正し、前記読取手段が前記バーコード面から遠ざかるように移動した場合は、前記読取手段の移動距離に応じてバー幅が太くなるように前記バーコードイメージデータを補正することを特徴とする請求項1乃至3のいずれかに記載のバーコード読取装置。The correction means corrects the barcode image data so that a bar width becomes narrow according to a moving distance of the reading means when the reading means moves so as to approach the barcode, and the reading means 4. The barcode image data is corrected so that a bar width is increased according to a moving distance of the reading unit when the barcode is moved away from the barcode surface. The barcode reader described in 1.
前記検出手段は、前記読取手段が前記バーコードに対して傾斜して光を照射した移動状態を検出し、The detection unit detects a moving state in which the reading unit is irradiated with light inclined with respect to the barcode,
前記補正手段は、前記読取手段が前記バーコードに対して傾斜して光を照射した場合は、前記読取手段の傾斜角に応じてバーコードイメージデータのバー幅を補正することを特徴とする請求項1乃至4のいずれかに記載のバーコード読取装置。The correction means corrects the bar width of the barcode image data in accordance with the inclination angle of the reading means when the reading means irradiates light with an inclination with respect to the barcode. Item 5. The barcode reader according to any one of Items 1 to 4.
前記検出手段は、前記読取手段が前記バーコードに対してバー配列方向に移動した移動状態を検出し、The detection means detects a movement state in which the reading means moves in the bar arrangement direction with respect to the barcode,
前記補正手段は、前記読取手段が前記バーコードに対してバー配列方向に移動した場合は、前記読取手段の移動距離に応じてバーコードイメージデータのスタートマージンの幅を補正することを特徴とする請求項1乃至5のいずれかに記載のバーコード読取装置。The correction means corrects the width of the start margin of the barcode image data according to the moving distance of the reading means when the reading means moves in the bar arrangement direction with respect to the barcode. The barcode reader according to any one of claims 1 to 5.
前記検出手段は、前記読取手段が前記バーコードのバー配列方向に対して傾斜して光を照射した移動状態を検出し、The detection means detects a movement state in which the reading means is irradiated with light inclined with respect to the bar arrangement direction of the barcode,
前記補正手段は、前記読取手段が前記バーコードのバー配列方向に対して傾斜して光を照射した場合は、前記読取手段の前記バー配列方向に対する傾斜角に応じてバーコードイメージデータのバー幅を補正することを特徴とする請求項1乃至6のいずれかに記載のバーコード読取装置。When the reading unit irradiates light with an inclination with respect to the bar arrangement direction of the barcode, the correction unit determines the bar width of the barcode image data according to the inclination angle of the reading unit with respect to the bar arrangement direction. The barcode reader according to claim 1, wherein the barcode reader is corrected.
コンピュータを、
バーコードに対する読取範囲の移動とともに当該バーコードを順次読取手段により読み取らせ、バーコードデータを取得する手段、
前記取得された各バーコードデータを記憶手段に記憶させる手段、
前記読取手段の3次元空間での移動状態を検出する手段、
前記検出された移動状態に基づいて、バーコードデータの合成に必要な前記読取手段の移動量を算出する手段、
前記読取手段が前記算出された移動量分移動したか否かを判定する手段、
前記読取手段が前記算出された移動量分移動したと判定された場合は、移動前に取得されたバーコードデータと、移動後に取得されたバーコードデータとを合成する手段、
前記合成されたバーコードデータをデコードする手段、
として機能させるためのプログラム。
Computer
Means for sequentially reading the barcode by the reading means together with the movement of the reading range with respect to the barcode, and obtaining barcode data;
Means for storing each acquired barcode data in a storage means;
Means for detecting a movement state of the reading means in a three-dimensional space;
Means for calculating a movement amount of the reading means necessary for synthesizing the barcode data based on the detected movement state;
Means for determining whether or not the reading means has moved by the calculated movement amount;
Means for synthesizing the barcode data acquired before the movement and the barcode data acquired after the movement when it is determined that the reading means has moved by the calculated movement amount ;
Means for decoding the synthesized barcode data;
Program to function as.
JP2007082520A 2007-03-27 2007-03-27 Bar code reader and program Expired - Fee Related JP4910822B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2007082520A JP4910822B2 (en) 2007-03-27 2007-03-27 Bar code reader and program
DE602008006482T DE602008006482D1 (en) 2007-03-27 2008-03-13 Bar code reader and computer readable medium
EP08004739A EP1975849B1 (en) 2007-03-27 2008-03-13 Bar-code reading apparatus and computer-readable medium
EP09008776.8A EP2101281B1 (en) 2007-03-27 2008-03-13 Bar-code reading apparatus and computer-readable medium
US12/079,148 US7832642B2 (en) 2007-03-27 2008-03-25 Bar-code reading apparatus and computer-readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007082520A JP4910822B2 (en) 2007-03-27 2007-03-27 Bar code reader and program

Publications (2)

Publication Number Publication Date
JP2008242829A JP2008242829A (en) 2008-10-09
JP4910822B2 true JP4910822B2 (en) 2012-04-04

Family

ID=39914095

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007082520A Expired - Fee Related JP4910822B2 (en) 2007-03-27 2007-03-27 Bar code reader and program

Country Status (1)

Country Link
JP (1) JP4910822B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6065719B2 (en) * 2013-04-04 2017-01-25 株式会社デンソーウェーブ Optical information reader
KR102311903B1 (en) * 2019-12-27 2021-10-13 안동대학교 산학협력단 A product purchase system for the visually impaired using an acceleration sensor and a bar code

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08114439A (en) * 1994-10-14 1996-05-07 Nippondenso Co Ltd Portable type dimension measuring device
JP2000099709A (en) * 1998-09-25 2000-04-07 Ascii Mirai Kenkyusho:Kk Manual scanning type scanner
JP2003203198A (en) * 2002-01-08 2003-07-18 Canon Inc Imaging device, imaging method, computer readable storage medium and computer program

Also Published As

Publication number Publication date
JP2008242829A (en) 2008-10-09

Similar Documents

Publication Publication Date Title
JP5012133B2 (en) Bar code reader and program
EP1975849B1 (en) Bar-code reading apparatus and computer-readable medium
JP5273196B2 (en) Image processing device
US6970600B2 (en) Apparatus and method for image processing of hand-written characters using coded structured light and time series frame capture
US7747080B2 (en) System and method for scanning edges of a workpiece
CN1898677A (en) Fingerprint detection using sweep-type imager with optoelectronic speed sensor
JP2007213359A (en) Two-dimensional code detection system and two-dimensional code detection program
JPWO2008026722A1 (en) 3D model data generation method and 3D model data generation apparatus
JP4147528B2 (en) Method and device for decoding position coding patterns
JP2008547115A (en) System and method for placing a predetermined pattern in an image
JP2005196543A (en) Optical information reader
JP4910822B2 (en) Bar code reader and program
WO2007125981A1 (en) Boundary position decision device, boundary position decision method, program for functioning computer as the device, and recording medium
JP2006279442A (en) Image processing method, apparatus, and program
US20020114022A1 (en) Image input apparatus, recording medium and image synthesis method
US20150378441A1 (en) Input apparatus
JP2020053931A (en) Image processing system, image scanner, and image processing method
JP2009300501A (en) Imaging device and map medium
JP4535104B2 (en) Image correction apparatus and image correction method, and fingerprint image reading apparatus and fingerprint image reading method using the same
JP6041011B2 (en) Portable processing apparatus and program
JP5403091B2 (en) Reading apparatus and program
JP4403750B2 (en) Code reader
JP2013250993A (en) Portable processing apparatus and program
JP6171165B2 (en) Driver's license reading device and driver's license reading method
CN113452920A (en) Focus point determining method, device, equipment and medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20091020

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110607

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110802

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20110802

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20111220

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120102

R150 Certificate of patent or registration of utility model

Ref document number: 4910822

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150127

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees