JPH113397A - Symbol information reader - Google Patents

Symbol information reader

Info

Publication number
JPH113397A
JPH113397A JP9153779A JP15377997A JPH113397A JP H113397 A JPH113397 A JP H113397A JP 9153779 A JP9153779 A JP 9153779A JP 15377997 A JP15377997 A JP 15377997A JP H113397 A JPH113397 A JP H113397A
Authority
JP
Japan
Prior art keywords
bar
information
bars
scan
symbol
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.)
Withdrawn
Application number
JP9153779A
Other languages
Japanese (ja)
Inventor
Norikazu Urata
憲和 浦田
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.)
Olympus Corp
Original Assignee
Olympus Optical 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 Olympus Optical Co Ltd filed Critical Olympus Optical Co Ltd
Priority to JP9153779A priority Critical patent/JPH113397A/en
Publication of JPH113397A publication Critical patent/JPH113397A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To accurately decode a bar code even when the position of a bar end part is different from a normal position by determining a scanning line crossing parts corresponding to symbol bars to be a two-dimensional(2D) image from luminance value information and detecting the height and position of the part corresponding to the bar. SOLUTION: When a baggage 7 is carried to a previously set position in a bar code information reder 1, reflected light from a bar code 8 stuck to the baggage 7 forms an image on a 2D CCD 3 having a photoelectric conversion face by an image pickup lens 2. Luminance value information, i.e. bar code information, photoelectrically converted by the CCD 3 is inputted to a frame memory 4 as an 8-bit image signal. An information processor 5 successively reads out the luminance value information crossing all parts corresponding to bars serially from pixels corresponding to the position of a straight line in a frame memory 4 storing the bar code information and sets up a scanning line. Then, the height and positions of bars are discriminated and decoded and the processed information is transferred to a host computer 6.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はCCD等の2次元撮
像手段を有するシンボル情報読取装置に関し、特に、郵
便局等において小荷物や書類等の分類あるいは情報入力
の処理効率化等をを目的として使用されるバーコードな
どのシンボルを読み取るためのシンボル情報読取装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a symbol information reading apparatus having a two-dimensional image pickup means such as a CCD, and more particularly to a post office or the like for classifying parcels and documents, or improving the efficiency of information input processing. The present invention relates to a symbol information reading device for reading a symbol such as a barcode used.

【0002】[0002]

【従来技術】最近のめざましいPOS(ポイント・オブ
・セールス=販売時点情報管理システム)の普及によっ
て、バーコードに代表される各種シンボルは、広く一般
に利用されるようになってきた。ここで、シンボルと
は、光学的情報認識のために印刷された、バーとスペー
スの適当な組み合わせ、英数字、文字、記号またはそれ
らに属するものであり、情報入力の効率化等を図るため
のものをいう。
2. Description of the Related Art With the recent remarkable spread of POS (point of sale = point of sale information management system), various symbols represented by barcodes have come to be widely and generally used. Here, the symbol is an appropriate combination of bars and spaces, alphanumeric characters, characters, symbols or those belonging to them, which are printed for optical information recognition, and are used to improve the efficiency of information input. A thing.

【0003】広く一般消費財に使用されているバーコー
ドシンボルとしては、JAN(Japanese Article Numbe
r)コードやEAN(European Article Number)コード
等がある。また、上記JANコードの前に1桁または2
桁の物流識別コードを追加した物流バーコードがある。
これらのバーコードシンボルは1次元バーコードと呼ば
れるものである。
A bar code symbol widely used for general consumer goods is JAN (Japanese Article Numbe).
r) codes and EAN (European Article Number) codes. Also, one digit or 2 before the JAN code
There is a distribution barcode to which a digit distribution identification code is added.
These barcode symbols are called one-dimensional barcodes.

【0004】1次元バーコードは数値・文字情報等を扱
うにあたり、使用する上での簡易さ、正確さ、高速性、
コスト等の点において、従来の管理手法に比べ有利であ
るため、近年非常に多岐に亘り普及するに至っている。
[0004] One-dimensional barcodes are simple, accurate, and fast to use when dealing with numerical and character information.
Since it is more advantageous than conventional management methods in terms of cost and the like, it has recently become very widespread.

【0005】この1次元バーコードに対して、その拡張
ともいえる2次元バーコードと呼ばれるバーコード体系
がいくつか発表されている。2次元バーコードは、1次
元バーコードを積み重ねることによって、より多くの情
報を一括して扱うことができるといった利点を有してい
る。
[0005] A bar code system called a two-dimensional bar code, which can be said to be an extension of the one-dimensional bar code, has been announced. The two-dimensional barcode has an advantage that more information can be handled collectively by stacking one-dimensional barcodes.

【0006】一方、1960年前後から欧米諸国では郵
便処理等の機械化のため、ドットコード、バーノーバー
・バーコード、フルバーハーフバー・バーコード等と呼
ばれるバーコード体系が相次いで制定され、人件費の比
率が高い郵便事業の効率化が推進されてきた。また、日
本においても、1998年2月から、新郵便番号制度が
導入されるとともに、新規バーコードシンボルが採用さ
れることになっている。
On the other hand, around 1960, barcode systems called dot codes, bar nova bar codes, full bar half bar codes, etc. have been successively enacted in Western countries for the mechanization of postal processing and the like, resulting in a reduction in labor costs. The postal service, which has high efficiency, has been promoted in efficiency. In Japan, a new postcode system has been introduced since February 1998, and a new barcode symbol has been adopted.

【0007】このような郵便用のバーコードでは一般
に、住所等の情報を扱う必要から情報量が増大する傾向
がある反面、あらゆる大きさ・形状の郵便物に対応する
ため、狭い領域に印刷できることが必要になっている。
したがって、このような分野においては、バーコードの
バーの高さを複数種類規定することにより情報量を増大
させ、かつバーの高さを極力低くして印刷の範囲を極力
狭くする等の改良を行うのが通常であり、従来の1次元
バーコード用の装置とは異なるバーコード情報読取装置
が必要となる。
In general, such a postal bar code tends to increase the amount of information due to the necessity of handling information such as an address. On the other hand, the postal bar code can be printed in a narrow area in order to cope with mails of all sizes and shapes. Is needed.
Therefore, in such a field, the amount of information is increased by defining a plurality of types of bar code bar heights, and improvements such as reducing the bar height as much as possible to narrow the printing range are made. This is usually performed, and a barcode information reading device different from a conventional one-dimensional barcode device is required.

【0008】従来、このような郵便用のバーコードに代
表されるバーコード情報読取装置として、例えば米国特
許第5428211号において開示されているように、
例えばCCD等の2次元撮像手段でバーコードを撮像
し、バーコードの画像をメモリに取り込み、この画像情
報に基づいてバーコードの情報を復号するものがあっ
た。
Conventionally, as a bar code information reading device represented by such a postal bar code, for example, as disclosed in US Pat. No. 5,428,211,
For example, there is a type in which a barcode is imaged by two-dimensional imaging means such as a CCD, a barcode image is fetched into a memory, and barcode information is decoded based on the image information.

【0009】[0009]

【発明が解決しようとする課題】しかしながら、米国特
許第5428211号に開示されている装置では、米国
で採用されているフルバーハーフバー・バーコードの復
号はできるものの、他国のバーコードを復号することが
困難である。
However, the apparatus disclosed in U.S. Pat. No. 5,428,211 can decode full bar half bar codes used in the United States, but decodes bar codes of other countries. Is difficult.

【0010】例えば、日本で採用される郵便用のバーコ
ードは図10(a)に図示されるようなカスタマバーコ
ードであって、バーの高さの比が1:2:3の関係を有
し、うち高さの比が2のバーは上側に位置するものと下
側に位置するものとの2つに分かれており、全部でバー
は4種類規定されている。そして、バーコードの各バー
の下端が必ずしも同一線上にはない。
For example, a postal bar code adopted in Japan is a customer bar code as shown in FIG. 10A, and has a bar height ratio of 1: 2: 3. A bar having a height ratio of 2 is divided into an upper bar and a lower bar. A total of four types of bars are defined. And the lower end of each bar of the bar code is not always on the same line.

【0011】米国特許第5428211号に開示される
装置がこのようなバーコードを復号しようとすると、バ
ーの高さについては検出できるが、特に高さの比が2の
バーの位置を検出することができず、バーコードの復号
が困難となる。さらに、同特許公報の図9に図示されて
いる「BAR AXIS」(バーの下端を結ぶ走査線)の定義が
困難となり、やはりバーコードの検出が困難となる。
When the apparatus disclosed in US Pat. No. 5,428,211 attempts to decode such a bar code, it is possible to detect the height of the bar, but in particular to detect the position of a bar having a height ratio of 2. And bar code decoding becomes difficult. Further, it is difficult to define "BAR AXIS" (scanning line connecting the lower ends of the bars) shown in FIG. 9 of the patent publication, and it is also difficult to detect a bar code.

【0012】したがって、本発明は、上述した不具合を
解決し、バーの下端および上端が必ずしも同一線上にな
く、また、バーの高さが同じであってもその位置が異な
るようなバーがシンボル内にあっても正確に復号できる
シンボル情報読取装置を提供することを目的とする。
Therefore, the present invention solves the above-described problem, and the lower and upper ends of the bars are not always on the same line, and even if the bars have the same height, the bars having different positions are included in the symbol. It is an object of the present invention to provide a symbol information reading device capable of decoding accurately even in the above case.

【0013】[0013]

【課題を解決するための手段】上記目的を達成するため
に、本発明は、異なる光反射率の部分を有するバーとス
ペースから構成されるシンボルを2次元像として撮像す
る撮像手段と、前記2次元像の輝度値情報を一時的に記
憶保持する記憶手段と、前記輝度値情報に基づき前記シ
ンボルが有する情報の復号を行う情報処理手段とを有す
るシンボル情報読取装置において、前記情報処理手段
は、前記記憶手段の輝度値情報から前記2次元像におけ
る前記シンボルのバーに相当する部分の全てを横切るス
キャンラインを決定するスキャンライン決定処理と、前
記バーに相当する部分の高さ及び位置を検出するバー判
別処理と、を行うことを特徴とする。
In order to achieve the above object, the present invention provides an image pickup means for picking up, as a two-dimensional image, a symbol composed of bars and spaces having portions having different light reflectivities; In a symbol information reading device including a storage unit that temporarily stores and holds luminance value information of a two-dimensional image and an information processing unit that decodes information included in the symbol based on the luminance value information, the information processing unit includes: A scan line determination process for determining a scan line that traverses all of the portion corresponding to the bar of the symbol in the two-dimensional image from the luminance value information of the storage unit; and detecting a height and a position of the portion corresponding to the bar. And a bar determination process.

【0014】この構成によれば、バーの下端および上端
が必ずしも同一線上になく、また、バーの高さが同じで
あってもその位置が異なるようなバーがシンボル内にあ
っても正確に復号することができる。
According to this configuration, even if the lower end and the upper end of the bar are not always on the same line, and even if a bar whose height is the same and whose position is different is present in the symbol, it is correctly decoded. can do.

【0015】なお、前記スキャンライン決定処理は、前
記スキャンライン上の輝度値を演算することでバーに相
当する部分を複数検出し、最初に検出されるバーから最
後に検出されるバーまでの前記スキャンライン上におけ
る中点の位置を検出する。これは、シンボルの全てのバ
ーを横切るスキャンラインを早く見つけることができる
点が望ましい。
In the scan line determination processing, a plurality of portions corresponding to bars are detected by calculating a luminance value on the scan line, and the portion from the bar detected first to the bar detected last is detected. The position of the midpoint on the scan line is detected. This desirably allows a scan line across all bars of the symbol to be found quickly.

【0016】[0016]

【発明の実施の形態】以下、図面を参照して本願発明の
実施形態について説明する。図1は本実施形態のバーコ
ード情報読取装置が使用される態様を示す図である。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing a mode in which the barcode information reading device of the present embodiment is used.

【0017】バーコード情報読取装置1は図示しない光
源と、撮像レンズ2、2次元CCD3、フレームメモリ
4、情報処理手段5から構成される。情報処理手段5は
ホストコンピュータ6に接続されている。ホストコンピ
ュータ6は、例えばCPU及びメモリ等で構成されてお
り、バーコード情報読取装置1で復号された情報に基づ
き、周辺機器を自動的に作動させる等、種々の作業を行
うことができる。ホストコンピュータ6は、情報処理手
段5の通信方式に対応できるコンピュータであれば、パ
ーソナルコンピュータ等、どのようなものであってもよ
い。
The bar code information reader 1 includes a light source (not shown), an imaging lens 2, a two-dimensional CCD 3, a frame memory 4, and an information processing means 5. The information processing means 5 is connected to a host computer 6. The host computer 6 includes, for example, a CPU and a memory, and can perform various operations such as automatically operating peripheral devices based on information decoded by the barcode information reading device 1. The host computer 6 may be any computer, such as a personal computer, as long as it can support the communication method of the information processing means 5.

【0018】次に、バーコード情報読取装置1の構成に
ついて詳細に説明する。図示しない光源はバーコード8
が貼付された荷物7に対し、発散光を照射させる。撮像
レンズ2はカスタマバーコード8から反射される光を後
述する2次元CCD3の光電変換面(受光領域)に結像
させる。2次元CCD3は光電変換面を有し、撮像され
た画像情報を輝度値情報に変換する機能を有する。フレ
ームメモリ4は、2次元CCD3から得られた2次元像
の輝度値情報を一時的に記憶保持する機能を有する。情
報処理手段5は、CPUとメモリ等で構成され、バーコ
ードの位置の推定やバーの種類の判別等を行ってから復
号を行う等、種々の処理を行う。またメモリには、後述
する各種定数及び変数を格納するための種々のレジスタ
が構成されている。
Next, the configuration of the barcode information reader 1 will be described in detail. Light source not shown is bar code 8
The diverging light is applied to the luggage 7 to which is attached. The imaging lens 2 forms an image of light reflected from the customer bar code 8 on a photoelectric conversion surface (light receiving area) of the two-dimensional CCD 3 described later. The two-dimensional CCD 3 has a photoelectric conversion surface, and has a function of converting captured image information into luminance value information. The frame memory 4 has a function of temporarily storing and holding luminance value information of a two-dimensional image obtained from the two-dimensional CCD 3. The information processing means 5 includes a CPU, a memory, and the like, and performs various processes, such as estimating the position of a barcode, determining the type of bar, and then performing decoding. The memory includes various registers for storing various constants and variables described below.

【0019】図1において、バーコード情報読取装置1
に対して予め設定された位置に荷物7が搬送される。荷
物7に貼付されたバーコード8は、例えば、日本の新郵
便番号制度で制定されたカスタマバーコードである。こ
のバーコード8からの反射光は撮像レンズ2によって、
光電変換面を有する2次元CCD3上に結像される。2
次元CCD3によって光電変換された輝度値情報、すな
わちバーコード情報は8ビットの画像信号としてフレー
ムメモリ4に取り込まれる。情報処理手段5はフレーム
メモリ4に記憶保持されているバーコード情報に対し
て、後述する種々の処理を行い、処理された情報をホス
トコンピュータ6に転送する。
In FIG. 1, a bar code information reading device 1
Is conveyed to a preset position. The barcode 8 affixed to the package 7 is, for example, a customer barcode established by the new postal code system in Japan. The reflected light from the bar code 8 is reflected by the imaging lens 2
An image is formed on a two-dimensional CCD 3 having a photoelectric conversion surface. 2
The luminance value information photoelectrically converted by the dimensional CCD 3, that is, barcode information, is taken into the frame memory 4 as an 8-bit image signal. The information processing means 5 performs various processes described below on the barcode information stored and held in the frame memory 4, and transfers the processed information to the host computer 6.

【0020】図2は、情報処理手段5で行われるバーコ
ードの復号アルゴリズムの概略を示すフローチャートで
ある。まず、フレームメモリ4、しきい値、各種グロー
バル変数等の種々のパラメータを初期設定する(ステッ
プS1)。
FIG. 2 is a flowchart showing an outline of a barcode decoding algorithm performed by the information processing means 5. First, various parameters such as the frame memory 4, threshold values, and various global variables are initialized (step S1).

【0021】次に、画像取り込みルーチン(図3参照)
をコールして画像をフレームメモリ4に取り込む(ステ
ップS2)。次に、バーコード検出ルーチン(図5参
照)をコールしてフレームメモリ4内のスキャン処理を
行い、フレームメモリ4内において、予め規定されたバ
ーコード8の検出を行う(ステップS3)。
Next, an image capturing routine (see FIG. 3)
To load the image into the frame memory 4 (step S2). Next, a barcode detection routine (see FIG. 5) is called to perform a scanning process in the frame memory 4, and a barcode 8 defined in advance is detected in the frame memory 4 (step S3).

【0022】そして、ステップS3におけるバーコード
検出ルーチンの結果、フレームメモリ4内にバーコード
に相当する画像が存在するかどうかを判別し(ステップ
S4)、バーコードに相当する画像が存在しなければ、
バーコードの読取処理を終了する。
As a result of the bar code detection routine in step S3, it is determined whether or not an image corresponding to the bar code exists in the frame memory 4 (step S4). ,
The barcode reading process ends.

【0023】バーコードに相当する画像が存在する場合
には、バーコード検出ルーチンから得られた各バーの座
標について、特定のバーを指定し、バーの判別ルーチン
をコールし、バーの種類(高さや位置)を判別する(ス
テップS5)。
If there is an image corresponding to the bar code, a specific bar is designated for the coordinates of each bar obtained from the bar code detection routine, the bar determination routine is called, and the type of bar (high) is determined. (Pod position) is determined (step S5).

【0024】この判別ルーチンをバーコードの全てのバ
ーについて行い(ステップS6)、全てのバーの種類の
判別できたならば、復号を行う(ステップS7)。その
後、チェックデジットを確認し(ステップS8)、チェ
ックデジットに異常があれば読取処理を終了する。
This determination routine is performed for all the bars of the bar code (step S6), and if all the bar types have been determined, decoding is performed (step S7). Thereafter, the check digit is confirmed (step S8), and if there is an abnormality in the check digit, the reading process is terminated.

【0025】チェックデジットに異常がなければ復号し
た結果を出力して(ステップS9)、バーコードの読取
処理を終了する。次に、これまでに説明した各種処理ル
ーチンについて、さらに詳細に説明する。
If there is no abnormality in the check digit, the result of decoding is output (step S9), and the barcode reading process is terminated. Next, the various processing routines described above will be described in more detail.

【0026】まず、バーコード検出ルーチン(図2のス
テップS3)を図4及び図5を参照して説明する。図4
(a),(b)はフレームメモリ4におけるスキャンラ
インの態様を示す図であり、図5はバーコード検出ルー
チンを示すフローチャートである。なお、以下、「スキ
ャン」という用語を用いるが、これは、ある特定の直線
を指定したときに、フレームメモリ4の中において直線
の位置に対応する画素から、一列状に順次輝度値情報を
読み出し、然るべき配列変数の中にその輝度値情報を格
納し演算する作業を意味する。また「スキャンライン」
とはそのフレームメモリ4内のスキャンするための直線
のことを意味する。
First, the barcode detection routine (step S3 in FIG. 2) will be described with reference to FIGS. FIG.
5A and 5B are diagrams showing the form of a scan line in the frame memory 4, and FIG. 5 is a flowchart showing a barcode detection routine. Hereinafter, the term “scan” is used, which means that when a certain specific straight line is designated, the luminance value information is sequentially read in a line from the pixel corresponding to the position of the straight line in the frame memory 4. This means that the luminance value information is stored in an appropriate array variable and is calculated. Also "scan line"
Means a straight line for scanning in the frame memory 4.

【0027】初めに、スキャンラインの角度及びスキャ
ンラインの位置を設定する(ステップS31、ステップ
S32)。スキャンラインの角度θ0(以下、スキャン
角度と呼ぶ)とはフレームメモリ4の水平方向とスキャ
ン処理の行う方向とのなす角のことである。またスキャ
ンラインの位置c0(以下、スキャン位置と呼ぶ)とは
スキャンラインが通る一点のことである。
First, the angle of the scan line and the position of the scan line are set (steps S31 and S32). The scan line angle θ0 (hereinafter, referred to as a scan angle) is the angle between the horizontal direction of the frame memory 4 and the direction in which the scan processing is performed. The scan line position c0 (hereinafter, referred to as a scan position) is a point through which the scan line passes.

【0028】スキャン角度θ0は最初、θ0=0度(水平
方向と平行)に設定され、スキャン位置c0はフレーム
メモリ4の撮像領域の面積を2等分する位置に設定され
る。このように設定されたスキャンラインでもってスキ
ャン処理が行われる(ステップS33)。スキャン処理
の詳細については後述するが、一列状に得られた輝度値
のなすパターンと予め規定されていたバーコードのバー
とスペースのなすパターンとを比較し、パターンが一致
した場合に、一致した領域におけるバーの本数Bar1を検
出する処理を行う。
The scan angle θ0 is initially set to θ0 = 0 degrees (parallel to the horizontal direction), and the scan position c0 is set to a position that divides the area of the imaging area of the frame memory 4 into two equal parts. Scan processing is performed using the scan lines set as described above (step S33). Although details of the scanning process will be described later, the pattern formed by the luminance values obtained in a row and the pattern formed by the bar and space of the barcode defined in advance are compared, and if the patterns match, the patterns match. Processing for detecting the number of bars Bar1 in the region is performed.

【0029】そして検出されたバーの本数Bar1が67本
(カスタマバーコードのバーの数は67本)かどうかを
判別し、Bar1=67であれば、そのスキャンラインは6
7本全てのバーを横切るものとして、上位ルーチンに返
す。
Then, it is determined whether or not the detected bar number Bar1 is 67 (the number of bars of the customer bar code is 67). If Bar1 = 67, the scan line is 6
Return to upper routine as it crosses all seven bars.

【0030】Bar1=67でない場合は、次にBar1≧3か
どうかを判別する。3本以上のバーが検出されたなら
ば、詳細検出ルーチンをコールし(ステップS34)、
スキャン角度、スキャン位置をより詳細に変更しながら
全てすなわち67本のバーを検出しようとする。
If Bar1 = 67, then it is determined whether Bar1 ≧ 3. If three or more bars are detected, a detailed detection routine is called (step S34),
While changing the scan angle and the scan position in more detail, it is attempted to detect all, ie, 67 bars.

【0031】Bar1が3本未満である場合、また、詳細検
出ルーチンの結果Bar1が67本でなかった場合、フレー
ムメモリ4において全スキャン位置及び全スキャン角度
について検出したかどうかを調べ(ステップS35、ス
テップS36)、まだ検出していないスキャン位置ある
いはスキャン角度があるならば、そのスキャン位置ある
いはスキャン角度を再設定し、上述したルーチンを繰り
返す。
If Bar1 is less than three, or if Bar1 is not 67 as a result of the detailed detection routine, it is checked whether or not all the scan positions and all scan angles have been detected in the frame memory 4 (step S35, Step S36) If there is a scan position or scan angle that has not yet been detected, the scan position or scan angle is reset, and the above-described routine is repeated.

【0032】例えば、スキャン位置についてはフレーム
メモリ4の中央位置(図4(a)のスキャンライン1)
からその周辺位置(図4(a)のスキャンライン2やス
キャンライン3)に再設定したり、さらに、スキャンラ
イン間隔を狭くするように(図4(a)のスキャンライ
ン4乃至7)再設定することで、Bar1=67になるよう
なスキャンラインを見つける。
For example, regarding the scan position, the center position of the frame memory 4 (scan line 1 in FIG. 4A)
To the peripheral position (scan line 2 or scan line 3 in FIG. 4 (a)) or to further narrow the scan line interval (scan lines 4 to 7 in FIG. 4 (a)). By doing so, a scan line that satisfies Bar1 = 67 is found.

【0033】また、スキャン角度については、例えば、
図4(b)に図示するように、+45度(スキャンライ
ン1−2)、90度、−45度(スキャンライン1−
3)等と再設定する。
As for the scan angle, for example,
As shown in FIG. 4B, +45 degrees (scan line 1-2), 90 degrees, -45 degrees (scan line 1-
3) Re-set as etc.

【0034】なお、スキャン位置及び角度の再設定値の
設定方法はどのような方式であってもよい。例えば、ス
キャン位置においては再設定する順序を図4(a)に図
示されるスキャンラインで1,2,3,4,5,6,7
でもよいし、1,4,5,3,2,6,7でもよい。ま
た、スキャン角度においては+45度ずつ変化させても
よいし、+30度ずつ変化させて設定してもよい。
The method for setting the reset values of the scan position and the angle may be any method. For example, at the scan position, the resetting order is 1, 2, 3, 4, 5, 6, 7 in the scan line shown in FIG.
Or 1,4,5,3,2,6,7. Further, the scan angle may be changed by +45 degrees or may be changed by +30 degrees.

【0035】なお、スキャン位置、スキャン角度は、ス
キャンラインによって分割されたフレームメモリ4の領
域の面積の比が1〜10になるように設定することが、
バーコードを検出するまでに要するスキャン処理の回数
が特に増大することはなく、十分に高速で検出できる点
で望ましい。なかでも特に、分割される領域の面積比が
1となるように設定することが望ましい。
The scan position and the scan angle can be set so that the ratio of the area of the area of the frame memory 4 divided by the scan line is 1 to 10.
This is desirable because the number of scan processes required to detect a barcode does not particularly increase and detection can be performed at a sufficiently high speed. In particular, it is desirable to set the area ratio of the divided regions to be one.

【0036】次に、スキャン処理ルーチン(ステップS
33)について図6及び図10を参照して説明する。図
6はスキャン処理ルーチンのフローチャートであり、図
10(a)はカスタマバーコードを示し、図10(b)
はフレームメモリ4においてバーコードをスキャン処理
する様子を示し、図10(c)は図10(b)の部分拡
大図である。
Next, a scan processing routine (step S
33) will be described with reference to FIGS. FIG. 6 is a flowchart of a scan processing routine. FIG. 10A shows a customer bar code, and FIG.
FIG. 10C shows the manner in which the bar code is scanned in the frame memory 4, and FIG. 10C is a partially enlarged view of FIG. 10B.

【0037】まず、上位ルーチンのステップS31、S
32において設定されたc0、θ0に基づいて各パラメー
タを設定する。ここではBar1(バーのカウント最大値)
=2、Bar2(バーのカウント値)=2、T1(許容範囲)
=0.6を設定する(ステップS331)。
First, steps S31 and S31 of the upper routine
Each parameter is set based on c0 and θ0 set in 32. Here Bar1 (the maximum bar count)
= 2, Bar2 (bar count value) = 2, T1 (tolerable range)
= 0.6 is set (step S331).

【0038】つぎに、点c0を通り傾きθ0のスキャンラ
インでフレームメモリ4内をスキャンし、順次スキャン
ライン上の輝度値を得る(ステップS332)。そし
て、得られた輝度値すべてについて差分化し、最初にそ
の差分値の絶対値が一定しきい値を越えた点と、その差
分値の符号(+または−)とを検出することで、最初に
スペースからバーへ移る境界点(ファーストエッジ)を
見つける。ファーストエッジを見つけた後は、差分値の
絶対値が一定しきい値を越えた点、つまりバーからスペ
ースおよびスペースからバーへ移る境界点(エッジ)の
みを検出することで、バーに相当する部分を見つける。
そして、バーに相当する部分における2つのエッジ(例
えば、ファーストエッジとその次の2番目のエッジ、3
番目のエッジと4番目のエッジ)の中点を求めること
で、バーの幅方向の中点を検出する(ステップS33
3)。
Next, the frame memory 4 is scanned with a scan line passing through the point c0 and having a gradient θ0, and luminance values on the scan line are sequentially obtained (step S332). Then, all the obtained luminance values are differentiated, and the point where the absolute value of the difference value exceeds a certain threshold value and the sign (+ or-) of the difference value are first detected, so that first, Find the boundary point (first edge) that transitions from space to bar. After finding the first edge, the point corresponding to the bar is detected by detecting only the point where the absolute value of the difference value exceeds a certain threshold value, that is, the boundary point (edge) transitioning from the bar to the space and from the space to the bar. Find out.
Then, two edges (for example, a first edge and a next second edge, 3
The midpoint of the bar in the width direction is detected by calculating the midpoint of the fourth edge and the fourth edge (step S33).
3).

【0039】つぎに、連続するバーの中点間隔D(i)
(i=1,2,・・・)を求め(ステップS334)、
さらに、連続するバーの中点間隔の比D(i)/D(i+1)が
0.6〜1/0.6の範囲内にあるかどうかを判別し
(ステップS335)、範囲内にあるときは等間隔のバ
ーが並んでいるものとみなし、Bar2を1つ増加させカウ
ントする(ステップS336)。ここでは、等間隔に並
ぶバーが3本であり、Bar2は3としてカウントされる。
日本の新郵便番号制度のもとで用いられるバーコード体
系や米国の郵便用に用いられているバーコード体系で
は、等間隔に並ぶバーのパターンが必ず存在するため、
ステップS335のような連続するバーの間隔がほぼ等
しいかどうか、という検出を行えばよい。また、他のバ
ーコード体系ではバーの間隔が異なる場合があるので、
そのバーコード体系の規格に従ってステップS335の
条件式を適宜変更することで対応する。
Next, the midpoint interval D (i) of successive bars
(I = 1, 2,...) (Step S334),
Further, it is determined whether or not the ratio D (i) / D (i + 1) of the midpoint intervals of the continuous bars is in the range of 0.6 to 1 / 0.6 (step S335). If there is, it is considered that bars at equal intervals are arranged, and Bar2 is incremented by one and counted (step S336). Here, three bars are arranged at equal intervals, and Bar2 is counted as three.
In the bar code system used under the new postal code system in Japan and the bar code system used for postal mail in the United States, there is always a pattern of bars arranged at equal intervals,
What is necessary is just to detect whether or not the intervals between successive bars are substantially equal as in step S335. Also, bar intervals may differ in other barcode systems,
This is dealt with by appropriately changing the conditional expression in step S335 according to the standard of the barcode system.

【0040】Bar2がBar1よりも大きい場合には、そのBa
r2のカウント値をバーの本数の最大値としてBar1の値と
して記録するとともに、Bar2でカウントされた最初のバ
ーから最後のバーまでのスキャンラインの中点の座標を
c1として記録する(ステップS337)。ここでは、B
ar2(=3)はBar1(=2)よりも大きいため、Bar1を
3として記録し、Bar2が3となる領域とは左から2番目
のバーの左側エッジから右から2番目のバーの右側エッ
ジまでの領域であり、その領域におけるスキャンライン
の中点は真ん中のバーの中心座標であるので、その中心
座標を中点c1として記録する。
If Bar2 is greater than Bar1, its Ba
The count value of r2 is recorded as the maximum value of the number of bars as the value of Bar1, and the coordinates of the middle point of the scan line from the first bar to the last bar counted by Bar2 are recorded as c1 (step S337). . Here, B
Since ar2 (= 3) is larger than Bar1 (= 2), Bar1 is recorded as 3, and the area where Bar2 is 3 is from the left edge of the second bar from the left to the right edge of the second bar from the right. Since the middle point of the scan line in this area is the center coordinate of the middle bar, the center coordinate is recorded as the middle point c1.

【0041】そして、スキャンライン上の全てに、さら
に等間隔に並ぶバーがあるかどうか調べ(ステップS3
38)、スキャンライン上の全てを調べたならば、検出
したバーの本数Bar1および中心座標c1を上位ルーチン
に移す(ステップS339)。
Then, it is checked whether or not there are bars arranged at equal intervals on all of the scan lines (step S3).
38) When all of the bars on the scan line have been examined, the number of detected bars Bar1 and the center coordinates c1 are transferred to the upper routine (step S339).

【0042】次に詳細検出ルーチン(ステップS34)
について図7を参照して説明する。図7は詳細検出ルー
チンのフローチャートである。詳細検出ルーチンはスキ
ャン処理ルーチンにおいて、検出されたバーの本数Bar1
が3以上の場合(ただし67ではない)に行う処理であ
る。
Next, a detail detection routine (step S34)
Will be described with reference to FIG. FIG. 7 is a flowchart of the detail detection routine. In the detailed detection routine, the number of detected bars Bar1
Is 3 or more (but not 67).

【0043】まず、各パラメータおよび初期値の設定を
行う(ステップS341)。上位ルーチンで設定されて
いたスキャン位置c1及びスキャン角度θ1の値を受け
る。。また、スキャン位置及びスキャン角度の変位量で
あるΔc、Δθの値を決定する。このΔcおよびΔθの
値は、定数Con1(=1)、Con2(=3)、Δx(=
0)、Δy(=0)、Bar1(=3)に基づき(カッコ内
の数値は初期値の一例)、 Δc=(Δx×Con2,Δy×Con2) Δθ=Arctan(1/(Bar1×2−1))×Con1 とする。
First, parameters and initial values are set (step S341). The scan position c1 and the scan angle θ1 set in the upper routine are received. . Further, the values of Δc and Δθ, which are displacement amounts of the scan position and the scan angle, are determined. The values of Δc and Δθ are constants Con1 (= 1), Con2 (= 3), Δx (=
0), Δy (= 0) and Bar1 (= 3) (numerical values in parentheses are examples of initial values), Δc = (Δx × Con2, Δy × Con2) Δθ = Arctan (1 / (Bar1 × 2−2) 1)) × Con1.

【0044】Con1は1または0の値であり、スキャン角
度を変えるか否かを示すものである。Con2はスキャンラ
インの平行移動量を示すもので、値が大きいと平行移動
量も大きくなる。xはフレームメモリの水平方向、yは
フレームメモリの垂直方向を示し、ΔxおよびΔyはそ
れぞれの方向のスキャン位置c1の変位量を示すもので
ある。
Con1 is a value of 1 or 0, and indicates whether to change the scan angle. Con2 indicates the amount of translation of the scan line. The larger the value, the greater the amount of translation. x indicates the horizontal direction of the frame memory, y indicates the vertical direction of the frame memory, and Δx and Δy indicate the displacement of the scan position c1 in each direction.

【0045】なお、これらのパラメータは後述するスキ
ャン処理ルーチン(ステップS343)で得られたBar1
にしたがって適宜変更していく。また、スキャン処理回
数n、およびスキャン処理回数の限度値nmax等も決定
する。
Note that these parameters correspond to Bar1 obtained in a scan processing routine (step S343) described later.
As needed. In addition, the number of scan processes n and the limit value nmax of the number of scan processes are determined.

【0046】ステップS341でΔc、Δθが決定した
ならば、スキャン位置cとスキャン角度θを設定し(ス
テップS342)、再度スキャン処理を行いバーが何本
あるのか検出する(ステップS343)。このスキャン
処理(ステップS343)は、スキャン処理回数がカウ
ントされることを除けば、前述したスキャン処理(ステ
ップS33)と同様の処理内容であるため、ここではそ
の説明を省略する。
When Δc and Δθ are determined in step S341, the scan position c and the scan angle θ are set (step S342), and the scanning process is performed again to detect how many bars are present (step S343). This scan process (step S343) has the same processing content as the above-described scan process (step S33) except that the number of scan processes is counted, and thus the description thereof is omitted here.

【0047】このスキャン処理によって検出されたバー
の本数Bar1がBarmaxよりも大きいか小さいか判別し、大
きい場合には、スキャン位置c及びスキャン角度θの値
をそれぞれ、c1およびθ1の値に更新し、また、Bar1の
値をBarmaxの値に更新する(ステップS344)。そし
て、スキャンラインの変位量Δc、変位角度Δθを再設
定する(ステップS345)。たとえば、Con1、Con2の
値を変化させたり、正負の符号を反転させたりする。ま
た、Δx、Δy、Con1の値を入れ替え、順次、スキャン
角度のみ、スキャン位置のx方向のみ、スキャン位置の
y方向のみが、それぞれ変更されスキャン処理をするよ
うに設定されてもよい。
It is determined whether the number of bars Bar1 detected by this scanning process is larger or smaller than Barmax. If the bar number is larger than Barmax, the values of the scan position c and the scan angle θ are updated to the values of c1 and θ1, respectively. Then, the value of Bar1 is updated to the value of Barmax (step S344). Then, the displacement amount Δc and the displacement angle Δθ of the scan line are reset (step S345). For example, the values of Con1 and Con2 are changed, and the signs are inverted. Alternatively, the values of Δx, Δy, and Con1 may be exchanged, and only the scan angle, only the x direction of the scan position, and only the y direction of the scan position may be sequentially changed and set to perform the scan process.

【0048】また、たとえばBar1の値が50となり、目
標値である67に近づいたならば、Con2の絶対値を減少
させ、スキャン位置の移動をより小さくする。すなわ
ち、スキャン位置c1の移動量Δcは、Δθと同様、Bar
1の減少関数で定義されている。
For example, when the value of Bar1 becomes 50 and approaches the target value of 67, the absolute value of Con2 is reduced, and the movement of the scan position is made smaller. That is, the movement amount Δc of the scan position c1 is equal to Bar
Defined by a decreasing function of 1.

【0049】そして、スキャン処理回数nを確認し(ス
テップS346)、nmax以下であれば再度スキャン処
理を行い、nmaxより大きければ詳細検出ルーチンは終
了し、上位ルーチンへ移る。
Then, the number n of scan processes is confirmed (step S346). If it is equal to or smaller than nmax, the scan process is performed again. If it is larger than nmax, the detailed detection routine ends and the routine shifts to the upper routine.

【0050】この詳細検出ルーチンでは、カスタマバー
コードのように互いのバーの上下端の位置が不規則であ
って、最終的にはバーのパターンが最も多く発見される
バーコードの中心位置を横切るスキャンラインが収束的
に検出される。
In this detailed detection routine, the positions of the upper and lower ends of each bar are irregular, such as a customer bar code, and finally the bar pattern crosses the center position of the bar code where the most found bar code is found. Scan lines are detected convergently.

【0051】以上説明した詳細検出ルーチンによってバ
ーコードが検出される過程を図4を参照して説明する。
バーコードがない場合は、図4(a)のようにスキャン
処理が反復されるが、図4(b)のスキャンライン1−
1のように、指定された本数(Bar1≧3)のバーを横切
ると、詳細検出ルーチンがコールされる(図5参照)。
The process of detecting a barcode by the above-described detailed detection routine will be described with reference to FIG.
If there is no barcode, the scanning process is repeated as shown in FIG.
When a specified number of bars (Bar1 ≧ 3) are crossed, as in 1, the detailed detection routine is called (see FIG. 5).

【0052】最初にスキャンライン1−2のようにスキ
ャン角度が変更される。しかし、スキャンライン1−2
では検出されるバーの本数が増えないので、Δθの符号
が反転され、スキャンライン1−3のようにスキャンラ
イン1−2とは反対方向に傾きを持つことになる。この
結果、検出されるバーの本数が増えるので、そのスキャ
ンラインのスキャン位置c1、スキャン角度θ1が記録さ
れる。そして、Δθが再設定されるのだが、Con1の値は
変わらず、かつΔθの絶対値はBar1の減少関数であるか
ら、Δθはより小さい値に設定され、再度スキャン処理
がなされる。検出されるバーの本数Bar1が増すごとにス
キャン角度の変位量Δθは0度に近づき、スキャン角度
θ1は最適な値、すなわちバーコードの全てのバーを横
切る中心位置に収束していく。また、スキャン位置につ
いても、バーの発見された領域の中心座標に随時更新さ
れるので、最適な点に収束していく。
First, the scan angle is changed as in scan line 1-2. However, scan line 1-2
Since the number of detected bars does not increase, the sign of Δθ is inverted, and the bar has an inclination in the opposite direction to the scan line 1-2 like the scan line 1-3. As a result, the number of detected bars increases, so that the scan position c1 and scan angle θ1 of the scan line are recorded. Then, although Δθ is reset, the value of Con1 does not change, and the absolute value of Δθ is a decreasing function of Bar1, so that Δθ is set to a smaller value and the scanning process is performed again. Every time the number of detected bars Bar1 increases, the scan angle displacement amount Δθ approaches 0 degrees, and the scan angle θ1 converges to an optimal value, that is, a center position across all the bars of the bar code. Also, the scan position is updated as needed to the center coordinates of the area where the bar is found, so that it converges to the optimal point.

【0053】したがって、スキャン処理が繰り返し行わ
れるたびに、スキャン位置及びスキャン角度がバーコー
ドのすべてのバーの存在する位置に収束していく。図4
(b)では、合計4回のスキャン処理を行うことによ
り、バーコードの全てのバーの検出が完了する様子を示
したが、ある1つのスキャンラインさえ、バーコードの
一部を横切ればバーコードの全てのバーの存在する位置
の検出が可能である。よって、フレームメモリ4の全領
域をスキャンし、全体のパターンの位置関係からバーコ
ードの上記位置を検出する方式と比較して、スキャン回
数を格段に減らすことができる。
Therefore, each time the scanning process is repeatedly performed, the scanning position and the scanning angle converge to the position where all the bars of the bar code exist. FIG.
(B) shows a state in which the detection of all the bars of the barcode is completed by performing the scanning process a total of four times. However, even if one scan line crosses a part of the barcode, the barcode is displayed. Can be detected. Therefore, the number of scans can be remarkably reduced as compared with a method of scanning the entire area of the frame memory 4 and detecting the above-described position of the barcode from the positional relationship of the entire pattern.

【0054】また、ΔcやΔθは、その絶対値がBar1の
減少関数となるように設定すればよく、より単純な関数
に変更し、角度などの演算処理を簡素化してもよい。な
お、ここでいう減少関数とは、必ずしも連続的に減少す
る関数である必要はなく、Bar1が増加するに伴い関数の
値がステップ状に減少するようなものであってもよい。
Further, Δc and Δθ may be set so that their absolute values become a decreasing function of Bar1, and may be changed to simpler functions to simplify the arithmetic processing such as angles. Here, the decreasing function does not necessarily need to be a function that continuously decreases, and may be a function in which the value of the function decreases stepwise as Bar1 increases.

【0055】またスキャン回数nがnmaxを越えた場合
で、スキャン処理においてスキャンライン上にスキャン
位置c1が複数発見されている場合、nを1に初期化
し、スキャン位置を他の位置に移動させる処理を行って
もよい。とくに、バーコード周辺に文字や汚れなどのノ
イズが多い場合には、必ずしも1回目で検出されたスキ
ャン位置が正しいとは限らないので、このような処理を
行うことで読取の信頼性が格段に向上する。
When the number of scans n exceeds nmax and a plurality of scan positions c1 are found on a scan line in the scan processing, n is initialized to 1 and the scan position is moved to another position. May be performed. In particular, when there are many noises such as characters and dirt around the barcode, the scanning position detected at the first time is not always correct, so that such processing significantly improves the reading reliability. improves.

【0056】次に、バーコードのバーの判別ルーチン
(ステップS5)を図8及び図9を参照して説明する。
図8はバーの判別ルーチンのフローチャートであり、図
9はあるバーの高さを検出する様子を示す図である。
Next, a bar code bar discrimination routine (step S5) will be described with reference to FIGS.
FIG. 8 is a flowchart of a bar determination routine, and FIG. 9 is a diagram showing how a height of a certain bar is detected.

【0057】この判別ルーチンに移る前、すでに、カス
タマバーコードの全てのバーが検出され、バーコードの
検出ルーチン(ステップS3)によって、各バーの中心
座標が認識されている。
Before proceeding to this determination routine, all the bars of the customer barcode have already been detected, and the center coordinates of each bar have been recognized by the barcode detection routine (step S3).

【0058】判別ルーチン(ステップS5)では、ま
ず、図9(a)に図示するように、検出されたバーの中
心座標のうちの1つについてP(1)を設定し、そのP
(1)と同じ位置にさらにP(2)及びP(3)を設定
する(ステップS51)。
In the determination routine (step S5), first, as shown in FIG. 9A, P (1) is set for one of the center coordinates of the detected bar, and the P (1) is set.
P (2) and P (3) are further set at the same position as (1) (step S51).

【0059】つぎに、そのP(2)に隣接する一点であ
り、かつ、P(3)との距離が最も大きくなる点をP
(4)として(ステップS52)、P(2)とP(4)
との輝度値の差分をとる(ステップS53)。そして差
分の絶対値が所定のしきい値以下であるかどうかを判断
する(ステップS54)。つまり、ステップS54では
P(4)がバー上に位置するのか、それともバー上から
外れてスペース上に位置するのかを判断しており、しき
い値以下であればP(4)はバー上に位置するものであ
り、しきい値以下でなければP(4)はスペース上に位
置するものとしている。
Next, a point adjacent to the point P (2) and having the greatest distance from P (3) is defined as P
As (4) (step S52), P (2) and P (4)
Then, a difference between the luminance values is calculated (step S53). Then, it is determined whether or not the absolute value of the difference is equal to or smaller than a predetermined threshold (step S54). That is, in step S54, it is determined whether P (4) is located on the bar or is located off the bar and on the space. It is assumed that P (4) is located on the space unless it is below the threshold value.

【0060】差分値の絶対値がしきい値以下である場
合、P(4)の座標をP(2)の座標として更新し、ス
テップ52〜54を繰り返す。また、差分値の絶対値が
しきい値以下でない場合、P(2)に隣接する他の点を
調べ(ステップS55)、P(2)に隣接する点がまだ
あるならば、それらのうちの1点をP(4)として設定
し直し(ステップS52)、ステップS53〜S54を
繰り返す。
If the absolute value of the difference value is equal to or smaller than the threshold value, the coordinates of P (4) are updated as the coordinates of P (2), and steps 52 to 54 are repeated. If the absolute value of the difference value is not smaller than or equal to the threshold value, another point adjacent to P (2) is checked (step S55), and if there are still points adjacent to P (2), One point is reset as P (4) (step S52), and steps S53 to S54 are repeated.

【0061】P(2)に隣接し、かつP(2)よりもP
(3)から離れている点のすべてが、P(2)との輝度
値の差分値の絶対値がしきい値以下でない場合、すなわ
ち、図9(c)に図示するように、P(2)がバーの端
部(角部)に位置している場合、P(4)を設定するこ
とができないため、そのP(2)の座標が記録され、P
(2)に関する処理が終了する。
P (2) is adjacent to P (2) and P (2)
For all the points far from (3), if the absolute value of the difference between the luminance value and P (2) is not equal to or smaller than the threshold value, that is, as shown in FIG. ) Is located at the end (corner) of the bar, since P (4) cannot be set, the coordinates of P (2) are recorded and P (4) is recorded.
The process related to (2) ends.

【0062】つぎに、P(3)についても同様な処理を
行う。その結果、図9(d)に図示するように、P
(3)はP(2)の対角上に位置することになる。そし
て、P(2)及びP(3)のそれぞれの座標から、2つ
の点を結ぶ線分を求め、その線分の長さからバーの高さ
を求める。
Next, the same processing is performed for P (3). As a result, as shown in FIG.
(3) is located on the diagonal of P (2). Then, a line segment connecting the two points is obtained from the coordinates of P (2) and P (3), and the height of the bar is obtained from the length of the line segment.

【0063】上述したように、カスタマバーコードのバ
ーの高さは3種類(高さ比1:2:3)であり、左端ま
たは右端のバー(高さ比3)との比較により各バーの高
さを判別することができる。また、高さ比2のバーは、
バーコード内における高さ方向の位置により2種類規定
されているが、この位置の判別はP(2)とP(3)を
結ぶ線分の中点がスキャンラインよりも上側に位置する
か下側に位置するかで判別する。例えば図9(d)に図
示されているバーの場合、P(2)とP(3)を結ぶ線
の中点はスキャンラインよりも上側にあるので、このバ
ーはバーコードの上側に配置された高さ比2のバーであ
ると判別する。なお、バーの位置の判別については、P
(2)とP(3)を結ぶ線分の中点がP(1)よりも上
側に位置するか下側に位置するかで判別してもよい。
As described above, there are three types of bar heights of the customer barcode (height ratio 1: 2: 3), and the bar height of each bar is compared with the bar at the left end or right end (height ratio 3). The height can be determined. The bar with a height ratio of 2
Although two types are defined by the position in the height direction in the barcode, this position is determined by determining whether the midpoint of the line connecting P (2) and P (3) is located above the scan line or below. It is determined by whether it is located on the side. For example, in the case of the bar shown in FIG. 9D, since the middle point of the line connecting P (2) and P (3) is above the scan line, this bar is arranged above the barcode. It is determined that the bar has a height ratio of 2. The position of the bar is determined by P
The determination may be made based on whether the midpoint of the line connecting (2) and P (3) is located above or below P (1).

【0064】なお、この判別ルーチンでは、任意のバー
を左右のロングバーと比較し、高さと位置の相対的な関
係のみでバーの種類を判別することができるから、例え
ば、荷物7がシンボル情報読取装置に対して傾斜して配
置されており、撮像された画像がゆがんでいる場合や、
バーコードの印刷精度が悪く印刷のはみ出しが多少生じ
ている場合やバーの短辺に対してバーの長辺方向が直交
していない場合、等の悪条件下であってもバーの種類を
判別することができる。
In this determination routine, an arbitrary bar can be compared with the left and right long bars, and the type of the bar can be determined only based on the relative relationship between the height and the position. It is placed at an angle to the reader, and the captured image is distorted,
Identifies the type of bar even under bad conditions, such as when the barcode printing accuracy is poor and printing runs off slightly, or when the long side of the bar is not perpendicular to the short side of the bar can do.

【0065】また、この判別ルーチンにおいて、移動す
る点(P(2)及びP(3))の数は2点である必要は
なく、たとえば、3点の点をとり同等のアルゴリズムに
よりバーの3つの角を検出してバーの高さのみならず、
幅を演算することもできるから、多様なバーコードシン
ボル体系に対応することができる。
In this discrimination routine, the number of moving points (P (2) and P (3)) does not need to be two. Detects one corner and not only the bar height,
Since the width can be calculated, it is possible to cope with various bar code symbol systems.

【0066】このように、バーの判別ルーチンを全ての
バーに対して行うことにより、全てのバーの種類を判別
する。なお、以上の各ルーチンにおいては、バーが予め
決められた間隔で並ぶパターンがあるバーコードシンボ
ルであればよく、したがって、上記実施形態で述べた日
本の郵便用バーコードのみに限られず、米国の郵便用の
バーコード、英国の4ステイト・バーコード、独国等の
バーノーバー・バーコード等であっても、バーの本数を
予め設定しておき、バーの間隔の設定を適宜変更し、バ
ーの本数をカウントするようにすれば、容易に対応する
ことができる。
As described above, by performing the bar determination routine for all the bars, the types of all the bars are determined. In each of the above routines, any bar code symbol having a pattern in which the bars are arranged at predetermined intervals may be used. Therefore, the bar code symbol is not limited to the Japanese postal bar code described in the above embodiment, and may be a U.S. Even for a postal bar code, a 4-state bar code in the UK, a bar bar bar code in Germany, etc., the number of bars is set in advance, and the setting of the bar interval is changed as appropriate. If the number is counted, it can be easily handled.

【0067】また、バーの全本数によってシンボルの検
出を行うので、印刷されたバーコードの大きさが変わっ
たり、撮像手段からの遠近によって撮像されるバーコー
ドシンボルの大きさが変わり、ゆがみ等が生じる場合で
あっても問題なく対応することができる。
Since symbols are detected based on the total number of bars, the size of a printed barcode changes, or the size of a barcode symbol imaged according to the distance from the image pickup means changes. Even if it occurs, it can be dealt with without any problem.

【0068】なお、本発明は、以下のように要約するこ
とができる。 (1)異なる光反射率の部分を有するバーとスペースか
ら構成されるシンボルを2次元像として撮像する撮像手
段と、前記2次元像の輝度値情報を一時的に記憶保持す
る記憶手段と、前記輝度値情報に基づき前記シンボルが
有する情報の復号を行う情報処理手段とを有するシンボ
ル情報読取装置において、前記情報処理手段は、 1)前記記憶手段の輝度値情報から前記2次元像におけ
る前記シンボルのバーに相当する部分の全てを横切るス
キャンラインを決定するスキャンライン決定処理と、 2)前記バーに相当する部分の高さ及び位置を検出する
バー判別処理と、を行うことを特徴とするシンボル情報
読取装置。
The present invention can be summarized as follows. (1) imaging means for imaging a symbol composed of bars and spaces having different light reflectance portions as a two-dimensional image, storage means for temporarily storing and holding luminance value information of the two-dimensional image, A symbol information reading device having information processing means for decoding information contained in the symbol based on luminance value information, wherein the information processing means comprises: 1) the luminance value information stored in the storage means; Symbol information characterized by performing scan line determination processing for determining a scan line that traverses all of the portion corresponding to the bar, and 2) bar determination processing for detecting the height and position of the portion corresponding to the bar. Reader.

【0069】この構成によれば、バーの下端および上端
が必ずしも同一線上になく、また、バーの高さが同じで
あってもその位置が異なるようなバーがシンボル内にあ
っても正確に復号することができる。 (2)前記第1項記載のシンボル情報読取装置におい
て、前記スキャンライン決定処理は、前記スキャンライ
ン上の輝度値を演算することでバーに相当する部分を複
数検出し、最初に検出されるバーから最後に検出される
バーまでの前記スキャンライン上における中点の位置を
検出することを特徴とするシンボル情報読取装置。
According to this configuration, even if the lower end and the upper end of the bar are not always on the same line, and even if the bar has the same height but the position is different within the symbol, the decoding is performed correctly. can do. (2) In the symbol information reading device according to (1), in the scan line determination processing, a plurality of portions corresponding to bars are detected by calculating a luminance value on the scan lines, and a bar detected first is provided. A symbol information reading device for detecting a position of a middle point on the scan line from the first to the last detected bar.

【0070】この構成によれば、シンボルの全てのバー
を横切るスキャンラインを早く見つけることができる。 (3)前記第2項記載のシンボル情報読取装置におい
て、前記スキャンライン決定処理におけるスキャンライ
ンの位置の設定は、前記最初に検出されるバーから最後
に検出されるバーまでの前記スキャンライン上における
中点の位置をc1、該位置c1を通るスキャンライン上で
のバーに相当する部分の数をBar1、次に設定されるスキ
ャンラインの位置をcとすると、位置c1から位置cへ
の変位量Δcは前記Bar1の減少関数とすることを特徴と
するシンボル情報読取装置。
According to this configuration, a scan line crossing all the bars of a symbol can be found quickly. (3) In the symbol information reading device according to the item (2), the setting of the position of the scan line in the scan line determination processing is performed on the scan line from the first detected bar to the last detected bar. Assuming that the position of the middle point is c1, the number of portions corresponding to bars on the scan line passing through the position c1 is Bar1, and the position of the next set scan line is c, the displacement amount from the position c1 to the position c A symbol information reading device wherein Δc is a decreasing function of Bar1.

【0071】この構成によれば、シンボルの全てのバー
を横切るスキャンラインをさらに早く見つけることがで
きる。 (4)前記第2項記載のシンボル情報読取装置におい
て、前記スキャンライン決定処理におけるスキャンライ
ンの角度の設定は、前記最初に検出されるバーから最後
に検出されるバーまでの前記スキャンライン上における
中点の位置を通るスキャンラインの角度をθ1、該角度
θ1のスキャンライン上でのバーに相当する部分の数をB
ar1、次に設定されるスキャンラインの角度をθとする
と、角度θ1から角度θへの変位角度量Δθは前記Bar1
の減少関数とすることを特徴とするシンボル情報読取装
置。
According to this configuration, a scan line crossing all the bars of the symbol can be found earlier. (4) In the symbol information reading device according to (2), the setting of the angle of the scan line in the scan line determination processing is performed on the scan line from the first detected bar to the last detected bar. The angle of the scan line passing through the position of the midpoint is θ1, and the number of parts corresponding to the bar on the scan line at the angle θ1 is B.
ar1, the angle of the scan line to be set next is θ, the displacement angle amount Δθ from the angle θ1 to the angle θ is Bar1
A symbol information reading device characterized by a decreasing function of

【0072】この構成によれば、シンボルの全てのバー
を横切るスキャンラインをさらに早く見つけることがで
きる。 (5)前記第1項記載のシンボル情報読取装置におい
て、前記バー判別処理は、前記バーに相当する部分内に
任意の2点P(2),P(3)を設定し、前記2点P
(2),P(3)が互いに最も離間し、かつ、移動前と
移動後の輝度値の変化がしきい値以下となる点に前記2
点P(2),P(3)をそれぞれ移動させ、前記点P
(2)と点P(3)と結ぶ線分の長さを検出し、他のバ
ーの長さとの比を検出することにより前記バーに相当す
る部分の高さを検出することを特徴とするシンボル情報
読取装置。
According to this configuration, a scan line crossing all the bars of a symbol can be found earlier. (5) In the symbol information reading device according to the item (1), in the bar discrimination processing, arbitrary two points P (2) and P (3) are set in a portion corresponding to the bar, and the two points P (2) and P (3) are set.
(2) and P (3) are located farthest apart from each other, and the change in the luminance value before and after the movement is equal to or less than the threshold value.
The points P (2) and P (3) are moved, respectively,
(2) The length of a line segment connecting the point P (3) is detected, and the height of a portion corresponding to the bar is detected by detecting the ratio of the length to another bar. Symbol information reading device.

【0073】この構成によれば、バーの高さを検出する
ことができる。 (6)前記第5項記載のシンボル情報読取装置におい
て、前記バー判別処理は、前記点P(2)と点P(3)
と結ぶ線分の長さからその中点を検出し、該中点が前記
スキャンラインを挟んでどちら側に位置するかを検出す
ることによりバーに相当する部分の位置を検出すること
を特徴とするシンボル情報読取装置。
According to this configuration, the height of the bar can be detected. (6) In the symbol information reading device according to the item (5), the bar discrimination processing includes the point P (2) and the point P (3).
Detecting the middle point from the length of the line segment connected to the bar, and detecting the position of the portion corresponding to the bar by detecting which side the middle point is located across the scan line. Symbol information reading device.

【0074】この構成よれば、シンボル内におけるバー
の高さ方向の位置を検出することができる。
According to this configuration, the position of the bar in the symbol in the height direction can be detected.

【0075】[0075]

【発明の効果】以上説明したように、本発明によれば、
バーの下端および上端が必ずしも同一線上になく、ま
た、バーの高さが同じであってもその位置が異なるよう
なバーがバーコード内にあっても正確に復号することが
できる。
As described above, according to the present invention,
Even if the lower end and the upper end of the bar are not always on the same line, and even if the bar has the same height but the position is different in the bar code, it can be correctly decoded.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 図1は本発明の実施形態にかかるバーコード
情報読取装置の構成を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of a barcode information reading device according to an embodiment of the present invention.

【図2】 図2は情報処理手段5で行われるバーコード
の復号アルゴリズムの概略を示すフローチャートであ
る。
FIG. 2 is a flowchart showing an outline of a barcode decoding algorithm performed by the information processing means 5;

【図3】 図3は画像取り込みルーチンを示すフローチ
ャートである。
FIG. 3 is a flowchart showing an image capturing routine.

【図4】 図4(a),(b)はフレームメモリ4にお
けるスキャンラインの各態様を示す図である
FIGS. 4A and 4B are diagrams showing each aspect of a scan line in a frame memory 4. FIGS.

【図5】 図5はバーコード検出ルーチンを示すフロー
チャートである。
FIG. 5 is a flowchart showing a barcode detection routine.

【図6】 図6はスキャン処理ルーチンのフローチャー
トである。
FIG. 6 is a flowchart of a scan processing routine.

【図7】 図7は詳細検出ルーチンのフローチャートで
ある。
FIG. 7 is a flowchart of a detail detection routine.

【図8】 図8はバーの判別ルーチンのフローチャート
である。
FIG. 8 is a flowchart of a bar determination routine.

【図9】 図9はあるバーの高さを検出する様子を示す
図である。
FIG. 9 is a diagram showing how a height of a certain bar is detected.

【図10】 図10(a)はカスタマバーコードを示
し、図10(b)はフレームメモリ4においてバーコー
ドをスキャン処理する様子を示し、図10(c)は図1
0(b)の部分拡大図である。
10 (a) shows a customer barcode, FIG. 10 (b) shows how the barcode is scanned in the frame memory 4, and FIG. 10 (c) shows FIG.
It is the elements on larger scale of 0 (b).

【符号の説明】[Explanation of symbols]

1 バーコード情報読取装置 2 撮像レンズ 3 2次元CCD 4 フレームメモリ 5 情報処理手段 6 ホストコンピュータ 7 荷物 8 カスタマバーコード DESCRIPTION OF SYMBOLS 1 Barcode information reading device 2 Image pickup lens 3 Two-dimensional CCD 4 Frame memory 5 Information processing means 6 Host computer 7 Package 8 Customer barcode

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】異なる光反射率の部分を有するバーとスペ
ースから構成されるシンボルを2次元像として撮像する
撮像手段と、 前記2次元像の輝度値情報を一時的に記憶保持する記憶
手段と、 前記輝度値情報に基づき前記シンボルが有する情報の復
号を行う情報処理手段とを有するシンボル情報読取装置
において、 前記情報処理手段は、 前記記憶手段の輝度値情報から前記2次元像における前
記シンボルのバーに相当する部分の全てを横切るスキャ
ンラインを決定するスキャンライン決定処理と、 前記バーに相当する部分の高さ及び位置を検出するバー
判別処理と、を行うことを特徴とするシンボル情報読取
装置。
An image pickup means for picking up, as a two-dimensional image, a symbol composed of bars and spaces having portions having different light reflectances, and a storage means for temporarily storing and holding luminance value information of the two-dimensional image. A symbol information reading device having information processing means for decoding information of the symbol based on the brightness value information, wherein the information processing means determines the symbol of the symbol in the two-dimensional image from the brightness value information of the storage means. A symbol information reading apparatus comprising: a scan line determining process for determining a scan line that traverses all of a portion corresponding to a bar; and a bar determining process for detecting a height and a position of the portion corresponding to the bar. .
【請求項2】請求項1記載のシンボル情報読取装置にお
いて、 前記スキャンライン決定処理は、 前記スキャンライン上の輝度値を演算することでバーに
相当する部分を複数検出し、最初に検出されるバーから
最後に検出されるバーまでの前記スキャンライン上にお
ける中点の位置を検出することを特徴とするシンボル情
報読取装置。
2. The symbol information reading device according to claim 1, wherein the scan line determination processing detects a plurality of portions corresponding to bars by calculating a luminance value on the scan line, and is detected first. A symbol information reading device for detecting a position of a midpoint on the scan line from a bar to a bar detected last.
JP9153779A 1997-06-11 1997-06-11 Symbol information reader Withdrawn JPH113397A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9153779A JPH113397A (en) 1997-06-11 1997-06-11 Symbol information reader

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9153779A JPH113397A (en) 1997-06-11 1997-06-11 Symbol information reader

Publications (1)

Publication Number Publication Date
JPH113397A true JPH113397A (en) 1999-01-06

Family

ID=15569963

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9153779A Withdrawn JPH113397A (en) 1997-06-11 1997-06-11 Symbol information reader

Country Status (1)

Country Link
JP (1) JPH113397A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002541566A (en) * 1999-04-07 2002-12-03 シンボル テクノロジーズ インコーポレイテッド Imaging engine and technology for reading zip codes
JP2011186950A (en) * 2010-03-10 2011-09-22 Toshiba Tec Corp Code reader and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002541566A (en) * 1999-04-07 2002-12-03 シンボル テクノロジーズ インコーポレイテッド Imaging engine and technology for reading zip codes
JP2011186950A (en) * 2010-03-10 2011-09-22 Toshiba Tec Corp Code reader and program
US8439259B2 (en) 2010-03-10 2013-05-14 Toshiba Tec Kabushiki Kaisha Code reading apparatus, sales registration processing apparatus, and code reading method

Similar Documents

Publication Publication Date Title
KR100309242B1 (en) Symbol information reading device
US7181066B1 (en) Method for locating bar codes and symbols in an image
US4896029A (en) Polygonal information encoding article, process and system
US6142376A (en) Method and apparatus for reading symbols on items moved by conveyor
US4998010A (en) Polygonal information encoding article, process and system
US4874936A (en) Hexagonal, information encoding article, process and system
CA2191433C (en) Method and apparatus for decoding bar code symbols using independent bar and space analysis
EP1086439B1 (en) Techniques for reading postal codes
US5742041A (en) Method and apparatus for locating and decoding machine-readable symbols, including data matrix symbols
EP0484132A2 (en) Multiple resolution machine readable symbols
EP3462372B1 (en) System and method for detecting optical codes with damaged or incomplete finder patterns
JP5140820B2 (en) Symbol information reading apparatus and symbol information reading method
US7050631B2 (en) Barcode detection system
JP7062722B2 (en) Specifying the module size of the optical cord
JP4652201B2 (en) Bar code symbol information reading method and bar code symbol information reading device
JPH113397A (en) Symbol information reader
EP1544783B1 (en) Robust barcode reader
JP3022459B2 (en) Form identification registration device
JP4403063B2 (en) Symbol information reading method and symbol information reading apparatus
JP4102742B2 (en) Optical information reader and image data analysis method
JPH02125386A (en) Image signal processor
JPH08329185A (en) Symbol information reader
JP4102741B2 (en) Optical information reader and image data analysis method
JP3730716B2 (en) Bar code reader
CN117454915A (en) Reading of optical codes

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20040907