JP4978460B2 - Bar code recognition apparatus and program - Google Patents
Bar code recognition apparatus and program Download PDFInfo
- Publication number
- JP4978460B2 JP4978460B2 JP2007333278A JP2007333278A JP4978460B2 JP 4978460 B2 JP4978460 B2 JP 4978460B2 JP 2007333278 A JP2007333278 A JP 2007333278A JP 2007333278 A JP2007333278 A JP 2007333278A JP 4978460 B2 JP4978460 B2 JP 4978460B2
- Authority
- JP
- Japan
- Prior art keywords
- barcode
- noise
- image
- contour position
- bar
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
本発明は、バーコード認識装置及びプログラムに関し、特に、バーコードの認識精度向上に関する。 The present invention relates to a barcode recognition apparatus and program, and more particularly, to improvement of barcode recognition accuracy.
文書を電子化する場合に、電子化する文書と電子化された文書のデータとを関連付けるために、バーコードが使用されることが多くなっている。関連付けに用いられるバーコードを含む電子データは、例えば写真モード等の方式によって画像読取装置の読取処理がなされると、ディザや誤差拡散等の処理が施される場合がある。また、文書の電子化において画像サイズを小さくするために、バーコードの読取処理が低解像度でなされる場合もある。これらの場合に、画像として読み取られたバーコードのバーの輪郭の両面に凹凸が発生することがある。 When a document is digitized, a barcode is often used to associate the document to be digitized with the data of the digitized document. Electronic data including a barcode used for association may be subjected to processing such as dithering or error diffusion when the image reading device is read by a method such as a photo mode. Further, in order to reduce the image size in digitizing a document, the barcode reading process may be performed at a low resolution. In these cases, irregularities may occur on both sides of the bar outline of the barcode read as an image.
ここで、例えば図7(a)は、上記のようにして輪郭に凹凸が生じたバーコードを示している。このバーコードに対して、バーの凹凸を復元する処理を施すと、図7(b)のようにバーが太くなることや、図7(c)のようにバーが細くなることがある。なお、特許文献1では、バーの周辺に現れる凹凸を除去するフィルタをかける等の処理により、ノイズの入ったバーコードを復号する技術が提案されている。
このように、上記の写真モード等の方式によって、ディザや誤差拡散等の処理が施されて多くのノイズがバーコードを含む画像に発生する場合や、バーコードを含む画像データの解像度が低い場合には、画像データに含まれるバーコード上のノイズを除去することで認識率が低下するという課題がある。 As described above, when processing such as dithering and error diffusion is performed by the above-described method such as the photo mode and a lot of noise is generated in an image including a barcode, or when the resolution of image data including the barcode is low However, there is a problem that the recognition rate is reduced by removing noise on the barcode included in the image data.
本発明は、上記課題に鑑みてなされたものであって、その目的は、画像データで表されたバーコードの認識率を向上させたバーコードの認識装置及びプログラムを提供することにある。 The present invention has been made in view of the above problems, and an object of the present invention is to provide a barcode recognition apparatus and program that improve the recognition rate of barcodes represented by image data.
請求項1の発明は、バーコードが表された画像からノイズを除去するノイズ除去手段と、前記ノイズ除去手段によりノイズが除去された前記画像に表された前記バーコードをデコードするデコード手段と、を含み、前記ノイズ除去手段は、前記バーコードにおける各バーの輪郭位置を判定する輪郭位置判定手段と、前記輪郭位置判定手段によって判定された前記輪郭位置におけるノイズの除去を制限するノイズ除去制限手段と、を含み、前記デコード手段は、前記バーコードにおける複数の読取線から読み取られるバー及びスペースの配置に基づいてデコードする、ことを特徴とするバーコード認識装置である。
The invention of
請求項2の発明は、請求項1記載のバーコード認識装置において、前記バーコードは、前記画像の一部の領域に表され、前記バーコード認識装置は、前記画像の一部の領域に表されたバーコードを抽出するバーコード抽出手段をさらに含むことを特徴とする。 According to a second aspect of the present invention, in the barcode recognition apparatus according to the first aspect, the barcode is represented in a partial area of the image, and the barcode recognition apparatus is represented in a partial area of the image. It further comprises bar code extracting means for extracting the bar code that has been read.
請求項3の発明は、請求項1又は2に記載のバーコード認識装置において、前記輪郭位置判定手段は、前記バーコードの各部分が所定のパターンの画像に該当するか否かに基づいて前記バーコードにおける前記各バーの輪郭位置を判定する、ことを特徴とする。 According to a third aspect of the present invention, in the barcode recognition apparatus according to the first or second aspect, the contour position determination unit is configured to determine whether each portion of the barcode corresponds to an image of a predetermined pattern. The contour position of each bar in the bar code is determined.
請求項4の発明は、請求項1又は2に記載のバーコード認識装置において、前記輪郭位置判定手段は、前記画像において、前記バーコードのバーを表す色情報が付与された画素が互いに隣接することにより形成される複数の画素群のうち、該画素群に含まれる画素数が所定の画素数以上となる画素群に従って、前記各バーの輪郭位置を判定する、ことを特徴とする。 According to a fourth aspect of the present invention, in the barcode recognition apparatus according to the first or second aspect, the contour position determination unit includes pixels in the image to which color information representing the bar of the barcode is attached. The contour position of each bar is determined according to a pixel group in which the number of pixels included in the pixel group is greater than or equal to a predetermined number of pixels among the plurality of pixel groups formed by the above.
請求項5の発明は、請求項1又は2に記載のバーコード認識装置において、前記輪郭位置判定手段は、前記バーコードの長さ方向の各バーにおけるエッジと、その他の方向の各バーにおけるエッジとを検出するとともに、前記画像の各部分において、それら2方向の各エッジを比較することにより、前記各バーの輪郭位置を判定する、ことを特徴とする。 According to a fifth aspect of the present invention, in the barcode recognition apparatus according to the first or second aspect, the contour position determination means includes an edge in each bar in the longitudinal direction of the barcode and an edge in each bar in the other direction. And the contour position of each bar is determined by comparing each edge in the two directions in each part of the image.
請求項6の発明は、請求項3又は5に記載のバーコード認識装置において、前記ノイズ除去手段は、前記輪郭位置判定手段が各部分を判定する毎に、その判定結果に応じてノイズを除去する、ことを特徴とする。 According to a sixth aspect of the present invention, in the barcode recognition apparatus according to the third or fifth aspect, the noise removing unit removes noise according to the determination result each time the contour position determining unit determines each part. It is characterized by.
請求項7の発明は、請求項4に記載のバーコード認識装置において、前記ノイズ除去手段は、前記画素群に含まれる画素数が所定の画素数未満となる画素群に従って、ノイズを除去する、ことを特徴とする。 According to a seventh aspect of the present invention, in the barcode recognition apparatus according to the fourth aspect, the noise removing unit removes noise according to a pixel group in which the number of pixels included in the pixel group is less than a predetermined number of pixels. It is characterized by that.
請求項8の発明は、バーコードが表された画像からノイズを除去するノイズ除去手段、及び前記ノイズ除去手段によりノイズが除去された前記画像に表された前記バーコードをデコードするデコード手段としてコンピュータを機能させるプログラムであって、前記ノイズ除去手段は、前記バーコードにおける各バーの輪郭位置を判定する輪郭位置判定手段と、前記輪郭位置判定手段によって判定された前記輪郭位置におけるノイズの除去を制限するノイズ除去制限手段と、を含み、前記デコード手段は、前記バーコードにおける複数の読取線から読み取られるバー及びスペースの配置に基づいてデコードする、ことを特徴とする。 The invention of claim 8 is a computer as noise removing means for removing noise from an image representing a barcode, and decoding means for decoding the barcode represented in the image from which noise has been removed by the noise removing means. The noise removing means limits the outline position determining means for determining the outline position of each bar in the barcode and the removal of noise at the outline position determined by the outline position determining means. Noise elimination limiting means for performing decoding, wherein the decoding means performs decoding based on an arrangement of bars and spaces read from a plurality of reading lines in the barcode.
請求項1及び請求項8によれば、バーコードが表された画像におけるバーコードの各バーの輪郭位置のノイズ除去を制限するとともに、複数の読取線からバーコードのバー及びスペースの配置を読み取るので、バー及びスペースの本来の配列から生じた情報を有効に活用して、バーコードの認識率を向上させることができる。 According to the first and eighth aspects, the noise removal of the contour position of each bar of the barcode in the image representing the barcode is restricted, and the arrangement of the bar and space of the barcode is read from a plurality of reading lines. Therefore, it is possible to improve the barcode recognition rate by effectively using information generated from the original arrangement of bars and spaces.
請求項2の発明によれば、バーコードが画像の一部の領域に表されている場合に、バーコードが表された領域を抽出するので、バーコードを認識する速度を向上させることができる。
According to the invention of
請求項3の発明によれば、所定のパターンに該当するか否かを判定することにより、バーコードの各バーの輪郭位置を判定できる。
According to the invention of
請求項4の発明によれば、所定の画素数以上となる画素群であるか否かを判断して、バーコードの各バーを表す画素群を識別することにより、バーコードの各バーの輪郭位置を判定できる。
According to the invention of
請求項5の発明によれば、バーコードとバーコード以外のノイズによって生じるエッジに着目して、バーコードの各バーの輪郭位置を判定できる。 According to the invention of claim 5, it is possible to determine the contour position of each bar of the bar code by paying attention to the bar code and an edge caused by noise other than the bar code.
請求項6の発明によれば、バーコードが表されている画像の各部分においてバーコードの各バーの輪郭位置を判定しつつ、ノイズを除去することで、バーコードを認識する速度を向上させることができる。 According to the invention of claim 6, the speed of recognizing the barcode is improved by removing the noise while determining the contour position of each bar of the barcode in each part of the image on which the barcode is represented. be able to.
請求項7の発明によれば、バーコードの各バーの輪郭位置を判定しつつノイズを除去するので、バーコードを認識する速度を向上させることができる。 According to the invention of claim 7, since noise is removed while determining the contour position of each bar of the barcode, the speed of recognizing the barcode can be improved.
[第1の実施形態]
以下、本発明の一実施形態について図面に基づき説明する。
[First embodiment]
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
図1は、本発明の実施形態にかかるバーコード認識装置1におけるハードウェア構成と機能的構成を示すブロック図である。
FIG. 1 is a block diagram showing a hardware configuration and a functional configuration in a
バーコード認識装置1は、制御部2、記憶部3、バーコード画像取得部4を含んで構成される。本実施形態におけるバーコード認識装置1は、手持ち型、あるいは据え置き型のいずれのバーコードリーダであってもよいし、パーソナルコンピュータ等の情報処理装置に実装されてもよい。ここで、バーコードは、複数種類の幅を有したバー及びスペースの配列からなり、コンピュータが識別するためのコードである。
The
制御部2は、CPU(Central Processing Unit)等のプログラム制御デバイスである。制御部2は、ノイズ除去部21と、バーコード抽出部22と、デコード部23とを機能ブロックとして含んでおり、本発明の実施形態にかかるプログラムを実行することによって各機能が実現される。このプログラムは、例えばCD−ROMやDVD−ROM等のコンピュータ読取可能な各種の情報記憶媒体に格納されて提供されてもよいし、インターネット等の通信手段を介して提供されてもよい。
The
記憶部3は、RAM(Random Access Memory)、ROM(Read Only Memory)等のメモリ素子、ならびにハードディスク等によって構成される。この記憶部3は、制御部2が実行するプログラム(ソフトウェア)を格納している。また、この記憶部3は、制御部2の処理の過程で利用される種々のデータを保持するワークメモリとしても動作する。
The
バーコード画像取得部4は、イメージスキャナ等によって構成される。そして、このイメージスキャナは、例えば、紙媒体に光を照射するLED等の光源、及び、その反射光を取り込むCCD等の受光素子から構成される。特に、本実施形態におけるバーコード画像取得部4は、画像を含む文書を電子化する際には写真モードが選択されて、文書上に表されたバーコードが2値の画像データとして取得される。バーコード画像取得部4がバーコードを2値の画像データで取得する際には、ディザや誤差拡散等の処理が伴うことによりノイズが発生する。ここで、バーコード画像とは、バーコード認識装置1が認識する対象となるバーコードが、少なくとも一部の領域に表されている画像データのことである。バーコード画像取得部4は、バーコード画像を取得する。バーコード画像取得部4に取得されたバーコード画像は、デコード処理等の対象として制御部2に提供される。また、バーコード画像取得部4と制御部2とが別構成となって、ネットワークを通じてバーコード画像取得部4から取得された画像データが提供されることとしてもよい。
The barcode
つぎに、バーコード認識装置1の制御部2に含まれる、ノイズ除去部21と、バーコード抽出部22と、デコード部23とが実現する各機能について説明する。
Next, functions realized by the
ノイズ除去部21は、バーコード画像取得部4が取得したバーコード画像に発生しているノイズを除去する処理を行う。図2は、バーコード画像に含まれるバーコードの一部に発生しているノイズの一例を示す図である。これらのノイズは、バーコードが示すバー及びスペースの本来の配列以外を示す画素となる。このようなノイズには、バーコードを画像化する際に発生する場合、及び、バーコードの表された媒体上にすでに発生している場合がある。前者は、例えば、紙媒体等に表されたバーコードを2値の画像データとして取得する際に、ディザや誤差拡散等の処理に伴って発生する。また、ノイズを除去するとは、ノイズと判断された画素群を、ノイズの周囲に存在する画素に置換等により調整する処理である。このノイズ除去処理は、バーコード本来の配列を認識しやすくするために実行される。
The
そして、特に本実施形態では、ノイズ除去部21は更に輪郭位置判定部21Aとノイズ除去制限部21Bとを含んで構成される。
And especially in this embodiment, the
輪郭位置判定部21Aは、バーコード画像に含まれる各パターンの境界となる輪郭位置と共に、バーコードを構成するバー及びスペースの境界となる各バーの輪郭位置を判定する。この輪郭位置では、各パターンが有する色情報によって色差が発生している。バーコード画像におけるバーコードの各バーの輪郭位置は、バーコード画像全体に、いわゆるマスク処理のアルゴリズムを適用することによって判定できる。以下では、この処理について詳細に述べる。
The contour
輪郭位置判定部21Aは、バーコード画像におけるバーコードを構成する各部分が、例えば図3(a)〜(f)に示すような3×3のサイズの6種類の画像のいずれかに該当するか否かに基づいて、輪郭位置を判定する。図3は、中心の黒画素に対して上下・左右のうちの少なくとも2画素を黒画素として連結している3×3のパターンを示している。2値化されたバーコード画像であれば、バーコードの各バーが黒画素群で表現され、各バーの輪郭を構成する画素が上下・左右のうち少なくとも2箇所に互いに連結されることとなる。従って、輪郭位置判定部21Aは、バーコード画像における全ての黒画素について、上下・左右のうちの少なくとも2画素を黒画素として連結しているパターンの一部に該当するか否かを判定する。そして、輪郭位置判定部21Aは、当該パターンの一部であると判断される黒画素が白画素と隣接して、黒画素群の外延部を構成する境界を、バーコードの各バー及びその他のパターンの輪郭位置として判定する。
In the contour
なお、上記では輪郭位置判定部21Aが、いわゆるマスク処理を施すことによって輪郭位置を判断することとしているが、いわゆるラベリング処理を施すこととしてもよい。具体的には、輪郭位置判定部21Aは、バーコード画像におけるバーコードのバーを示す階調が付与されて、上下又は左右の少なくとも1方向に隣接する画素が連結することにより一群を構成する画素群が、所定の画素数以上で構成されているか否かに従って、バーコードの各バー及びその他のパターンの輪郭位置を判定する。2値化されたバーコード画像であれば、各バーが黒画素群で表現される。そこで、まず輪郭位置判定部21Aは、バーコード画像上に存在する全ての黒画素を、上下又は左右の少なくとも1方向に隣接する画素が連結することにより一群を構成している画素群に分類する。バーコードのバーを構成する黒画素数は、一般的に、ノイズを構成する黒画素数に比べて多い。従って、輪郭位置判定部21Aは、分類された各画素群が所定の画素数以上で構成されているか否かを判断することにより、バー及びその他のパターンを構成する黒画素群を特定する。さらに、輪郭位置判定部21Aは、所定の画素数以上を有しているとして特定された各黒画素群にいて、黒画素と白画素とが隣接する境界を判定する。そして、輪郭位置判定部21Aは、黒画素の外延に白画素が存在する境界を、バー及びその他のパターンの輪郭位置として判定する。
In the above description, the contour
なお、輪郭位置判定部21Aは、いわゆるエッジ検出処理を施すことにより輪郭位置を判断することとしてもよい。具体的には、輪郭位置判定部21Aは、バーコード画像におけるバーコードの各バーの長さ方向と、それ以外の方向とのエッジを検出する処理により、各バーの輪郭位置であるか否かを判定する。ここで、バーコードの長さ方向とは、バーコードにおける各バーが延伸する方向に垂直な方向(バーコードの長手方向)のことをいう。また、エッジとは、所定の方向に色差が存在する場所のことをいう。図4はバーコードが存在する画像におけるバーコードの長さ方向のエッジ(図4(a))と、バーコードの高さ方向(バーコードの短手方向)のエッジ(図4(b))とを検出する処理を施した様子を示す図である。さらに、図4(c)及び図4(d)は、図4(a)及び図4(b)で実行されたそれぞれバーコードの長さ方向と高さ方向のエッジを検出する処理を、バーコードが存在しない画像で適用した様子を示す図である。図4の各図では、それぞれの元画像に、バーコードの長さ方向または高さ方向のエッジを検出する処理を施すことにより、エッジの存在する場所は黒画素に、エッジの存在しない場所は白画素に変換されている。同図で示されるように、バーコードの各バーが存在する部分では、長さ方向のエッジと、高さ方向のエッジの存在する比率が明らかに異なるが、バーコードが存在しない部分では、長さ方向のエッジと、高さ方向のエッジとが存在する比率が同程度となる。そこで、例えば、バーコード画像を10×10の領域毎に仕切った各部分において、バーコードの長さ方向のエッジを検出することによって得られる黒画素の面積を長さ方向のエッジ量とし、高さ方向のエッジを検出することによって得られる白画素の面積を高さ方向のエッジ量として、輪郭位置判定部21Aが各部分毎にこれらを求めて比較する。そして、輪郭位置判定部21Aは、長さ方向のエッジ量が高さ方向のエッジ量よりも、所定の比率を超えて多い部分において、バーコードの長さ方向のエッジが存在する位置にしたがって、バーコードの各バー及びその他のパターンの輪郭位置を判定する。なお、バーコード画像を仕切る各部分の大きさは、少なくとも、バーコードの長さ方向のエッジの一部を認識するために必要なサイズである。
The contour
次に、ノイズ除去部21によるノイズ除去処理の際に、ノイズ除去制限部21Bは、輪郭位置判定部21Aで判定された各バー及びその他のパターンの輪郭位置に存在するノイズの少なくとも一部を残すことにより、ノイズ除去部21によるノイズ除去処理を制限する。ノイズ除去部21が、バーコード全体のノイズを除去しつつ、各バーの輪郭位置のノイズの除去を制限することにより、バーコードが示すバーの本来の幅をさらに認識しやすくすることができる。ここで、輪郭位置におけるノイズとは、各バーと各スペースの境界に接して存在するノイズのことであり、例えば、図7(a)等においてその一例が表示されている。また、ノイズの除去を制限するとは、例えば、バーコード画像全体に平滑化等のフィルタを一律にかけてノイズを除去する処理をノイズ除去部21が実行する場合には、輪郭位置判定部21Aで判定された輪郭位置に存在するノイズを、予め当該フィルタによるノイズ除去処理の対象とならないようにすることである。また、例えば、輪郭位置判定部21Aで判定された各バーの輪郭位置以外の部分に存在するノイズだけを除去する処理をノイズ除去部21が行うことによって、ノイズ除去制限部21Bが輪郭位置のノイズの除去を制限することとしてもよい。ノイズ除去制限部21Bによるノイズの除去の制限は、例えば輪郭位置判定部21Aが輪郭位置を判定するのに伴って、輪郭位置以外に存在するノイズが識別されて除去されるのであってもよい。また、輪郭位置に存在するノイズが除去されない方式のノイズ除去処理をノイズ除去部21が実行することによりノイズ除去を制限してもよい。或いは、輪郭位置に存在するノイズのうちの少なくとも一部の除去が制限される処理をノイズ除去部21が実行してもよい。なお、図5(a)は、ノイズ除去部21がバーコードを含む画像全体にかかっているノイズを除去する前の画像の一例を示している。図5(b)は、図5(a)の画像にノイズ除去部21が、バーコード等のパターンの輪郭位置に存在するノイズ除去を制限しつつ、画像全体にかかっているノイズを除去する処理を施した画像の一例を示している。
Next, at the time of noise removal processing by the
また、輪郭位置判定部21Aが上記のマスク処理に従って輪郭位置を判定する際には、輪郭位置判定部21Aが、バーコード画像の各部分を、図3に示すようなパターンの画像に該当するか否か判定する毎に、ノイズ除去部21が、その判定結果に応じて当該部分をノイズとして除去する。具体的には、輪郭位置判定部21Aは、バーコード画像における黒画素であって、上下・左右のうちの少なくとも2画素が黒画素と連結されているパターンの一部に該当しないと判定する場合に、ノイズ除去部21が当該黒画素をノイズであるとして除去する。なお、輪郭位置判定部21Aが上記のラベリング処理に従って輪郭位置を判定する場合であれば、輪郭位置判定部21Aが所定の画素数未満であると判断した画素群に従って、ノイズ除去部21が当該画素群をノイズとして除去する。ここで例えば、所定画素数を5とすれば、バーコード画像において5画素未満で構成される黒画素群が、ノイズとして除去される。また、所定の画素数を、バーコードの下部に記載されている文字列等よりも多く、バーを構成する黒画素群の黒画素数よりも少なく設定することにより、輪郭位置判定部21Aが各バーの輪郭位置を判定しつつ、ノイズ除去部21はこれら文字列等をノイズとして除去する。なお、輪郭位置判定部21Aが上記のエッジ検出処理に従って輪郭位置を判定する場合であれば、輪郭位置判定部21Aが、バーコード画像の各部分を、バーコードの長さ方向と高さ方向のエッジ量を比較して各バーの輪郭位置を判定する毎に、ノイズ除去部21が、その判定結果に応じて当該部分をノイズとして除去する。具体的には、ノイズ除去部21は、長さ方向のエッジ量が高さ方向のエッジ量に対して所定の比率を超えない部分に存在する黒画素をノイズとして除去したり、所定の比率を超える部分においてバーコードの各バーの輪郭位置として判定されなかった位置に存在するパターンをノイズとして除去する。これらのようにして、輪郭位置判定部21Aが輪郭位置を判定するとともに、ノイズ除去部21が輪郭位置のノイズを除去しないようにバーコード画像のノイズを除去することで、バーコード画像のノイズ除去処理が効率化されるとともに、ノイズが除去されたバーコード画像からバーコードを抽出しやすくなり、バーコードを認識する速度の向上につながる。
Further, when the contour
バーコード抽出部22は、ノイズ除去部21がノイズを除去したバーコード画像におけるバーコードが表された領域の画像から、バーコードを抽出する。バーコードが表された領域とは、バーコードの各バー及び各スペースを識別できる画像として切り出すことができる範囲のことをいい、バー及びスペースの全ての部分を切り出しつつバーコード以外のパターンをなるべく含まずに切り出すことができる範囲であることが望ましい。ここで、バーコード抽出部22がバーコードを抽出する処理は、バーコードが所定の方向に並んで配置されるバーの集合であるという特徴を持っていることから、パターンマッチング等の当業者に既知のアルゴリズムを用いて施すことが可能である。ノイズ除去後のバーコード画像ではディザパターン等が除去されているため、ノイズ除去前のバーコード画像からバーコードを抽出するよりも、バーコードがより高速に抽出される。
The
デコード部23は、バーコード画像から抽出されたバーコードに対して、バー及びスペースの配置を読み取るための読取線を設定し、複数の読取線から取得されるバー及びスペースの配置を示すラインデータにしたがって、バーコードをデコードする。この読取線は、少なくとも1画素の幅で、バーコードの開始位置からバーコードが終了する位置まで、バーコードの長さ方向に引かれる仮想的な線のことをいう。デコード部23は、バーコード画像の各読取線上に存在する画素の情報から、バー及びスペースの配置を示すラインデータを取得し、複数の読取線から取得されるラインデータに従ってバーコードをデコードする。特に本実施形態では、ノイズ除去制限部21Bの機能によりバーコードの各バーにおける輪郭位置に存在するノイズの除去が制限されている。これにより、デコード部23のデコード処理に用いられる複数の読取線には各バーの輪郭位置の凹凸が残されることとなる。輪郭位置の凹凸が残されたバーコードを複数の読取線に従ってデコードする場合には、凹凸の除去されたバーコードをデコードする場合よりも多様な複数のラインデータが取得されることにより、バーコード画像の情報を有効に活用して、本来のバーコードの配列に近いバー及びスペースの配置を認識することができ、認識率の向上につながる。
The
図6は、バーコード画像におけるバー及びその他のパターンの輪郭位置のノイズ除去を制限したノイズ除去処理のフローの一例を示す図である。まずS601では、図4に示すような3×3マスクを用いて、マスクに該当しない黒画素を白画素に調整することによってノイズを除去する。この処理により、例えば、バーコードのスペース上であってバーコードの輪郭位置にない黒画素によるノイズが除去される。次にS602では、S601でノイズが除去されたバーコード画像の白画素を黒画素に、黒画素を白画素に反転する。そして、S601と同様に3×3マスクを用いて、マスクに該当しない黒画素を白画素に調整することによってノイズを除去する(S603)。この処理により、例えば、バーコードのバー上であってバーコードの輪郭位置にないノイズを除去することとなる。そして、S604で再びバーコード画像の白画素を黒画素に、黒画素を白画素に反転して、バーの輪郭位置以外のノイズが除去されたバーコード画像を得る。S605では、いわゆるラベリング処理により、S604で得られた各黒画素群を分類して名称を与え、記憶部3にその名称と当該画素群を構成する画素とを記憶する。そしてS606では、S605で記憶された各画素群を構成する画素の情報に従って、所定の画素数以下の黒画素群を除去する処理を行う。このS606の処理により、バーコードの数字部分の記載や、S602で除去されずに残ったノイズがさらに除去されることとなる。
FIG. 6 is a diagram illustrating an example of a flow of noise removal processing that restricts noise removal of the contour positions of bars and other patterns in a barcode image. First, in step S601, noise is removed by adjusting a black pixel that does not correspond to the mask to a white pixel using a 3 × 3 mask as shown in FIG. By this processing, for example, noise due to black pixels that are on the barcode space and not at the contour position of the barcode is removed. Next, in S602, the white pixel of the barcode image from which noise has been removed in S601 is inverted to a black pixel, and the black pixel is inverted to a white pixel. Then, similarly to S601, using a 3 × 3 mask, noise is removed by adjusting black pixels not corresponding to the mask to white pixels (S603). By this processing, for example, noise that is on the bar of the bar code but not at the outline position of the bar code is removed. In step S604, the barcode image is inverted again to black pixels and the black pixels to white pixels to obtain a barcode image from which noise other than the contour position of the bar has been removed. In S605, each black pixel group obtained in S604 is classified and given a name by so-called labeling processing, and the name and the pixels constituting the pixel group are stored in the
なお、上記では、バーコード画像は、少なくとも一部の領域に表されている画像データとしているが、バーコード認識装置1が認識する対象のバーコードのみが表示されている画像データであってもよい。この場合にノイズ除去部21は、上記と同様にバーコードの輪郭位置を判断して輪郭位置のノイズ除去を制限しつつ、ノイズ除去処理を行う。そして、輪郭位置以外のノイズが除去されたバーコードを、デコード部23がデコードする。
In the above description, the barcode image is image data represented in at least a part of the area. However, the barcode image may be image data in which only the barcode to be recognized by the
[第2の実施形態]
第2の実施形態では、バーコード抽出部22は、ノイズ除去前のバーコード画像から、バーコードが表されている領域の画像を抽出し、ノイズ除去部21が、抽出された画像において、バーコードの輪郭位置を判断して輪郭位置のノイズ除去を制限しつつ、ノイズを除去する。以下において、第2の実施形態を説明するが、第1の実施形態と共通する部分は説明を省略する。
[Second Embodiment]
In the second embodiment, the
バーコード抽出部22は、まず、バーコード画像取得部4が取得したバーコード画像の一部の領域に表されているバーコードを抽出する。具体的には、例えば、バーコード抽出部22は、バーコード画像を記憶部3に記憶するとともに、バーコードの各バーの輪郭位置であるか否かに関わらずバーコード画像全体にかかっているノイズを除去し、ノイズの除去されたバーコード画像からバーコードが表された領域を検出する。そしてさらにバーコード抽出部22は、ノイズの除去後のバーコード画像から検出された領域に対応しているノイズ除去前のバーコード画像の領域から、ノイズが除去されていないバーコードが表された画像を抽出する。
The
上記のバーコード画像全体にかかっているノイズを除去する処理は、具体的には、バーコード画像のバーコードが表示されている領域、及び、バーコードが表示されていない領域に対して一律にノイズを除去する平滑化処理等である。この平滑化処理は、例えば膨張・収縮フィルタを画像の全面に適用する処理である。平滑化処理が行われたバーコード画像からは、バーコードが表された領域を判断することが容易となり、バーコード画像におけるバーコード以外のパターン等がバーコードとして判断される可能性が低くなる。なお、バーコード抽出部22が、バーコードが表された領域を検出する処理は、バーコードが所定の方向に並んで配置されるバーの集合であるという特徴を持っていることため、例えば、パターンマッチング等の当業者に既知のアルゴリズムを用いることが可能である。
Specifically, the processing for removing the noise applied to the entire barcode image is uniformly performed on the area where the barcode of the barcode image is displayed and the area where the barcode is not displayed. For example, a smoothing process for removing noise. This smoothing process is a process for applying, for example, an expansion / contraction filter to the entire surface of the image. From the barcode image that has been subjected to the smoothing process, it is easy to determine the area where the barcode is represented, and the possibility that a pattern other than the barcode in the barcode image is determined as the barcode is reduced. . In addition, since the process in which the
ノイズ除去部21は、バーコード抽出部22が抽出したバーコードが表された画像に従って、バーコードの輪郭位置を判断し、輪郭位置のノイズ除去を制限しつつ、ノイズを除去する。
The
なお、上述した第一及び第二の実施形態において、ノイズ除去部21、バーコード抽出部22、又は、デコード部23による処理の際には、バーコード画像に対して、あらかじめ回転調整等の他の画像処理を行ってもよい。例えば、バーコード画像を回転調整することで、上述のマスク処理、ラベリング処理、エッジ検出処理において、ノイズ除去部21による処理を円滑化し、処理の精度を向上させることができる。
In the first and second embodiments described above, when the processing by the
なお、上述した第一及び第二の実施形態において、バーコード画像取得部4が、バーコードを2値の画像データとして取得することとしているが、多値の画像データとして取得してもよい。この場合には、例えば、制御部2が、バーコード画像取得部4から提供される多値の画像データを2値化して、画像ノイズ除去部21等の処理に供される。
In the first and second embodiments described above, the barcode
1 バーコード認識装置、2 制御部、3 記憶部、4 バーコード画像取得部、21 ノイズ除去部、21A 輪郭位置判定部、21B ノイズ除去制限部、22 バーコード抽出部、23 デコード部。
DESCRIPTION OF
Claims (8)
前記ノイズ除去手段によりノイズが除去された前記画像に表された前記バーコードをデコードするデコード手段と、を含み、
前記ノイズ除去手段は、
前記バーコードにおける各バーの輪郭位置を判定する輪郭位置判定手段と、
前記輪郭位置判定手段によって判定された前記輪郭位置におけるノイズの除去を制限するノイズ除去制限手段と、を含み、
前記デコード手段は、前記バーコードにおける複数の読取線から読み取られるバー及びスペースの配置に基づいてデコードする、
ことを特徴とするバーコード認識装置。 Noise removal means for removing noise from the image on which the barcode is represented;
Decoding means for decoding the barcode represented in the image from which noise has been removed by the noise removing means,
The noise removing means is
Contour position determination means for determining the contour position of each bar in the barcode;
Noise removal restriction means for restricting removal of noise at the contour position determined by the contour position determination means,
The decoding means decodes based on the arrangement of bars and spaces read from a plurality of reading lines in the barcode.
A barcode recognition apparatus characterized by the above.
前記バーコードは、前記画像の一部の領域に表され、
前記バーコード認識装置は、
前記画像の一部の領域に表されたバーコードを抽出するバーコード抽出手段をさらに含む、
ことを特徴とするバーコード認識装置。 The barcode recognition device according to claim 1,
The barcode is represented in a partial area of the image,
The bar code recognition device includes:
A barcode extracting means for extracting a barcode represented in a partial area of the image;
A barcode recognition apparatus characterized by the above.
前記輪郭位置判定手段は、前記画像の各部分が所定のパターンの画像に該当するか否かに基づいて前記バーコードにおける前記各バーの輪郭位置を判定する、
ことを特徴とするバーコード認識装置。 The barcode recognition apparatus according to claim 1 or 2,
The contour position determining means determines the contour position of each bar in the barcode based on whether each part of the image corresponds to an image of a predetermined pattern;
A barcode recognition apparatus characterized by the above.
前記輪郭位置判定手段は、前記画像において、前記バーコードのバーを表す色情報が付与された画素が互いに隣接することにより形成される複数の画素群のうち、該画素群に含まれる画素数が所定の画素数以上となる画素群に従って、前記各バーの輪郭位置を判定する、
ことを特徴とするバーコード認識装置。 The barcode recognition apparatus according to claim 1 or 2,
In the image, the contour position determination unit includes a pixel group including a plurality of pixel groups formed by adjacent pixels to which color information representing the barcode bar is provided. According to a pixel group having a predetermined number of pixels or more, the contour position of each bar is determined.
A barcode recognition apparatus characterized by the above.
前記輪郭位置判定手段は、前記バーコードの長さ方向の各バーにおけるエッジと、その他の方向の各バーにおけるエッジとを検出するとともに、前記画像の各部分において、それら2方向の各エッジを比較することにより、前記各バーの輪郭位置を判定する、
ことを特徴とするバーコード認識装置。 The barcode recognition apparatus according to claim 1 or 2,
The contour position determining means detects an edge in each bar in the longitudinal direction of the barcode and an edge in each bar in the other direction, and compares each edge in the two directions in each part of the image. To determine the contour position of each bar,
A barcode recognition apparatus characterized by the above.
前記ノイズ除去手段は、前記輪郭位置判定手段が各部分を判定する毎に、その判定結果に応じてノイズを除去する、
ことを特徴とするバーコード認識装置。 In the barcode recognition device according to claim 3 or 5,
The noise removing unit removes noise according to the determination result each time the contour position determining unit determines each part.
A barcode recognition apparatus characterized by the above.
前記ノイズ除去手段は、前記画素群に含まれる画素数が所定の画素数未満となる画素群に従って、ノイズを除去する、
ことを特徴とするバーコード認識装置。 In the barcode recognition device according to claim 4,
The noise removing unit removes noise according to a pixel group in which the number of pixels included in the pixel group is less than a predetermined number of pixels.
A barcode recognition apparatus characterized by the above.
前記ノイズ除去手段によりノイズが除去された前記画像に表された前記バーコードをデコードするデコード手段としてコンピュータを機能させるプログラムであって、
前記ノイズ除去手段は、
前記バーコードにおける各バーの輪郭位置を判定する輪郭位置判定手段と、
前記輪郭位置判定手段によって判定された前記輪郭位置におけるノイズの除去を制限するノイズ除去制限手段と、を含み、
前記デコード手段は、前記バーコードにおける複数の読取線から読み取られるバー及びスペースの配置に基づいてデコードする、
ことを特徴とするプログラム。 A program for causing a computer to function as a noise removing unit for removing noise from an image on which a barcode is represented, and a decoding unit for decoding the barcode represented on the image from which noise has been removed by the noise removing unit. ,
The noise removing means is
Contour position determination means for determining the contour position of each bar in the barcode;
Noise removal restriction means for restricting removal of noise at the contour position determined by the contour position determination means,
The decoding means decodes based on the arrangement of bars and spaces read from a plurality of reading lines in the barcode.
A program characterized by that.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007333278A JP4978460B2 (en) | 2007-12-25 | 2007-12-25 | Bar code recognition apparatus and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007333278A JP4978460B2 (en) | 2007-12-25 | 2007-12-25 | Bar code recognition apparatus and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009157532A JP2009157532A (en) | 2009-07-16 |
JP4978460B2 true JP4978460B2 (en) | 2012-07-18 |
Family
ID=40961514
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007333278A Expired - Fee Related JP4978460B2 (en) | 2007-12-25 | 2007-12-25 | Bar code recognition apparatus and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4978460B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6874606B2 (en) * | 2017-08-31 | 2021-05-19 | ブラザー工業株式会社 | Control programs, information processing equipment, and scanning systems |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07107689B2 (en) * | 1988-07-13 | 1995-11-15 | 松下電器産業株式会社 | Image signal processor |
JPH0896059A (en) * | 1994-09-28 | 1996-04-12 | Toshiba Corp | Bar code reader |
JPH10105640A (en) * | 1996-09-27 | 1998-04-24 | Hitachi Maxell Ltd | Mark reading device |
JP3635829B2 (en) * | 1996-12-10 | 2005-04-06 | 松下電器産業株式会社 | Bar code reader |
JP3726653B2 (en) * | 2000-07-27 | 2005-12-14 | ノーリツ鋼機株式会社 | Image processing method, image processing apparatus, and recording medium on which program for executing image processing method is recorded |
-
2007
- 2007-12-25 JP JP2007333278A patent/JP4978460B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2009157532A (en) | 2009-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4525787B2 (en) | Image extraction apparatus and image extraction program | |
EP1456816B1 (en) | Apparatus and method for recognizing code | |
JP5566811B2 (en) | Deblurring and surveillance adaptive thresholding for image evaluation of printed and scanned documents | |
US9349237B2 (en) | Method of authenticating a printed document | |
JP6599672B2 (en) | Character cutout device, character recognition device, and character cutout method | |
JP2007272348A (en) | Character string recognition method and character string recognition device | |
US20080240582A1 (en) | Method and apparatus for character string recognition | |
JP3774690B2 (en) | Method and apparatus for dividing an image into character image lines, and character image recognition method and apparatus | |
KR101676000B1 (en) | Method for Detecting and Security-Processing Fingerprint in Digital Documents made between Bank, Telecommunications Firm or Insurance Company and Private person | |
JP5630689B2 (en) | Character recognition method and character recognition device | |
JP5428935B2 (en) | Two-dimensional barcode reader, program, two-dimensional barcode and medium | |
JP5335581B2 (en) | Image processing apparatus, image processing method, and program | |
JP4404224B2 (en) | Optical recognition code recognition apparatus, method and program | |
JP4978460B2 (en) | Bar code recognition apparatus and program | |
JP4132766B2 (en) | Image processing apparatus and method | |
US7221795B2 (en) | Document processing method, recording medium having recorded thereon document processing program, document processing program, document processing apparatus, and character-input document | |
JP7341758B2 (en) | Image processing device, image processing method, and program | |
JP4847378B2 (en) | Image processing apparatus, image processing method, program, and computer-readable recording medium | |
JP5470734B2 (en) | Image processing apparatus and image processing program | |
JP4627845B2 (en) | Digital image segmentation method and digital image processing apparatus | |
JP3545227B2 (en) | Image processing method and apparatus, optical character reader | |
Prachanucroa et al. | Marginal noise removal for scanned document images by projection profile based method | |
JP4254008B2 (en) | Pattern detection apparatus and method | |
JP2008219086A (en) | Information embedding device, information extraction device and information embedding system | |
JP4439054B2 (en) | Character recognition device and character frame line detection method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090825 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120315 |
|
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: 20120321 |
|
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: 20120403 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150427 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |