JP2008083843A - Code reader and program - Google Patents

Code reader and program Download PDF

Info

Publication number
JP2008083843A
JP2008083843A JP2006261206A JP2006261206A JP2008083843A JP 2008083843 A JP2008083843 A JP 2008083843A JP 2006261206 A JP2006261206 A JP 2006261206A JP 2006261206 A JP2006261206 A JP 2006261206A JP 2008083843 A JP2008083843 A JP 2008083843A
Authority
JP
Japan
Prior art keywords
binarization
image
shooting
data
code
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
JP2006261206A
Other languages
Japanese (ja)
Other versions
JP5017988B2 (en
Inventor
Noriyoshi Irie
知徳 入江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2006261206A priority Critical patent/JP5017988B2/en
Publication of JP2008083843A publication Critical patent/JP2008083843A/en
Application granted granted Critical
Publication of JP5017988B2 publication Critical patent/JP5017988B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

<P>PROBLEM TO BE SOLVED: To improve performance of reading a data code of a code reader. <P>SOLUTION: A binarization table 340 is created on the basis of image data 31 obtained by taking a photograph by an automatic exposure adjustment function. Unidentified information of '2', and binary data of '0' and '1' sorted on the basis of a prescribed threshold value are stored in the binarization table 340. When it is decided that binarization fails on the basis of the binarization table 340, an exposure time of a camera part is changed, and photographing is performed again to obtain new image data 31. The unidentified information stored in the binarization table 340 is selected, a cell on coordinates corresponding to the unidentified information is detected from the image data 31, the cell is binarized, and the unidentified information stored in the binarization table 340 is updated. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、撮影したデータコードの画像を二値化してデコードするコード読取装置及びプログラムに関する。   The present invention relates to a code reading apparatus and a program for binarizing and decoding a captured data code image.

近年、太さや間隔の異なる一次元のバーを並べ合わせたバーコード(一次元コード)と共に、二次元のセルを縦横に組み合わせた二次元コードが広く普及している(以下、一次元コード及び二次元コードを総称して「データコード」という)。   2. Description of the Related Art In recent years, two-dimensional codes in which two-dimensional cells are combined vertically and horizontally have been widely used together with barcodes (one-dimensional codes) in which one-dimensional bars having different thicknesses and intervals are arranged (hereinafter referred to as one-dimensional codes and two-dimensional codes). The dimension code is generically called "data code").

このデータコードは、コード読取装置のCCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)等の撮像部で撮影された画像を二値化することでバーやセルを検出し、デコードエンジン(デコーダ)が解析することにより読み取られる。   This data code detects a bar or a cell by binarizing an image taken by an image pickup unit such as a CCD (Charge Coupled Device) or a CMOS (Complementary Metal Oxide Semiconductor) of a code reader, and decodes a decoder engine (decoder ) Is read by analysis.

このデータコードを撮影する撮像部は、適切な明るさの画像が得られるように露光時間を自動的に調節する自動露出調整機能を一般に有している。ところが、この自動露出調整機能により露光時間を調整したとしても、外光や陰等の影響によってデータコードの一部に明暗が生じたり、印刷媒体の材質等によってコントラスト差を十分に確保できない場合があるため、デコードに適したデータコードの画像が得られるとは限らない。   An imaging unit that captures the data code generally has an automatic exposure adjustment function that automatically adjusts the exposure time so that an image with appropriate brightness can be obtained. However, even if the exposure time is adjusted using this automatic exposure adjustment function, the data code may become brighter or darker due to the influence of outside light or shade, or the contrast difference may not be sufficiently secured due to the material of the printing medium. Therefore, an image of a data code suitable for decoding is not always obtained.

デコードに適したデータコードの画像を得るための技術としては、次のような技術が知られている。即ち、二次元コードの画像の明部と暗部との境界を抽出し、その明部と暗部それぞれを鮮明化する画像処理を施した後に画像を合成する技術(特許文献1参照)や、複数のLED(Light Emitting Diode)を設け、鏡面反射高度判定値よりも高い光度領域が画像中に存在する場合に、照射するLEDの数を減らして撮影した画像と合成することにより鏡面反射領域を除去する技術(特許文献2参照)が開発されている。
特開平11−102411号公報 特開平11−120284号公報
The following techniques are known as techniques for obtaining data code images suitable for decoding. That is, a technique of extracting a boundary between a bright part and a dark part of an image of a two-dimensional code and performing image processing for sharpening each of the bright part and the dark part (see Patent Document 1), When an LED (Light Emitting Diode) is provided and a light intensity area higher than the specular reflection height judgment value exists in the image, the specular reflection area is removed by combining the image taken with a reduced number of LEDs to be irradiated. Technology (see Patent Document 2) has been developed.
Japanese Patent Laid-Open No. 11-102411 JP-A-11-120284

しかし、特許文献1の技術は、二値化を行う前の画像から明部と暗部との境界を抽出し、明部と暗部それぞれを鮮明化する画像処理を行わなければならない。また、特許文献2の技術においても、二値化を行う前の画像から鏡面反射領域を抽出する処理を行わなければならない。   However, the technique of Patent Document 1 must extract a boundary between a bright part and a dark part from an image before binarization, and perform image processing for sharpening each of the bright part and the dark part. Also in the technique of Patent Document 2, a process of extracting a specular reflection region from an image before binarization must be performed.

一般に、二値化を施す以前の画像データの各ピクセルは多値データ(輝度値)であるため、その画像に対するデータ処理量は二値化した後の画像の場合よりも膨大になる。このため、特許文献1及び2の技術では、二値化以前の画像に対する処理時間が長くなり、データコードのデコードまでに係る処理時間に影響を与えてしまい、データコードの読み取り性能が低下してしまった。   In general, since each pixel of image data before binarization is multi-value data (luminance value), the data processing amount for that image becomes enormous compared to the case of an image after binarization. For this reason, in the techniques of Patent Documents 1 and 2, the processing time for an image before binarization becomes long, which affects the processing time until the data code is decoded, and the data code reading performance is deteriorated. Oops.

また、特許文献2の技術は、撮影時のLEDの照射条件を変えるために複数のLEDを設けなければならなく、部品点数が多くなりコストが嵩んでしまった。   Further, the technique of Patent Document 2 has to provide a plurality of LEDs in order to change the irradiation condition of the LEDs at the time of photographing, which increases the number of parts and increases the cost.

本発明の課題は、コード読取装置のデータコードの読み取り性能を向上させることである。   An object of the present invention is to improve data code reading performance of a code reading device.

本発明は、データコードの画像を撮影する撮影手段と、前記撮影手段により撮影された画像の二値化を行う二値化手段と、前記二値化手段による二値化の成否を判定する判定手段と、前記判定手段により前記二値化が失敗したと判定された場合に、前記撮影手段と前記二値化手段とに再度撮影及び二値化をそれぞれ行わせる再撮影制御手段と、前記再撮影制御手段の制御下で二値化された画像と、前記再撮影制御手段の制御前に二値化された画像とを合成する合成手段と、前記合成手段により合成された画像をデコードするデコード手段と、を備えることを特徴としている。   The present invention relates to a photographing means for photographing an image of a data code, a binarizing means for binarizing an image photographed by the photographing means, and a determination for determining success or failure of binarization by the binarizing means. And a re-shooting control unit that causes the shooting unit and the binarization unit to perform shooting and binarization again when it is determined by the determination unit that the binarization has failed. Combining means for combining an image binarized under the control of the photographing control means and an image binarized before the control of the re-shooting control means, and decoding for decoding the image combined by the combining means Means.

本発明によれば、デコードするまでの処理時間を短くすることができ、コード読取装置のデータコードの読み取り性能を向上させることができる。   According to the present invention, the processing time until decoding can be shortened, and the data code reading performance of the code reader can be improved.

以下、本発明のコード読取装置の実施形態について図1〜図16を参照して詳細に説明する。先ず、コード読取装置の概要について説明する。   Hereinafter, embodiments of the code reading device of the present invention will be described in detail with reference to FIGS. First, the outline of the code reader will be described.

図1は、コード読取装置1の外観の一例を示す図であり、図1(a)はコード読取装置1を正面から見た外観斜視図、図1(b)はコード読取装置1を背面から見た外観斜視図である。図1に示すように、コード読取装置1は、各種キー群52、電源スイッチ54、ディスプレイ62、インジケータ66、スピーカ64、I/O端子72、カメラ部40、LED46及び充電池82を備えて構成される。   FIG. 1 is a diagram illustrating an example of the appearance of the code reading device 1. FIG. 1A is an external perspective view of the code reading device 1 viewed from the front, and FIG. FIG. As shown in FIG. 1, the code reading device 1 includes various key groups 52, a power switch 54, a display 62, an indicator 66, a speaker 64, an I / O terminal 72, a camera unit 40, an LED 46, and a rechargeable battery 82. Is done.

コード読取装置1は、カメラ部40でデータコードを露光・結像することで生成した画像データをデコードすることで、当該データコードによって符号化されたデータ(例えば、価格やシリアル番号等の商品管理情報、URLやE−mailアドレス等がある。)を読み取る。   The code reader 1 decodes the image data generated by exposing and imaging the data code by the camera unit 40, thereby data encoded by the data code (for example, product management such as price and serial number). Information, URL, E-mail address, etc.).

各種キー群52は、テンキーやエンターキー、トリガーキー等を有して構成される。ユーザは、被写体であるデータコードにカメラ部40を向けて撮影を行う。このとき、ディスプレイ62は電子ファインダーとして機能して、被写体の画像が表示される。この撮影によって得られたデータコードの画像のデコードが成功した場合、あるいは失敗した場合には、スピーカ64からブザー音が出力されたりインジケータ66が点滅したりして、デコード成功やエラーが通知される。   The various key groups 52 include a numeric keypad, an enter key, a trigger key, and the like. The user takes a picture with the camera unit 40 facing the data code that is the subject. At this time, the display 62 functions as an electronic viewfinder and displays an image of the subject. If the decoding of the data code image obtained by this photographing is successful or unsuccessful, a buzzer sound is output from the speaker 64 or the indicator 66 blinks to notify the decoding success or error. .

I/O端子72は、クレイドル等の拡張機器と電気的に接続する端子であり、クレイドルとの間の電気信号を中継することで、例えば、充電池82を充電したり、外部とのデータ通信を行う。また、カメラ部40の近傍には、図1(b)に示すようにLED46が設けられており、データコードの撮影時に光量不足が生じている場合にはLED46が点灯される。   The I / O terminal 72 is a terminal that is electrically connected to an extension device such as a cradle. For example, the I / O terminal 72 is used to charge the rechargeable battery 82 or to perform data communication with the outside by relaying an electrical signal to and from the cradle. I do. Further, an LED 46 is provided in the vicinity of the camera unit 40 as shown in FIG. 1B, and the LED 46 is turned on when there is a shortage of light amount when the data code is captured.

データコードのコード形式には、1次元コード(バーコード)のJAN(Japan Article Number)、code39、ITF(Interleaved Two of Five)等や、2次元コードのQR(Quick Response)コード(QRコードは(株)デンソーウェーブの登録商標)、PDF417(PDF417はシンボルテクノロジー社の登録商標)、DataMatrixコード(DataMatrixコードはデータマトリックス社の登録商標)、Maxiコード(MaxiコードはUSP社の登録商標)等があり、データコードの画像に対してコード形式に適応したデコードが行われる。   Data code formats include one-dimensional code (barcode) JAN (Japan Article Number), code 39, ITF (Interleaved Two of Five), etc., and two-dimensional code QR (Quick Response) code (QR code is ( DENSO WAVE INCORPORATED), PDF417 (PDF417 is a registered trademark of Symbol Technology Inc.), DataMatrix code (DataMatrix code is a registered trademark of Datamatrix Inc.), Maxi code (Maxi code is a registered trademark of USP), etc. Decoding adapted to the code format is performed on the image of the data code.

尚、このコード読取装置1は、例えば、データコードを読み取ってデータ収集を行うハンディターミナル(携帯端末)、POS(Point of Sales)システムのバーコードリーダ、バーコードスキャナ等に適用されるが、その適用例はこれに限られず、例えば、携帯電話やPDA(Personal Digital Assistant)の各種電子機器に適宜適用可能である。   The code reading device 1 is applied to, for example, a handy terminal (portable terminal) that reads a data code and collects data, a bar code reader of a POS (Point of Sales) system, a bar code scanner, and the like. The application example is not limited to this, and can be appropriately applied to various electronic devices such as a mobile phone and a PDA (Personal Digital Assistant).

次に、コード読取装置1の構成について、図2を参照して説明する。図2は、コード読取装置1の機能構成の一例を示すブロック図である。図2によれば、コード読取装置1は、CPU(Central Processing Unit)10、ROM(Read Only Memory)20、RAM(Random Access Memory)30、カメラ部40、入力部50、出力部60、I/F部70及び電源部80を備えて構成される。   Next, the configuration of the code reader 1 will be described with reference to FIG. FIG. 2 is a block diagram illustrating an example of a functional configuration of the code reading device 1. According to FIG. 2, the code reader 1 includes a CPU (Central Processing Unit) 10, a ROM (Read Only Memory) 20, a RAM (Random Access Memory) 30, a camera unit 40, an input unit 50, an output unit 60, an I / An F unit 70 and a power supply unit 80 are provided.

CPU10は、ROM20に記憶されたプログラムに基づいた処理を実行し、各機能部への指示やデータの入出力を行うことで、コード読取装置1を統括的に制御する。より具体的には、ROM20に記憶されたプログラム(例えば、図3(a)のコード読取プログラム21)を読み出して、そのプログラムに基づいた処理を行う。そして、その処理結果を出力部60から表示及び音声出力する。   The CPU 10 executes processing based on a program stored in the ROM 20 and performs overall control of the code reading device 1 by inputting instructions to each functional unit and inputting / outputting data. More specifically, a program (for example, the code reading program 21 in FIG. 3A) stored in the ROM 20 is read and processing based on the program is performed. Then, the processing result is displayed and output from the output unit 60.

ROM20は、各種初期設定やハードウェアの検査等を行うための初期プログラムや、コード読取装置1の動作に係る各種機能を実現するためのプログラムを格納する。RAM30は、CPU10が実行する各種プログラムの実行に係るデータ等を一時的に保持する記憶領域である。   The ROM 20 stores an initial program for performing various initial settings, hardware inspections, and the like, and a program for realizing various functions related to the operation of the code reading device 1. The RAM 30 is a storage area that temporarily stores data related to execution of various programs executed by the CPU 10.

カメラ部40は、被写体の撮影を行って画像データを生成する機能部であり、図2に示すように撮影レンズ41と、絞り機構42と、イメージセンサ43と、A/D変換器44と、撮影制御部45とを備えて構成される。   The camera unit 40 is a functional unit that shoots a subject and generates image data. As shown in FIG. 2, the camera unit 40, an aperture mechanism 42, an image sensor 43, an A / D converter 44, And an imaging control unit 45.

撮影レンズ41は、被写体の焦点を合わせるためのレンズ等を備えて構成され、被写体の像をイメージセンサ43に結像する。絞り機構42は、撮影レンズ41からの被写体の像の光の絞りを調整する。   The photographing lens 41 is configured to include a lens for focusing the subject, and forms an image of the subject on the image sensor 43. The aperture mechanism 42 adjusts the aperture of the light of the subject image from the photographic lens 41.

イメージセンサ43は、CCD(Charge Coupled Diode)や、CMOS(Complementary Metal-Oxide Semiconductor)等の撮像素子により構成され、撮影レンズ41及び絞り機構42を介して結像された光を光電変換して、アナログの電気信号を出力する。   The image sensor 43 is configured by an image sensor such as a CCD (Charge Coupled Diode) or a CMOS (Complementary Metal-Oxide Semiconductor), and photoelectrically converts light imaged through the photographing lens 41 and the diaphragm mechanism 42, Outputs analog electrical signals.

A/D変換器44は、イメージセンサ43からの電気信号をA/D変換してデジタルの画像データを生成する。撮影制御部45は、CPU10の指示に従って撮影レンズ41及び絞り機構42を駆動して、撮影レンズ41の移動や露光時間、ゲイン等の調整を行う。コード読取装置1の露光時間の調整には、自動露出調整機能と、マニュアル露出調整機能とがある。   The A / D converter 44 performs A / D conversion on the electrical signal from the image sensor 43 to generate digital image data. The imaging control unit 45 drives the imaging lens 41 and the aperture mechanism 42 according to instructions from the CPU 10 and adjusts movement of the imaging lens 41, exposure time, gain, and the like. The adjustment of the exposure time of the code reader 1 includes an automatic exposure adjustment function and a manual exposure adjustment function.

自動露出調整機能は、撮影に最適な露光時間及びゲインを算出して画像の明るさを自動的に調整して撮影する機能であり、公知のシャッター速度優先自動露出調整や絞り優先自動露出調整等でカメラ部40により行われる。尚、この自動露出調整機能は、コード読取装置1のアプリケーションプログラムによりCPU10がソフト的に実現することとしてもよい。   The automatic exposure adjustment function is a function that automatically adjusts the brightness of the image by calculating the optimal exposure time and gain for shooting, such as well-known shutter speed priority automatic exposure adjustment and aperture priority automatic exposure adjustment, etc. This is performed by the camera unit 40. The automatic exposure adjustment function may be realized by the CPU 10 in a software manner using an application program of the code reading device 1.

マニュアル露出調整機能は、コード読取装置1のアプリケーションプログラム(例えば、図3(a)のコード読取プログラム21)が指定した露光時間及びゲインで撮影を行う機能である。撮影制御部45は、自動露出調整機能によって調整した露光時間及びゲイン、又はマニュアル露出調整機能によってCPU10によって指定された露光時間及びゲインに基づいて絞り機構42及びイメージセンサ43を制御して撮影を行う。   The manual exposure adjustment function is a function for performing photographing with an exposure time and gain designated by an application program of the code reading device 1 (for example, the code reading program 21 in FIG. 3A). The imaging control unit 45 performs imaging by controlling the aperture mechanism 42 and the image sensor 43 based on the exposure time and gain adjusted by the automatic exposure adjustment function or the exposure time and gain specified by the CPU 10 by the manual exposure adjustment function. .

カメラ部40により生成された被写体の画像データは、ROM20内に格納されたプログラムに基づいてデコードされる。この画像データ内にデコードの対象となるデータコードが含まれ、そのデータコードのデコードが成功すると、復元されたデータや桁数、コード形式等が出力部60から出力される。   The subject image data generated by the camera unit 40 is decoded based on a program stored in the ROM 20. When the data code to be decoded is included in the image data and the data code is successfully decoded, the restored data, the number of digits, the code format, and the like are output from the output unit 60.

入力部50は、図1に示す各種キー群52や電源スイッチ54等のキー及びスイッチを有して構成され、ユーザによって押下されたキー又はスイッチに対応する操作信号をCPU10に出力する。   The input unit 50 includes keys and switches such as various key groups 52 and a power switch 54 shown in FIG. 1, and outputs an operation signal corresponding to the key or switch pressed by the user to the CPU 10.

出力部60は、図1のディスプレイ62やインジケータ66、スピーカ64を含み、LCD(liquid crystal monitor)やELD(Electro Luminescence Display)等の表示部と、音声出力部とから構成される。出力部60は、CPU10の指示に基づいてコード読取装置1の各種情報を表示又は音声出力する。   The output unit 60 includes the display 62, the indicator 66, and the speaker 64 of FIG. 1, and includes a display unit such as an LCD (liquid crystal monitor) or ELD (Electro Luminescence Display), and an audio output unit. The output unit 60 displays or outputs audio information of the code reading device 1 based on instructions from the CPU 10.

I/F部70は、LANインターフェイスやUSBインターフェイス等を備えて構成され、図1のI/O端子72に相当する。I/F部70は、クレイドル等の外部からの供給電力を電源部80に出力したり、CPU10の制御に基づいてデータ通信を行ったりする。電源部80は、コード読取装置1の各機能部に対して電力の供給を行い、図1の充電池82を備えて構成される。   The I / F unit 70 includes a LAN interface, a USB interface, and the like, and corresponds to the I / O terminal 72 in FIG. The I / F unit 70 outputs power supplied from the outside such as a cradle to the power supply unit 80 or performs data communication based on the control of the CPU 10. The power supply unit 80 supplies power to each functional unit of the code reading device 1 and includes the rechargeable battery 82 shown in FIG.

〔第1実施形態〕
次にコード読取装置1の第1実施形態について説明する。図3は、第1実施形態においけるROM20及びRAM30のデータ構成の一例を示す図である。図3(a)に示すように、ROM20は、コード読取プログラム21とデコーダプログラム22とを記憶している。
[First Embodiment]
Next, a first embodiment of the code reading device 1 will be described. FIG. 3 is a diagram illustrating an example of a data configuration of the ROM 20 and the RAM 30 in the first embodiment. As shown in FIG. 3A, the ROM 20 stores a code reading program 21 and a decoder program 22.

コード読取プログラム21は、図8〜図11に示すコード読取処理を実現するためのアプリケーションプログラムである。デコーダプログラム22は、データコードをデコードするためのプログラムであり、所定のコード形式に対応したデコードが行われる。CPU10は、デコーダプログラム22に基づいた処理を行うことで所謂デコーダエンジンとして機能する。   The code reading program 21 is an application program for realizing the code reading processing shown in FIGS. The decoder program 22 is a program for decoding a data code, and decoding corresponding to a predetermined code format is performed. The CPU 10 functions as a so-called decoder engine by performing processing based on the decoder program 22.

図3(b)によれば、RAM30には、画像データ31と、露光時間32と、コード画像33と、二値化テーブル34と、座標テーブル35と、平均輝度値36とが記憶されている。   According to FIG. 3B, the RAM 30 stores image data 31, an exposure time 32, a code image 33, a binarization table 34, a coordinate table 35, and an average luminance value 36. .

CPU10は、撮影の指示入力を行うトリガーキーの押下を検知すると、カメラ部40の自動露光調整機能によって撮影を行い、その撮影により生成された画像データ31をRAM30に記憶する。この画像データ31は、例えば、0(暗い)〜255(明るい)の輝度値からなるピクセルの集合体、即ち多値のデータとなる。また、CPU10は、自動露光調整機能によって設定された露光時間32をカメラ部40から取得してRAM30に記憶する。   When the CPU 10 detects that the trigger key for inputting the shooting instruction is pressed, the CPU 10 performs shooting by the automatic exposure adjustment function of the camera unit 40 and stores the image data 31 generated by the shooting in the RAM 30. The image data 31 is, for example, an aggregate of pixels having luminance values from 0 (dark) to 255 (bright), that is, multi-value data. Further, the CPU 10 acquires the exposure time 32 set by the automatic exposure adjustment function from the camera unit 40 and stores it in the RAM 30.

そして、その画像データ31を走査して、データコードが含まれているか否かを判別する。データコードの判別は、2個以上の角と、その角を結ぶ直線若しくは緩やかな曲線とが画像中に含まれているかという判別基準に従って行う。例えば、図4の画像データ31においては、二つの角AG1及びAG2が含まれると共に、その角AG1及びAG2を結ぶ辺SD1が含まれている。   Then, the image data 31 is scanned to determine whether or not a data code is included. The data code is discriminated in accordance with a discriminating criterion as to whether two or more corners and a straight line or a gentle curve connecting the corners are included in the image. For example, the image data 31 of FIG. 4 includes two corners AG1 and AG2, and a side SD1 connecting the corners AG1 and AG2.

画像データ31に2個以上の角と、その角を結ぶ直線又は曲線とが含まれている場合には、その角から延伸する複数の辺で囲まれたデータ領域をデータコードとして判別し、そのデータ領域を画像データ31から切り出してコード画像33としてRAM30に記憶する。図4においては、辺SD1,SD2及びSD3で囲まれたデータ領域を切り出し、コード画像33として記憶している。   When the image data 31 includes two or more corners and a straight line or a curve connecting the corners, a data area surrounded by a plurality of sides extending from the corner is determined as a data code, A data area is cut out from the image data 31 and stored in the RAM 30 as a code image 33. In FIG. 4, the data area surrounded by the sides SD <b> 1, SD <b> 2 and SD <b> 3 is cut out and stored as the code image 33.

また、画像データ31中に2個以上の角と、その角を結ぶ直線又は曲線が含まれていなかった場合には、データコードを判別できないため、カメラ部40の自動露出調整機能により露光時間32を再調整させて撮影を行う。このようにして、自動露出調整機能により画像データ31からデータコードを検出できた場合には、画像データ31からコード画像33を切り出し、そのコード画像33に対して二値化処理を行う。   In addition, when the image data 31 does not include two or more corners and a straight line or a curve connecting the corners, the data code cannot be determined. Therefore, the exposure time 32 is set by the automatic exposure adjustment function of the camera unit 40. Re-adjust and take a picture. In this way, when the data code can be detected from the image data 31 by the automatic exposure adjustment function, the code image 33 is cut out from the image data 31 and binarization processing is performed on the code image 33.

尚、データコードの判別には、適宜公知技術を採用して他の条件や方法により判別することとしてよく、例えば、QRコードに含まれる3つの切り出しシンボルを検知してデータコードを判別することとしてもよいし、一次元コード(バーコード)の判別を行うこととしてもよい。   Note that the data code may be determined by appropriately adopting a known technique according to other conditions and methods. For example, the data code is determined by detecting three cutout symbols included in the QR code. Alternatively, a one-dimensional code (bar code) may be determined.

図3(b)に示す二値化テーブル34(二値化データ)は、このコード画像33に含まれるセルの多値データを所定の閾値に基づいてCPU10が二値化処理を行って生成するデータテーブルであり、セル情報を記憶する。セル情報は、二値化処理によって多値データを変換した‘0’及び‘1’の二値データと、その二値データへの変換ができなかったことを示す二値化不明情報‘2’とを含む。尚、二値化不明情報としては、‘0’及び‘1’の二値データとの識別が可能な値であればよく、他の数字やデータで表しても良い。   The binarization table 34 (binarization data) shown in FIG. 3B is generated by the CPU 10 performing binarization processing on the basis of a predetermined threshold value for the multilevel data of the cells included in the code image 33. It is a data table and stores cell information. Cell information includes binary data “0” and “1” obtained by converting multi-value data by binarization processing, and binarization unknown information “2” indicating that conversion to the binary data was not possible. Including. The binarization unknown information may be any value that can be distinguished from binary data of “0” and “1”, and may be expressed by other numbers or data.

図3(b)に示す座標テーブル35は、コード画像33に含まれるセルの中心座標の座標情報(x座標,y座標)を記憶するデータテーブルである。   A coordinate table 35 shown in FIG. 3B is a data table that stores coordinate information (x coordinate, y coordinate) of the center coordinates of the cells included in the code image 33.

ここで、本実施形態における二値化処理について図5及び図6を参照して説明する。本実施形態における二値化処理は、コード画像33に含まれる各セルの輝度の平均値を算出し、その平均値を所定の二値化条件に基づいて‘0’、‘1’、‘2’の何れかに区分けする。   Here, the binarization processing in the present embodiment will be described with reference to FIGS. In the binarization processing in the present embodiment, the average value of the luminance of each cell included in the code image 33 is calculated, and the average value is set to “0”, “1”, “2” based on a predetermined binarization condition. It is classified into one of '.

二値化条件とは、コード画像33のセルを二値データ又は二値化不明情報に区分するための条件であり、本実施形態においては2つの閾値を用いる。その閾値としては、第1閾値TH1(例えば、150)と、第1閾値よりも小さい第2閾値TH2(例えば、100)とを予め設定する。   The binarization condition is a condition for dividing the cell of the code image 33 into binary data or binarization unknown information. In the present embodiment, two threshold values are used. As the threshold value, a first threshold value TH1 (for example, 150) and a second threshold value TH2 (for example, 100) smaller than the first threshold value are set in advance.

先ず、CPU10は、コード画像33を走査して、そのコード画像33からセルを抽出し、そのセルの中心座標の座標情報を座標テーブル35に記憶する。そして、そのセルを構成する各ピクセルの輝度値の平均を算出し、その輝度値が第2閾値TH2よりも小さい場合には、図5のセルCL2のように黒色のセルであると判別して二値化テーブル34にセル情報の‘1’を記憶する。また、輝度値が第1閾値TH1よりも大きい場合には、図5のセルCL1のように白色のセルであると判別して二値化テーブル34に‘0’を記憶する。   First, the CPU 10 scans the code image 33, extracts a cell from the code image 33, and stores the coordinate information of the center coordinates of the cell in the coordinate table 35. Then, the average luminance value of each pixel constituting the cell is calculated, and when the luminance value is smaller than the second threshold value TH2, it is determined that the cell is a black cell like the cell CL2 in FIG. Cell information “1” is stored in the binarization table 34. If the luminance value is larger than the first threshold value TH1, it is determined that the cell is a white cell like the cell CL1 in FIG. 5, and '0' is stored in the binarization table 34.

また、輝度値が第1閾値TH1以下であり且つ第2閾値TH2以上である場合には、図5のセルCL3のように黒色及び白色のセルと判別ができないグレーゾーンとして二値化不明情報の‘2’を二値化テーブル34に記憶する。また、第1閾値TH1よりも大きい輝度値を持つセルや第2閾値TH2よりも小さい輝度値を持つセルが縦又は横方向に一定数以上続いた場合には、十分なコントラストが確保できていないデータ領域であると判別して、図5のセル領域CL10のように‘2’を二値化テーブル34に記憶する。   Further, when the luminance value is equal to or lower than the first threshold TH1 and equal to or higher than the second threshold TH2, the binarization unknown information is displayed as a gray zone that cannot be distinguished from black and white cells like the cell CL3 in FIG. “2” is stored in the binarization table 34. In addition, when a certain number of cells having a luminance value larger than the first threshold TH1 or a cell having a luminance value smaller than the second threshold TH2 continue in the vertical or horizontal direction, sufficient contrast cannot be secured. It discriminate | determines that it is a data area, and memorize | stores "2" in the binarization table 34 like the cell area CL10 of FIG.

従って、本実施形態の二値化処理では、第1閾値TH1及び第2閾値TH2に基づいて各ピクセルが白色又は黒色のセルであると判別できた場合には、二値データの‘0’又は‘1’を二値化テーブル34に記憶するが、白色又は黒色のセルであると判別できなかった場合には、二値化に失敗したことを示す二値化不明情報‘2’を記憶することとなる。   Therefore, in the binarization process of the present embodiment, if each pixel can be determined to be a white or black cell based on the first threshold value TH1 and the second threshold value TH2, binary data “0” or “1” is stored in the binarization table 34. If it cannot be determined that the cell is a white or black cell, binarization unknown information “2” indicating that the binarization has failed is stored. It will be.

CPU10は、コード画像33を全走査して各セルに対応する座標情報と、二値データ又は二値化不明情報とを座標テーブル35及び二値化テーブル34それぞれに記憶する。例えば、図6においては、コード画像33のデータ領域33a内の各セルに対応する二値データ34aを二値化テーブル34に、座標情報35aを座標テーブル35にそれぞれ記憶している。   The CPU 10 scans the code image 33 and stores coordinate information corresponding to each cell and binary data or binarization unknown information in the coordinate table 35 and the binarization table 34, respectively. For example, in FIG. 6, binary data 34 a corresponding to each cell in the data area 33 a of the code image 33 is stored in the binarization table 34, and coordinate information 35 a is stored in the coordinate table 35.

また、図6のコード画像33においてセル毎のコントラストが不明瞭なデータ領域33bにおいては、そのデータ領域33b内の各セルに対応する座標情報35bが座標テーブル35に記憶される一方、上述した二値化が失敗したとして二値化不明情報34bが二値化テーブル34に記憶される。   In the data area 33b in which the contrast for each cell is unclear in the code image 33 of FIG. 6, the coordinate information 35b corresponding to each cell in the data area 33b is stored in the coordinate table 35, while The binarization unknown information 34b is stored in the binarization table 34 because the binarization has failed.

尚、上述した二値化処理における2つの閾値の設定方法としては、適宜公知技術を採用してよく、例えば、画像データ31全体の輝度値の平均を算出して、その平均値に応じて動的に設定することとしてもよい。   As a method for setting the two threshold values in the binarization process described above, a publicly known technique may be adopted as appropriate. For example, an average of luminance values of the entire image data 31 is calculated, and movement is performed according to the average value. It may be set automatically.

図3(b)に示すRAM30に記憶される平均輝度値36は、二値化処理に失敗したセル全体の輝度値の平均値である。一般に、二次元コードのデコードには、公知技術のエラー訂正機能が有効であり、撮影した二次元コードの一部に解読不能な領域があったとしても、その領域が全体のおよそ10%未満であった場合には、そのエラー訂正機能によりデコードが可能となる。   The average luminance value 36 stored in the RAM 30 shown in FIG. 3B is an average value of the luminance values of the entire cells that have failed in the binarization process. In general, the error correction function of a known technique is effective for decoding a two-dimensional code. Even if there is an unreadable area in a part of a photographed two-dimensional code, the area is less than about 10% of the whole. If there is, it can be decoded by the error correction function.

しかし、解読不能な領域が10%以上となった場合には、エラー訂正機能を用いたとしてもデコードができないため、再撮影が必要となる。このとき、同等の撮影条件の下で再撮影を行ったとしても、画質の改善が期待できないため、本実施形態では、二値化テーブル34に二値化不明情報を記憶した全セルの平均輝度値36を算出して、その平均輝度値36に基づいてカメラ部40の露光時間32を変更して、再撮影を行う。   However, if the undecipherable area becomes 10% or more, it cannot be decoded even if the error correction function is used, and re-shooting is necessary. At this time, even if re-shooting is performed under the same shooting conditions, since improvement in image quality cannot be expected, in this embodiment, the average luminance of all cells in which binarization unknown information is stored in the binarization table 34 The value 36 is calculated, the exposure time 32 of the camera unit 40 is changed based on the average luminance value 36, and re-photographing is performed.

CPU10は、二値化テーブル34の全データ量に対して二値化不明情報が占める割合(以下、「占有率」という)を算出し、その占有率が所定値(例えば、10%)以上であった場合には、二値化に失敗したと判別する。尚、二値化に失敗したか否かの判定基準として、本実施形態では二値化不明情報の占有率が10%以上であることを判定基準として説明するが、例えば、5%以上としてデコードの精度向上を図ってもよく、デコードに求められる精度に応じて適宜変更してよい。   The CPU 10 calculates a ratio (hereinafter referred to as “occupation ratio”) occupied by the binarization unknown information with respect to the total data amount of the binarization table 34, and the occupation ratio is equal to or greater than a predetermined value (for example, 10%). If there is, it is determined that the binarization has failed. Note that, in this embodiment, the occupancy ratio of binarization unknown information is 10% or more as a criterion for determining whether or not binarization has failed. The accuracy may be improved, and may be changed as appropriate according to the accuracy required for decoding.

このように二値化に失敗したと判定した場合には、二値化不明情報を記憶したセルに対応する多値データをコード画像33から読み出して、平均輝度値36を算出する。具体的には、二値化テーブル34に記憶した二値化不明情報に対応する座標情報を座標テーブル35から読み出し、その座標情報で示される座標を中心したとしたセルの多値データをコード画像33から読み出す。そして、その読み出した多値データ(輝度値)を逐次加算していき、その平均値である平均輝度値36を求める。   When it is determined that the binarization has failed as described above, the multi-value data corresponding to the cell storing the binarization unknown information is read from the code image 33, and the average luminance value 36 is calculated. Specifically, the coordinate information corresponding to the binarization unknown information stored in the binarization table 34 is read from the coordinate table 35, and the multi-value data of the cell centered on the coordinates indicated by the coordinate information is coded image Read from 33. Then, the read multi-value data (luminance value) is sequentially added to obtain an average luminance value 36 that is an average value thereof.

この算出した平均輝度値36が、図7に示すデコード可能範囲(例えば、30〜225)内であった場合には、二次元コードが汚れている、二次元コード全体が撮影されていない等の露出以外の原因で二値化できなかったものと判断する。これに対し、平均輝度値36が、例えば30以下又は225以上であってデコード可能範囲外であった場合には、露光時間32を算出して更新する。   If the calculated average luminance value 36 is within the decodable range shown in FIG. 7 (for example, 30 to 225), the two-dimensional code is dirty, the entire two-dimensional code is not photographed, etc. Judge that binarization could not be done for reasons other than exposure. On the other hand, when the average luminance value 36 is, for example, 30 or less or 225 or more and is outside the decodable range, the exposure time 32 is calculated and updated.

この露光時間32の算出は、例えば、平均輝度値36が30以下であった場合は、RAM30に記憶している露光時間32にN(実数値)を乗算した値を新たな露光時間32として算出し、平均輝度値36が225以上であった場合は、露光時間32をNで除算した値を新たな露光時間32として算出する。   For example, when the average luminance value 36 is 30 or less, the exposure time 32 is calculated by multiplying the exposure time 32 stored in the RAM 30 by N (real value) as the new exposure time 32. When the average luminance value 36 is 225 or more, a value obtained by dividing the exposure time 32 by N is calculated as a new exposure time 32.

即ち、二値化に失敗したセル全体が暗過ぎた場合には露光時間32を長め、明る過ぎた場合には露光時間を短縮するように当該露光時間32を変更する。尚、露光時間32を乗算、除算する実数値Nの値は、実験やチューニングによって予め決定される値である。また、デコード可能範囲としての輝度値の設定は、適宜変更可能である。   That is, the exposure time 32 is changed so that the exposure time 32 is lengthened when the entire cell that has failed to be binarized is too dark, and the exposure time is shortened when it is too bright. Note that the value of the real value N by which the exposure time 32 is multiplied or divided is a value determined in advance by experiment or tuning. The setting of the luminance value as the decodable range can be changed as appropriate.

このようにした新たに算出した露光時間32をカメラ部40のマニュアル露出設定機能に設定させて、再度撮影を行うため、始めに撮影したデータコードとは異なる撮影条件で撮影されたデータコードの画像データ31が得られるようになる。   Since the newly calculated exposure time 32 is set in the manual exposure setting function of the camera unit 40 and shooting is performed again, an image of a data code shot under shooting conditions different from the data code shot first. Data 31 is obtained.

そして、再撮影により得られた画像データ31から再度コード画像33を切り出し、二値化テーブル34において二値化不明情報が記憶された座標上のセルの多値データをコード画像33から抽出して、上述した二値化処理を行う。この部分的に抽出したセルの多値データに基づいて二値化処理を行った結果を、二値化テーブル34に記憶された二値化不明情報と置き換えることで合成し、当該二値化テーブル34を補完していく。尚、この二値化テーブル34の合成については、後述する。   Then, the code image 33 is cut out again from the image data 31 obtained by the re-photographing, and the multi-value data of the cell on the coordinates where the binarization unknown information is stored in the binarization table 34 is extracted from the code image 33. The binarization process described above is performed. The binarization process based on the partially extracted cell multi-value data is combined with the binarization unknown information stored in the binarization table 34 to synthesize the binarization table. 34 will be complemented. The composition of the binarization table 34 will be described later.

〔コード読取装置の具体的な動作〕
次に、コード読取装置1の具体的な動作について図8〜図11のフローチャートと、図12の二値化テーブル34の合成例とを参照して説明する。
[Specific operation of the code reader]
Next, a specific operation of the code reading device 1 will be described with reference to flowcharts of FIGS. 8 to 11 and a synthesis example of the binarization table 34 of FIG.

先ず、CPU10は、各種キー群52のトリガーキーの押下を検知すると、コード読取プログラム21をROM20から読み出して、そのプログラムに従った処理を開始する。そして、自動露出調整機能により設定された露光時間32でカメラ部40に撮影を行わせ(ステップA1)、その撮影によって生成された画像データ31をRAM30に記憶する(ステップA3)。   First, when detecting the depression of the trigger key of the various key group 52, the CPU 10 reads the code reading program 21 from the ROM 20 and starts processing according to the program. Then, the camera unit 40 is photographed with the exposure time 32 set by the automatic exposure adjustment function (step A1), and the image data 31 generated by the photographing is stored in the RAM 30 (step A3).

次いで、画像データ31にデータコードが含まれているか否かを判別し(ステップA5)、上述した判別基準に従ったデータコードを検出できなかった場合には(ステップA7;No)、ステップA1に処理を移行して、カメラ部40の自動露出調整機能により再度撮影を行う。   Next, it is determined whether or not the data code is included in the image data 31 (step A5). If the data code according to the above-described determination standard cannot be detected (step A7; No), the process proceeds to step A1. The processing is shifted, and photographing is performed again by the automatic exposure adjustment function of the camera unit 40.

また、データコードを検出した場合には(ステップA7;Yes)、そのデータコードを切り出した画像をコード画像33として記憶し、図9の二値化テーブル作成処理を行う(ステップA9)。図9の二値化テーブル作成処理においてCPU10は、先ず、コード画像33を走査してセルを検出し(ステップB1〜B3)、そのセルの輝度値に基づいて上述したように二値化テーブル34に0(白)、1(黒)及び2(不明)の何れかのセル情報を記憶する(ステップB5)。   If a data code is detected (step A7; Yes), an image obtained by cutting out the data code is stored as the code image 33, and the binarization table creation process of FIG. 9 is performed (step A9). In the binarization table creation process of FIG. 9, the CPU 10 first scans the code image 33 to detect cells (steps B1 to B3), and the binarization table 34 as described above based on the luminance values of the cells. Cell information of 0 (white), 1 (black), or 2 (unknown) is stored (step B5).

そして、検出したセルの中心座標の座標を取得して座標テーブル35に記憶し(ステップB7)、コード画像33の全走査が終了していない場合には(ステップB9;No)、ステップB1に処理を移行してコード画像33の操作を繰り返す。また、コード画像33の全走査が終了した場合には(ステップB9;Yes)、二値化テーブル作成処理を終了して図8のコード読取処理に処理を戻す。   Then, the coordinates of the center coordinates of the detected cell are acquired and stored in the coordinate table 35 (step B7), and if the full scanning of the code image 33 has not been completed (step B9; No), the process proceeds to step B1. And the operation of the code image 33 is repeated. If the entire scanning of the code image 33 is completed (step B9; Yes), the binarization table creation process is terminated and the process returns to the code reading process of FIG.

CPU10は、二値化テーブル作成処理の処理後、二値化テーブル34に記憶された二値化不明情報の占有率に基づいて二値化が成功したか否かを判定する(ステップA11)。このとき、二値化不明情報の占有率が10%未満であった場合には、二値化が成功したと判定し(ステップA11;Yes)、デコーダプログラム22をROM20から読み出して二値化テーブル34に対して所定のデコード処理を行う(ステップA13)。   After the binarization table creation process, the CPU 10 determines whether the binarization is successful based on the occupancy rate of the binarization unknown information stored in the binarization table 34 (step A11). At this time, if the occupancy ratio of the binarization unknown information is less than 10%, it is determined that the binarization is successful (step A11; Yes), the decoder program 22 is read from the ROM 20, and the binarization table is read. 34 is subjected to a predetermined decoding process (step A13).

そして、そのデコード処理が成功した場合には(ステップA15;Yes)、デコード結果を出力部60から表示出力及び音声出力させ(ステップA17)、デコード処理が失敗した場合には(ステップA15;No)、エラーを出力部60から出力させた後に(ステップA19)、コード読取処理を終了する。   If the decoding process is successful (step A15; Yes), the decoding result is displayed and output from the output unit 60 (step A17). If the decoding process fails (step A15; No) After the error is output from the output unit 60 (step A19), the code reading process is terminated.

一方、ステップA11において二値化テーブル34内の二値化不明情報の占有率が10%以上であって二値化に失敗したと判定した場合には(ステップA11;No)、図10の露出値決定処理を開始する(ステップA21)。   On the other hand, if it is determined in step A11 that the binarization unknown information occupancy rate in the binarization table 34 is 10% or more and binarization has failed (step A11; No), the exposure shown in FIG. The value determination process is started (step A21).

図10の露出値決定処理においてCPU10は、ステップA1の自動露出調整機能により設定された撮影時の露光時間32をRAM30から取得する(ステップC1)。次いで、二値化不明情報を記憶したセル全体の平均輝度値36を算出し(ステップC3)、その平均輝度値36がデコード可能範囲外である否かを判別する(ステップC5)。CPU10は、その平均輝度値36がデコード可能範囲内であると判別した場合には(ステップC5;No)、デコードを中断して、図8のコード読取処理を終了する。   In the exposure value determination process of FIG. 10, the CPU 10 acquires from the RAM 30 the exposure time 32 at the time of shooting set by the automatic exposure adjustment function in step A1 (step C1). Next, the average luminance value 36 of the entire cell storing the binarization unknown information is calculated (step C3), and it is determined whether or not the average luminance value 36 is outside the decodable range (step C5). When the CPU 10 determines that the average luminance value 36 is within the decodable range (step C5; No), the CPU 10 interrupts decoding and ends the code reading process of FIG.

また、平均輝度値36がデコード可能範囲外である場合には(ステップC5;Yes)、その平均輝度値36に基づいて新たな露光時間32を算出する(ステップC9)。即ち、平均輝度値36が0〜29内であった場合には(ステップC9;0〜29)、ステップC1において取得した露光時間32に実数値Nを乗算して新たな露光時間32を算出し(ステップC11)、226〜255内であった場合には(ステップC9;226〜255)、取得した露光時間32を実数値Nで除算して新たな露光時間32を算出する(ステップC13)。   If the average luminance value 36 is outside the decodable range (step C5; Yes), a new exposure time 32 is calculated based on the average luminance value 36 (step C9). That is, when the average luminance value 36 is within 0-29 (step C9; 0-29), a new exposure time 32 is calculated by multiplying the exposure time 32 acquired in step C1 by the real value N. (Step C11) When it is within 226 to 255 (Step C9; 226 to 255), the obtained exposure time 32 is divided by the real value N to calculate a new exposure time 32 (Step C13).

CPU10は、露出値決定処理によりRAM30の露光時間32を更新すると、図8のコード読取処理に戻り、マニュアル露出調整機能によってRAM30の露光時間32での撮影をカメラ部40に行わせる(ステップA23〜A25)。そして、その撮影により生成された画像データ31からデータコードを判別してコード画像33を検出できなかった場合には(ステップA27〜A29;No)、再び露出値決定処理を行い、ステップA21〜A29の処理を繰り返す。   When the CPU 10 updates the exposure time 32 of the RAM 30 by the exposure value determination process, the CPU 10 returns to the code reading process of FIG. 8 and causes the camera unit 40 to perform photographing at the exposure time 32 of the RAM 30 by the manual exposure adjustment function (steps A23 to A23). A25). If the code image 33 cannot be detected by determining the data code from the image data 31 generated by the photographing (steps A27 to A29; No), the exposure value determination process is performed again, and steps A21 to A29 are performed. Repeat the process.

このため、例えば、露光量が不足してデータコードが検出できない場合には、露出値決定処理により露光時間32を長めて撮影時の露光量を増やし、逆に露光量が過多である場合には、露光時間32を短縮して露光量を抑制させることで、データコードが検出可能な最適な露光時間32を算出することとなる。   For this reason, for example, when the data amount cannot be detected because the exposure amount is insufficient, the exposure time 32 is lengthened by the exposure value determination process to increase the exposure amount at the time of shooting. On the contrary, when the exposure amount is excessive By shortening the exposure time 32 and suppressing the exposure amount, the optimum exposure time 32 that can be detected by the data code is calculated.

一方、ステップA29においてデータコードを検出した場合には(ステップA29;Yes)、そのデータコードのコード画像33を画像データ31から切り出し、図11に示す二値化テーブル合成処理を開始する(ステップA31)。   On the other hand, when the data code is detected in step A29 (step A29; Yes), the code image 33 of the data code is cut out from the image data 31, and the binarization table synthesis process shown in FIG. 11 is started (step A31). ).

次の二値化テーブル合成処理の説明では、図11のフローチャートと共に図12を参照する。図12(a)は、自動露出調整機能により撮影した際に生成された画像データ31の画像例と、その画像データ31に基づいて作成された二値化テーブル340のデータ構成例を示している。また、図12(b)は、マニュアル露出調整機能により撮影した際に生成された画像データ31の画像例と、その画像データ31に基づいて二値化テーブル342を作成した場合のデータ構成例を示している。   In the following description of the binarization table synthesis process, FIG. 12 is referred to together with the flowchart of FIG. FIG. 12A shows an image example of the image data 31 generated when the automatic exposure adjustment function is used for photographing, and a data configuration example of the binarization table 340 created based on the image data 31. . FIG. 12B shows an image example of the image data 31 generated when the manual exposure adjustment function is taken, and a data configuration example when the binarization table 342 is created based on the image data 31. Show.

尚、図12(b)に二値化テーブル342を図示したのは、説明の簡便化のためであり、第1実施形態においてはマニュアル露出調整機能により撮影した画像データ31に基づいて二値化テーブル342を作成しない。   Note that the binarization table 342 is illustrated in FIG. 12B for the sake of simplification of description. In the first embodiment, the binarization table 342 is binarized based on the image data 31 photographed by the manual exposure adjustment function. The table 342 is not created.

図11の二値化テーブル合成処理においてCPU10は、先ず、二値化テーブル34に記憶されたセル情報の中から二値化不明情報(不明セル)を選択し(ステップD1)、その不明セルに対応する座標情報を座標テーブル35から取得する(ステップD3)。そして、その座標情報に基づいた座標を中心とした付近のセルをコード画像33から検出する(ステップD5)。   In the binarization table synthesis process of FIG. 11, the CPU 10 first selects binarization unknown information (unknown cell) from the cell information stored in the binarization table 34 (step D1), and sets the unknown cell as the unknown cell. Corresponding coordinate information is acquired from the coordinate table 35 (step D3). Then, a nearby cell centered on the coordinates based on the coordinate information is detected from the code image 33 (step D5).

CPU10は、ステップD5において検出したセルの多値データをコード画像33から読み出し、その多値データに上述した二値化処理を施し、‘0’、‘1’及び‘2’に区分けしてセル情報を決定する(ステップD7)。そして、ステップD3で取得した座標情報に対応する二値化テーブル34内のセル情報を、その決定したセル情報で更新して記憶した後(ステップD7)、二値化テーブル34の不明セルの全てを選択したか否かを判別する(ステップD11)。CPU10は、不明セル全てを選択していない場合には(ステップD11;No)、ステップD1〜D11の処理を繰り返して、全不明セルのセル情報を更新する。   The CPU 10 reads out the multi-value data of the cell detected in step D5 from the code image 33, performs the above-described binarization process on the multi-value data, and classifies the multi-value data into “0”, “1”, and “2”. Information is determined (step D7). After the cell information in the binarization table 34 corresponding to the coordinate information acquired in step D3 is updated and stored with the determined cell information (step D7), all the unknown cells in the binarization table 34 are stored. Is determined (step D11). When all the unknown cells are not selected (step D11; No), the CPU 10 repeats the processes of steps D1 to D11 to update the cell information of all unknown cells.

例えば、自動露出調整機能による撮影の結果、図12(a)のような画像データ31が生成された場合、露光量が最適なデータ領域31aの二値化処理は、二値化テーブル340のセル情報340aのように二値データ‘0’又は‘1’に変換できる。これに対して、露光量の低い暗い画像のデータ領域31bに対する二値化処理は、二値データへの変換ができずセル情報340bのように二値化不明情報‘2’が記憶される。   For example, when the image data 31 as shown in FIG. 12A is generated as a result of photographing by the automatic exposure adjustment function, the binarization processing of the data area 31a with the optimum exposure amount is performed in the cell of the binarization table 340. It can be converted into binary data “0” or “1” like information 340a. On the other hand, the binarization process for the dark image data region 31b with a low exposure amount cannot be converted into binary data, and the binarization unknown information “2” is stored like the cell information 340b.

この二値化テーブル340の二値化不明情報の占有率が10%以上である場合には、デコード処理のエラー訂正機能が有効に機能しないため、露出値決定処理により算出した露光時間32で再撮影を行う。例えば、図12(a)の画像データ31において平均輝度値36が0〜29の値で算出されたものとすると、始めの撮影時の露光時間32に実数値N(例えば、2)が乗算されて露光時間32が長められ、その結果、図12(b)のような明るい画像データ31が得られる。   When the occupancy rate of the binarization unknown information in the binarization table 340 is 10% or more, the error correction function of the decoding process does not function effectively, so that the re-exposure is performed at the exposure time 32 calculated by the exposure value determination process. Take a picture. For example, assuming that the average luminance value 36 is calculated as a value from 0 to 29 in the image data 31 of FIG. 12A, the exposure time 32 at the time of the first shooting is multiplied by a real value N (for example, 2). Thus, the exposure time 32 is lengthened, and as a result, bright image data 31 as shown in FIG. 12B is obtained.

このため、図12(a)の画像データ31において、コントラストが低いために二値化が困難であったデータ領域31bが、図12(b)の画像データ31では、コントラストが高くなり、その二値化が可能になる。   For this reason, in the image data 31 of FIG. 12A, the data area 31b, which is difficult to binarize because the contrast is low, becomes high in the image data 31 of FIG. Can be valuated.

CPU10は、不明セルであるセル情報341に対応する座標情報を座標テーブル35から取得し、その座標情報で示されるセルに対する二値化処理を新たに撮影して得られたコード画像33に行う。図12(b)の画像データ31において、新たに撮影された画像データ31のデータ領域31bのコントラストが高くなっているため、二値化処理により‘0’又は‘1’の二値データに変換可能であり、例えば、二値化テーブル342のようにセル情報343として‘0’が決定される。   The CPU 10 acquires coordinate information corresponding to the cell information 341 which is an unknown cell from the coordinate table 35, and performs a binarization process for the cell indicated by the coordinate information on the code image 33 obtained by newly photographing. In the image data 31 of FIG. 12B, since the contrast of the data area 31b of the newly captured image data 31 is high, it is converted into binary data of “0” or “1” by binarization processing. For example, “0” is determined as the cell information 343 as in the binarization table 342.

その結果、二値化テーブル340のセル情報341がセル情報343と置き換えられて更新される。このように、露光時間32を変更して再撮影した画像データ31に基づいて二値化テーブル340の二値化不明情報を更新することで、その二値化不明情報を二値データに置き換えて補完していくことができる。   As a result, the cell information 341 in the binarization table 340 is updated by being replaced with the cell information 343. In this manner, by updating the binarization unknown information in the binarization table 340 based on the image data 31 re-photographed by changing the exposure time 32, the binarization unknown information is replaced with binary data. It can be complemented.

CPU10は、二値化テーブル合成処理を終了すると(ステップA31)、更新後の二値化テーブル34に基づいて二値化の成否を判定する(ステップA11)。このとき、再び占有率10%以上であって二値化に失敗したと判定した場合には(ステップA11;No)、ステップA21に処理を移行して、露光値決定処理後、同様にステップA23〜A31の処理を繰り返す。即ち、二値化テーブル34の二値化不明情報の占有率が10%未満となるまで、露光時間32を再算出して再撮影を行い二値化テーブル34を補完していくこととなる。   When the CPU 10 finishes the binarization table synthesis process (step A31), the CPU 10 determines whether or not binarization is successful based on the updated binarization table 34 (step A11). At this time, if it is determined again that the occupation rate is 10% or more and the binarization has failed (step A11; No), the process proceeds to step A21, and after the exposure value determination process, similarly, step A23. Repeat the process of ~ A31. That is, until the occupation ratio of the binarization unknown information in the binarization table 34 becomes less than 10%, the exposure time 32 is recalculated and re-shooting is performed to complement the binarization table 34.

以上、第1実施形態によれば、始めに撮影して得られた画像データ31に基づいて二値化処理を行い、その二値化が失敗したと判定した場合には、再撮影によって新たに得られた画像データ31を部分的に二値化して二値化テーブル34の二値化不明情報を更新して補完していく。即ち、二値化テーブル34は、最初の撮影で得られた画像データ31に対する二値化処理と、再撮影によって得られた画像データ31に対する部分的な二値化処理とにより生成される。このため、多値データの画像データ31に対して処理時間の係る画像処理を行うことなく、デコードに適した二値化テーブル34を作成することができる。   As described above, according to the first embodiment, binarization processing is performed based on the image data 31 obtained by first photographing, and when it is determined that the binarization has failed, a new image is obtained by re-imaging. The obtained image data 31 is partially binarized, and the binarization unknown information in the binarization table 34 is updated and complemented. That is, the binarization table 34 is generated by binarization processing for the image data 31 obtained by the first shooting and partial binarization processing for the image data 31 obtained by the re-shooting. For this reason, the binarization table 34 suitable for decoding can be created without performing image processing with processing time on the image data 31 of multi-value data.

また、露光量の低い画像であった場合には露光時間32を長め、露光量の高い画像であった場合には露光時間32を短縮するように露光時間32を算出して再撮影を行うため、始めに撮影した画像とは異なる露光量を持つ画像データ31が得られる。このため、一度の撮影で外光や陰、印刷媒体等の影響によってデータコードの読み取りが困難であっても、再撮影によって二値化テーブル34をデコードに適したものに逐次補完していくことができる。従って、複数のLEDを設けることなく、コード読取装置1のデータコードの読み取り性能を向上させることができる。   Further, when the image is a low exposure amount, the exposure time 32 is lengthened, and when the image is a high exposure amount, the exposure time 32 is calculated so as to shorten the exposure time 32, and re-photographing is performed. Then, image data 31 having an exposure amount different from that of the first photographed image is obtained. For this reason, even if it is difficult to read the data code due to the influence of external light, shadows, printing media, etc., once in the shooting, the binarization table 34 should be complemented to one suitable for decoding by re-shooting. Can do. Therefore, the data code reading performance of the code reader 1 can be improved without providing a plurality of LEDs.

〔第2実施形態〕
次に、第2実施形態におけるコード読取装置1について図13〜図16を参照して説明する。尚、第2実施形態におけるコード読取装置1は、図3(b)に示すRAM30を図13に示すRAM30aに置き換えた構成であり、他の構成要素は同一であるため同一の符号を付してそれらの説明は省略する。
[Second Embodiment]
Next, the code reading device 1 in the second embodiment will be described with reference to FIGS. The code reading device 1 in the second embodiment has a configuration in which the RAM 30 shown in FIG. 3B is replaced with the RAM 30a shown in FIG. 13, and the other components are the same, so that the same reference numerals are given. Those explanations are omitted.

図13によれば、RAM30aは、画像データ31、露光時間32、コード画像33、座標テーブル35、平均輝度値36及び二値化テーブル37を記憶している。二値化テーブル37は、撮影時テーブル38と、合成テーブル39とを有して構成される。   According to FIG. 13, the RAM 30 a stores image data 31, exposure time 32, code image 33, coordinate table 35, average luminance value 36, and binarization table 37. The binarization table 37 includes a shooting time table 38 and a synthesis table 39.

第1実施形態において、マニュアル露出調整機能による再撮影時には二値化テーブルを作成しなかったが、第2実施形態においては、その再撮影時にも二値化テーブルを作成する。その撮影により生成した二値化テーブルを撮影時テーブル38として記憶する。合成テーブル39は、自動露出調整機能及びマニュアル露出調整機能により生成された画像データ31から生成された2つの二値化テーブルを合成した二値化テーブルである。   In the first embodiment, the binarization table is not created at the time of re-shooting by the manual exposure adjustment function, but in the second embodiment, the binarization table is also created at the time of re-shooting. The binarization table generated by the photographing is stored as the photographing time table 38. The combination table 39 is a binarization table obtained by combining two binarization tables generated from the image data 31 generated by the automatic exposure adjustment function and the manual exposure adjustment function.

図14及び15は、第2実施形態におけるコード読取装置1の具体的な動作を説明するためのフローチャートである。尚、図14及び15のフローチャートにおいて、第1実施形態の図8〜図11に示したフローチャートと同一の処理ステップには、同一のステップ番号を付して、その説明は省略する。   14 and 15 are flowcharts for explaining a specific operation of the code reading device 1 according to the second embodiment. In the flowcharts of FIGS. 14 and 15, the same processing steps as those in the flowcharts of FIGS. 8 to 11 of the first embodiment are denoted by the same step numbers, and the description thereof is omitted.

図14によれば、CPU10は、第1実施形態と同様に、自動露出調整機能による撮影を行った後に(ステップA1〜A7)、二値化テーブル作成処理を行う(ステップA9a)。尚、第2実施形態における二値化テーブル作成処理は、図9に示す二値化テーブル作成処理と同等の処理であるが、ステップB5では二値化テーブル37の撮影時テーブル38にセル情報を記憶して当該撮影時テーブル38を作成する。   As shown in FIG. 14, the CPU 10 performs binarization table creation processing (step A9a) after performing shooting using the automatic exposure adjustment function (steps A1 to A7), as in the first embodiment. The binarization table creation process in the second embodiment is the same as the binarization table creation process shown in FIG. 9, but in step B5, cell information is stored in the shooting time table 38 of the binarization table 37. This is stored and the shooting time table 38 is created.

そして、ステップA11aにおいては、撮影時テーブル38に基づいて二値化が成功したか否かを判定し、当該二値化が成功したと判定した場合には(ステップA11a;Yes)、第1実施形態と同様にデコード処理を行う(ステップA13)。また、二値化が失敗したと判定した場合には(ステップA11a;No)、露出値決定処理を行う(ステップA21a)。   In step A11a, it is determined whether or not the binarization is successful based on the shooting time table 38. If it is determined that the binarization is successful (step A11a; Yes), the first implementation is performed. Decoding processing is performed in the same manner as in the form (step A13). If it is determined that binarization has failed (step A11a; No), an exposure value determination process is performed (step A21a).

尚、第2実施形態における露出値決定処理は、図10に示す露出値決定処理と同等の処理であるが、ステップC3では撮影時テーブル38に記憶された二値化不明情報に基づいて平均輝度値36を算出する。   The exposure value determination process in the second embodiment is equivalent to the exposure value determination process shown in FIG. 10, but in step C3, the average luminance is calculated based on the binarization unknown information stored in the shooting table 38. A value 36 is calculated.

CPU10は、二値化テーブル37の撮影時テーブル38を合成テーブル39として記憶して(ステップA20)、ステップA23に処理を移行し、第1実施形態と同様にマニュアル露出調整機能による撮影を行った後に(ステップA23〜A29)、図15に示す再撮影時二値化処理を行う(ステップA33)。   The CPU 10 stores the shooting time table 38 of the binarization table 37 as the synthesis table 39 (step A20), shifts the processing to step A23, and performs shooting by the manual exposure adjustment function as in the first embodiment. Later (steps A23 to A29), re-photographing binarization processing shown in FIG. 15 is performed (step A33).

図15の再撮影時二値化処理においてCPU10は、ステップA9aと同様に二値化テーブル作成処理を行って、再撮影後のコード画像33に基づいて二値化テーブル37の撮影時テーブル38を作成する(ステップE1)。そして、その撮影時テーブル38の二値化不明情報の占有率に基づいて二値化が成功したか否かを判定し(ステップE3)、成功したと判定した場合には(ステップE3;Yes)、デコーダプログラム22をROM20から読み出して撮影時テーブル38に対して所定のデコード処理を行う(ステップE5)。   In the re-shooting binarization process of FIG. 15, the CPU 10 performs a binarization table creation process in the same manner as in step A <b> 9 a, and sets the shooting time table 38 of the binarization table 37 based on the code image 33 after the re-shooting. Create (step E1). Then, it is determined whether or not the binarization is successful based on the occupancy ratio of the binarization unknown information in the shooting time table 38 (step E3). If it is determined that the binarization is successful (step E3; Yes). The decoder program 22 is read from the ROM 20 and a predetermined decoding process is performed on the photographing table 38 (step E5).

従って、再撮影によりデコードに適した二値化テーブル37が得られた場合には、二値化テーブル合成処理を行わずに、その二値化テーブル37を用いてデコード処理を行うこととなる。   Therefore, when a binarization table 37 suitable for decoding is obtained by re-photographing, the binarization table 37 is used for decoding processing without performing binarization table synthesis processing.

また、二値化に失敗したと判定した場合には(ステップE3;No)、二値化テーブル37の合成テーブル39に撮影時テーブル38を合成する二値化テーブル合成処理を行う(ステップE7)。第2実施形態における二値化テーブル合成処理は、図11に示す第1実施形態における二値化テーブル合成処理と略同一の処理であるが、簡単に説明すると次のようになる。   If it is determined that the binarization has failed (step E3; No), a binarization table synthesis process for synthesizing the shooting time table 38 with the synthesis table 39 of the binarization table 37 is performed (step E7). . The binarization table synthesis process in the second embodiment is substantially the same process as the binarization table synthesis process in the first embodiment shown in FIG. 11, but it will be briefly described as follows.

先ず、二値化テーブル37の合成テーブル39に記憶されたセル情報の中から二値化不明情報(不明セル)を選択し、その不明セルに対応する座標情報を座標テーブル35から取得する。そして、その座標情報に対応する撮影時テーブル38のセル情報を取得して、そのセル情報を合成テーブル39の選択したセル情報と置き換えて当該合成テーブル39を更新する。この一連の処理を全不明セルのセル情報に対して行う。   First, binarization unknown information (unknown cell) is selected from the cell information stored in the synthesis table 39 of the binarization table 37, and coordinate information corresponding to the unknown cell is acquired from the coordinate table 35. Then, the cell information of the shooting time table 38 corresponding to the coordinate information is acquired, the cell information is replaced with the selected cell information of the synthesis table 39, and the synthesis table 39 is updated. This series of processing is performed on the cell information of all unknown cells.

例えば、自動露出調整機能の撮影によって図16のようなデータ構成の合成テーブル39が作成され、マニュアル露出調整機能による再撮影により撮影時テーブル38が作成されたとする。このとき、二値化不明情報が記憶されたセル情報39aを合成テーブル39の中からCPU10が不明セルとして選択し、その不明セルに対応するセル情報38aを撮影時テーブル38から取得して合成テーブル39のセル情報39aに置き換える。また、不明セルであるセル情報39bを選択し、撮影時テーブル38のセル情報38bでセル情報39bを置き換える。   For example, it is assumed that a composite table 39 having a data structure as shown in FIG. 16 is created by shooting with the automatic exposure adjustment function, and a shooting time table 38 is created by re-shooting with the manual exposure adjustment function. At this time, the CPU 10 selects the cell information 39a in which the binarized unknown information is stored as the unknown cell from the synthesis table 39, acquires the cell information 38a corresponding to the unknown cell from the shooting time table 38, and combines the table. The cell information 39a is replaced with 39 cell information 39a. Further, the cell information 39b which is an unknown cell is selected, and the cell information 39b is replaced with the cell information 38b of the shooting time table 38.

このように、合成テーブル39に記憶された二値化不明情報を撮影時テーブル38のセル情報で置き換えることで図16のように新たな合成テーブル39が生成される。CPU10は、二値化テーブル合成処理後の合成テーブル39に基づいて二値化が成功したか否かを判定し(ステップE9)、成功したと判定した場合には(ステップE9;Yes)、合成テーブル39に基づいたデコード処理を行って(ステップE11)、図14のステップA15に処理を移行し、失敗したと判定した場合には(ステップE9;No)、ステップA22に処理を移行して、再撮影を行う。   In this way, by replacing the binarization unknown information stored in the synthesis table 39 with the cell information of the shooting table 38, a new synthesis table 39 is generated as shown in FIG. The CPU 10 determines whether or not the binarization is successful based on the synthesis table 39 after the binarization table synthesis processing (step E9). When it is determined that the binarization is successful (step E9; Yes), the synthesis is performed. The decoding process based on the table 39 is performed (step E11), and the process proceeds to step A15 in FIG. 14. If it is determined that the process has failed (step E9; No), the process proceeds to step A22. Re-shoot.

以上、第2実施形態によれば、第1実施形態の効果に加えて、再撮影時に二値化テーブル37の撮影時テーブル38を作成して二値化が成功したと判定した場合に、二値化テーブル合成処理を行うことなく、その撮影時テーブル38に基づいてデコードを行うため、データコードの読み取り時間を短くすることができる。また、デコードまでの処理のパターンが増えるため、コード読取装置1のデータコードの読み取り性能を向上させることができる。   As described above, according to the second embodiment, in addition to the effects of the first embodiment, when the shooting time table 38 of the binarization table 37 is created at the time of re-shooting and it is determined that binarization is successful, Since decoding is performed based on the shooting time table 38 without performing the value table synthesis processing, the data code reading time can be shortened. Further, since the number of processing patterns until decoding increases, the data code reading performance of the code reading device 1 can be improved.

尚、上述した実施形態において、二値化に失敗したと判定した場合には、撮影条件としての露光時間32を変更して再撮影を行うこととして説明したが、イメージセンサ43のゲインを変更してもよいし、絞り機構42の絞り値を変更してもよい。その変更方法としては、図10の露出値決定処理と同等の処理で実現可能であり、例えば、ステップC11において平均輝度値36が0〜29内である場合には、イメージセンサ43の感度に実数値Nを乗算してゲインを高め、226〜255内である場合には、実数値Nで除算してゲインを低めて調整する。   In the above-described embodiment, when it is determined that the binarization has failed, the exposure time 32 as the imaging condition is changed and re-imaging is performed. However, the gain of the image sensor 43 is changed. Alternatively, the aperture value of the aperture mechanism 42 may be changed. The change method can be realized by a process equivalent to the exposure value determination process of FIG. 10. For example, when the average luminance value 36 is in the range of 0 to 29 in step C 11, the sensitivity of the image sensor 43 is realized. When the gain is increased by multiplying by the numerical value N and is within the range of 226 to 255, the gain is decreased by dividing by the real value N and adjusted.

また、このような撮影条件を適宜複数組み合わせて、その複数の撮影条件を変更して再撮影を行うこととしてもよい。このように、様々な撮影条件を変更して再撮影を行うことで、輝度分布の異なる様々なパターンの画像データ31が得られるため、二値化テーブルの補完精度が上がり、コード読取装置1のデータコードの読み取り性能を更に向上させることができる。   Further, a plurality of such shooting conditions may be combined as appropriate, and the plurality of shooting conditions may be changed to perform re-shooting. In this way, by performing various imaging conditions and performing re-imaging, image data 31 having various patterns with different luminance distributions can be obtained, so that the complementation accuracy of the binarization table is improved, and the code reader 1 Data code reading performance can be further improved.

コード読取装置の外観図の一例。An example of the external view of a code reader. コード読取装置の機能構成の一例を示すブロック図。The block diagram which shows an example of a function structure of a code reader. 第1実施形態における(a)はROM、(b)はRAMのデータ構成の一例を示す図。FIG. 2A is a diagram illustrating an example of a data configuration of a ROM, and FIG. データコードの判別方法を説明するための図。The figure for demonstrating the discrimination method of a data code. 二値化処理の処理方法を説明するための図。The figure for demonstrating the processing method of a binarization process. 二値化テーブルと座標テーブルの作成例を示す図。The figure which shows the creation example of a binarization table and a coordinate table. 露出時間の変更方法を説明するための図。The figure for demonstrating the change method of exposure time. 第1実施形態におけるコード読取装置の動作を説明するためのフローチャート。The flowchart for demonstrating operation | movement of the code reader in 1st Embodiment. 二値化テーブル作成処理を説明するためのフローチャート。The flowchart for demonstrating a binarization table preparation process. 露出値決定処理を説明するためのフローチャート。The flowchart for demonstrating exposure value determination processing. 二値化テーブル合成処理を説明するためのフローチャート。The flowchart for demonstrating a binarization table synthetic | combination process. 第1実施形態における二値化テーブル合成処理の処理内容を説明するための図。The figure for demonstrating the processing content of the binarization table synthetic | combination process in 1st Embodiment. 第2実施形態におけるRAMのデータ構成の一例を示す図。The figure which shows an example of the data structure of RAM in 2nd Embodiment. 第2実施形態におけるコード読取装置の動作を説明するためのフローチャート。The flowchart for demonstrating operation | movement of the code reader in 2nd Embodiment. 再撮影時二値化処理を説明するためのフローチャート。The flowchart for demonstrating the binarization process at the time of re-photographing. 第2実施形態における二値化テーブル合成処理の処理内容を説明するための図。The figure for demonstrating the processing content of the binarization table synthetic | combination process in 2nd Embodiment.

符号の説明Explanation of symbols

1 コード読取装置
20 ROM
21 コード読取プログラム
22 デコーダプログラム
30 RAM
31 画像データ
32 露光時間
33 コード画像
34 二値化テーブル
35 座標テーブル
36 平均輝度値
40 カメラ部
41 撮影レンズ
42 絞り機構
43 イメージセンサ
44 A/D変換器
45 撮影制御部
1 Code reader 20 ROM
21 Code reading program 22 Decoder program 30 RAM
31 Image data 32 Exposure time 33 Code image 34 Binary table 35 Coordinate table 36 Average luminance value 40 Camera unit 41 Shooting lens 42 Aperture mechanism 43 Image sensor 44 A / D converter 45 Shooting control unit

Claims (7)

データコードの画像を撮影する撮影手段と、
前記撮影手段により撮影された画像の二値化を行う二値化手段と、
前記二値化手段による二値化の成否を判定する判定手段と、
前記判定手段により前記二値化が失敗したと判定された場合に、前記撮影手段と前記二値化手段とに再度撮影及び二値化をそれぞれ行わせる再撮影制御手段と、
前記再撮影制御手段の制御下で二値化された画像と、前記再撮影制御手段の制御前に二値化された画像とを合成する合成手段と、
前記合成手段により合成された画像をデコードするデコード手段と、
を備えることを特徴とするコード読取装置。
Photographing means for photographing an image of the data code;
Binarization means for binarizing an image photographed by the photographing means;
Determination means for determining success or failure of binarization by the binarization means;
A re-shooting control unit that causes the shooting unit and the binarization unit to perform shooting and binarization again when the determination unit determines that the binarization has failed;
A combining unit that combines the binarized image under the control of the re-shooting control unit and the binarized image before the control of the re-shooting control unit;
Decoding means for decoding the image synthesized by the synthesis means;
A code reading device comprising:
前記二値化手段は、
前記撮影手段により撮影された画像の多値データを所定の二値化条件に基づいて二値データと二値化不明情報とに区分して二値化データを作成する作成手段を有し、
前記判定手段は、
前記二値化不明情報が前記二値化データに対して占める割合に基づいて前記二値化の成否を判定することを特徴とする請求項1に記載のコード読取装置。
The binarization means includes
Creating means for creating binarized data by classifying multi-value data of an image photographed by the photographing means into binary data and binarization unknown information based on a predetermined binarization condition;
The determination means includes
The code reading apparatus according to claim 1, wherein the success or failure of the binarization is determined based on a ratio of the binarization unknown information to the binarized data.
前記合成手段は、
前記再撮影制御手段の制御前に作成された前記二値化データのうちの二値化不明情報を、前記再撮影制御手段の制御下で生成された前記二値化データで置換する置換手段を有することを特徴とする請求項2に記載のコード読取装置。
The synthesis means includes
Substitution means for replacing the binarization unknown information in the binarized data created before the control of the re-imaging control means with the binarized data generated under the control of the re-imaging control means. The code reader according to claim 2, further comprising:
前記判定手段は、
前記合成手段により合成された画像の二値化の成否を判定する合成後判定手段を有し、
前記デコード手段は、
前記合成後判定手段により二値化が成功したと判定された場合に、前記合成手段により合成された画像をデコードするデコード制御手段を有することを特徴とする請求項1〜3の何れか一項に記載のコード読取装置。
The determination means includes
Comprising post-combination determination means for determining success or failure of binarization of the image combined by the combining means;
The decoding means includes
The decoding control unit according to any one of claims 1 to 3, further comprising: a decoding control unit configured to decode an image synthesized by the synthesizing unit when the binarization is determined to be successful by the post-combining determining unit. The code reader according to claim 1.
前記判定手段により二値化が失敗したと判定された場合に、前記再撮影制御手段による撮影時の前記撮影手段の撮影条件を前記二値化手段による二値化の結果に基づいて変更する撮影条件変更手段を更に備えることを特徴とする請求項1〜4の何れか一項に記載のコード読取装置。   Shooting for changing the shooting condition of the shooting unit at the time of shooting by the re-shooting control unit based on the binarization result by the binarization unit when the determination unit determines that binarization has failed The code reading device according to claim 1, further comprising a condition changing unit. 前記撮影手段により撮影された画像から前記判定手段により二値化が失敗したと判定された部分の画像を抽出する抽出手段と、
前記抽出手段により抽出された画像の平均輝度値を算出する算出手段と、
を更に備え、
前記撮影条件変更手段は、
前記算出手段により算出された平均輝度値に基づいて前記撮影条件を変更することを特徴とする請求項5に記載のコード読取装置。
Extracting means for extracting an image of a portion determined to have failed to be binarized by the determining means from an image photographed by the photographing means;
Calculating means for calculating an average luminance value of the image extracted by the extracting means;
Further comprising
The photographing condition changing means is
6. The code reading apparatus according to claim 5, wherein the photographing condition is changed based on an average luminance value calculated by the calculating means.
コンピュータを、
撮影部により撮影されたデータコードの画像の二値化を行う二値化手段、
前記二値化手段による二値化の成否を判定する判定手段、
前記判定手段により前記二値化が失敗したと判定された場合に、前記撮影手段と前記二値化手段とに再度撮影及び二値化をそれぞれ行わせる再撮影制御手段、
前記再撮影制御手段の制御下で二値化された画像と、前記再撮影制御手段の制御前に二値化された画像とを合成する合成手段、
前記合成手段により合成された画像をデコードするデコード手段、
として機能させるためのプログラム。
Computer
Binarization means for binarizing the image of the data code captured by the imaging unit;
Determination means for determining success or failure of binarization by the binarization means;
A re-shooting control unit that causes the shooting unit and the binarization unit to perform shooting and binarization again when the determination unit determines that the binarization has failed;
Combining means for combining the image binarized under the control of the re-shooting control means and the image binarized before the control of the re-shooting control means;
Decoding means for decoding the image synthesized by the synthesizing means;
Program to function as.
JP2006261206A 2006-09-26 2006-09-26 Code reader and program Active JP5017988B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006261206A JP5017988B2 (en) 2006-09-26 2006-09-26 Code reader and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006261206A JP5017988B2 (en) 2006-09-26 2006-09-26 Code reader and program

Publications (2)

Publication Number Publication Date
JP2008083843A true JP2008083843A (en) 2008-04-10
JP5017988B2 JP5017988B2 (en) 2012-09-05

Family

ID=39354691

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006261206A Active JP5017988B2 (en) 2006-09-26 2006-09-26 Code reader and program

Country Status (1)

Country Link
JP (1) JP5017988B2 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010157034A (en) * 2008-12-26 2010-07-15 Ritsumeikan System, method, and program for displaying composite image
JP2012208824A (en) * 2011-03-30 2012-10-25 Denso Wave Inc Optical information reading apparatus
JP2013080101A (en) * 2011-10-04 2013-05-02 Keyence Corp Image processing apparatus, and image processing program
JP2013148981A (en) * 2012-01-17 2013-08-01 Denso Wave Inc Two-dimensional code reading device
US8857718B2 (en) 2012-07-20 2014-10-14 Casio Computer Co., Ltd Information terminal and computer readable medium
JP2016184422A (en) * 2013-03-15 2016-10-20 コグネックス・コーポレイション System and method for pattern stitching and decoding using multiple captured images
WO2021038727A1 (en) * 2019-08-27 2021-03-04 セガサミークリエイション株式会社 Dice lottery device
JP2021110980A (en) * 2020-01-06 2021-08-02 株式会社デンソーウェーブ Reading apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11120284A (en) * 1997-10-15 1999-04-30 Denso Corp Optical information reader and recording medium
JP2001167222A (en) * 1999-09-29 2001-06-22 Denso Corp Error correcting method, method and device for reading two-dimensional code and recording medium
JP2004054581A (en) * 2002-07-19 2004-02-19 Denso Wave Inc Method for displaying information code and method for reading the information code

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11120284A (en) * 1997-10-15 1999-04-30 Denso Corp Optical information reader and recording medium
JP2001167222A (en) * 1999-09-29 2001-06-22 Denso Corp Error correcting method, method and device for reading two-dimensional code and recording medium
JP2004054581A (en) * 2002-07-19 2004-02-19 Denso Wave Inc Method for displaying information code and method for reading the information code

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010157034A (en) * 2008-12-26 2010-07-15 Ritsumeikan System, method, and program for displaying composite image
JP2012208824A (en) * 2011-03-30 2012-10-25 Denso Wave Inc Optical information reading apparatus
JP2013080101A (en) * 2011-10-04 2013-05-02 Keyence Corp Image processing apparatus, and image processing program
JP2013148981A (en) * 2012-01-17 2013-08-01 Denso Wave Inc Two-dimensional code reading device
US8857718B2 (en) 2012-07-20 2014-10-14 Casio Computer Co., Ltd Information terminal and computer readable medium
JP2016184422A (en) * 2013-03-15 2016-10-20 コグネックス・コーポレイション System and method for pattern stitching and decoding using multiple captured images
WO2021038727A1 (en) * 2019-08-27 2021-03-04 セガサミークリエイション株式会社 Dice lottery device
JP2021110980A (en) * 2020-01-06 2021-08-02 株式会社デンソーウェーブ Reading apparatus
JP7331703B2 (en) 2020-01-06 2023-08-23 株式会社デンソーウェーブ reader

Also Published As

Publication number Publication date
JP5017988B2 (en) 2012-09-05

Similar Documents

Publication Publication Date Title
JP5017988B2 (en) Code reader and program
US9477867B2 (en) System and method to manipulate an image
EP3040906B1 (en) Visual feedback for code readers
US7245780B2 (en) Group average filter algorithm for digital image processing
US7764835B2 (en) Method and apparatus for recognizing code
US6997384B2 (en) Method for displaying and reading information code for commercial transaction
JP5265708B2 (en) Image capture device with integrated barcode scanning
JP5265709B2 (en) Barcode detection based on morphological operations
JP4058529B2 (en) Optical information reader
US9147095B2 (en) Optical code scanner optimized for reading 2D optical codes
JP2007213359A (en) Two-dimensional code detection system and two-dimensional code detection program
JP2008533590A (en) Digital image acquisition optical reader with monochromatic and color hybrid image sensor array
EP1719068B1 (en) Section based algorithm for image enhancement
US8718370B2 (en) Optical information-reading apparatus and optical information-reading method
JP2003337941A (en) Device and method for image recognition, and program
JP4103909B2 (en) Portable information terminal and image processing method
JP4337597B2 (en) Code symbol reader and program
JP2007310675A (en) Qr code recognition device, qr code recognition device control method, qr code recognition device control program and computer-readable recording medium having program recorded thereon
JP2021015489A (en) Image analysis device, image analysis system, image analysis method and image analysis program
CN105893996B (en) Information processing method and electronic equipment
US8960550B2 (en) Minimizing misdecodes in electro-optical readers
JP2011197856A (en) Optical information reading device
JP2008140033A (en) Code reader and code reading method
JP2005004642A (en) Camera-equipped cellphone, bar code reading method and program
JP2023062139A (en) Improved method for correcting errors in matrix symbols

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090909

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120224

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120306

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120424

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20120424

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 5017988

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150622

Year of fee payment: 3