JP2010140310A - Bar code reading apparatus, bar code reading program, and bar code reading method - Google Patents

Bar code reading apparatus, bar code reading program, and bar code reading method Download PDF

Info

Publication number
JP2010140310A
JP2010140310A JP2008316836A JP2008316836A JP2010140310A JP 2010140310 A JP2010140310 A JP 2010140310A JP 2008316836 A JP2008316836 A JP 2008316836A JP 2008316836 A JP2008316836 A JP 2008316836A JP 2010140310 A JP2010140310 A JP 2010140310A
Authority
JP
Japan
Prior art keywords
barcode
density
bar
width
array
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.)
Granted
Application number
JP2008316836A
Other languages
Japanese (ja)
Other versions
JP5121685B2 (en
Inventor
Hiroo Miyake
啓夫 三宅
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.)
Toshiba Corp
Toshiba Digital Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Solutions Corp
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 Toshiba Corp, Toshiba Solutions Corp filed Critical Toshiba Corp
Priority to JP2008316836A priority Critical patent/JP5121685B2/en
Publication of JP2010140310A publication Critical patent/JP2010140310A/en
Application granted granted Critical
Publication of JP5121685B2 publication Critical patent/JP5121685B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a bar code reading apparatus for properly decoding a captured bar code image. <P>SOLUTION: The bar code reading apparatus is provided with: a scan data acquisition part 12 for acquiring concentration sequence data showing the sequence of concentration values in a bar code sequence direction from an image obtained by imaging a bar code; a bar width calculation part 13 for acquiring a position where the concentration value is a peak value from the acquired concentration sequence data, and for calculating the concentration mean value of a predetermined range in the concentration sequence data on the basis of the peak position for each peak position, and for calculating the width of the bar of the bar code and the width of a space between the bars on the basis of the mean concentration value; a bar determination part 14 for converting the bar code into a bit sequence on the basis of the calculated bar width and the calculated space between the bars; and a code extraction part 15 for extracting characters corresponding to the converted bit sequence. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、バーコードを含んだ領域を撮像し、撮像された画像からバーコードを読み取るバーコード読取装置、バーコード読取プログラム、バーコード読取方法に関する。   The present invention relates to a barcode reading apparatus, a barcode reading program, and a barcode reading method that capture an image of an area including a barcode and read the barcode from the captured image.

従来、カメラによってバーコードを含んだ領域が撮像され、撮像された画像に基づきバーコードをデコードする手法が開示されている。   Conventionally, a method has been disclosed in which a region including a barcode is captured by a camera, and the barcode is decoded based on the captured image.

また、波形を解読するために撮像画像を2回微分処理し、得られた画像から0クロス点を求める方法が知られている。   Also, a method is known in which a captured image is differentiated twice in order to decode a waveform, and a zero cross point is obtained from the obtained image.

なお、本発明の関連ある従来技術として、バーコードの画像が不鮮明であっても、情報を認識可能なバーコード認識装置、方法が開示されている(例えば特許文献1)。
特開2007−226328号公報
As a related art related to the present invention, a barcode recognition apparatus and method capable of recognizing information even if a barcode image is unclear is disclosed (for example, Patent Document 1).
JP 2007-226328 A

しかしながら、ノイズがある撮像画像に対し、またバー幅の細いバーコードに対して、サブピクセルでの波形を解読するためには、上述の2回微分処理をすることで0クロス点を求める方法では、正確なバー幅を求めるのは困難であり、よって正確なバーコード読取を行うことができない。   However, in order to decipher the waveform at the sub-pixel for a picked-up image with noise or for a bar code with a narrow bar width, the method of obtaining the zero cross point by performing the above-described two-time differentiation process. Therefore, it is difficult to obtain an accurate bar width, and thus accurate barcode reading cannot be performed.

本発明は上述した課題を解決するためになされたものであり、撮像された画像が粗い、撮像された画像がぼやけている、ノイズがある、またバーコードのバー幅が細い等であってもバーコードの位置を的確に検出し、検出されたバーコード位置に基づきバーコードを的確にデコードすることができるバーコード読取装置、バーコード読取プログラム、バーコード読取方法を提供することを目的とする。   The present invention has been made to solve the above-described problems. Even when the captured image is rough, the captured image is blurred, noisy, or the barcode has a narrow bar width, etc. An object of the present invention is to provide a barcode reading apparatus, a barcode reading program, and a barcode reading method capable of accurately detecting the position of a barcode and accurately decoding the barcode based on the detected barcode position. .

上述した課題を解決するため、本発明の一態様に係るバーコード読取装置は、バーコードが撮像された画像から、バーコード配列方向の濃度値の配列である濃度配列データを取得する濃度配列データ取得部と、前記濃度配列データ取得部によって取得された濃度配列データから、濃度値がピーク値となる位置をそれぞれ取得し、前記ピーク値となる位置を中心とした、前記濃度配列データ内の所定範囲の濃度平均値を前記ピーク値となる位置ごとに算出し、該平均濃度値に基づき前記バーコードのバーの幅およびバー間のスペースの幅を算出するバー幅算出部と、前記バー幅算出部によって算出されたバーの幅およびバー間のスペースの幅に基づき前記バーコードをビット配列に変換するビット配列変換部と、前記ビット配列変換部によって変換されたビット配列に対応する文字を抽出するコード抽出部と、を備えるものである。   In order to solve the above-described problem, a barcode reading apparatus according to an aspect of the present invention provides density array data that acquires density array data that is an array of density values in the barcode array direction from an image obtained by capturing a barcode. A position at which the density value becomes a peak value is acquired from the acquisition unit and the density array data acquired by the density array data acquisition unit, respectively, and a predetermined value in the density array data centered on the position at which the peak value is obtained A bar width calculation unit that calculates a density average value of a range for each position that becomes the peak value, and calculates a bar width of the barcode and a width of a space between bars based on the average density value; and the bar width calculation A bit array conversion unit that converts the barcode into a bit array based on the width of the bar calculated by the unit and the width of the space between the bars, and the bit array conversion unit A code extraction unit for extracting a character corresponding to the conversion bit sequences, are those comprising a.

また、本発明の一態様に係るバーコード読取プログラムは、バーコードが撮像された画像から、バーコード配列方向の濃度値の配列である濃度配列データを取得する濃度配列データ取得ステップと、前記濃度配列データ取得ステップによって取得された濃度配列データから、濃度値がピーク値となる位置をそれぞれ取得し、前記ピーク値となる位置を中心とした、前記濃度配列データ内の所定範囲の濃度平均値を前記ピーク値となる位置ごとに算出し、該平均濃度値に基づき前記バーコードのバーの幅およびバー間のスペースの幅を算出するバー幅算出ステップと、前記バー幅算出ステップによって算出されたバーの幅およびバー間のスペースの幅に基づき前記バーコードをビット配列に変換するビット配列変換ステップと、前記ビット配列変換ステップによって変換されたビット配列に対応する文字を抽出するコード抽出ステップと、をコンピュータに実行させるものである。   The barcode reading program according to one aspect of the present invention includes a density array data acquisition step of acquiring density array data that is an array of density values in the barcode array direction from an image in which a barcode is captured, and the density From the density array data acquired by the array data acquisition step, each position where the density value becomes a peak value is acquired, and a concentration average value in a predetermined range in the density array data centered on the position where the peak value is the center. A bar width calculating step for calculating the width of the bar of the barcode and the width of the space between the bars based on the average density value, and calculating the bar width calculated by the bar width calculating step. A bit array conversion step for converting the barcode into a bit array based on the width of the data and the width of the space between the bars, and the bit array A code extraction step of extracting a character corresponding to the bit sequence that has been converted by the conversion step, is intended to execute on a computer.

さらに、本発明の一態様に係るバーコード読取方法は、バーコードが撮像された画像から、バーコード配列方向の濃度値の配列である濃度配列データを取得する濃度配列データ取得ステップと、前記濃度配列データ取得ステップによって取得された濃度配列データから、濃度値がピーク値となる位置をそれぞれ取得し、前記ピーク値となる位置を中心とした、前記濃度配列データ内の所定範囲の濃度平均値を前記ピーク値となる位置ごとに算出し、該平均濃度値に基づき前記バーコードのバーの幅およびバー間のスペースの幅を算出するバー幅算出ステップと、前記バー幅算出ステップによって算出されたバーの幅およびバー間のスペースの幅に基づき前記バーコードをビット配列に変換するビット配列変換ステップと、前記ビット配列変換ステップによって変換されたビット配列に対応する文字を抽出するコード抽出ステップと、を実行するものである。   Furthermore, the barcode reading method according to an aspect of the present invention includes a density array data acquisition step of acquiring density array data that is an array of density values in the barcode array direction from an image in which a barcode is captured, and the density From the density array data acquired by the array data acquisition step, each position where the density value becomes a peak value is acquired, and a concentration average value in a predetermined range in the density array data centered on the position where the peak value is the center. A bar width calculating step for calculating the width of the bar of the barcode and the width of the space between the bars based on the average density value, and calculating the bar width calculated by the bar width calculating step. A bit array conversion step for converting the barcode into a bit array based on the width of the data and the space between the bars, and the bit array conversion A code extraction step of extracting a character corresponding to the converted bit sequence by step, is to run.

撮像されたバーコード画像を的確にデコードすることができる。   The captured barcode image can be accurately decoded.

本実施の形態では、NW−7のコード体系の仕様に準拠したバーコードを処理の対象とする。ここで、NW−7について説明する。尚、本実施の形態で開示するバーコード読取装置、バーコード読取プログラム、バーコード読取方法は、NW−7以外のコード体系(例えばCode−39)でも適用可能である。   In the present embodiment, a barcode that conforms to the specifications of the NW-7 code system is the target of processing. Here, NW-7 will be described. Note that the barcode reading apparatus, barcode reading program, and barcode reading method disclosed in the present embodiment can be applied to code systems other than NW-7 (for example, Code-39).

NW−7のコード体系では、4本のバーと3本のスペースの合計7本で1文字が構成される。また、文字と文字の間には、キャラクタギャップと呼ばれるワイドスペース部分があるものとする。   In the NW-7 code system, one character is composed of a total of seven bars of four bars and three spaces. Also, it is assumed that there is a wide space portion called a character gap between characters.

バーとスペースは幅が細いもの(ナローバー/ナロースペース)と、太いもの(ワイドバー/ワイドスペース)がある。尚、ナローとワイドの比率が2倍〜3倍であることとする。   Bars and spaces are narrow (narrow bar / narrow space) and thick (wide bar / wide space). The ratio between narrow and wide is 2 to 3 times.

また、バーコード幅の密度は、以下の通りである。本実施の形態では、高密度にも対応できる。
・低密度 : ナロー幅=0.40mm、比率2.5倍
・中密度 : ナロー幅=0.26mm 比率2.5倍
・高密度 : ナロー幅=0.19mm 比率2.25倍
Further, the density of the barcode width is as follows. In this embodiment, it is possible to cope with high density.
・ Low density: narrow width = 0.40mm, ratio 2.5 times ・ Medium density: narrow width = 0.26mm ratio 2.5 times ・ High density: narrow width = 0.19mm ratio 2.25 times

ナローバーとナロースペースは、バイナリーコードの0を表し、ワイドバーとワイドスペースはバイナリーコードの1を表す。すなわち、1文字は7ビットで表現されることになる。   Narrow bar and narrow space represent 0 of the binary code, and wide bar and wide space represent 1 of the binary code. That is, one character is expressed by 7 bits.

また、NW−7のコード体系には、以下の仕様がある。
・バーコードの左マージン、右マージンにナロースペースの10倍以上のスペースを要する。
・データフィールド長は96ビットで、12文字を表現する。
・開始文字、終了文字は「a」のみ。
The NW-7 code system has the following specifications.
-The bar code's left and right margins require more than 10 times the narrow space.
• The data field length is 96 bits and represents 12 characters.
・ Start character and end character are “a” only.

また、以下の説明では、バーコードの位置検出に特化したバーコード読取装置の形態を「実施の形態1」として説明し、バーコードの判読に特化したバーコード読取装置の形態を「実施の形態2」として説明する。また、以降の説明では、バーコードの配列方向すなわちスキャン方向を横軸(X軸)とした画像を対象とする。   In the following description, the form of the barcode reader specialized for barcode position detection will be described as “Embodiment 1”, and the form of the barcode reader specialized for barcode interpretation will be described as “implementation”. This will be described as “Mode 2”. Further, in the following description, an image having the horizontal axis (X axis) in the barcode arrangement direction, that is, the scanning direction is targeted.

(実施の形態1)
実施の形態1におけるバーコード読取装置の機能構成を、図1を参照しつつ説明する。バーコード読取装置100は、撮像部1、明暗領域識別部2、膨張縮退部3、位置抽出部4(選定部)、バーコード解読部5を備える。
(Embodiment 1)
A functional configuration of the barcode reading apparatus according to the first embodiment will be described with reference to FIG. The barcode reader 100 includes an imaging unit 1, a light / dark region identification unit 2, an expansion / reduction unit 3, a position extraction unit 4 (selection unit), and a barcode decoding unit 5.

撮像部1は、少なくともバーコードを含んだ領域を、レンズを介して動画として撮像し、撮像した映像を撮像素子に結像させビデオ信号として出力するカメラである。撮像部1は、例えば携帯電話機に代表される動画撮像機能を有する携帯端末機であり、ユーザはバーコード近傍を撮像し続けた状態で、撮像画像の動画を確認しながら作業を実施することができる。   The imaging unit 1 is a camera that captures an area including at least a barcode as a moving image through a lens, forms an image on the imaging element, and outputs the image as a video signal. The imaging unit 1 is a portable terminal device having a moving image imaging function represented by, for example, a mobile phone, and the user can perform work while confirming a moving image of the captured image while continuously capturing the vicinity of the barcode. it can.

明暗領域識別部2は、撮像された動画画像の1フレーム(1枚の静止画)に対し、シェーディング補正、X方向微分処理等の画像処理を実施し、画像処理後の画像の明るい領域(以下、白色領域(明領域)と称す)と暗い領域(以下、黒色領域(暗領域)と称す)を識別した画像を生成する。尚、実施の形態1では、白色領域、黒色領域とが2値化された画像が生成されるものとする。   The light / dark region identifying unit 2 performs image processing such as shading correction and X-direction differentiation processing on one frame (one still image) of the captured moving image, and performs a bright region (hereinafter referred to as an image processed image). , A white region (bright region)) and a dark region (hereinafter referred to as a black region (dark region)) are generated. In the first embodiment, it is assumed that an image in which the white area and the black area are binarized is generated.

膨張縮退部3は、明暗領域識別部2によって2値化された画像に対し、少なくとも白色部分に挟まれた黒色部分が白色領域になるまで(バー間の黒い隙間(濃度値が0のもの)が埋まるまで、すなわちバー間のスペース部が無くなるまで)白色領域を膨張させる。また、膨張縮退部3は、バーコードの白色領域が周辺の白色領域と接触しているのを切断するため、白色領域を縮退させる。   The expansion / reduction unit 3 applies to the image binarized by the light / dark region identification unit 2 until at least a black portion sandwiched between white portions becomes a white region (a black gap between bars (with a density value of 0)). The white area is expanded until the space is filled, i.e., the space between the bars disappears. Further, the expansion / reduction unit 3 reduces the white area in order to cut the white area of the barcode in contact with the surrounding white area.

さらに、膨張縮退部3は、縮退させた白色領域を再度膨張させ、バーコードを元のサイズに戻す。尚、膨張縮退部3は、膨張処理、縮退処理、および元のバーコードサイズに戻すための膨張処理の各ステップで得られるデータを画像データとしてメモリに保持させるものとする。   Further, the expansion / reduction unit 3 expands the contracted white area again, and returns the barcode to the original size. The expansion / reduction unit 3 stores data obtained in each step of expansion processing, reduction processing, and expansion processing for returning to the original barcode size in the memory as image data.

位置抽出部4は、膨張縮退部3によって膨張処理、縮退処理、および元のバーコードサイズに戻すための膨張処理が実行された画像データに対し、ラベリング処理を行い、白色領域を抽出する。その後、位置抽出部4は、白色領域のうちで一番大きい面積を選定する。尚、この最大面積がバーコードの位置となる。   The position extraction unit 4 performs a labeling process on the image data that has been subjected to the expansion process, the contraction process, and the expansion process for returning to the original barcode size by the expansion / reduction unit 3 to extract a white region. Thereafter, the position extraction unit 4 selects the largest area in the white region. This maximum area is the bar code position.

バーコード解読部5は、位置抽出部4によって抽出された最大面積の白色領域をバーコードの位置とし、当該バーコードの位置に基づき、撮像部1によって撮像された画像内のバーコードをデコード(バーコード解読処理)する。   The barcode decoding unit 5 sets the white area of the maximum area extracted by the position extraction unit 4 as the barcode position, and decodes the barcode in the image captured by the imaging unit 1 based on the barcode position ( Barcode decoding process).

次に、本実施の形態におけるバーコード読取装置100の動作を図2のフローチャートを参照しつつ説明する。   Next, the operation of the barcode reading apparatus 100 in the present embodiment will be described with reference to the flowchart of FIG.

まず、撮像部1は、少なくともバーコードを含んだ領域を撮像し、撮像画像を取得する(S1)。次に明暗領域識別部2は、撮像された画像の平均濃度を算出し、平均濃度が一定範囲にない場合はゲイン値を変更し、平均濃度が一定範囲になるよう補正する(S2)。   First, the imaging unit 1 captures an area including at least a barcode and acquires a captured image (S1). Next, the bright / dark region identifying unit 2 calculates the average density of the captured image, and if the average density is not within a certain range, changes the gain value and corrects the average density to be within the certain range (S2).

明暗領域識別部2は、ゲインの変更が行われた画像に対し、シェーディング補正を行う(S3)。明暗領域識別部2は、シェーディング補正としてX方向(画像に対する横成分方向)で所定区域の最大の濃度値をその所定領域の中央の濃度値として平均化し、画素毎に、平均化処理をした濃度値で元の画像の濃度値を除算する。また明暗領域識別部2は、その後、除算した値に一定値を積算して各画素の濃度値とする。   The bright / dark region identifying unit 2 performs shading correction on the image whose gain has been changed (S3). The light / dark area identifying unit 2 averages the maximum density value of a predetermined area in the X direction (the horizontal component direction with respect to the image) as shading correction, and averages the density for each pixel. Divide the density value of the original image by the value. The bright / dark region identifying unit 2 then adds a constant value to the divided value to obtain the density value of each pixel.

ここで、撮像部1によって得られた原画像のバーコード部を図3に、上述シェーディング補正までを施した画像を図4にそれぞれ示す。このように、ゲイン変更処理やシェーディング補正を行うことによって、照明などの外来光の影響を緩和するとともに、原画像のバーの部分とバー間のスペースとの区別をある程度を鮮明にすることができる。尚、図3、図4ではバーコードの画像(X軸、Y軸の2次元画像)を示したが、処理を高速にするため、実際は上述の通りX方向のみの1次元で処理が行われる。   Here, the barcode portion of the original image obtained by the imaging unit 1 is shown in FIG. 3, and the image subjected to the shading correction is shown in FIG. In this way, by performing gain change processing and shading correction, the influence of extraneous light such as illumination can be alleviated, and the distinction between the bar portion of the original image and the space between the bars can be made clear to some extent. . 3 and 4 show barcode images (X-axis and Y-axis two-dimensional images). However, in order to increase the processing speed, processing is actually performed in one dimension only in the X direction as described above. .

次に、明暗領域識別部2は、シェーディング補正が施された画像に対し、X方向に隣接した画素の濃度値の差分を取って各画素の濃度値とするX方向微分処理を行う(S4)。図5にX方向微分処理を施した画像を示す。図5に示すように明暗領域識別部2は、X方向微分処理を行うことでバーの部分を強調する。尚、本実施の形態においては、図5に示すように、X方向微分処理を施した後の画像は本来明るい領域近傍は低い濃度値となり、本来暗い領域近傍は高い濃度値となっていることに留意する。   Next, the light / dark region identifying unit 2 performs X-direction differentiation processing on the image subjected to the shading correction to obtain the density value of each pixel by taking the difference between the density values of pixels adjacent in the X direction (S4). . FIG. 5 shows an image subjected to the X-direction differentiation process. As shown in FIG. 5, the light / dark region identifying unit 2 emphasizes the bar portion by performing X-direction differentiation processing. In the present embodiment, as shown in FIG. 5, the image after the X-direction differentiation process has a low density value in the vicinity of the originally bright area and a high density value in the vicinity of the originally dark area. Keep in mind.

続いて明暗領域識別部2は、X方向微分処理を施した後の画像に対し2値化処理を行う(S5)。   Subsequently, the light / dark region identifying unit 2 performs binarization processing on the image after the X-direction differentiation processing is performed (S5).

2値化処理を行う際の閾値の選定方法について、図6、図7を参照しつつ説明する。まず、図6(A)にX方向微分処理を施した画像の濃度断面図(縦軸が濃度値、横軸が画素単位での画像上の位置)を示す。明暗領域識別部2は、ここで例えば20画素ずつの局所領域(図6(B)参照)の濃度値ヒストグラムを作成する。実施の形態1では、例えば濃度のピークが2画素分程度である場合、そのピーク10箇所分を局所領域の範囲とする。   A method of selecting a threshold value when performing binarization processing will be described with reference to FIGS. First, FIG. 6A shows a density cross-sectional view of an image that has been subjected to X-direction differentiation processing (the vertical axis is the density value, and the horizontal axis is the position on the image in units of pixels). Here, for example, the light / dark region identifying unit 2 creates a density value histogram of a local region (see FIG. 6B) of, for example, 20 pixels. In the first embodiment, for example, when the density peak is about 2 pixels, 10 peaks are set as the range of the local region.

図7に、縦軸を局所領域内の画素数(個数)、横軸を濃度値とした局所領域の濃度値ヒストグラムを示す。明暗領域識別部2は、濃度波形を2つのクラスに区切ったときに、双方の波形間の分散が最大になるような濃度値を閾値とする(クラス間分散)。明暗領域識別部2は、このように局所領域ごとに閾値を算出し、当該局所領域内の各画素と、算出された閾値を比較する。明暗領域識別部2は、当該画素の濃度値が算出された閾値以上である場合、当該画素を白色(濃度値255)とし、閾値未満である場合、当該画素を黒色(濃度値0)とする(図6(B)も参照)。   FIG. 7 shows a local area density value histogram in which the vertical axis represents the number of pixels in the local area (number) and the horizontal axis represents the density value. The light / dark region identifying unit 2 sets a density value that maximizes the variance between the two waveforms when the density waveform is divided into two classes (interclass variance). The light / dark region identifying unit 2 thus calculates a threshold value for each local region, and compares each pixel in the local region with the calculated threshold value. When the density value of the pixel is equal to or greater than the calculated threshold value, the light / dark region identification unit 2 sets the pixel to white (density value 255), and if the density value is less than the threshold value, sets the pixel to black (density value 0). (See also FIG. 6B).

尚、明暗領域識別部2は、事前に設けられた所定の閾値以上を白色(濃度値255)、閾値未満を黒色(濃度値0)とする手法でも当然よい。図8に、2値化処理を施した画像を示す。   It should be noted that the light / dark region identifying unit 2 may naturally adopt a method in which a predetermined threshold value or more provided in advance is white (density value 255) and a value less than the threshold value is black (density value 0). FIG. 8 shows an image that has been binarized.

膨張縮退部3は、このように2値化された画像に対し、バーコード部分のバー間の黒い隙間(濃度値0)が全て埋まる(濃度値255になる)まで白色領域を膨張させる(S6)。図9に、白色領域を膨張させた画像を示す。   The expansion / reduction unit 3 expands the white area in the binarized image until all the black gaps (density value 0) between the bars in the barcode portion are filled (the density value becomes 255) (S6). ). FIG. 9 shows an image in which the white region is expanded.

一般的に、バーコードは、バーの領域の下部にバーの配列によって示される数字が印字されている。図9に示したように白色領域を膨張させた画像では、印字された数字も膨張され、膨張したバーコード部分に数字部分がノイズとして接触した状態となってしまう。またバーコードの印刷の質、よごれの付着によっては、この印字された数字以外のノイズが発生している場合もある。よって、これらノイズとの接触を切断するため、膨張縮退部3は、ノイズとの接触が無くなるまで白色領域を縮退させる(S7)。縮退処理を行った後の画像を図10に示す。   In general, a barcode is printed with a number indicated by an array of bars at the bottom of the bar area. As shown in FIG. 9, in the image in which the white region is expanded, the printed numbers are also expanded, and the number portions are in contact with the expanded barcode portion as noise. In addition, depending on the quality of barcode printing and the adhesion of dirt, noise other than the printed numbers may occur. Therefore, in order to cut | disconnect contact with these noises, the expansion / contraction part 3 contracts a white area | region until there is no contact with noise (S7). FIG. 10 shows an image after the reduction process is performed.

続いて膨張縮退部3は、ステップS6、S7によって膨張、縮退処理を行った画像に対し、再度膨張処理を実施することで、白色領域を膨張、縮退処理実施前の元のサイズに戻す(S8)。元のサイズに戻った画像を図11に示す。   Subsequently, the expansion / reduction unit 3 performs the expansion process again on the image subjected to the expansion / reduction process in steps S6 and S7, thereby returning the white area to the original size before the expansion / reduction process is performed (S8). ). The image returned to the original size is shown in FIG.

位置抽出部4は、S8の処理まで施された画像に対しラベリング処理を行う(S9)。すなわち、位置抽出部4は、バーコード部分を含めた白色領域の閉領域を抽出し、抽出した閉領域にラベルを付す。その後、位置抽出部4は、ラベルを付した閉領域のうちで、一番面積の大きいものをバーコードの位置として抽出する(S10)。尚、バーコードの位置の抽出は、特徴点(矩形領域の場合は各頂点)のX座標値、Y座標値を抽出するものとする。   The position extraction unit 4 performs a labeling process on the image that has been subjected to the process of S8 (S9). That is, the position extraction unit 4 extracts a closed region of the white region including the barcode part, and attaches a label to the extracted closed region. Thereafter, the position extraction unit 4 extracts the largest area among the labeled closed areas as the barcode position (S10). Note that the barcode position is extracted by extracting the X-coordinate value and Y-coordinate value of the feature point (each vertex in the case of a rectangular area).

位置抽出部4は、抽出されたバーコード位置の面積が所定の閾値以上でない場合はバーコードとしない、または、抽出した領域内に黒色領域が含まれている場合はバーコードとしない等の予め設けられた条件を満たさない場合、処理を撮像部1による撮像処理(S1)に戻す(S11、No)。また条件を満たしている場合(S11、Yes)、バーコード解読部5は、位置抽出部4によって抽出されたバーコードの位置情報に基づき原画像または上述S3のシェーディング補正が施された画像からバーコードを切り出し、切り出し画像をスキャンすることでバーコードをデコードする(S12)。尚、バーコード解読部5によるバーコード解読処理は、後述する実施の形態2の処理であってもよいし、また従来のバーコード解読処理であってもよい。   If the area of the extracted barcode position is not equal to or greater than a predetermined threshold, the position extraction unit 4 does not use the barcode, or does not use the barcode if the extracted area includes a black area. When the provided conditions are not satisfied, the process is returned to the imaging process (S1) by the imaging unit 1 (S11, No). If the condition is satisfied (S11, Yes), the barcode decoding unit 5 reads the barcode from the original image or the image subjected to the shading correction of S3 described above based on the barcode position information extracted by the position extraction unit 4. The bar code is decoded by cutting out the code and scanning the cut out image (S12). Note that the barcode decoding process by the barcode decoding unit 5 may be a process according to a second embodiment to be described later, or may be a conventional barcode decoding process.

膨張縮退部3は、膨張率、縮退率として事前に設けられた値を、白色領域の面積に対し積算することでS6、S7、S8の膨張、縮退処理を実施してもよい。   The expansion / reduction unit 3 may perform the expansion / reduction process of S6, S7, and S8 by adding the values provided in advance as the expansion rate and the reduction rate to the area of the white region.

バーコード読取装置100は、バーコードの位置を抽出できた場合に発信音等を鳴らしてユーザに通知してもよい。   The bar code reader 100 may notify the user by sounding a dial tone or the like when the bar code position can be extracted.

以上のように、実施の形態1のバーコード読取装置100によって、バーコードの位置を的確に検出することができる。   As described above, the barcode reader 100 according to the first embodiment can accurately detect the barcode position.

(実施の形態2)
実施の形態1では、バーコードの位置を抽出する機能に特化したバーコード読取装置を説明したが、実施の形態2では、抽出されたバーコードを正確にデコードする機能を有するバーコード読取装置について説明する。
(Embodiment 2)
In the first embodiment, the barcode reader specialized in the function of extracting the barcode position has been described. In the second embodiment, the barcode reader having a function of accurately decoding the extracted barcode. Will be described.

図12に、実施の形態2におけるバーコード読取装置を示す。バーコード読取装置200は、バーコード位置抽出部11、スキャンデータ取得部12(濃度配列データ取得部)、バー幅算出部13、バー判定部14、コード抽出部15を備える。   FIG. 12 shows a barcode reader according to the second embodiment. The barcode reader 200 includes a barcode position extraction unit 11, a scan data acquisition unit 12 (density array data acquisition unit), a bar width calculation unit 13, a bar determination unit 14, and a code extraction unit 15.

バーコード位置抽出部11は、少なくともバーコードが撮像された画像からバーコードの位置を抽出する。   The barcode position extraction unit 11 extracts a barcode position from at least an image of the barcode imaged.

スキャンデータ取得部12は、バーコード位置抽出部11によって位置が抽出されたバーコード部分に対し、所定のY座標でX方向にスキャンし、位置毎(画素毎)の濃度値をスキャンデータとして取得する。   The scan data acquisition unit 12 scans the barcode portion whose position is extracted by the barcode position extraction unit 11 in the X direction with a predetermined Y coordinate, and acquires a density value for each position (for each pixel) as scan data. To do.

バー幅算出部13は、スキャンデータから濃度値がピーク値となる位置をそれぞれ取得する。またバー幅算出部13は、ピーク値となる位置を中心とした、スキャンデータの所定範囲内の濃度平均値をピーク値となる位置ごとに算出する。バー幅算出部13は、平均濃度値に基づきバーコードのバーの幅およびバー間のスペースの幅を算出する。   The bar width calculation unit 13 acquires each position where the density value becomes the peak value from the scan data. Further, the bar width calculation unit 13 calculates the average density value within a predetermined range of the scan data centered on the position that becomes the peak value for each position that becomes the peak value. The bar width calculator 13 calculates the bar width of the barcode and the width of the space between the bars based on the average density value.

バー判定部14は、バー幅算出部13によって算出されたバーの幅およびバー間のスペースの幅に基づき、当該バーまたはスペースの示す値が1か0かを判定し、0と1とで成るビット配列を作成する。   Based on the width of the bar calculated by the bar width calculation unit 13 and the width of the space between the bars, the bar determination unit 14 determines whether the value indicated by the bar or the space is 1 or 0, and consists of 0 and 1 Create a bit array.

コード抽出部15は、バー判定部14によって作成された0と1との配列に対応する文字を抽出する。   The code extraction unit 15 extracts characters corresponding to the array of 0 and 1 created by the bar determination unit 14.

次に、バーコード読取装置200の動作について、図13のフローチャートを参照しつつ説明する。   Next, the operation of the barcode reader 200 will be described with reference to the flowchart of FIG.

バーコード位置抽出部11は、少なくともバーコードが撮像された画像からバーコードの位置を抽出する(S51)。バーコード位置抽出部11は、例えば上述実施の形態1で示した構成であってもよいし、また、従来のバーコード位置抽出処理機能を有するものであってもよい。   The barcode position extraction unit 11 extracts a barcode position from at least an image of the barcode imaged (S51). For example, the barcode position extraction unit 11 may have the configuration shown in the first embodiment, or may have a conventional barcode position extraction processing function.

スキャンデータ取得部12は、バーコード位置抽出部11によって抽出された位置に基づきバーコードを撮像画像から切り出し、切り出されたバーコード部分に対し、所定のY座標値でX方向にスキャンし、位置毎(画素毎)の濃度値(以下、スキャンデータと称す)を取得する(S52)。尚、本実施の形態では検出したバーコード位置のY座標の中心値をスキャン位置とする。   The scan data acquisition unit 12 cuts out a barcode from the captured image based on the position extracted by the barcode position extraction unit 11, scans the cut barcode part in the X direction with a predetermined Y coordinate value, A density value (hereinafter referred to as scan data) for each (pixel) is acquired (S52). In this embodiment, the center value of the Y coordinate of the detected barcode position is set as the scan position.

バー幅算出部13は、取得されたスキャンデータで、濃度値がピークとなる位置を特定する(S53)。尚、ピークとなる位置とは、例えば横軸をスキャンデータの配列(すなわち、位置のデータ)、縦軸を濃度値とした波形グラフ上で、立ち上がり(右上がり勾配)から立ち下がり(右下がり勾配)に変化する位置、または立ち下がりから立ち上がりに変化する位置(換言すると、波形グラフと接する接線の傾きが0またはその近傍になる位置)をいう。この際、立ち下り量や立ち上がり量が波形グラフの平均高さの一定割合の値以上でない場合、バー幅算出部13は、局所部分でのノイズとして無視する。   The bar width calculation unit 13 specifies the position where the density value reaches a peak in the acquired scan data (S53). The peak position is, for example, on the waveform graph with the horizontal axis representing the scan data array (ie, position data) and the vertical axis representing the density value, from the rising edge (upward slope) to the falling edge (lower slope). ) Or a position that changes from a falling edge to a rising edge (in other words, a position where the slope of the tangent line that contacts the waveform graph is 0 or in the vicinity thereof). At this time, if the falling amount or the rising amount is not equal to or greater than a certain ratio of the average height of the waveform graph, the bar width calculation unit 13 ignores it as noise in the local portion.

またバー幅算出部13は、上述のように特定したピーク位置の前後の一定画素を局所領域とし、局所領域の濃度値の平均値(以下、局所平均濃度値)を算出する(S54)。尚、実施の形態1の2値化処理(S5)で使用したクラス間分散を用いてもよく、クラス間分散によって求められた値を局所平均濃度値としてもよい。または、前後のピーク濃度値の平均としてもよい。   In addition, the bar width calculation unit 13 sets a constant pixel before and after the peak position specified as described above as a local region, and calculates an average value of density values in the local region (hereinafter, local average density value) (S54). Note that the interclass variance used in the binarization process (S5) of the first embodiment may be used, and the value obtained by the interclass variance may be used as the local average density value. Or it is good also as an average of the peak density value before and behind.

さらにバー幅算出部13は、横軸(X軸)を位置のデータ、縦軸(Y軸)を濃度値とした上述局所領域に対する波形グラフと、算出した局所平均濃度値とが交差する点のX座標値を小数点レベルまで求め、波形グラフの立ち上がり部と局所平均濃度値とが交差する点のX座標値と、波形グラフの立ち下がり部と局所平均濃度値とが交差する点のX座標値との差を小数点レベルで計算し、算出された差をバーの幅、またはバー間のスペース幅とする(S55)。   Further, the bar width calculation unit 13 calculates a point at which the waveform graph for the above-described local region having the horizontal axis (X axis) as position data and the vertical axis (Y axis) as the density value intersects with the calculated local average density value. The X coordinate value is obtained up to the decimal point level, the X coordinate value at the point where the rising portion of the waveform graph intersects with the local average density value, and the X coordinate value at the point where the falling portion of the waveform graph intersects with the local average density value Is calculated at the decimal point level, and the calculated difference is set as a bar width or a space width between bars (S55).

バー判定部14は、算出されたバーの幅、スペース幅に基づき、当該バー(またはスペース)の示す値が1か0かを判定し、0と1とで成る配列を作成する。バー判定部14は、所定の閾値よりバー幅(またはスペース幅)が大きい場合は1とし、小さい場合は0とする(後述のバーコードの仕様も参照)。   Based on the calculated bar width and space width, the bar determination unit 14 determines whether the value indicated by the bar (or space) is 1 or 0, and creates an array of 0 and 1. The bar determination unit 14 sets 1 when the bar width (or space width) is larger than a predetermined threshold, and sets 0 when it is smaller (see also the barcode specification described later).

尚、バー判定部14は、上述実施の形態1の2値化処理(S5)のクラス間分散を用いて閾値を算出してもよい。図14に、縦軸をバーおよびバー間のスペースの個数、横軸にバー幅またはスペース幅(画素数)としたグラフを示す。バー判定部14は、波形を2つのクラスに区切ったときに、双方の波形間の分散が最大になるような値を幅判定の閾値とし、幅が閾値より大きければ1と判断し、小さければ0と判断する。   Note that the bar determination unit 14 may calculate the threshold using the interclass variance of the binarization process (S5) of the first embodiment. FIG. 14 is a graph in which the vertical axis indicates the number of bars and spaces between bars, and the horizontal axis indicates the bar width or space width (number of pixels). The bar determination unit 14 sets a value that maximizes the variance between the two waveforms when the waveform is divided into two classes as a threshold for the width determination. If the width is larger than the threshold, the bar determination unit 14 determines 1. Judge as 0.

コード抽出部15は、バー判定部14によって作成された0と1との配列から対応する文字を抽出する(S57)。図15に、コードと文字との対応を示す。図15(A)は、7ビットコードと文字との対応を示し、図15(B)に、バーコードと文字との対応を示す。   The code extraction unit 15 extracts a corresponding character from the array of 0 and 1 created by the bar determination unit 14 (S57). FIG. 15 shows the correspondence between codes and characters. FIG. 15A shows the correspondence between 7-bit codes and characters, and FIG. 15B shows the correspondence between barcodes and characters.

コード抽出部15は、NW−7で未登録の文字(すなわち上述のNW−7の仕様に準拠していない文字)があるかを判定する(S58)。ここで、未登録の文字がない、すなわち有効なコードである場合(S58、No)、次にコード抽出部15は、開始、終了文字が正しいかを判定する(S59)。開始、終了文字が正しい場合(S59、Yes)、デコードした文字列をユーザに表示し(S60)、処理は終了する。   The code extraction unit 15 determines whether there is an unregistered character in NW-7 (that is, a character that does not comply with the above-described NW-7 specification) (S58). Here, when there is no unregistered character, that is, it is a valid code (S58, No), the code extraction unit 15 next determines whether the start and end characters are correct (S59). If the start and end characters are correct (S59, Yes), the decoded character string is displayed to the user (S60), and the process ends.

一方、未登録の文字がある場合(S58、Yes)、または開始、終了文字が正しくない場合(S59、No)、読み込まれたバーコードのデータは不正であるため、バーコード位置抽出処理の画像入力処理を再度実施する(S61)。すなわち、S51から再度処理が行われる。   On the other hand, if there is an unregistered character (S58, Yes), or if the start and end characters are incorrect (S59, No), the read barcode data is invalid, so the barcode position extraction processing image The input process is performed again (S61). That is, the process is performed again from S51.

尚、動画画像の所定のフレームと次フレームとの前後の画像で、バーコードをデコードした結果を比較し、例えば3回の結果のうち2回以上が同じならその結果を正規のものとしてもよい。   It should be noted that the result of decoding the barcode is compared between the image before and after the predetermined frame and the next frame of the moving image. For example, if two or more of the three results are the same, the result may be normal. .

上述では、バーコードの位置が抽出され、それ以降についての動作を主に説明したが、以下、バーコード位置抽出処理を用いない場合について示す。   In the above description, the barcode position is extracted and the operation after that is mainly described. However, hereinafter, the case where the barcode position extraction process is not used will be described.

原画像全体に対し、スキャンデータ取得部12は、Y座標値の間隔を大きくとり、X軸方向に数本スキャンする。例えばスキャンデータ取得部12は、Y座標最大値の1/4、1/2、3/4のY座標値でスキャンする。バー幅算出部13、バー判定部14、コード抽出部15は、スキャンデータそれぞれに対し上述S57までの処理を実施する。   For the entire original image, the scan data acquiring unit 12 scans several lines in the X-axis direction with a large interval between Y coordinate values. For example, the scan data acquisition unit 12 scans with Y coordinate values of 1/4, 1/2, and 3/4 of the Y coordinate maximum value. The bar width calculation unit 13, the bar determination unit 14, and the code extraction unit 15 perform the processes up to S57 described above for each scan data.

バーコード読取装置200は、コード抽出部15によって抽出されたスキャンデータのうちで、例えば開始コードと終了コードがあり、その間の文字数が12文字である等、上述NW−7の仕様に沿うデータが含まれているスキャンデータにバーコードが含まれているものと判断する。さらに、スキャンデータ取得部12は、そのバーコードが含まれているスキャンデータをスキャンしたY座標値前後付近を複数箇所(例えば3箇所)スキャンし、バー幅算出部13、バー判定部14、コード抽出部15は、さらに、スキャンデータそれぞれに対し上述S57までの処理を実施する。この結果、複数回(例えば2回)以上同じコードが抽出された場合、それを正規のコードとする。   The barcode reading apparatus 200 includes data that conforms to the above-described NW-7 specifications, such as a start code and an end code among the scan data extracted by the code extraction unit 15, and the number of characters between them is 12 characters. It is determined that the barcode is included in the included scan data. Further, the scan data acquisition unit 12 scans a plurality of locations (for example, three locations) around the Y coordinate value obtained by scanning the scan data including the barcode, and the bar width calculation unit 13, the bar determination unit 14, the code The extraction unit 15 further performs the processing up to S57 described above for each scan data. As a result, if the same code is extracted a plurality of times (for example, twice) or more, it is regarded as a normal code.

この場合、スキャンデータの濃度断面の波形上、X方向端部から一定割合の位置で濃度値が落ち込んだ部分(暗領域)がバーコード端と判断されてもよい。尚、バーコード端と判断された位置(画素)から一定画素以上次の山(明領域)が離れていたら、その次の濃度値が落ち込んだ部分がバーコード端とする。この処理が真のバーコード端が見つかるまで繰り返される。また仕様上、バーコードが始まる部分の前は白い部分が一定画素以上続くので、一定画素以上明領域が続いた後の落ち込んだ部分をバーコード端とする条件を付け加えた方がより正確性が増す。   In this case, on the waveform of the density cross section of the scan data, a portion (dark region) where the density value falls at a certain rate from the end in the X direction may be determined as the end of the barcode. If the next peak (bright area) is more than a certain pixel away from the position (pixel) determined to be the barcode end, the portion where the next density value falls is the barcode end. This process is repeated until a true bar code edge is found. In addition, because of the specification, the white part continues for a certain number of pixels before the part where the barcode begins, so it is more accurate to add the condition that the bar code end is the depressed part after the bright area continues for a certain number of pixels. Increase.

また、スキャンデータ取得部12は、1フレーム画像に対し、バーコード位置内でY座標を数画素ずらして複数回スキャンし、デコードされた結果所定回以上が同じデコード結果の場合、その結果を正規のコードとしてもよい。例えば3回スキャンした場合、デコードされた結果3回のうち2回以上が同じコードならその結果を正規のものとする。   Further, the scan data acquisition unit 12 scans one frame image a plurality of times while shifting the Y coordinate by several pixels within the barcode position. If the result of decoding is the same decoding result more than a predetermined number of times, the result is normalized. The code may be For example, when scanning is performed three times, if two or more of the three decoded results are the same code, the result is assumed to be normal.

また、撮像部1が携帯端末機である場合、ユーザの携帯端末機の持ち方によってバーコードの配列が反転する場合がある。上述の実施の形態で示したバーコード読取装置は、左から右、右から左、水平と垂直方向でもバーコードの読み取りが可能である。例えば左右が反転している場合、バーコード読取装置は、スキャンされたデータ配列の位置を反転する。   When the imaging unit 1 is a mobile terminal, the barcode arrangement may be reversed depending on how the user holds the mobile terminal. The bar code reader shown in the above embodiment can read bar codes in the left-to-right, right-to-left, horizontal and vertical directions. For example, when the left and right are reversed, the barcode reader reverses the position of the scanned data array.

上述の実施の形態で示したバーコード読取装置は、少なくともCPU(Central Processing Unit)、揮発性記憶装置である主記憶装置、不揮発性記憶装置をハードウェア資源として有する1台のコンピュータであってもよいし、また実施の形態1の撮像部1は携帯端末機、その他の機能ブロックはコンピュータとした構成で提供されてもよい。また、全ての機能ブロックを1台の携帯端末機(CPU、記憶装置等のハードウェアを少なくとも有する機器)に集約した状態で提供されてもよい。   The bar code reader shown in the above-described embodiment may be a single computer having at least a CPU (Central Processing Unit), a main storage device that is a volatile storage device, and a nonvolatile storage device as hardware resources. Alternatively, the imaging unit 1 of the first embodiment may be provided as a mobile terminal, and the other functional blocks may be provided as a computer. Further, all the functional blocks may be provided in a state where they are integrated into one mobile terminal (a device having at least hardware such as a CPU and a storage device).

上述の各機能ブロックは、不揮発性記憶装置に予め導入されたソフトウェアが、CPU、主記憶装置等のハードウェア資源と協働することで実現される。   Each functional block described above is realized by software previously installed in a nonvolatile storage device cooperating with hardware resources such as a CPU and a main storage device.

上述の実施の形態において、バーコード読取プログラムは上述したバーコード読取装置の内部に予めインストールされているものとして記載したが、本発明におけるバーコード読取プログラムは記憶媒体に記憶されたものも含まれる。ここで記憶媒体とは、磁気テープ、磁気ディスク(フロッピー(登録商標)ディスク、ハードディスクドライブ等)、光ディスク(CD−ROM、DVDディスク等)、光磁気ディスク(MO等)、フラッシュメモリ等、バーコード読取装置に対し脱着可能な媒体や、さらにネットワークを介することで伝送可能な媒体等、上述したバーコード読取装置におけるコンピュータで読み取りや実行が可能な全ての媒体をいう。   In the above-described embodiment, the barcode reading program is described as being installed in advance in the above-described barcode reading apparatus. However, the barcode reading program according to the present invention includes that stored in a storage medium. . Here, the storage medium is a magnetic tape, a magnetic disk (floppy (registered trademark) disk, hard disk drive, etc.), an optical disk (CD-ROM, DVD disk, etc.), a magneto-optical disk (MO, etc.), a flash memory, etc. It refers to all media that can be read and executed by a computer in the barcode reader described above, such as media that can be attached to and detached from the reader, and media that can be transmitted via a network.

実施の形態1に係る、バーコード読取装置の機能ブロックの一例を示す図である。3 is a diagram illustrating an example of functional blocks of the barcode reading apparatus according to Embodiment 1. FIG. 実施の形態1に係る、バーコード読取装置の動作を示すフローチャートである。3 is a flowchart showing the operation of the barcode reading apparatus according to the first embodiment. 実施の形態1に係る、撮像部によって得られた原画像のバーコード部を示す図である。4 is a diagram illustrating a barcode portion of an original image obtained by an imaging portion according to Embodiment 1. FIG. 実施の形態1に係る、シェーディング補正までを施した画像を示す図である。6 is a diagram illustrating an image that has been subjected to shading correction according to Embodiment 1. FIG. 実施の形態1に係る、X方向微分処理を施した画像を示す図である。6 is a diagram illustrating an image subjected to X-direction differentiation processing according to Embodiment 1. FIG. 実施の形態1に係る、明暗領域識別部の処理を説明するための図である。6 is a diagram for explaining processing of a light / dark region identifying unit according to Embodiment 1. FIG. 実施の形態1に係る、明暗領域識別部の処理を説明するための図である(クラス間分散)。It is a figure for demonstrating the process of the light and dark area | region identification part based on Embodiment 1 (interclass dispersion | distribution). 実施の形態1に係る、2値化処理を施した画像を示す図である。6 is a diagram illustrating an image subjected to binarization processing according to Embodiment 1. FIG. 実施の形態1に係る、白色領域を膨張させた画像を示す図である。6 is a diagram illustrating an image in which a white region is expanded according to Embodiment 1. FIG. 実施の形態1に係る、縮退処理を行った後の画像を示す図である。FIG. 6 is a diagram showing an image after performing a reduction process according to the first embodiment. 実施の形態1に係る、白色領域を元のサイズに戻した画像を示す図である。It is a figure which shows the image which returned the white area | region to the original size based on Embodiment 1. FIG. 実施の形態2に係る、バーコード読取装置の機能ブロックの一例を示す図である。6 is a diagram illustrating an example of functional blocks of a barcode reading apparatus according to Embodiment 2. FIG. 実施の形態2に係る、バーコード読取装置の動作を示すフローチャートである。6 is a flowchart showing the operation of the barcode reading apparatus according to the second embodiment. 実施の形態2に係る、縦軸をバーおよびバー間のスペースの個数、横軸にバー幅またはスペース幅(画素数)としたグラフを示す図である。It is a figure which shows the graph which made the vertical axis | shaft the number of the bars and the space between bars, and made the horizontal axis | shaft bar width or space width (number of pixels) based on Embodiment 2. FIG. 実施の形態2に係る、コード体系の仕様を示す図である。FIG. 10 is a diagram illustrating a specification of a code system according to the second embodiment.

符号の説明Explanation of symbols

1 撮像部、2 明暗領域識別部、3 膨張縮退部、4 位置抽出部、5 バーコード解読部、11 バーコード位置抽出部、12 スキャンデータ取得部、バー幅算出部、14 バー判定部、15 コード抽出部、100、200 バーコード読取装置。   DESCRIPTION OF SYMBOLS 1 Image pick-up part, 2 Light / dark area identification part, 3 Expansion / reduction part, 4 Position extraction part, 5 Bar code decoding part, 11 Bar code position extraction part, 12 Scan data acquisition part, Bar width calculation part, 14 Bar determination part, 15 Code extraction unit, 100, 200 Bar code reader.

Claims (4)

バーコードが撮像された画像から、バーコード配列方向の濃度値の配列である濃度配列データを取得する濃度配列データ取得部と、
前記濃度配列データ取得部によって取得された濃度配列データから、濃度値がピーク値となる位置をそれぞれ取得し、前記ピーク値となる位置を中心とした、前記濃度配列データ内の所定範囲の濃度平均値を前記ピーク値となる位置ごとに算出し、該平均濃度値に基づき前記バーコードのバーの幅およびバー間のスペースの幅を算出するバー幅算出部と、
前記バー幅算出部によって算出されたバーの幅およびバー間のスペースの幅に基づき前記バーコードをビット配列に変換するビット配列変換部と、
前記ビット配列変換部によって変換されたビット配列に対応する文字を抽出するコード抽出部と、
を備えるバーコード読取装置。
A density array data acquisition unit that acquires density array data that is an array of density values in the barcode array direction from an image in which the barcode is captured;
From the density array data acquired by the density array data acquisition unit, each position where the density value becomes a peak value is acquired, and the density average of a predetermined range in the density array data centered on the position where the peak value becomes A bar width calculation unit that calculates a value for each position that becomes the peak value, and calculates the width of the bar of the barcode and the width of the space between the bars based on the average density value;
A bit array conversion unit that converts the barcode into a bit array based on the width of the bar calculated by the bar width calculation unit and the width of the space between the bars;
A code extraction unit for extracting a character corresponding to the bit arrangement converted by the bit arrangement conversion unit;
A barcode reader.
請求項1に記載のバーコード読取装置において、さらに、
少なくともバーコードを含む領域が撮像された画像から、前記バーコードの位置を検出する位置検出部を備え、
前記濃度配列データ取得部は、さらに、前記位置検出部によって検出されたバーコードの位置に基づき、前記バーコードが撮像された画像からバーコード領域を切り出し、切り出したバーコード領域に対し、バーコード配列方向の濃度値の配列である濃度配列データを取得することを特徴とするバーコード読取装置。
The barcode reader according to claim 1, further comprising:
A position detection unit that detects a position of the barcode from an image in which an area including at least the barcode is captured;
The density array data acquisition unit further cuts out a barcode area from an image obtained by capturing the barcode based on the barcode position detected by the position detection unit, and applies a barcode to the cut barcode area. A bar code reading apparatus which acquires density array data which is an array of density values in an array direction.
バーコードが撮像された画像から、バーコード配列方向の濃度値の配列である濃度配列データを取得する濃度配列データ取得ステップと、
前記濃度配列データ取得ステップによって取得された濃度配列データから、濃度値がピーク値となる位置をそれぞれ取得し、前記ピーク値となる位置を中心とした、前記濃度配列データ内の所定範囲の濃度平均値を前記ピーク値となる位置ごとに算出し、該平均濃度値に基づき前記バーコードのバーの幅およびバー間のスペースの幅を算出するバー幅算出ステップと、
前記バー幅算出ステップによって算出されたバーの幅およびバー間のスペースの幅に基づき前記バーコードをビット配列に変換するビット配列変換ステップと、
前記ビット配列変換ステップによって変換されたビット配列に対応する文字を抽出するコード抽出ステップと、
をコンピュータに実行させるバーコード読取プログラム。
A density array data acquisition step for acquiring density array data that is an array of density values in the barcode array direction from an image in which the barcode is captured;
From the density array data acquired by the density array data acquisition step, each position where the density value becomes a peak value is acquired, and the density average of a predetermined range in the density array data centered on the position where the peak value becomes A bar width calculating step for calculating a value for each position to be the peak value, and calculating a bar width of the barcode and a width of a space between the bars based on the average density value;
A bit array conversion step for converting the barcode into a bit array based on the width of the bar calculated by the bar width calculation step and the width of the space between the bars;
A code extraction step of extracting a character corresponding to the bit array converted by the bit array conversion step;
Barcode reading program that causes a computer to execute.
バーコードが撮像された画像から、バーコード配列方向の濃度値の配列である濃度配列データを取得する濃度配列データ取得ステップと、
前記濃度配列データ取得ステップによって取得された濃度配列データから、濃度値がピーク値となる位置をそれぞれ取得し、前記ピーク値となる位置を中心とした、前記濃度配列データ内の所定範囲の濃度平均値を前記ピーク値となる位置ごとに算出し、該平均濃度値に基づき前記バーコードのバーの幅およびバー間のスペースの幅を算出するバー幅算出ステップと、
前記バー幅算出ステップによって算出されたバーの幅およびバー間のスペースの幅に基づき前記バーコードをビット配列に変換するビット配列変換ステップと、
前記ビット配列変換ステップによって変換されたビット配列に対応する文字を抽出するコード抽出ステップと、
を実行するバーコード読取方法。
A density array data acquisition step for acquiring density array data that is an array of density values in the barcode array direction from an image in which the barcode is captured;
From the density array data acquired by the density array data acquisition step, each position where the density value becomes a peak value is acquired, and the density average of a predetermined range in the density array data centered on the position where the peak value becomes A bar width calculating step for calculating a value for each position to be the peak value, and calculating a bar width of the barcode and a width of a space between the bars based on the average density value;
A bit array conversion step of converting the barcode into a bit array based on the width of the bar calculated by the bar width calculation step and the width of the space between the bars;
A code extraction step of extracting a character corresponding to the bit array converted by the bit array conversion step;
Bar code reading method to execute.
JP2008316836A 2008-12-12 2008-12-12 Bar code reading apparatus, bar code reading program, and bar code reading method Expired - Fee Related JP5121685B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008316836A JP5121685B2 (en) 2008-12-12 2008-12-12 Bar code reading apparatus, bar code reading program, and bar code reading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008316836A JP5121685B2 (en) 2008-12-12 2008-12-12 Bar code reading apparatus, bar code reading program, and bar code reading method

Publications (2)

Publication Number Publication Date
JP2010140310A true JP2010140310A (en) 2010-06-24
JP5121685B2 JP5121685B2 (en) 2013-01-16

Family

ID=42350396

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008316836A Expired - Fee Related JP5121685B2 (en) 2008-12-12 2008-12-12 Bar code reading apparatus, bar code reading program, and bar code reading method

Country Status (1)

Country Link
JP (1) JP5121685B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111046690A (en) * 2018-10-15 2020-04-21 富士通株式会社 Code information reading apparatus, method and computer-readable storage medium
JP2020064373A (en) * 2018-10-15 2020-04-23 富士通株式会社 Code information reader, method, and program
JP2022524675A (en) * 2019-03-18 2022-05-10 アドバンスド ニュー テクノロジーズ カンパニー リミテッド Elongated 2D barcodes, methods, devices, and devices for generating and identifying elongated 2D barcodes

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102576212B1 (en) 2018-09-21 2023-09-07 삼성전자주식회사 Semiconductor devices

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63196990A (en) * 1987-02-10 1988-08-15 Omron Tateisi Electronics Co Bar-code reader
JPH02141886A (en) * 1988-11-24 1990-05-31 Eastman Kodatsuku Japan Kk Binarizing device for bar-code reader
JPH05199414A (en) * 1992-09-11 1993-08-06 Ricoh Co Ltd Picture signal binarizing device
JPH0896059A (en) * 1994-09-28 1996-04-12 Toshiba Corp Bar code reader
JPH08147402A (en) * 1994-11-25 1996-06-07 Nippondenso Co Ltd Signal processor of optical information reader
JPH09153110A (en) * 1995-11-30 1997-06-10 Toshiba Corp Bar code reader
JPH1019731A (en) * 1996-06-28 1998-01-23 Matsushita Electric Ind Co Ltd Method for inspecting display screen
JP2005266907A (en) * 2004-03-16 2005-09-29 Toshiba Social Automation Systems Co Ltd Bar code detection cutout method, device therefor and computer-readable recording medium storing program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63196990A (en) * 1987-02-10 1988-08-15 Omron Tateisi Electronics Co Bar-code reader
JPH02141886A (en) * 1988-11-24 1990-05-31 Eastman Kodatsuku Japan Kk Binarizing device for bar-code reader
JPH05199414A (en) * 1992-09-11 1993-08-06 Ricoh Co Ltd Picture signal binarizing device
JPH0896059A (en) * 1994-09-28 1996-04-12 Toshiba Corp Bar code reader
JPH08147402A (en) * 1994-11-25 1996-06-07 Nippondenso Co Ltd Signal processor of optical information reader
JPH09153110A (en) * 1995-11-30 1997-06-10 Toshiba Corp Bar code reader
JPH1019731A (en) * 1996-06-28 1998-01-23 Matsushita Electric Ind Co Ltd Method for inspecting display screen
JP2005266907A (en) * 2004-03-16 2005-09-29 Toshiba Social Automation Systems Co Ltd Bar code detection cutout method, device therefor and computer-readable recording medium storing program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111046690A (en) * 2018-10-15 2020-04-21 富士通株式会社 Code information reading apparatus, method and computer-readable storage medium
JP2020064373A (en) * 2018-10-15 2020-04-23 富士通株式会社 Code information reader, method, and program
JP2020064374A (en) * 2018-10-15 2020-04-23 富士通株式会社 Code information reader, method, and program
JP2022524675A (en) * 2019-03-18 2022-05-10 アドバンスド ニュー テクノロジーズ カンパニー リミテッド Elongated 2D barcodes, methods, devices, and devices for generating and identifying elongated 2D barcodes
US11699053B2 (en) 2019-03-18 2023-07-11 Advanced New Technologies Co., Ltd. Narrow-strip 2-dimensional bar codes, methods, apparatuses, and devices for generating and identifying narrow-strip 2-dimensional bar codes

Also Published As

Publication number Publication date
JP5121685B2 (en) 2013-01-16

Similar Documents

Publication Publication Date Title
JP4180497B2 (en) Code type discrimination method and code boundary detection method
JP4911340B2 (en) Two-dimensional code detection system and two-dimensional code detection program
US8254683B2 (en) Code image processing method
Chen et al. PiCode: A new picture-embedding 2D barcode
US20070272755A1 (en) Two-directional bar code symbol and its encoding &amp; decoding method
JP4658848B2 (en) Character string recognition method and character string recognition apparatus
JP2001357345A (en) Method for positioning and reading two-dimensional bar code
JP6075190B2 (en) Image processing method and apparatus
EP0999519A1 (en) Distortion correction method in optical code reading
WO2013044875A1 (en) Linear barcode identification method and system
US8538191B2 (en) Image correction apparatus and method for eliminating lighting component
JP5121685B2 (en) Bar code reading apparatus, bar code reading program, and bar code reading method
JP4945739B2 (en) Character string recognition method and character string recognition apparatus
JPWO2017141802A1 (en) Image processing apparatus, character recognition apparatus, image processing method, and program recording medium
WO2010110385A1 (en) Optical information reading device and optical information reading method
JP2008011484A (en) Apparatus and method for extracting character and graphic string, program for executing the method, recording medium with the program stored therein
JP5127687B2 (en) Bar code reading apparatus, bar code reading program, and bar code reading method
US8200016B2 (en) Method and apparatus for character string recognition
JP4398498B2 (en) Code boundary detection method
JP4454297B2 (en) Binarization processing apparatus and binarization processing method
JP5470734B2 (en) Image processing apparatus and image processing program
JP5125961B2 (en) Binarization processing apparatus, information processing apparatus, binarization processing method, and binarization processing program
JP2019021085A (en) Image processing program, image processing method, and image processing device
JP5453594B2 (en) Symbol information reading apparatus and symbol information reading method
JP4892362B2 (en) Character recognition program, character recognition device, and character recognition method

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20100412

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100517

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100524

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110221

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120719

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120724

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120906

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: 20120925

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: 20121023

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

Free format text: PAYMENT UNTIL: 20151102

Year of fee payment: 3

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees