[go: up one dir, main page]

JP2018055304A - Code reading device, control program and control method - Google Patents

Code reading device, control program and control method Download PDF

Info

Publication number
JP2018055304A
JP2018055304A JP2016189031A JP2016189031A JP2018055304A JP 2018055304 A JP2018055304 A JP 2018055304A JP 2016189031 A JP2016189031 A JP 2016189031A JP 2016189031 A JP2016189031 A JP 2016189031A JP 2018055304 A JP2018055304 A JP 2018055304A
Authority
JP
Japan
Prior art keywords
reading
image
barcode
code
range
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.)
Pending
Application number
JP2016189031A
Other languages
Japanese (ja)
Inventor
洋一 谷手
Youichi Tanite
洋一 谷手
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.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP2016189031A priority Critical patent/JP2018055304A/en
Publication of JP2018055304A publication Critical patent/JP2018055304A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Character Input (AREA)

Abstract

【構成】 読取装置(10)は、CPU(20)を含み、CPU(20)の指示の下、初期設定処理において、複数の基準バーコードの各々を囲むように読取範囲(200)が設定され、読取範囲200の出力順序が設定される。初期設定処理が完了した後、撮影画像からバーコードが復号される場合に、設定された出力順序に従って読取範囲(200)に含まれる画像が復号され、復号されたバーコード情報が出力される。【効果】 符号を読み取った後のデータ整理作業を不要にし、読み取り処理にかかる時間を短縮できる。【選択図】 図9[Configuration] The reading device (10) includes a CPU (20). Under an instruction of the CPU (20), a reading range (200) is set so as to surround each of a plurality of reference bar codes in an initial setting process. The output order of the reading range 200 is set. When the barcode is decoded from the photographed image after the initial setting process is completed, the image included in the reading range (200) is decoded according to the set output order, and the decoded barcode information is output. [Effect] Data arrangement work after reading a code becomes unnecessary, and the time required for the reading process can be shortened. [Selection] Figure 9

Description

この発明は、符号読取装置、制御プログラムおよび制御方法に関し、特にたとえば、複数の符号を一括して読み取る、符号読取装置、制御プログラムおよび制御方法に関する。   The present invention relates to a code reading device, a control program, and a control method, and more particularly, to a code reading device, a control program, and a control method that collectively read a plurality of codes.

背景技術の一例が特許文献1に開示される。この特許文献1に開示されるバーコードシンボル読取装置では、複数のバーコードシンボルの読み取り処理が実行される。   An example of background art is disclosed in Patent Document 1. In the barcode symbol reading apparatus disclosed in Patent Document 1, a plurality of barcode symbol reading processes are executed.

読み取り処理では、複数のバーコードシンボルが一括撮像され、取得されたデジタル多値画像から、複数のバーコードシンボル領域が抽出される。その後、複数のバーコードシンボル領域毎に復号処理が実行される。   In the reading process, a plurality of barcode symbols are collectively imaged, and a plurality of barcode symbol areas are extracted from the acquired digital multi-valued image. Thereafter, a decoding process is performed for each of the plurality of barcode symbol areas.

復号処理が実行されると、バーコードシンボルの桁数またはバーコードシンボルの大きさについての情報およびバーコードシンボル種別情報が記憶される。複数のバーコードシンボルが読み取られた場合には、バーコードシンボルの桁数またはバーコードシンボルの大きさについての情報およびバーコードシンボル種別情報に応じて、バーコードシンボルのデータの出力順序が設定される。   When the decoding process is executed, information about the number of digits of the barcode symbol or the size of the barcode symbol and the barcode symbol type information are stored. When multiple barcode symbols are read, the output order of the barcode symbol data is set according to the number of digits of the barcode symbol or the size of the barcode symbol and the barcode symbol type information. The

特開2014−219775号公報JP 2014-219775 A

しかし、特許文献1の技術では、撮像された画像から読み取った複数のバーコードシンボルを、複数のバーコードシンボルを受け取ったアプリケーション側で入れ替える必要があり、処理に時間がかかるという問題がある。   However, the technique of Patent Document 1 has a problem that it takes time for processing because it is necessary to replace a plurality of barcode symbols read from a captured image on the application side that has received the plurality of barcode symbols.

それゆえに、この発明の主たる目的は、新規な、符号読取装置、制御プログラムおよび制御方法を提供することである。   Therefore, a main object of the present invention is to provide a novel code reader, control program, and control method.

また、この発明の他の目的は、符号を読み取った後のデータ整理作業を不要にし、読み取り処理にかかる時間を短縮できる、符号読取装置、制御プログラムおよび制御方法を提供することである。   Another object of the present invention is to provide a code reading device, a control program, and a control method that eliminate the need for data arrangement work after reading codes and reduce the time required for reading processing.

第1の発明は、複数の符号を一度に読み取る符号読取装置であって、撮影画像取得部、記憶部、画像抽出部、および復号部を備える。撮影画像取得部は、複数の符号を含む画像を撮影する。撮影画像取得部によって撮像された撮影画像は、2値化処理され、2値画像に変換される。記憶部は、撮影画像取得部によって撮像される撮影画像に対して設定される複数の読取範囲および当該複数の読取範囲の各々の読取順序を含む符号読取情報を記憶する。読取範囲は、ユーザの指示によって設定されても良いし、自動的に設定されても良い。複数の読取範囲の各々の読取順序は、たとえば、ユーザによって複数の読取範囲が選択された順に設定される。画像抽出部は、撮影画像取得部によって撮像された撮影画像のうち、複数の読取範囲に含まれる画像の各々を、読取順序に従う順序で抽出する。復号部は、画像抽出部によって抽出された順序で各画像に含まれる符号を復号する。   A first invention is a code reading device that reads a plurality of codes at a time, and includes a captured image acquisition unit, a storage unit, an image extraction unit, and a decoding unit. The captured image acquisition unit captures an image including a plurality of codes. The captured image captured by the captured image acquisition unit is binarized and converted into a binary image. The storage unit stores code reading information including a plurality of reading ranges set for a captured image captured by the captured image acquisition unit and a reading order of each of the plurality of reading ranges. The reading range may be set by a user instruction or may be set automatically. The reading order of each of the plurality of reading ranges is set, for example, in the order in which the plurality of reading ranges are selected by the user. The image extraction unit extracts each of the images included in the plurality of reading ranges from the captured images captured by the captured image acquisition unit in an order according to the reading order. A decoding part decodes the code | symbol contained in each image in the order extracted by the image extraction part.

第1の発明によれば、複数の読取範囲に含まれる画像の各々を、読取順序に従う順序で抽出し、抽出された順序で各画像に含まれる符号を復号するようにしてある。このため、符号を読み取った後のデータ整理作業を不要にし、読み取り処理にかかる時間を短縮できる。   According to the first invention, each of the images included in the plurality of reading ranges is extracted in the order according to the reading order, and the code included in each image is decoded in the extracted order. This eliminates the need for data arrangement work after reading the code, and shortens the time required for the reading process.

第2の発明は、第1の発明に従属する符号読取装置であって、復号部は、抽出部によって抽出された画像に含まれる符号が読取範囲内に位置する場合に、当該符号を復号する。   A second invention is a code reading device subordinate to the first invention, wherein the decoding unit decodes the code when the code included in the image extracted by the extraction unit is located within the reading range. .

第2の発明によれば、読取範囲を設定する際に用いられた被写体(物品)と異なる位置に符号が付された他の種類の物品に付された符号については、その符号が復号されることがない。このため、他の種類の物品について誤って読み取り処理を行っても、符号が復号されないので、誤って復号されたデータの整理作業などを行う必要が無くなり、手間がかかる作業を減らすことができる。   According to the second aspect of the present invention, for codes attached to other types of articles having codes attached to positions different from the subject (article) used when setting the reading range, the codes are decoded. There is nothing. For this reason, even if other types of articles are erroneously read, the codes are not decoded, so that it is not necessary to organize the data decoded in error, and the time-consuming work can be reduced.

第3の発明は、第1または第2の発明に従属する符号読取装置であって、撮影画像取得部によって撮像された撮影画像と複数の読取範囲との位置および向きを合わせるように、当該撮影画像と当該複数の読取範囲との位置および向きの少なくとも一方を変化させる変化部をさらに備える。   A third invention is a code reading device subordinate to the first or second invention, wherein the photographic image taken by the photographic image acquisition unit and the plurality of reading ranges are matched so that the positions and orientations thereof are matched. It further includes a changing unit that changes at least one of the position and orientation of the image and the plurality of reading ranges.

第3の発明によれば、撮影画像取得部において撮影される際に、当該撮影画像と当該複数の読取範囲との位置および向きの少なくとも一方に誤りがあった場合でも、符号を復号することができる。   According to the third invention, when the captured image acquisition unit captures an image, the code can be decoded even if there is an error in at least one of the position and orientation of the captured image and the plurality of reading ranges. it can.

第4の発明は、第3の発明に従属する符号読取装置であって、変化部は、複数の読取範囲の位置を、撮影画像のうち、符号が含まれる画像上に移動させる。   A fourth invention is a code reading device subordinate to the third invention, and the changing unit moves the positions of the plurality of reading ranges onto the image including the code in the photographed image.

第4の発明によれば、撮影画像と当該複数の読取範囲との位置が異なる場合でも、符号を復号することができる。   According to the fourth aspect of the present invention, the code can be decoded even when the captured image and the plurality of reading ranges are different in position.

第5の発明は、第3または第4の発明に従属する符号読取装置であって、変化部は、撮影画像に含まれる複数の符号の大きさを変化させる。   A fifth invention is a code reading device subordinate to the third or fourth invention, wherein the changing unit changes the size of a plurality of codes included in the photographed image.

第5の発明によれば、撮影画像と当該複数の読取範囲との大きさが異なる場合でも、符号を復号することができる。   According to the fifth aspect, the code can be decoded even when the captured image and the plurality of reading ranges are different in size.

第6の発明は、第1ないし第5のいずれかの発明に従属する符号読取装置であって、複数の符号に対応する複数の読取範囲を設定する読取範囲設定部、読取範囲設定部で設定された複数の読取範囲の各々の読取順序を設定する順序設定部、および読取範囲設定部によって設定された複数の読取範囲の各々の読取位置および順序設定部によって設定された当該複数の読取範囲の各々の読取順序を含む符号読取情報を生成する符号読取情報生成部をさらに備える。   A sixth invention is a code reading device subordinate to any one of the first to fifth inventions, and is set by a reading range setting unit and a reading range setting unit for setting a plurality of reading ranges corresponding to a plurality of codes. An order setting unit for setting the reading order of each of the plurality of reading ranges, and each of the reading positions set by the reading range setting unit and the reading positions set by the order setting unit. A code reading information generating unit that generates code reading information including each reading order is further provided.

第6の発明によれば、第1の発明と同様に、符号を読み取った後のデータ整理作業を不要にし、読み取り処理にかかる時間を短縮できる。   According to the sixth aspect, similarly to the first aspect, the data organization work after reading the code is unnecessary, and the time required for the reading process can be shortened.

第7の発明は、複数の符号を一度に読み取る符号読取装置で実行される制御プログラムであって、符号読取装置のプロセッサに、複数の符号を含む画像を撮影した撮影画像を取得する画像取得ステップ、画像取得ステップにおいて取得される撮影画像に対して設定される複数の読取範囲および当該複数の読取範囲の各々の読取順序を含む符号読取情報を記憶する記憶ステップ、画像取得ステップにおいて取得した撮影画像のうち、複数の読取範囲に含まれる画像の各々を、読取順序に従う順序で抽出する画像抽出ステップ、および画像抽出ステップにおいて抽出した順序で各画像に含まれる符号を復号する復号ステップを実行させる。   A seventh invention is a control program executed by a code reader that reads a plurality of codes at once, and an image acquisition step of acquiring a captured image obtained by capturing an image including a plurality of codes in a processor of the code reader A storage step for storing a plurality of reading ranges set for a captured image acquired in the image acquisition step and a reading order of each of the plurality of reading ranges; a captured image acquired in the image acquisition step Among these, an image extraction step for extracting each of the images included in the plurality of reading ranges in an order according to the reading order, and a decoding step for decoding the code included in each image in the order extracted in the image extraction step are executed.

第8の発明は、複数の読取範囲、当該複数の読取範囲の各々の読取位置および当該複数の読取範囲の各々の読取順序を含む符号読取情報を記憶する記憶部を備え、複数の符号を一度に読み取る符号読取装置の制御方法であって、(a)複数の符号を含む画像を撮影した撮影画像を取得するステップ、(b)ステップ(a)において取得される撮影画像に対して設定される複数の読取範囲および当該複数の読取範囲の各々の読取順序を含む符号読取情報を記憶し、(c)ステップ(a)において取得した撮影画像のうち、複数の読取範囲に含まれる画像の各々を、読取順序に従う順序で抽出するステップ、および(d)ステップ(c)において抽出した順序で各画像に含まれる符号を復号するステップを含む。   The eighth invention includes a storage unit that stores code reading information including a plurality of reading ranges, reading positions of the reading ranges, and reading orders of the reading ranges, and the plurality of codes are stored once. (A) a step of obtaining a photographed image obtained by photographing an image including a plurality of codes, (b) a method for controlling the photographed image obtained in step (a). Code reading information including a plurality of reading ranges and a reading order of each of the plurality of reading ranges is stored, and (c) among the captured images acquired in step (a), each of the images included in the plurality of reading ranges is stored. , Extracting in the order according to the reading order, and (d) decoding the codes included in each image in the order extracted in step (c).

第7および第8の発明においても、第1の発明と同様に、符号を読み取った後のデータ整理作業を不要にし、読み取り処理にかかる時間を短縮できる。   In the seventh and eighth inventions, similarly to the first invention, the data organization work after reading the codes is unnecessary, and the time required for the reading process can be shortened.

この発明によれば、符号を読み取った後のデータ整理作業を不要にし、読み取り処理にかかる時間を短縮できる。   According to the present invention, it is not necessary to organize data after reading the code, and the time required for the reading process can be shortened.

図1(A)は符号読取装置の外観の一例を表面から見た図解図であり、図1(B)は符号読取装置の外観の一例を裏面から見た図解図である。FIG. 1A is an illustrative view showing an example of the appearance of the code reading device from the front surface, and FIG. 1B is an illustrative view showing an example of the appearance of the code reading device from the back surface. 図2は図1(A)および(B)に示す符号読取装置の電気的な構成の一例を示すブロック図である。FIG. 2 is a block diagram showing an example of the electrical configuration of the code reader shown in FIGS. 1 (A) and 1 (B). 図3は符号読取装置に表示される基本画面の一例を示す図解図である。FIG. 3 is an illustrative view showing one example of a basic screen displayed on the code reading device. 図4は撮像装置で撮影された撮影画像の一例を示す図解図である。FIG. 4 is an illustrative view showing one example of a photographed image photographed by the imaging device. 図5は基準バーコードと読取範囲との関係を示す図解図である。FIG. 5 is an illustrative view showing the relationship between the reference bar code and the reading range. 図6は設定された読取範囲の位置を示す図解図である。FIG. 6 is an illustrative view showing the position of the set reading range. 図7は読取範囲の位置および出力順序を記載したテーブルの一例を示す図解図である。FIG. 7 is an illustrative view showing one example of a table in which the position of the reading range and the output order are described. 図8は図2に示すRAMのメモリマップの一例を示す図解図である。FIG. 8 is an illustrative view showing one example of a memory map of the RAM shown in FIG. 図9は図2に示すCPUのメイン処理の一例を示すフロー図である。FIG. 9 is a flowchart showing an example of the main processing of the CPU shown in FIG. 図10は図9に示すCPUの読み取り処理の一例を示すフロー図である。FIG. 10 is a flowchart showing an example of the reading process of the CPU shown in FIG. 図11(A)は、撮影画像に含まれるバーコードが設定された読取範囲200の範囲内に位置する場合を示す図解図であり、図11(B)は、撮影画像に含まれるバーコードが設定された読取範囲200の範囲内に位置しない場合を示す図解図である。FIG. 11A is an illustrative view showing a case where the barcode included in the photographed image is located within the set reading range 200, and FIG. 11B shows the barcode included in the photographed image. FIG. 10 is an illustrative view showing a case where the reading position is not within a set reading range 200. 図12は、第2実施例における読み取り処理の一例を示すフロー図である。FIG. 12 is a flowchart showing an example of the reading process in the second embodiment. 図13(A)〜(D)は、第3実施例における撮影画像におけるバーコードの位置または/および大きさを変化させる場合の一例を示す図解図である。FIGS. 13A to 13D are illustrative views showing an example of changing the position or / and the size of the barcode in the captured image in the third embodiment. 図14(A)〜(D)は、第3実施例における撮影画像におけるバーコードの向きを変化させる場合の一例を示す図解図である。FIGS. 14A to 14D are illustrative views showing an example of changing the direction of the barcode in the photographed image in the third embodiment. 図15は、第3実施例における読み取り処理の一例を示すフロー図である。FIG. 15 is a flowchart showing an example of the reading process in the third embodiment.

[第1実施例]
図1(A)はこの発明の第1実施例の読取装置10の外観構成の一例を表面から見た図解図であり、図1(B)はこの読取装置10の外観構成の一例を裏面から見た図解図である。
[First embodiment]
FIG. 1A is an illustrative view showing an example of the external configuration of the reading device 10 according to the first embodiment of the present invention as viewed from the front surface. FIG. 1B shows an example of the external configuration of the reading device 10 from the back surface. It is the illustration figure which saw.

符号読取装置10は、光学的に読取り可能であって予め定める形式でデータを表す符号を複数個一括して読取り、各符号の符号信号を検出し、検出した符号信号から符号が表す符号情報信号をそれぞれ再生する。たとえば、符号読取装置10は、手持ち型のバーコードリーダないしバーコードスキャナである。したがって、たとえば、読取り可能な符号は一次元バーコードである。また、符号信号は一次元バーコードの形状を表す画像信号であり、符号情報信号は数値コード信号である。   The code reader 10 reads a plurality of codes that are optically readable and represent data in a predetermined format, detects a code signal of each code, and a code information signal represented by the code from the detected code signal Play each one. For example, the code reader 10 is a hand-held bar code reader or bar code scanner. Thus, for example, a readable code is a one-dimensional barcode. The code signal is an image signal representing the shape of a one-dimensional barcode, and the code information signal is a numerical code signal.

ただし、符号読取装置10は、手持ち型に限定されず、定置型のリーダないしスキャナであっても良い。また、読取り可能な符号は、一次元バーコードに限定されず、二次元コードであっても良い。   However, the code reading device 10 is not limited to a hand-held type, and may be a stationary reader or scanner. The readable code is not limited to a one-dimensional bar code, and may be a two-dimensional code.

図1(A)に示すように、符号読取装置(以下、単に「読取装置」という。)10は、正面から見た形状が縦長の長方形の筐体12を含む。筐体12の表面側には、表示装置14および入力装置16が設けられる。また、筐体12は、ユーザが片手で持つことができる大きさで形成される。なお、筐体12の形状および大きさは一例であり、限定されるべきでない。   As shown in FIG. 1A, a code reading device (hereinafter simply referred to as “reading device”) 10 includes a casing 12 having a vertically long rectangular shape when viewed from the front. A display device 14 and an input device 16 are provided on the surface side of the housing 12. Moreover, the housing | casing 12 is formed in the magnitude | size which a user can have with one hand. In addition, the shape and size of the housing | casing 12 are examples, and should not be limited.

表示装置14は、タッチパネル付きのLCDであり、表示面が筐体12から露出するように配置される。ただし、LCDに代えて、有機ELを用いても良い。また、タッチパネルは、汎用のタッチパネルであり、静電容量方式、電磁誘導方式、抵抗膜方式、赤外線方式など、任意の方式のものを用いることができる。   The display device 14 is an LCD with a touch panel, and is arranged so that the display surface is exposed from the housing 12. However, an organic EL may be used instead of the LCD. The touch panel is a general-purpose touch panel, and an arbitrary type such as a capacitance method, an electromagnetic induction method, a resistance film method, and an infrared method can be used.

入力装置16は、ハードウェアキーであり、第1実施例では、スキャンキー16a、OK(決定)キー16b、カーソルキー16c、クリアキー16d、電源キー16eおよび数字キー(テンキー)16fを含む。   The input device 16 is a hardware key, and includes a scan key 16a, an OK (decision) key 16b, a cursor key 16c, a clear key 16d, a power key 16e, and a numeric key (ten key) 16f in the first embodiment.

スキャンキー16aは、バーコードの読取指示(読取処理の実行指示)を入力するために用いられる。OKキー16bは、各種の設定および各種の処理(バーコードの読取処理を除く)の実行を決定するために用いられる。カーソルキー16cは、表示装置14に表示されるカーソルを移動させたり、表示装置14に表示されたアイコンなどのオブジェクトを選択したりするために用いられる。   The scan key 16a is used to input a barcode reading instruction (reading process execution instruction). The OK key 16b is used to determine execution of various settings and various processes (excluding barcode reading processes). The cursor key 16c is used to move a cursor displayed on the display device 14 or to select an object such as an icon displayed on the display device 14.

クリアキー16dは、各種の設定をクリア(リセット)するために用いられる。電源キー16eは、読取装置10の主電源をオン/オフするために用いられる。数字キー16fは、数字を入力するために用いられる。   The clear key 16d is used to clear (reset) various settings. The power key 16e is used to turn on / off the main power supply of the reading apparatus 10. The number key 16f is used for inputting a number.

図1(B)に示すように、筐体12の裏面側であり、表示装置14の反対側には、撮像装置18が設けられる。図示および詳細な説明は省略するが、撮像装置18は、撮像素子、照射装置および画像処理回路を含む。撮像素子は、CCDまたはCMOSである。照射装置は、レーザ光を照射する装置であって、撮影時に、撮影範囲を視認可能に指示するための四角枠のレーザ光を被写体に向けて照射する。図示は省略するが、撮像装置18の撮影面(レンズ)および照射装置の照射面(発光面)は筐体12から露出されるように配置される。たとえば、撮像装置18の撮影方向および照射装置の照射方向は、筐体12の平坦な裏面に対して所定角度(60°程度)傾いた方向に設定される。   As illustrated in FIG. 1B, an imaging device 18 is provided on the back surface side of the housing 12 and on the opposite side of the display device 14. Although illustration and detailed description are omitted, the imaging device 18 includes an imaging device, an irradiation device, and an image processing circuit. The image sensor is a CCD or a CMOS. The irradiation apparatus is an apparatus that irradiates a laser beam, and irradiates a subject with a rectangular frame laser beam for instructing the imaging range to be visible at the time of imaging. Although illustration is omitted, the imaging surface (lens) of the imaging device 18 and the irradiation surface (light emitting surface) of the irradiation device are arranged so as to be exposed from the housing 12. For example, the imaging direction of the imaging device 18 and the irradiation direction of the irradiation device are set to a direction inclined by a predetermined angle (about 60 °) with respect to the flat back surface of the housing 12.

なお、図示は省略するが、筐体12内にはバッテリが収納され、収納されたバッテリを覆うように筐体12の裏面に蓋が設けられている。   Although illustration is omitted, a battery is housed in the housing 12, and a lid is provided on the back surface of the housing 12 so as to cover the stored battery.

図2は図1に示した読取装置10の電気的な構成の一例を示すブロック図である。図2に示すように、読取装置10は、CPU20を含み、CPU20には、入力装置16、撮像装置18、ROM22、フラッシュメモリ23、RAM24、電源制御回路26およびドライバ28が接続される。また、ドライバ28には、表示装置14が接続される。   FIG. 2 is a block diagram showing an example of the electrical configuration of the reading apparatus 10 shown in FIG. As illustrated in FIG. 2, the reading device 10 includes a CPU 20, and an input device 16, an imaging device 18, a ROM 22, a flash memory 23, a RAM 24, a power supply control circuit 26, and a driver 28 are connected to the CPU 20. The display device 14 is connected to the driver 28.

CPU20は、読取装置10の全体的な制御を司る。ROM22は、読取装置10の制御プログラム(符号読取プログラムを含む)および必要なデータを記憶する。フラッシュメモリ23は、読取装置10に設定される各種の情報(設定情報)を記憶する。ただし、フラッシュメモリ23に代えて、EEPROMまたはHDDのような他の不揮発性のメモリが設けられてもよい。RAM24は、CPU20のバッファ領域およびワーク領域として用いられる。電源制御回路26は、CPU20の指示の下、バッテリからの電源を各回路コンポーネトに供給および停止する。   The CPU 20 governs overall control of the reading device 10. The ROM 22 stores a control program (including a code reading program) of the reading device 10 and necessary data. The flash memory 23 stores various information (setting information) set in the reading device 10. However, in place of the flash memory 23, other nonvolatile memory such as EEPROM or HDD may be provided. The RAM 24 is used as a buffer area and a work area for the CPU 20. The power supply control circuit 26 supplies and stops the power from the battery to each circuit component under the instruction of the CPU 20.

入力装置16は、上述した各種キー(16a〜16f)であり、操作されたキーに対応する操作信号ないし操作データをCPU20に入力する。撮像装置18は、CPU20からの撮影指示に応じて、予め定められる撮影範囲内の被写体(バーコードが付された物品ないし商品を含む)の画像を撮影し、2次元画像(撮影画像)についての画像データ(撮影画像データ)を生成する。ただし、2次元画像は、白黒画像(濃淡画像)またはカラー画像である。   The input device 16 is the above-described various keys (16a to 16f), and inputs an operation signal or operation data corresponding to the operated key to the CPU 20. The imaging device 18 shoots an image of a subject (including an article or a product with a barcode attached) within a predetermined shooting range in response to a shooting instruction from the CPU 20 and takes a two-dimensional image (shooted image). Image data (photographed image data) is generated. However, the two-dimensional image is a black and white image (grayscale image) or a color image.

なお、撮影範囲は、撮像装置18の画角で決定され、たとえば、撮像装置18を被写体に近づければ、撮影範囲は狭くなり、撮像装置18を被写体から遠ざければ、撮影範囲は広くなる。ただし、ズーム機能によって撮影範囲が変化されてもよい。   Note that the shooting range is determined by the angle of view of the imaging device 18. For example, if the imaging device 18 is brought closer to the subject, the shooting range becomes narrower, and if the imaging device 18 is moved away from the subject, the shooting range becomes wider. However, the shooting range may be changed by the zoom function.

撮像装置18は、撮影画像データをCPU20に与える。CPU20は、撮影画像データをRAM24に一旦記憶する。また、撮像装置18では、照射装置が、撮影時に、撮影範囲を指示するためのレーザ光を照射する。   The imaging device 18 provides the captured image data to the CPU 20. The CPU 20 temporarily stores the captured image data in the RAM 24. Further, in the imaging device 18, the irradiation device irradiates a laser beam for instructing a shooting range at the time of shooting.

ドライバ28は、表示制御回路であり、たとえば、GPUおよびVRAMを含み、CPU20からの指示に従って表示画像データを生成し、表示装置14に出力する。したがって、表示装置14には、表示画像データに対応する表示画像(画面)が表示される。また、ドライバ28は、CPU20からの指示に従って、RAM24に記憶された撮影画像に対応する画像データを表示装置14に出力する。したがって、表示装置14には、撮影画像が表示される。つまり、撮影画像がプレビュー表示される。   The driver 28 is a display control circuit, and includes, for example, a GPU and a VRAM. The driver 28 generates display image data in accordance with an instruction from the CPU 20 and outputs the display image data to the display device 14. Therefore, a display image (screen) corresponding to the display image data is displayed on the display device 14. Further, the driver 28 outputs image data corresponding to the captured image stored in the RAM 24 to the display device 14 in accordance with an instruction from the CPU 20. Therefore, the captured image is displayed on the display device 14. That is, the captured image is displayed as a preview.

また、撮像装置18では、画像処理回路が、RAM24に記憶された撮影画像データに2値化処理を施し、2値画像の画像データ(2値画像データ)を生成する。たとえば、2値化処理では、撮影画像において、所定の明るさ(輝度)未満の画素が黒色の画素に変換され、所定の明るさ以上の画素が白色の画素に変換される。所定の明るさは、予め実験等によって経験的に決定される。たとえば、黒色のバーコードを検出する(読み取る)場合には、所定の明るさを比較的低い値に設定することができる。CPU20は、生成された2値画像データから処理対象であるバーコードを抽出(検出)し、抽出したバーコードを復号する。   In the imaging device 18, the image processing circuit performs binarization processing on the captured image data stored in the RAM 24, and generates binary image image data (binary image data). For example, in the binarization process, in a captured image, pixels less than a predetermined brightness (luminance) are converted to black pixels, and pixels having a predetermined brightness or more are converted to white pixels. The predetermined brightness is empirically determined in advance by experiments or the like. For example, when detecting (reading) a black barcode, the predetermined brightness can be set to a relatively low value. The CPU 20 extracts (detects) a barcode to be processed from the generated binary image data, and decodes the extracted barcode.

たとえば、2値画像データからバーコードを抽出する場合には、CPU20は、まず、2値画像データに平滑化フィルタをかけ、2値画像をぼやけた状態にする。次に、CPU20は、ぼやけた2値画像データから島状の塊(同じ色が集中している箇所)の位置を抽出する。CPU20は、抽出した島状の塊の位置およびその付近において、平滑化フィルタをかける前の2値画像データから直線が存在するかどうか判断し、直線が存在する場合には、その直線を検出する(エッジ抽出)。そして、CPU20は、検出した直線とこの直線に対して垂直に伸びる島状の塊の範囲(領域)を抽出することによって、2値画像データから矩形画像データを抽出する。2値画像データから抽出された矩形画像データは、バーコードに対応する画像データの候補として一時的にリストアップされる。   For example, when extracting a barcode from binary image data, the CPU 20 first applies a smoothing filter to the binary image data to make the binary image blurred. Next, the CPU 20 extracts the position of island-like chunks (locations where the same color is concentrated) from the blurred binary image data. The CPU 20 determines whether or not there is a straight line from the binary image data before applying the smoothing filter at the position of the extracted island-shaped lump and its vicinity, and detects the straight line if it exists. (Edge extraction). Then, the CPU 20 extracts rectangular image data from the binary image data by extracting the detected straight line and the range (region) of the island-shaped chunk extending perpendicularly to the straight line. The rectangular image data extracted from the binary image data is temporarily listed as image data candidates corresponding to the barcode.

続いて、CPU20は、抽出した各矩形画像データがバーコードを示す画像データであるかどうかを、たとえば、パリティチェックを行うことにより判断する。パリティチェックでは、CPU20は、矩形画像データに含まれる直線(バー)に基づいて、矩形画像データをコード化し、コード化したコードのパターンがバーコードのパターンに合っているかどうかを判断する。   Subsequently, the CPU 20 determines whether or not each extracted rectangular image data is image data indicating a barcode by performing a parity check, for example. In the parity check, the CPU 20 encodes the rectangular image data based on a straight line (bar) included in the rectangular image data, and determines whether or not the encoded code pattern matches the barcode pattern.

CPU20は、バーコードを示す画像データであることが判断された矩形画像データから、数値および文字の少なくとも一方で示されるバーコード情報(符号情報信号)に変換する。つまり、バーコードが復号される。ただし、バーコード情報は、さらに記号を含んでいてもよい。   The CPU 20 converts the rectangular image data determined to be image data indicating a barcode into barcode information (code information signal) indicated by at least one of numerical values and characters. That is, the barcode is decoded. However, the barcode information may further include a symbol.

なお、撮影画像に複数のバーコードが含まれる場合には、それぞれのバーコードに対して上述した処理が行われる。   In addition, when the captured image includes a plurality of barcodes, the above-described processing is performed on each barcode.

CPU20は、変換したバーコード情報(復号結果)を出力する。一例として、バーコード情報は、表示装置14に表示される。ただし、バーコード情報は、読取装置10のホスト装置(図示せず)に送信されてもよい。図示は省略したが、CPU20は、インターフェイスを介して、ホスト装置にバーコード情報を送信する。したがって、バーコード情報は、ホスト装置における処理に用いられる。たとえば、店舗で販売される商品にバーコードが付されている場合には、バーコード情報は小売金額、商品名および商品種類を表し、ホスト装置は金銭登録機として機能する。ただし、バーコード情報は、無線でホスト装置に送信されてもよい。   The CPU 20 outputs the converted barcode information (decoding result). As an example, the barcode information is displayed on the display device 14. However, the barcode information may be transmitted to a host device (not shown) of the reading device 10. Although not shown, the CPU 20 transmits barcode information to the host device via the interface. Therefore, the barcode information is used for processing in the host device. For example, when a bar code is attached to a product sold at a store, the bar code information represents a retail price, a product name, and a product type, and the host device functions as a cash register. However, the barcode information may be transmitted to the host device wirelessly.

また、バーコード情報には、バーコードの桁数またはバーコードの大きさについての情報および種別情報が含まれる。ただし、種別情報は、一次元バーコードか二次元コードかを示す情報のことである。   Further, the barcode information includes information about the number of digits of the barcode or the size of the barcode and the type information. However, the type information is information indicating a one-dimensional barcode or a two-dimensional code.

このような構成の読取装置10では、上述したように、撮影画像に含まれる複数のバーコードを一括して読み取る(復号する)ことができる。たとえば、バーコードの復号に成功した場合には、バーコードの桁数またはバーコードの大きさについての情報およびバーコード種別情報が記憶される。複数のバーコードが読み取られた場合には、バーコードの桁数またはバーコードの大きさについての情報およびバーコード種別情報に応じて、バーコードのデータの出力順序が設定される。   As described above, the reader 10 having such a configuration can collectively read (decode) a plurality of barcodes included in a captured image. For example, when the decoding of the barcode is successful, information about the number of digits of the barcode or the size of the barcode and the barcode type information are stored. When a plurality of barcodes are read, the barcode data output order is set according to the number of digits of the barcode or the barcode size information and the barcode type information.

たとえば、このような構成の読取装置10は、同じ位置にバーコードが付された同種の物品ないし商品(以下、「物品」という。)を、物品毎に連続してバーコードを読み取る作業に用いられることがある。   For example, the reader 10 having such a configuration uses the same kind of article or commodity (hereinafter referred to as “article”) having a barcode attached at the same position for the operation of continuously reading the barcode for each article. May be.

なお、この第1実施例では、物品にバーコードが付される場合について説明するが、これに限定される必要はない。物品以外の伝票またはラベルにバーコードが付されている場合も同様である。   In addition, although this 1st Example demonstrates the case where a barcode is attached | subjected to articles | goods, it does not need to be limited to this. The same is true when a bar code is attached to a slip or label other than an article.

しかし、上記の場合には、撮像された画像から読み取った複数のバーコードを、複数のバーコードを受け取ったアプリケーション側で入れ替える必要があり、処理に時間がかかるという問題がある。   However, in the above case, it is necessary to replace a plurality of barcodes read from the captured image on the application side that has received the plurality of barcodes, and there is a problem that processing takes time.

そこで、この第1実施例では、バーコードを読み取った後のデータ整理作業を不要にし、読み取り処理にかかる時間を短縮できるようにしてある。   Therefore, in the first embodiment, the data organization work after reading the barcode is unnecessary, and the time required for the reading process can be shortened.

簡単に説明すると、複数のバーコードが付された物品を撮影し、撮影画像を用いて、各バーコードが付された位置および大きさに相当する複数の読取範囲200(図5参照)を設定する。ただし、複数の読取範囲200は、撮像装置18によって撮影された撮影画像に対して設定される。そして、複数の読取範囲200に対応して、バーコードを読み取る(復号する)順序が設定される。この第1実施例では、すべてのバーコードを復号した後に、ユーザによって設定された出力順序に従って復号されたバーコード情報がホスト装置に送信される。   Briefly, an article with a plurality of barcodes is photographed, and a plurality of reading ranges 200 (see FIG. 5) corresponding to the position and size of each barcode are set using the photographed image. To do. However, the plurality of reading ranges 200 are set for a captured image captured by the imaging device 18. Then, a barcode reading (decoding) order is set corresponding to the plurality of reading ranges 200. In the first embodiment, after decoding all the barcodes, the barcode information decoded according to the output order set by the user is transmitted to the host device.

ただし、バーコードを復号した順序(復号順序)に従って復号されたバーコード情報をホスト装置に送信するようにしてもよい。かかる場合には、出力順序に代えて、バーコードを復号する復号順序がユーザによって設定される。   However, the barcode information decoded according to the decoding order (decoding order) of the barcodes may be transmitted to the host device. In such a case, the decoding order for decoding the barcode is set by the user instead of the output order.

また、出力順序は、複数のバーコード情報を受け取るアプリケーション側でそのまま使用できるように、ユーザによって、所望の順序に設定される。これらの設定を初期設定と呼ぶことにする。   Also, the output order is set in a desired order by the user so that it can be used as it is on the application side that receives a plurality of barcode information. These settings are referred to as initial settings.

このように、複数のバーコードが付された物品を撮影した撮影画像に対して複数の読取範囲200を設定するとともに、各読取範囲200に含まれるバーコードの読取順序を設定しておけば、その後に、同種の物品の読取処理を実行する場合において、設定した読取範囲200に含まれるバーコードを、設定した読取順序に従って読み取ることにより、複数のバーコード情報を受け取るアプリケーション側での入れ替え(整理)が不要である。   In this way, if a plurality of reading ranges 200 are set for a photographed image obtained by photographing an article with a plurality of barcodes, and the reading order of the barcodes included in each reading range 200 is set, After that, when the reading process of the same kind of article is executed, the barcode included in the set reading range 200 is read according to the set reading order, so that the application side that receives a plurality of barcode information is replaced (organized). ) Is not required.

まず、複数のバーコードが付された物品を撮影した撮影画像に対して複数の読取範囲200を設定するとともに、各読取範囲200に読取順序を設定することについて説明する。ここでは、複数の読取範囲200を設定するために使用する物品を基準の物品と呼び、基準の物品に付されたバーコードを基準バーコードRBと呼ぶことにする。   First, a description will be given of setting a plurality of reading ranges 200 for a captured image obtained by photographing an article with a plurality of barcodes, and setting a reading order for each reading range 200. FIG. Here, an article used to set a plurality of reading ranges 200 is referred to as a reference article, and a barcode attached to the reference article is referred to as a reference barcode RB.

図3は読取装置10の表示装置14に表示されるメニュー画面100の一例を示す図解図である。このメニュー画面100は、電源キー16eが操作され、読取装置10の主電源がオンされると、表示装置14の表示範囲140に自動的に表示される。   FIG. 3 is an illustrative view showing an example of a menu screen 100 displayed on the display device 14 of the reading device 10. The menu screen 100 is automatically displayed in the display range 140 of the display device 14 when the power key 16e is operated and the main power supply of the reading device 10 is turned on.

図3に示すように、メニュー画面100には、初期設定ボタン102aおよび読み取りボタン102bが設けられる。初期設定ボタン102aは、初期設定の実行を指示(初期設定処理の指示)するためのボタンである。読み取りボタン102bは、バーコードの読み取りの実行を指示(読み取り処理の指示)するためのボタンである。   As shown in FIG. 3, the menu screen 100 is provided with an initial setting button 102a and a reading button 102b. The initial setting button 102a is a button for instructing execution of initial setting (instruction for initial setting processing). The reading button 102b is a button for instructing execution of barcode reading (instruction for reading processing).

初期設定ボタン102aが選択(タッチ)されると、初期設定処理が開始される。すると、CPU20は、撮像装置18を制御して、所定の被写体(複数のバーコードが付された物品)に対して撮像処理(撮影処理)を実行する。撮像装置18は、CPU20からの撮影指示を受けて、レーザ光を発光することにより、撮影範囲を視認可能に表示し、オートフォーカス処理を実行し、焦点距離が合わされると、撮像処理を実行する。したがって、上述したように、撮影画像データがRAM24に記憶されるとともに、表示装置14に撮影画像が表示される。たとえば、複数のバーコードを含む撮影画像が取得され、表示装置14に表示される。複数のバーコードが撮像されると、撮影画像を用いて、複数のバーコードの各々の読取範囲200を設定するとともに、当該読取範囲200に対応して出力順序を設定するための初期設定画面110が表示装置14に表示される。   When the initial setting button 102a is selected (touched), an initial setting process is started. Then, the CPU 20 controls the imaging device 18 to execute an imaging process (imaging process) on a predetermined subject (an article with a plurality of barcodes). The imaging device 18 receives a shooting instruction from the CPU 20, emits laser light, displays the shooting range so as to be visible, executes autofocus processing, and executes imaging processing when the focal length is adjusted. . Therefore, as described above, the captured image data is stored in the RAM 24 and the captured image is displayed on the display device 14. For example, a captured image including a plurality of barcodes is acquired and displayed on the display device 14. When a plurality of barcodes are imaged, an initial setting screen 110 for setting the reading range 200 of each of the plurality of barcodes using the captured image and setting the output order corresponding to the reading range 200. Is displayed on the display device 14.

図4は撮像装置18で撮影された撮影画像の一例を示す図解図である。ただし、図4には、一例として、モノクロの撮影画像が示されるが、撮影画像はカラーであってもよい。また、第1実施例では、四つのバーコードが付された被写体を撮影するようにしてあるが、これは単なる例示であり、限定されるべきでない。また、バーコードの他に文字等も撮影されるが、図4では省略してある。ただし、初期設定処理では、バーコードの読み取りは行わないので、2値化処理は行われなくてよい。   FIG. 4 is an illustrative view showing one example of a photographed image photographed by the imaging device 18. However, FIG. 4 shows a monochrome captured image as an example, but the captured image may be in color. In the first embodiment, a subject with four barcodes is photographed, but this is merely an example and should not be limited. In addition to the barcode, characters and the like are also photographed, but are omitted in FIG. However, since the barcode is not read in the initial setting process, the binarization process may not be performed.

図4に示すように、初期設定画面110として、撮像装置18で撮影された撮影画像が表示される。第1実施例では、撮影画像には、四つの基準バーコードRB1〜RB4が含まれる。この基準バーコードRB1〜RB4の各々に対応して、読取範囲200が設定される。つまり、四つの読取範囲200が設定される。以下、基準バーコードRB1〜RB4のそれぞれを識別する必要が無い場合には、単に「基準バーコードRB」ということがある。   As shown in FIG. 4, a photographed image photographed by the imaging device 18 is displayed as the initial setting screen 110. In the first embodiment, the captured image includes four reference barcodes RB1 to RB4. A reading range 200 is set corresponding to each of the reference bar codes RB1 to RB4. That is, four reading ranges 200 are set. Hereinafter, when it is not necessary to identify each of the reference barcodes RB1 to RB4, it may be simply referred to as “reference barcode RB”.

たとえば、ユーザが基準バーコードRB1〜RB4の各々を囲む矩形の枠(四角枠)を指定する。一例として、ユーザが基準バーコードRBを囲む(含む)四角枠(読取範囲200)の左上の頂点に相当する位置をタッチ(指定)し、続いて、四角枠の右下の頂点に相当する位置をタッチする。このような指定操作が基準バーコードRB1〜RB4の各々について行われる。   For example, the user designates a rectangular frame (square frame) surrounding each of the reference barcodes RB1 to RB4. As an example, the user touches (specifies) a position corresponding to the upper left vertex of the square frame (reading range 200) surrounding (including) the reference barcode RB, and then the position corresponding to the lower right vertex of the square frame. Touch. Such a designation operation is performed for each of the reference barcodes RB1 to RB4.

ただし、これは一例であり、限定される必要はない。上述したように、撮影画像に2値化処理を施し、2値化画像から基準バーコードRB1〜RB4を自動で認識して、基準バーコードRB1〜RB4の各々を囲む(含む)四角枠(読取範囲200)を自動で設定するようにしてもよい。   However, this is merely an example and need not be limited. As described above, a binarization process is performed on the captured image, the reference barcodes RB1 to RB4 are automatically recognized from the binarized image, and a square frame (read) surrounding (including) each of the reference barcodes RB1 to RB4. The range 200) may be set automatically.

また、読取範囲200は、右上の頂点と左下の頂点を指定することにより、その位置および大きさを設定されてもよい。   Further, the reading range 200 may be set in position and size by designating an upper right vertex and a lower left vertex.

図5は基準バーコードRBおよび基準バーコードRBに対応して設定された読取範囲200を示す図解図である。読取範囲200は、矩形形状に形成され、上述したように、対応する基準バーコードRBの全体を含むように設定される。このため、読取範囲200は、対応する基準バーコードRBと同じ大きさか、基準バーコードRBよりも少し大きく設定される。図5では、読取範囲200を点線の四角枠で示してあるが、これは一例であり、限定されるべきではない。また、たとえば、読取範囲200は、撮影画像の前面に重ねて(重畳して)表示される。   FIG. 5 is an illustrative view showing a reference bar code RB and a reading range 200 set corresponding to the reference bar code RB. The reading range 200 is formed in a rectangular shape, and is set to include the entire corresponding reference bar code RB as described above. Therefore, the reading range 200 is set to be the same size as the corresponding reference barcode RB or slightly larger than the reference barcode RB. In FIG. 5, the reading range 200 is indicated by a dotted square frame, but this is an example and should not be limited. Further, for example, the reading range 200 is displayed superimposed (superimposed) on the front surface of the captured image.

なお、図示は省略するが、読取範囲200は、他の読取範囲200の一部と重なる場合もある。ただし、一つの読取範囲200は、一つの基準バーコードRBに対応する。   Although not shown, the reading range 200 may overlap with a part of another reading range 200. However, one reading range 200 corresponds to one reference barcode RB.

図5に示す例では、基準バーコードRB1に対応して読取範囲200Aが設定され、基準バーコードRB2に対応して読取範囲200Bが設定され、基準バーコードRB3に対応して読取範囲200Cが設定され、そして、基準バーコードRB4に対応して読取範囲200Dが設定される。以下、読取範囲200A〜200Dを個別に識別する必要が無い場合には、単に「読取範囲200」ということにする。   In the example shown in FIG. 5, the reading range 200A is set corresponding to the reference barcode RB1, the reading range 200B is set corresponding to the reference barcode RB2, and the reading range 200C is set corresponding to the reference barcode RB3. Then, the reading range 200D is set corresponding to the reference barcode RB4. Hereinafter, when there is no need to individually identify the reading ranges 200 </ b> A to 200 </ b> D, they are simply referred to as “reading range 200”.

また、図5に示すように、読取範囲200の左上の頂点および右下の頂点に記載した点は、上記のように、読取範囲200を指定する際に、ユーザがタッチ(指定)した点である。この第1実施例では、左上の頂点および右下の頂点によって、読取範囲200の位置および大きさが規定される。   Further, as shown in FIG. 5, the points described at the upper left vertex and the lower right vertex of the reading range 200 are points touched (specified) by the user when the reading range 200 is specified as described above. is there. In the first embodiment, the position and size of the reading range 200 are defined by the upper left vertex and the lower right vertex.

各読取範囲200の位置および大きさは、撮影画像に対応して設定される。ただし、この第1実施例では、表示装置14の表示範囲140の大きさと撮影画像の大きさは同じものとする。たとえば、縦長の撮影画像に対して、横方向をX軸とし、縦方向をY軸とする2次元座標系が設定される。また、たとえば、撮影画像の左上の頂点が2次元座標系の原点O(0,0)に設定される。また、撮影画像の横方向がX軸方向であり、縦方向がY軸方向である。さらに、原点から右向きがX軸のプラス方向であり、原点から下向きがY軸のプラス方向である。このような2次元座標系において、各読取範囲200の位置および大きさが特定される。ただし、座標のX成分およびY成分は撮影画像の画素数で表現される。   The position and size of each reading range 200 are set corresponding to the captured image. However, in the first embodiment, the size of the display range 140 of the display device 14 and the size of the captured image are the same. For example, for a vertically long captured image, a two-dimensional coordinate system is set in which the horizontal direction is the X axis and the vertical direction is the Y axis. Further, for example, the upper left vertex of the captured image is set to the origin O (0, 0) of the two-dimensional coordinate system. Further, the horizontal direction of the captured image is the X-axis direction, and the vertical direction is the Y-axis direction. Furthermore, the right direction from the origin is the plus direction of the X axis, and the downward direction from the origin is the plus direction of the Y axis. In such a two-dimensional coordinate system, the position and size of each reading range 200 are specified. However, the X component and Y component of the coordinates are expressed by the number of pixels of the captured image.

したがって、図5に示す例では、読取範囲200Aの左上の頂点の座標は(50,100)であり、右下の頂点の座標は(300,250)である。また、読取範囲200Bの左上の頂点の座標は(350,100)であり、右下の頂点の座標は(800,250)である。さらに、読取範囲200Cの左上の頂点の座標は(150,300)であり、右下の頂点の座標は(700,550)である。そして、読取範囲200Dの左上の頂点の座標は(350,550)であり、右下の頂点の座標は(800,750)である。   Therefore, in the example shown in FIG. 5, the coordinates of the upper left vertex of the reading range 200A are (50, 100), and the coordinates of the lower right vertex are (300, 250). Further, the coordinates of the upper left vertex of the reading range 200B are (350, 100), and the coordinates of the lower right vertex are (800, 250). Further, the coordinates of the upper left vertex of the reading range 200C are (150, 300), and the coordinates of the lower right vertex are (700, 550). The coordinates of the upper left vertex of the reading range 200D are (350, 550), and the coordinates of the lower right vertex are (800, 750).

なお、図5では、説明の都合上、読取範囲200A〜Dの左上の頂点および右下の頂点を図示するとともに、各頂点の近傍に各点の座標を表示してあるが、実際にはこれらは初期設定画面110には表示されない。   In FIG. 5, for convenience of explanation, the upper left vertex and the lower right vertex of the reading ranges 200A to 200D are illustrated, and the coordinates of each point are displayed in the vicinity of each vertex. Is not displayed on the initial setting screen 110.

このようにして、四つの基準バーコードRB1〜RB4の各々について、読取範囲200A〜200Dが設定される。たとえば、ユーザは、読取範囲200の設定を終了(完了)すると、OKキー16bを操作する。続いて、各読取範囲200に対応して出力順序がユーザによって設定される。   In this way, the reading ranges 200A to 200D are set for each of the four reference barcodes RB1 to RB4. For example, when the setting of the reading range 200 is completed (completed), the user operates the OK key 16b. Subsequently, the output order is set by the user corresponding to each reading range 200.

図6は撮影画像の基準バーコードRBに対応して設定された読取範囲200を示す図解図である。たとえば、複数の基準バーコードRBに対応して読取範囲200が設定されると、各読取範囲200にラベル(識別情報)が付される。   FIG. 6 is an illustrative view showing a reading range 200 set corresponding to the reference bar code RB of the photographed image. For example, when the reading range 200 is set corresponding to a plurality of reference barcodes RB, a label (identification information) is attached to each reading range 200.

なお、図6の初期設定画面110においては、撮影画像が非表示(消去)され、読取範囲200のみが表示されるが、撮影画像は表示されていてもよい。また、図6に示す例では、読取範囲200AにラベルAが付され、読取範囲200BにラベルBが付され、読取範囲200CにラベルCが付され、そして、読取範囲200DにラベルDが付される。ただし、ラベルA〜Dは内部処理で使用されるだけであり、実際には初期設定画面110には表示されない。   In the initial setting screen 110 in FIG. 6, the captured image is not displayed (erased) and only the reading range 200 is displayed, but the captured image may be displayed. In the example shown in FIG. 6, label A is attached to the reading range 200A, label B is attached to the reading range 200B, label C is attached to the reading range 200C, and label D is attached to the reading range 200D. The However, labels A to D are only used in internal processing and are not actually displayed on the initial setting screen 110.

図6に示す初期設定画面110において、ユーザが読取範囲200A〜200Dを所望の順序で選択することによって、ユーザが選択した順序で読取範囲200A〜200Dに対して出力順序が設定される。   In the initial setting screen 110 shown in FIG. 6, when the user selects the reading ranges 200A to 200D in a desired order, the output order is set for the reading ranges 200A to 200D in the order selected by the user.

図7は読取範囲200の位置および範囲と、読取範囲200に対応する出力順序を記載した読取範囲テーブルの一例を示す図解図である。読取範囲200および読取範囲200に対応する出力順序が設定されると、図7に示すような読取範囲テーブルが生成される。図7に示す読取範囲テーブルでは、ラベルに対応して、座標X1、座標Y1、座標X2、座標Y2および出力順序が記述される。   FIG. 7 is an illustrative view showing one example of a reading range table in which the position and range of the reading range 200 and the output order corresponding to the reading range 200 are described. When the reading range 200 and the output order corresponding to the reading range 200 are set, a reading range table as shown in FIG. 7 is generated. In the reading range table shown in FIG. 7, the coordinates X1, the coordinates Y1, the coordinates X2, the coordinates Y2, and the output order are described corresponding to the labels.

ラベルは、各読取範囲200に付されたラベル(識別情報)であり、上述したように、アルファベット(A〜D)が記述される。ただし、ラベルは、数字または数字とアルファベットの組み合わせでもよいし、読取範囲テーブルは内部処理で生成および使用されるだけであるため、人間が解読できない記号でもよい。   The label is a label (identification information) attached to each reading range 200, and alphabets (A to D) are described as described above. However, the label may be a number or a combination of a number and an alphabet, and the reading range table may be a symbol that cannot be deciphered by humans because it is only generated and used by internal processing.

座標X1、座標Y1、座標X2および座標Y2は、基準バーコードRBに設定された読取範囲200の位置および大きさを規定するための情報である。具体的には、座標X1および座標Y1が読取範囲200の左上の頂点の2次元座標であり、座標X2および座標Y2が読取範囲200の右下の頂点の2次元座標である。   The coordinates X1, coordinates Y1, coordinates X2, and coordinates Y2 are information for defining the position and size of the reading range 200 set in the reference barcode RB. Specifically, the coordinate X1 and the coordinate Y1 are the two-dimensional coordinates of the upper left vertex of the reading range 200, and the coordinate X2 and the coordinate Y2 are the two-dimensional coordinates of the lower right vertex of the reading range 200.

出力順序は、読取範囲200に対して設定された出力順序であり、出力順序に対応する数字が記述される。したがって、図7に示す読取範囲テーブルの例では、読取範囲200B、読取範囲200D、読取範囲200Aおよび読取範囲200Cの順で、各読取範囲200に含まれるバーコードが読み取られた(復号された)バーコード情報が、ホスト装置に出力(送信)される。ただし、復号処理を実行する順番は任意でよい。   The output order is an output order set for the reading range 200, and a number corresponding to the output order is described. Accordingly, in the example of the reading range table shown in FIG. 7, the barcodes included in each reading range 200 are read (decoded) in the order of the reading range 200B, the reading range 200D, the reading range 200A, and the reading range 200C. Bar code information is output (transmitted) to the host device. However, the order of executing the decoding process may be arbitrary.

このように、読取範囲200および当該読取範囲200に対応する出力順序が設定され、図7に示すような読取範囲テーブルが生成されると、初期設定が完了する。初期設定が完了すると、表示装置14には、図3に示したメニュー画面100が表示される。   Thus, when the reading range 200 and the output order corresponding to the reading range 200 are set and the reading range table as shown in FIG. 7 is generated, the initial setting is completed. When the initial setting is completed, the menu screen 100 shown in FIG.

なお、読取装置10が初めて起動される場合には、自動的に初期設定が開始されてもよい。また、種類の異なる物品のバーコードを読み取り場合には、種類の異なる物品について上記の初期設定が実行され、新たに読取範囲テーブルが生成される。ただし、種類の異なる物品毎に読取範囲テーブルを生成しておき、必要に応じて読取範囲テーブルを使い分けるようにしてもよい。この実施例では、「種類の異なる物品」とは、付されるバーコードの数、位置および範囲のいずれか1つが異なる物品であることを意味する。したがって、「種類の同じ物品(同種の物品)」とは、付されるバーコードの数、位置および範囲が同じ物品であることを意味する。   When the reading device 10 is activated for the first time, the initial setting may be automatically started. When reading bar codes of different types of articles, the above initial setting is executed for different types of articles, and a new reading range table is generated. However, a reading range table may be generated for each article of a different type, and the reading range table may be properly used as necessary. In this embodiment, “a different kind of article” means that any one of the number, position, and range of barcodes attached is different. Therefore, “the same kind of article (the same kind of article)” means that the number, position, and range of barcodes to be attached are the same.

初期設定が行われた後に、メニュー画面100で読み取りボタン102bが選択されるか、またはスキャンキー16aが操作されると、CPU20は、初期設定で生成した読取範囲テーブルを参照し、バーコードの読み取り処理を実行する。バーコードの読み取り処理が実行されると、CPU20は、撮像装置18を制御して、撮像処理を実行する。ただし、第1実施例では、バーコードの読み取り処理において撮像される被写体は、初期設定に用いられた物品と同種の物品である。このため、バーコードの読み取り処理において撮像される物品に付されたバーコードの数は、初期設定に用いられた基準の物品に付された基準バーコードRBの数と同じである。また、コードの読み取り処理において撮像される物品に付された複数のバーコードの位置および大きさは、複数の基準バーコードRBの位置および大きさと同じである。   After the initial setting, when the reading button 102b is selected on the menu screen 100 or the scan key 16a is operated, the CPU 20 refers to the reading range table generated by the initial setting and reads the barcode. Execute the process. When the barcode reading process is executed, the CPU 20 controls the imaging device 18 to execute the imaging process. However, in the first embodiment, the subject imaged in the barcode reading process is the same type of article as the article used for the initial setting. For this reason, the number of barcodes attached to the article to be imaged in the barcode reading process is the same as the number of reference barcodes RB attached to the reference article used for the initial setting. Further, the positions and sizes of the plurality of barcodes attached to the article to be imaged in the code reading process are the same as the positions and sizes of the plurality of reference barcodes RB.

したがって、バーコードの読み取り処理では、上述したように、撮像処理が実行され、複数のバーコードを含む撮影画像が取得される。この撮影画像に対応する撮影画像データに2値化処理が施され、2値画像が生成される。2値画像が生成されると、CPU20は、2値画像から、初期設定で生成された読取範囲テーブルを参照して、読取範囲200毎に画像を抽出する。ただし、初期設定時の基準の画像と同様に、2値画像に2次元座標系が設定され、2値画像から読取範囲200毎に当該読取範囲200内の画像が抽出される。次に、CPU20は、抽出した画像(抽出画像)から2値画像からバーコードを抽出(検出)し、抽出したバーコードを復号する。ただし、抽出画像は、読取範囲200(読取範囲200のラベル)に紐づけられて管理され、読取範囲テーブルに記入された出力順序に従って、復号されたバーコード情報(復号結果)は出力される。   Therefore, in the barcode reading process, as described above, the imaging process is executed, and a captured image including a plurality of barcodes is acquired. A binarization process is performed on the captured image data corresponding to the captured image to generate a binary image. When the binary image is generated, the CPU 20 extracts an image for each reading range 200 from the binary image with reference to the reading range table generated by the initial setting. However, similarly to the reference image at the time of initial setting, a two-dimensional coordinate system is set for the binary image, and an image in the reading range 200 is extracted for each reading range 200 from the binary image. Next, the CPU 20 extracts (detects) a barcode from the binary image from the extracted image (extracted image), and decodes the extracted barcode. However, the extracted image is managed in association with the reading range 200 (label of the reading range 200), and the decoded barcode information (decoding result) is output according to the output order entered in the reading range table.

図8は図2に示したRAM24のメモリマップ70の一例を示す図解図である。図8に示すように、RAM24は、プログラム記憶領域72およびデータ記憶領域74を含む。プログラム記憶領域72には、バーコード(符号)の読取プログラムを含む制御プログラムを記憶し、この制御プログラムは、メイン処理プログラム72a、画像表示プログラム72b、操作検出プログラム72c、撮像処理プログラム72d、読取範囲設定プログラム72e、出力順序設定プログラム72f、符号検出プログラム72gおよび復号プログラム72hなどを含む。   FIG. 8 is an illustrative view showing one example of a memory map 70 of the RAM 24 shown in FIG. As shown in FIG. 8, the RAM 24 includes a program storage area 72 and a data storage area 74. The program storage area 72 stores a control program including a barcode (code) reading program. The control program includes a main processing program 72a, an image display program 72b, an operation detection program 72c, an imaging processing program 72d, and a reading range. A setting program 72e, an output order setting program 72f, a code detection program 72g, a decoding program 72h, and the like are included.

メイン処理プログラム72aは、読取装置10のメインルーチンを処理するためのプログラムである。画像表示プログラム72bは、表示装置14に表示する各種の表示画像に対応する表示画像データを生成および出力するためのプログラムである。また、画像表示プログラム72bは、撮影画像に対応する撮影画像データを表示装置14に出力するためのプログラムでもある。   The main processing program 72 a is a program for processing the main routine of the reading device 10. The image display program 72b is a program for generating and outputting display image data corresponding to various display images displayed on the display device 14. The image display program 72b is also a program for outputting captured image data corresponding to a captured image to the display device 14.

操作検出プログラム72cは、入力装置16(キー16a〜16f)から入力される操作データを検出し、検出した操作データを操作データバッファ74aに記憶するためのプログラムである。また、操作検出プログラム72cは、タッチパネルから入力される座標データを検出し、検出した座標データを操作データバッファ74aに記憶するためのプログラムでもある。   The operation detection program 72c is a program for detecting operation data input from the input device 16 (keys 16a to 16f) and storing the detected operation data in the operation data buffer 74a. The operation detection program 72c is also a program for detecting coordinate data input from the touch panel and storing the detected coordinate data in the operation data buffer 74a.

撮像処理プログラム72dは、初期設定処理または読み取り処理が実行されたときに、撮像装置18を制御して、被写体を撮像するためのプログラムである。また、撮像処理プログラム72dは、撮影画像から2値画像を生成するためのプログラムでもある。   The imaging processing program 72d is a program for controlling the imaging device 18 and imaging a subject when an initial setting process or a reading process is executed. The imaging processing program 72d is also a program for generating a binary image from the captured image.

読取範囲設定プログラム72eは、撮像処理プログラム72dに従って撮像された撮影画像において、ユーザの指示に従って、複数の読取範囲200の位置および大きさを設定するプログラムである。   The reading range setting program 72e is a program that sets the positions and sizes of the plurality of reading ranges 200 in accordance with a user instruction in a captured image captured according to the imaging processing program 72d.

出力順序設定プログラム72fは、ユーザの指示に従って、読取範囲設定プログラム72eで設定された複数の読取範囲200の出力順序を設定するためのプログラムである。   The output order setting program 72f is a program for setting the output order of the plurality of reading ranges 200 set by the reading range setting program 72e in accordance with a user instruction.

初期設定において、読取範囲設定プログラム72eおよび出力順序設定プログラム72fが実行されることにより、図7に示した読取範囲テーブルが生成され、生成された読取範囲テーブルに対応するデータ(読取範囲テーブルデータ74e)がデータ記憶領域74に記憶(上書き)される。   In the initial setting, the reading range setting program 72e and the output order setting program 72f are executed to generate the reading range table shown in FIG. 7, and data corresponding to the generated reading range table (reading range table data 74e). ) Is stored (overwritten) in the data storage area 74.

符号検出プログラム72gは、2値画像から、読取範囲設定プログラム72eによって設定された読取範囲200に含まれる画像を抽出し、抽出画像からバーコードを検出するためのプログラムである。   The code detection program 72g is a program for extracting an image included in the reading range 200 set by the reading range setting program 72e from the binary image and detecting a barcode from the extracted image.

復号プログラム72hは、読取範囲200毎に検出されたバーコードを読み取ってバーコード情報に復号し、出力順序設定プログラム72fに従って設定された出力順序に従って、復号したバーコード情報をホスト装置に出力するためのプログラムである。   The decoding program 72h reads the barcode detected for each reading range 200, decodes it into barcode information, and outputs the decoded barcode information to the host device according to the output order set according to the output order setting program 72f. It is a program.

図示は省略するが、プログラム記憶領域72には、読取装置10の制御に必要な他のプログラムも記憶される。   Although not shown, the program storage area 72 also stores other programs necessary for controlling the reading device 10.

データ記憶領域74には、操作データバッファ74a、画像生成データ74b、撮影画像データ74c、2値画像データ74dおよび読取範囲テーブルデータ74eが記憶される。   The data storage area 74 stores operation data buffer 74a, image generation data 74b, captured image data 74c, binary image data 74d, and reading range table data 74e.

操作データバッファ74aは、検出された操作データを時系列に従って記憶するためのバッファである。操作データバッファ74aに記憶された操作データは、CPU20の処理に使用された後に消去される。ただし、上述したように、タッチパネルから入力された座標データが記憶される場合もある。   The operation data buffer 74a is a buffer for storing detected operation data in time series. The operation data stored in the operation data buffer 74a is deleted after being used for the processing of the CPU 20. However, as described above, coordinate data input from the touch panel may be stored.

画像生成データ74bは、表示装置14に表示する表示画像に対応する表示画像データを生成するためのポリゴンデータおよびテクスチャデータなどを含むデータである。撮影画像データ74cは、撮像装置18で撮影された撮影画像についての画像データである。2値画像データ74dは、撮影画像に2値化処理を施して生成した2値画像についての画像データである。読取範囲テーブルデータ74eは、図7に示したような読取範囲テーブルについてのデータである。   The image generation data 74b is data including polygon data and texture data for generating display image data corresponding to the display image displayed on the display device 14. The photographed image data 74c is image data regarding a photographed image photographed by the imaging device 18. The binary image data 74d is image data regarding a binary image generated by performing binarization processing on a captured image. The reading range table data 74e is data regarding the reading range table as shown in FIG.

図示は省略するが、データ記憶領域74には、読取装置10の制御に必要な他のデータが記憶され、読取装置10の制御に必要なフラグおよびカウンタ(タイマ)が設けられる。   Although illustration is omitted, the data storage area 74 stores other data necessary for controlling the reading device 10 and is provided with a flag and a counter (timer) necessary for controlling the reading device 10.

図9は図2に示すCPU20のメイン処理の一例を示すフロー図である。このメイン処理は、読取装置10が起動された場合に開始される。CPU20は、メイン処理を開始すると、ステップS1で、設定情報が存在するかどうかを判断する。第1実施例では、設定情報は初期設定において生成された読取範囲テーブルを意味する。つまり、ステップS1では、CPU20は、読取情報(読取範囲テーブルデータ74e)がフラッシュメモリ23に保存されているかどうかが判断される。   FIG. 9 is a flowchart showing an example of main processing of the CPU 20 shown in FIG. This main process is started when the reading apparatus 10 is activated. When starting the main process, the CPU 20 determines whether or not setting information exists in step S1. In the first embodiment, the setting information means a reading range table generated in the initial setting. That is, in step S <b> 1, the CPU 20 determines whether reading information (reading range table data 74 e) is stored in the flash memory 23.

ステップS1で“NO”であれば、つまり、設定情報が存在しない場合は、後述するステップS7に進む。一方、ステップS1で“YES”であれば、つまり、設定情報が存在する場合は、ステップS3で、表示装置14にメニュー画面100を表示して、ステップS5で、初期設定が選択されたかどうかを判断する。ここでは、CPU20は、初期設定ボタン102aが選択されたかどうかを判断する。   If “NO” in the step S1, that is, if the setting information does not exist, the process proceeds to a step S7 described later. On the other hand, if “YES” in the step S1, that is, if the setting information exists, the menu screen 100 is displayed on the display device 14 in a step S3, and whether or not the initial setting is selected in the step S5. to decide. Here, the CPU 20 determines whether or not the initial setting button 102a has been selected.

ステップS5で“YES”であれば、つまり、初期設定が選択された場合は、ステップS7で、撮像処理を実行する。ここでは、CPU20は、撮像装置18に撮影指示を与える。これに応じて、撮像装置18は、撮像処理を実行し、撮影画像を取得する。取得された撮影画像に対応する撮影画像データ74dは、RAM24に記憶される。   If “YES” in the step S5, that is, if the initial setting is selected, an imaging process is executed in a step S7. Here, the CPU 20 gives a shooting instruction to the imaging device 18. In response to this, the imaging device 18 executes an imaging process and acquires a captured image. Captured image data 74d corresponding to the acquired captured image is stored in the RAM 24.

次のステップS9では、ステップS5で取得した撮影画像を表示装置14に表示し、ステップS11で、ユーザの操作に従って、または、自動で、読取範囲200を設定する。ここでは、ユーザの操作に従って、または、自動で設定された各読取範囲200の左上の頂点の座標(X1,Y1)および右下の頂点の座標(X2,Y2)が読取範囲テーブルに記述される。また、読取範囲200が設定されると、読取範囲200にはラベルが付され、読取範囲200に付されたラベルが当該読取範囲200を規定する座標に対応して読取範囲テーブルに記述される。   In the next step S9, the captured image acquired in step S5 is displayed on the display device 14, and in step S11, the reading range 200 is set in accordance with a user operation or automatically. Here, the coordinates (X1, Y1) of the upper left vertex and the coordinates (X2, Y2) of the lower right vertex of each reading range 200 set in accordance with a user operation or automatically are described in the reading range table. . When the reading range 200 is set, a label is attached to the reading range 200, and the label attached to the reading range 200 is described in the reading range table corresponding to the coordinates defining the reading range 200.

続いて、ステップS13では、読取範囲200の設定を終了したかどうかを判断する。ここでは、CPU20は、OKキー16bが操作されたかどうかを判断する。ステップS13で“NO”であれば、つまり、読取範囲200の設定を終了していなければ、ステップS11に戻る。一方、ステップS3で“YES”であれば、つまり、読取範囲200の設定を終了すれば、ステップS15で、ユーザの操作に従って、読取範囲200の出力順序を設定する。ここでは、ユーザの操作に従って設定された出力順序が各バーコードのラベルに対応して読取範囲テーブルに記述される。   Subsequently, in step S13, it is determined whether or not the setting of the reading range 200 has been completed. Here, the CPU 20 determines whether or not the OK key 16b has been operated. If “NO” in the step S13, that is, if the setting of the reading range 200 is not ended, the process returns to the step S11. On the other hand, if “YES” in the step S3, that is, if the setting of the reading range 200 is ended, the output order of the reading range 200 is set in step S15 according to the user's operation. Here, the output order set in accordance with the user's operation is described in the reading range table corresponding to each barcode label.

そして、ステップS17では、出力順序の設定を終了したかどうかを判断する。ここでは、CPU20は、読取範囲テーブルにおいて、各基準バーコードRBのラベルに対応して各読取範囲200の出力順序が記述されたかどうかを判断する。ステップS17で“NO”であれば、つまり、出力順序の設定を終了していなければ、ステップS15に戻る。一方、ステップS17で“YES”であれば、つまり、出力順序の設定を終了すれば、読取範囲テーブルが生成され、ステップS19で、設定情報を記憶して、ステップS3に戻る。つまり、ステップS19では、CPU20は、読取範囲テーブルデータ74eをフラッシュメモリ23に記憶する。   In step S17, it is determined whether the setting of the output order has been completed. Here, the CPU 20 determines whether or not the output order of each reading range 200 is described corresponding to the label of each reference barcode RB in the reading range table. If “NO” in the step S17, that is, if the setting of the output order is not ended, the process returns to the step S15. On the other hand, if “YES” in the step S17, that is, if the setting of the output order is finished, a reading range table is generated, the setting information is stored in a step S19, and the process returns to the step S3. That is, in step S19, the CPU 20 stores the reading range table data 74e in the flash memory 23.

また、ステップS3で“NO”であれば、つまり、初期設定が選択されない場合は、ステップS21で、読み取りが選択されたかどうかを判断する。ここでは、CPU20は、読み取りボタン102bが選択されたかどうか、またはスキャンキー16aが操作されたかどうかを判断する。   If “NO” in the step S3, that is, if the initial setting is not selected, it is determined whether or not reading is selected in a step S21. Here, the CPU 20 determines whether the reading button 102b has been selected or whether the scan key 16a has been operated.

ステップS21で“NO”であれば、つまり、読み取りが選択されない場合は、ステップS3に戻る。一方、ステップS21で“YES”であれば、つまり、読み取りが選択された場合は、ステップS23で、バーコードの読み取り処理を実行して、ステップS3に戻る。   If “NO” in the step S21, that is, if reading is not selected, the process returns to the step S3. On the other hand, if “YES” in the step S21, that is, if reading is selected, a barcode reading process is executed in a step S23, and the process returns to the step S3.

図10は図9に示したステップS23の読み取り処理の一例を示すフロー図である。図10に示すように、CPU20は、読み取り処理を開始すると、ステップS31で、設定情報を読み出す。つまり、CPU20は、フラッシュメモリ23から設定情報(読取範囲テーブルデータ74e)を読み出して、RAM24に記憶する。次のステップS33では、撮像処理を実行する。ここでは、CPU20は、撮像装置18に撮影指示を与える。これに応じて、撮像装置18は、上述したように、撮像処理を実行する。   FIG. 10 is a flowchart showing an example of the reading process in step S23 shown in FIG. As shown in FIG. 10, when starting the reading process, the CPU 20 reads the setting information in step S31. That is, the CPU 20 reads the setting information (reading range table data 74e) from the flash memory 23 and stores it in the RAM 24. In the next step S33, an imaging process is executed. Here, the CPU 20 gives a shooting instruction to the imaging device 18. In response to this, the imaging device 18 executes the imaging process as described above.

続くステップS35では、撮影画像を、2値画像に変換する。ここでは、CPU20は、撮像装置18に2値化処理を実行させる指示を与える。撮像装置18は、撮像した撮影画像から2値画像を生成する。生成された2値画像に対応する2値画像データ74dは、RAM24に記憶される。   In subsequent step S35, the captured image is converted into a binary image. Here, the CPU 20 gives an instruction to cause the imaging device 18 to execute binarization processing. The imaging device 18 generates a binary image from the captured image. The binary image data 74d corresponding to the generated binary image is stored in the RAM 24.

続くステップS37では、読取範囲200の画像を抽出し、ステップS39で、抽出画像に対して復号処理を行う。ただし、ステップS39の復号処理は、読取範囲200毎に行われる。   In subsequent step S37, an image of the reading range 200 is extracted, and in step S39, decoding processing is performed on the extracted image. However, the decoding process in step S39 is performed for each reading range 200.

続いて、ステップS41では、次の読取範囲200があるかどうかを判断する。ここでは、復号処理が施されていない読取範囲200の抽出画像(バーコード)があるかどうかを判断する。   Subsequently, in step S41, it is determined whether or not there is a next reading range 200. Here, it is determined whether there is an extracted image (barcode) of the reading range 200 that has not been subjected to decoding processing.

ステップS41で“YES”であれば、つまり、次の読取範囲200がある場合は、ステップS39に戻る。一方、ステップS41で“NO”であれば、つまり、全ての読取範囲200の抽出画像(バーコード)の復号処理を完了した場合は、読取範囲テーブルに記述された出力順序に従って、バーコード情報をホスト装置に出力し、メイン処理に戻る。   If “YES” in the step S41, that is, if there is a next reading range 200, the process returns to the step S39. On the other hand, if “NO” in the step S41, that is, if the decoding processing of the extracted images (barcodes) of all the reading ranges 200 is completed, the barcode information is displayed according to the output order described in the reading range table. Output to the host device and return to the main process.

第1実施例によれば、基準の物品に付された複数の基準バーコードRBの各々に対応して読取範囲200を予め設定するとともに、各読取範囲200に出力順序を予め設定しておくことにより、基準の物品と同様に複数のバーコードが付された同種の物品の撮影画像からバーコードを復号する(読み取る)場合に、設定された読取範囲200に含まれる抽出画像から検出したバーコードを復号し、出力順序に従って復号したバーコード情報をホスト装置に出力するので、バーコードを読み取った後のデータ整理作業を不要にし、読み取り処理にかかる時間を短縮できる。たとえば、基準の物品と同様に複数のバーコードが付された同種の物品についてバーコードの読取処理を繰り返し実行する場合には、全ての物品についてのバーコードの読取処理を実行するための時間を非常に短縮することができる。   According to the first embodiment, the reading range 200 is set in advance corresponding to each of the plurality of reference bar codes RB attached to the reference article, and the output order is set in advance in each reading range 200. Thus, the barcode detected from the extracted image included in the set reading range 200 when the barcode is decoded (read) from the photographed image of the same kind of article with a plurality of barcodes attached as in the reference article Since the decoded barcode information is output to the host device in accordance with the output order, it is not necessary to organize the data after the barcode is read, and the time required for the reading process can be shortened. For example, in the case where the barcode reading process is repeatedly executed for the same type of article having a plurality of barcodes as in the case of the reference article, the time for executing the barcode reading process for all the articles is set. Can be shortened very much.

なお、この第1実施例では、撮影画像の左上の頂点を原点Oに設定し、各読取範囲200の左上の頂点および右下の頂点の座標を決定したが、これに限定される必要はない。たとえば、読取装置10は手持ち型であり、毎回同じ撮影画像を取得するのは困難であるため、いずれか1つの読取範囲200のうちのいずれか1つの頂点を原点に設定し、各読取範囲の左上の頂点および右下の頂点の座標を決定するようにしてもよい。ただし、かかる場合には、撮影画像において、バーコードの位置を検出し、原点を設定した読取範囲200に対応するバーコードを特定して、各読取範囲200と各バーコードの位置を合わせる必要がある。
[第2実施例]
第2実施例の読取装置10は、被写体(物品)に付された(撮影画像に含まれる)複数のバーコードの各々が、設定された読取範囲200の範囲内に位置する場合に、バーコード情報を出力するようにした以外は、第1実施例の読取装置10と同じであるため、重複する説明は省略または簡略化する。また、上述の第1実施例と共通する部分については、同じ参照番号を用いて説明することにする。
In the first embodiment, the upper left vertex of the captured image is set as the origin O, and the coordinates of the upper left vertex and the lower right vertex of each reading range 200 are determined. However, the present invention is not limited to this. . For example, since the reading device 10 is hand-held and it is difficult to acquire the same captured image every time, any one vertex of any one reading range 200 is set as the origin, and each reading range The coordinates of the upper left vertex and the lower right vertex may be determined. However, in such a case, it is necessary to detect the position of the barcode in the photographed image, identify the barcode corresponding to the reading range 200 in which the origin is set, and match the position of each reading range 200 with each barcode. is there.
[Second Embodiment]
The reading device 10 according to the second embodiment is configured so that each of a plurality of barcodes (included in a captured image) attached to a subject (article) is located within a set reading range 200. Since it is the same as the reading device 10 of the first embodiment except that information is output, the overlapping description is omitted or simplified. Further, parts common to the first embodiment described above will be described using the same reference numerals.

つまり、第1実施例では、読取処理を実行する物品に付されたバーコードの位置および範囲が、基準の物品に付された基準バーコードRBの位置および範囲と同じであることを前提としたが、読取処理を実行する物品に付されたバーコードの位置および範囲が、基準バーコードRBの位置および範囲と異なる場合もある。したがって、第2実施例では、このような場合も考慮してある。   In other words, in the first embodiment, it is assumed that the position and range of the barcode attached to the article to be read are the same as the position and range of the reference barcode RB attached to the reference article. However, the position and range of the barcode attached to the article for which the reading process is executed may be different from the position and range of the reference barcode RB. Therefore, in the second embodiment, such a case is also taken into consideration.

図11(A)は、撮影画像に含まれるバーコードが設定された読取範囲200の範囲内に位置する場合を示す図解図であり、図11(B)は、撮影画像に含まれるバーコードが設定された読取範囲200の範囲内に位置しない場合を示す図解図である。   FIG. 11A is an illustrative view showing a case where the barcode included in the photographed image is located within the set reading range 200, and FIG. 11B shows the barcode included in the photographed image. FIG. 10 is an illustrative view showing a case where the reading position is not within a set reading range 200.

図11(A)に示すように、撮影画像におけるバーコードの各々が、設定された読取範囲200の範囲内に位置する場合には、読み取り処理が実行されると、第1実施例で説明したように、各読取範囲200に対応する抽出画像からバーコードが検出され、検出されたバーコードが復号される。そして、設定された読取範囲200の出力順序に従って復号されたバーコード情報が出力される。   As shown in FIG. 11A, when each barcode in the photographed image is located within the set reading range 200, the reading process is executed, as described in the first embodiment. As described above, the barcode is detected from the extracted image corresponding to each reading range 200, and the detected barcode is decoded. Then, the barcode information decoded according to the set output order of the reading range 200 is output.

一方、図11(B)に示すように、撮影画像におけるバーコードの各々が、設定された読取範囲200の範囲内に位置しない場合には、バーコードの一部が読取範囲200からはみ出したり、バーコードが読取範囲200に含まれない位置に存在したりするため、読取範囲200に対応する抽出画像にバーコードの一部または全部が含まれない。したがって、バーコードが、設定された読取範囲200の範囲内に位置しない場合には、復号処理が実行されても、バーコードの復号に失敗する(成功しない)。   On the other hand, as shown in FIG. 11B, when each of the barcodes in the photographed image is not located within the set reading range 200, a part of the barcode protrudes from the reading range 200, Since the barcode is present at a position not included in the reading range 200, a part or all of the barcode is not included in the extracted image corresponding to the reading range 200. Therefore, when the barcode is not located within the set reading range 200, the barcode decoding fails (not succeeded) even if the decoding process is executed.

ただし、バーコードの復号に失敗した場合、予め設定された所定の時間(読取時間)が経過するまでは、撮像処理が繰り返し実行される。第2実施例の読取装置10には、読み取り処理が開始された時から経過時間(読取時間)をカウントするためのタイマが設けられる。図示は省略するが、このタイマは、読取装置10の内部(CPU20またはRAM24)に設けられる。また、第2実施例では、初期設定において、読取時間がユーザによって指定(設定)される。この読取時間は、設定情報に含まれる。   However, when the decoding of the barcode fails, the imaging process is repeatedly executed until a predetermined time (reading time) set in advance has elapsed. The reading apparatus 10 of the second embodiment is provided with a timer for counting elapsed time (reading time) from the time when the reading process is started. Although not shown, this timer is provided inside the reading apparatus 10 (CPU 20 or RAM 24). In the second embodiment, the reading time is designated (set) by the user in the initial setting. This reading time is included in the setting information.

このように読取時間を設定するのは、被写体に付された(撮影画像に含まれる)複数のバーコードが、設定された複数の読取範囲200に対応する位置に存在する場合であっても、撮像処理が行われるタイミングによって撮影画像におけるバーコードの位置が設定された読取範囲200からずれる可能性があるからである。このため、読取時間が経過するまで、撮像処理を繰り返し実行し、撮影画像におけるバーコードの位置が設定された読取範囲200の位置に一致されるようにしてある。   The reading time is set in this way even when a plurality of barcodes (included in the captured image) attached to the subject are present at positions corresponding to the plurality of set reading ranges 200. This is because the barcode position in the captured image may deviate from the set reading range 200 depending on the timing at which the imaging process is performed. For this reason, the imaging process is repeatedly executed until the reading time elapses so that the position of the barcode in the photographed image matches the position of the set reading range 200.

バーコードの復号に成功しない状態で読取時間が経過した場合には、エラーが報知される。図示は省略するが、たとえばバーコードの読み取り処理に失敗した旨および正しい物品のバーコードを読み取っているか確認するべき旨のエラーメッセージが表示装置14に表示される。また、エラーメッセージの表示に代えて、または、エラーメッセージの表示とともに、エラーを報知する音(メロディ)または音声が出力されてもよい。   If the reading time elapses without successfully decoding the barcode, an error is notified. Although illustration is omitted, for example, an error message indicating that the barcode reading process has failed and that it should be confirmed whether the barcode of the correct article is being read is displayed on the display device 14. Further, instead of displaying the error message, or together with the display of the error message, a sound (melody) or sound for informing the error may be output.

図示は省略するが、第2実施例では、メイン処理において、CPU20は、読取範囲テーブルを生成するのみならず、読取時間も設定する。そして、設定情報として、読取範囲テーブルと読取時間をフラッシュメモリ23に記憶する。   Although illustration is omitted, in the second embodiment, in the main process, the CPU 20 not only generates the reading range table but also sets the reading time. Then, the reading range table and the reading time are stored in the flash memory 23 as setting information.

図12は、第2実施例における読み取り処理の一例を示すフロー図である。以下、図12に示す読み取り処理について説明するが、第1実施例で説明した処理と同じ処理については、説明を省略する、または、簡単に説明することとする。   FIG. 12 is a flowchart showing an example of the reading process in the second embodiment. In the following, the reading process shown in FIG. 12 will be described, but the description of the same process as that described in the first embodiment will be omitted or simply described.

図12に示すように、CPU20は、ステップS39で復号処理を行うと、続くステップS71で、バーコードの復号に成功したかどうかを判断する。図示は省略するが、1回目の復号処理を開始するときに、タイマのカウントが開始される。   As shown in FIG. 12, when the CPU 20 performs the decoding process in step S39, the CPU 20 determines in step S71 whether the barcode has been successfully decoded. Although illustration is omitted, the timer count starts when the first decoding process is started.

ステップS71で“YES”であれば、つまり、バーコードの復号に成功した場合は、第1実施例で説明したステップS41に進む。一方、ステップS71で“NO”であれば、つまり、バーコードの復号に失敗した場合は、ステップS73で、読取時間を経過したかどうかを判断する。ここでは、タイマのカウント値が設定情報に含まれる読取時間を超えたかどうかを判断する。   If “YES” in the step S71, that is, if the decoding of the barcode is successful, the process proceeds to the step S41 described in the first embodiment. On the other hand, if “NO” in the step S71, that is, if the decoding of the barcode has failed, it is determined whether or not the reading time has passed in a step S73. Here, it is determined whether or not the count value of the timer has exceeded the reading time included in the setting information.

ステップS73で“NO”であれば、つまり、読取時間を経過していない場合は、ステップS33に戻り、撮像処理からやり直す。一方、ステップS73で“YES”であれば、つまり、読取時間が経過した場合は、ステップS75で、エラーを報知して、メイン処理に戻る。   If “NO” in the step S73, that is, if the reading time has not elapsed, the process returns to the step S33 and starts again from the imaging process. On the other hand, if “YES” in the step S73, that is, if the reading time has elapsed, an error is notified in a step S75, and the process returns to the main process.

この第2実施例によれば、初期設定に用いられた被写体(物品)と異なる位置にバーコードが付された他の種類の物品について誤って読み取り処理を行っても、バーコード情報は出力されない。また、バーコードの復号に失敗した場合には、撮像処理をやり直すので、正しい物品についてはその位置等を変更することにより、バーコードの復号に成功する場合がある。バーコード情報が出力順序に従って出力される点は、第1実施例と同じであるため、第2実施例においても、読み取り処理の後にデータの整理作業などを行う必要が無くなり、手間がかかる作業を減らすことができる。
[第3実施例]
第3実施例は、撮影画像におけるバーコードの位置、大きさおよび向きの少なくとも1つを変化させ、変化された撮影画像からバーコードを読み取るようにした以外は、第1実施例の読取装置10と同じであるため、重複する説明は省略または簡略化する。また、上述の第1実施例と共通する部分については、同じ参照番号を用いて説明することにする。
According to the second embodiment, barcode information is not output even if another type of article with a barcode attached at a position different from the subject (article) used for the initial setting is erroneously read. . In addition, when the decoding of the barcode is unsuccessful, since the imaging process is performed again, the barcode may be successfully decoded by changing the position of the correct article. Since the bar code information is output according to the output order, it is the same as in the first embodiment. Therefore, in the second embodiment, it is not necessary to perform data organization work after the reading process. Can be reduced.
[Third embodiment]
In the third embodiment, at least one of the position, size, and orientation of the barcode in the captured image is changed, and the barcode is read from the changed captured image. Therefore, the duplicated explanation is omitted or simplified. Further, parts common to the first embodiment described above will be described using the same reference numerals.

たとえば、手持ち型の読取装置10が用いられるため、基準の物品を撮像した場合と比較して、読み取り対象の物品(バーコード)を撮像する場合の位置がずれたり、当該物品と読取装置10との距離が変化したり、当該物品に対する読取装置10(撮像装置18)の向きが異なったりすることがある。したがって、第3実施例では、上記のように、撮影画像におけるバーコードの位置、大きさおよび向きの少なくとも1つを変化させることにより、撮像時に発生する位置、大きさおよび向きの違いを吸収するようにしてある。   For example, since the hand-held reading device 10 is used, the position when the article (bar code) to be read is imaged is different from the case where the reference article is imaged. Or the orientation of the reading device 10 (imaging device 18) with respect to the article may be different. Therefore, in the third embodiment, as described above, by changing at least one of the position, size, and orientation of the barcode in the captured image, the difference in position, size, and orientation that occurs during imaging is absorbed. It is like that.

図13(A)〜(D)は、第3実施例におけるバーコードの位置または/および大きさを変化させる場合の一例を示す図解図である。   FIGS. 13A to 13D are illustrative views showing an example of changing the position or / and size of the barcode in the third embodiment.

図13(A)に示すように、撮像処理が実行される際に、初期設定時と比較した場合に、被写体に対する読取装置10(撮像装置18)の位置がずれたり、被写体と読取装置10(撮像装置18)との距離が異なったりすることによって、読み取り処理において、撮影画像(2値画像)におけるバーコードの位置と、読取範囲200の位置とが一致しない場合がある。たとえば、図13(A)に示す例では、2値画像におけるバーコードの位置が、読取範囲200の位置に対して全体的に下側にずれており、バーコードが含まれない読取範囲200が存在する。この状態でバーコードの読み取り処理が行われると、復号が失敗する。   As shown in FIG. 13A, when the imaging process is executed, the position of the reading device 10 (imaging device 18) with respect to the subject is shifted or the subject and the reading device 10 ( Due to the difference in distance from the imaging device 18), the position of the barcode in the captured image (binary image) may not match the position of the reading range 200 in the reading process. For example, in the example shown in FIG. 13A, the position of the barcode in the binary image is shifted downward as a whole with respect to the position of the reading range 200, and the reading range 200 that does not include the barcode is displayed. Exists. If the barcode reading process is performed in this state, decoding fails.

このような場合、第3実施例では、2値画像におけるバーコードの位置と、読取範囲200の位置とを一致させるように、2値画像におけるバーコードの位置または/および大きさが変化される。たとえば、2値画像の一部を切り出し、切り出した画像を読取範囲200の位置に合うように移動させる。以下、2値画像におけるバーコードの位置または/および大きさを変化させる方法の一例を説明する。   In such a case, in the third embodiment, the position or / and size of the barcode in the binary image is changed so that the position of the barcode in the binary image matches the position of the reading range 200. . For example, a part of the binary image is cut out, and the cut out image is moved so as to match the position of the reading range 200. Hereinafter, an example of a method for changing the position or / and the size of the barcode in the binary image will be described.

まず、図13(B)に示すように、初期設定処理において、基準バーコードRBに基づいて基準範囲RAが設定され、基準範囲RAから第1基準点RP1および第2基準点RP2が抽出(設定)される。ただし、第3実施例の初期設定処理では、基準の画像に2値化処理が施され、2値画像データから基準バーコードRBが抽出される。   First, as shown in FIG. 13B, in the initial setting process, the reference range RA is set based on the reference barcode RB, and the first reference point RP1 and the second reference point RP2 are extracted (set) from the reference range RA. ) However, in the initial setting process of the third embodiment, the reference image is binarized and the reference bar code RB is extracted from the binary image data.

基準範囲RAは、2値画像データから抽出された全ての基準バーコードRBを含む最小の矩形形状に含まれる範囲に設定される。たとえば、基準範囲RAの左辺は、複数の基準バーコードRBのうち最も左側にある基準バーコードRB1の左側の端部の位置を通る直線によって形成され、基準範囲RAの右辺は、複数の基準バーコードRBのうち最も右側にある基準バーコードRB4の右側の端部の位置を通る直線によって形成される。また、基準範囲RAの上辺は、複数の基準バーコードRBのうち最も上側にある基準バーコードRB2の上側の端部の位置を通る直線によって形成され、基準範囲RAの下辺は、複数の基準バーコードRBのうち最も下側にある基準バーコードRB4の下側の端部の位置を通る直線によって形成される。   The reference range RA is set to a range included in the minimum rectangular shape including all the reference barcodes RB extracted from the binary image data. For example, the left side of the reference range RA is formed by a straight line passing through the position of the left end of the leftmost reference bar code RB1 among the plurality of reference bar codes RB, and the right side of the reference range RA is a plurality of reference bar codes It is formed by a straight line passing through the position of the right end of the reference bar code RB4 that is the rightmost of the codes RB. Further, the upper side of the reference range RA is formed by a straight line passing through the position of the upper end of the uppermost reference bar code RB2 among the plurality of reference bar codes RB, and the lower side of the reference range RA is a plurality of reference bar codes. It is formed by a straight line passing through the position of the lower end portion of the lowermost reference bar code RB4 in the code RB.

第1基準点RP1は、基準範囲RAの左上の頂点に相当する位置に設定され、第2基準点RP2は、基準範囲RAの右下の頂点に相当する位置に設定される。   The first reference point RP1 is set at a position corresponding to the upper left vertex of the reference range RA, and the second reference point RP2 is set at a position corresponding to the lower right vertex of the reference range RA.

初期設定処理が完了すると、第1基準点RP1および第2基準点RP2に対応する基準点データがフラッシュメモリ23に記憶される。ただし、図示は省略するが、基準点データが示す第1基準点RP1および第2基準点RP2の位置は、読取範囲200を特定するために設定された2次元座標系の座標によって表現される。   When the initial setting process is completed, the reference point data corresponding to the first reference point RP1 and the second reference point RP2 is stored in the flash memory 23. Although not shown, the positions of the first reference point RP1 and the second reference point RP2 indicated by the reference point data are expressed by coordinates of a two-dimensional coordinate system set to specify the reading range 200.

次に、図13(C)に示すように、読み取り処理において、撮影画像(2値画像)から、バーコードに基づいて切出し範囲CAが設定され、切出し範囲CA内の画像が切り出される。また、切出し範囲CA内の画像(切出し画像)から第1抽出点P1および第2抽出点P2が抽出される。ただし、切出し範囲CAが設定されるとは、2値画像データにおける切出し範囲CA用の読出し範囲が設定されることを意味する。   Next, as shown in FIG. 13C, in the reading process, a cutout area CA is set based on the barcode from the captured image (binary image), and an image in the cutout area CA is cut out. Further, the first extraction point P1 and the second extraction point P2 are extracted from the image (cutout image) within the cutout range CA. However, the setting of the cutout range CA means that the read range for the cutout range CA in the binary image data is set.

具体的には、切出し範囲CAは、2値画像データから抽出された全てのバーコードを含む最小の矩形形状に含まれる範囲に設定される。なお、切出し範囲CAの具体的な設定方法は、基準範囲RAと同様であるので説明を省略する。   Specifically, the cutout range CA is set to a range included in the minimum rectangular shape including all barcodes extracted from the binary image data. Note that the specific method for setting the cutout range CA is the same as that for the reference range RA, and thus the description thereof is omitted.

第1抽出点P1は、切出し範囲CAの左上の頂点に相当する位置に設定され、第2抽出点P2は、切出し範囲CAの右下の頂点に相当する位置に設定される。ただし、図示は省略するが、第1抽出点P1および第2抽出点P2の位置は、読取範囲200を特定するために設定された2次元座標系の座標によって表現される。   The first extraction point P1 is set at a position corresponding to the upper left vertex of the cutout range CA, and the second extraction point P2 is set at a position corresponding to the lower right vertex of the cutout range CA. Although illustration is omitted, the positions of the first extraction point P1 and the second extraction point P2 are expressed by coordinates of a two-dimensional coordinate system set to specify the reading range 200.

第1抽出点P1および第2抽出点P2が設定されると、第1抽出点P1が第1基準点RP1に重なるように、切出し範囲CAが移動される。また、第1抽出点P1が第1基準点RP1に重なった状態で、第2抽出点P2が第2基準点RP2に重なるように、切出し範囲CAが拡大または縮小される。つまり、バーコードの位置または/および大きさが変化される。ただし、切出し範囲CAが移動、拡大または縮小されるとは、2値画像データの読出し範囲が変更されることを意味する。   When the first extraction point P1 and the second extraction point P2 are set, the cutout range CA is moved so that the first extraction point P1 overlaps the first reference point RP1. Further, in the state where the first extraction point P1 overlaps the first reference point RP1, the cutout range CA is expanded or reduced so that the second extraction point P2 overlaps the second reference point RP2. That is, the position or / and size of the barcode is changed. However, the movement, enlargement, or reduction of the cutout range CA means that the read range of the binary image data is changed.

また、基準の物品を撮像した場合と比較して、読み取り対象の物品を撮像する場合の距離が同じであれば、基準範囲RAの大きさと、切出し範囲CAの大きさは同じである。つまり、基準バーコードRBの大きさと、処理対象のバーコードの大きさは同じである。この場合、第1抽出点P1が第1基準点RP1に重なるように切出し範囲CAが移動されれば、2値画像におけるバーコードの位置と、読取範囲200の位置とが一致する。この場合には、切出し範囲CAの拡大または縮小は省略されてもよい。   In addition, as compared with the case where the reference article is imaged, the size of the reference range RA and the size of the cutout range CA are the same if the distance when the article to be read is imaged is the same. That is, the size of the reference barcode RB and the size of the barcode to be processed are the same. In this case, if the cutout range CA is moved so that the first extraction point P1 overlaps the first reference point RP1, the position of the barcode in the binary image matches the position of the reading range 200. In this case, the enlargement or reduction of the cutout range CA may be omitted.

図13(D)に示すように、切出し画像が移動され、バーコードの位置または/および大きさが変化されると、バーコードの位置と、読取範囲200の位置とが一致する。第3実施例では、バーコードの読み取り処理において、切出し画像から抽出画像が抽出される。   As shown in FIG. 13D, when the cutout image is moved and the position or / and size of the barcode is changed, the position of the barcode matches the position of the reading range 200. In the third embodiment, the extracted image is extracted from the cut-out image in the barcode reading process.

図14(A)〜(D)は、第3実施例におけるバーコードの向きを変化させる場合の一例を示す図解図である。   FIGS. 14A to 14D are illustrative views showing an example of changing the direction of the barcode in the third embodiment.

図14(A)に示すように、撮像処理が実行される際に、初期設定時と比較した場合に、被写体に対する読取装置10(撮像装置18)の向きが異なったりすることによって、読み取り処理において、撮影画像(2値画像)におけるバーコードの向きと、読取範囲200の向きとが一致しない場合がある。たとえば、図14(A)に示す例では、2値画像におけるバーコードの向きが、読取範囲200の向きに対して左回り(反時計回り)に90度回転した向きである。   As shown in FIG. 14A, when the imaging process is executed, the orientation of the reading device 10 (imaging device 18) with respect to the subject is different from that in the initial setting. In some cases, the orientation of the barcode in the captured image (binary image) does not match the orientation of the reading range 200. For example, in the example shown in FIG. 14A, the barcode orientation in the binary image is the orientation rotated 90 degrees counterclockwise (counterclockwise) with respect to the orientation of the reading range 200.

このような場合、第3実施例では、2値画像におけるバーコードの向きと、読取範囲200の向きとを一致させるように、2値画像の向きが変化される。以下、2値画像を回転させる方法の一例を説明する。   In such a case, in the third embodiment, the orientation of the binary image is changed so that the orientation of the barcode in the binary image matches the orientation of the reading range 200. Hereinafter, an example of a method for rotating a binary image will be described.

まず、図14(B)に示すように、初期設定処理において、基準バーコードRBの向きRDが抽出(設定)される。たとえば、自動的に検出された基準バーコードRBの直線に垂直な方向(島状の塊が延びる方向)が基準バーコードRBの向きRDとして設定される。上述したように、読取範囲200は、基準バーコードRBに対応するように設定されるので、基準バーコードRBの向きRDは、読取範囲200の向きと同じである。たとえば、図14(B)に示す例では、基準バーコードRB(読取範囲200)の向きRDは、横方向である。   First, as shown in FIG. 14B, in the initial setting process, the direction RD of the reference barcode RB is extracted (set). For example, a direction perpendicular to the straight line of the automatically detected reference bar code RB (the direction in which the island-shaped chunk extends) is set as the direction RD of the reference bar code RB. As described above, since the reading range 200 is set to correspond to the reference barcode RB, the orientation RD of the reference barcode RB is the same as the orientation of the reading range 200. For example, in the example shown in FIG. 14B, the direction RD of the reference barcode RB (reading range 200) is the horizontal direction.

次に、図14(C)に示すように、読み取り処理において、撮影画像(2値画像)におけるバーコードの向きBDが抽出される。たとえば、図14(C)に示す例では、バーコードの向きBDは、縦方向である。   Next, as shown in FIG. 14C, the barcode orientation BD in the captured image (binary image) is extracted in the reading process. For example, in the example shown in FIG. 14C, the barcode direction BD is the vertical direction.

バーコードの向きが抽出されると、2値画像におけるバーコードの向きBDと、基準バーコードRBの向きRDとが一致するように、2値画像が回転される。たとえば、図14(C)に示す例では、2値画像が右回り(時計回り)に90度回転される。   When the barcode orientation is extracted, the binary image is rotated so that the barcode orientation BD in the binary image matches the orientation RD of the reference barcode RB. For example, in the example shown in FIG. 14C, the binary image is rotated 90 degrees clockwise (clockwise).

図14(D)に示すように、2値画像が回転されると、2値画像におけるバーコードの向きBDと、基準バーコードRB(読取範囲200)の向きRDとが一致する。この状態で、バーコードの位置と、読取範囲200の位置とが一致している場合には、バーコードの読み取り処理が行われる。ただし、バーコードの向きBDと、基準バーコードRB(読取範囲200)の向きRDとが一致しただけでは、バーコードの位置と、読取範囲200の位置とが一致しない場合がある。この場合は、上述したように、バーコードの位置または/および大きさを変化(図13(A)〜(D)を参照)させた後に、バーコードの読み取り処理が行われる。   As shown in FIG. 14D, when the binary image is rotated, the barcode orientation BD in the binary image matches the orientation RD of the reference barcode RB (reading range 200). In this state, when the barcode position matches the position of the reading range 200, barcode reading processing is performed. However, the barcode position may not match the position of the reading range 200 just by matching the barcode direction BD and the direction RD of the reference barcode RB (reading range 200). In this case, as described above, the barcode reading process is performed after changing the position or / and size of the barcode (see FIGS. 13A to 13D).

なお、第3実施例では、2値画像におけるバーコードの位置、大きさおよび向きの少なくとも1つを変化させるようにしたが、読取範囲200の位置、大きさおよび向きの少なくとも1つを変化させるようにしても良い。   In the third embodiment, at least one of the position, size, and orientation of the barcode in the binary image is changed. However, at least one of the position, size, and orientation of the reading range 200 is changed. You may do it.

また、第3実施例では、2値画像の向きが変化された後に、切出し範囲CAが設定され、切出し画像が切出されるようにしたが、切出し画像が切出された後に、切出し画像の向きが変化されるようにしてもよい。   In the third embodiment, after the orientation of the binary image is changed, the cutout area CA is set and the cutout image is cut out. However, after the cutout image is cut out, the direction of the cutout image is set. May be changed.

さらに、バーコードの位置と、読取範囲200の位置とが一致していても、バーコードの向きBDと、基準バーコードRB(読取範囲200)の向きRDとが反対を向いている(右回り(時計回り)または左回り(反時計回り)に180度回転した方向を向いている)場合がある。このような場合、バーコードの復号が失敗することがある。この場合、バーコードの位置と、読取範囲200の位置とが一致していた場合であって、バーコードの復号が失敗した場合には、2値画像の向きを180度変化させた後に、再度バーコードの復号が実行される。   Furthermore, even if the position of the bar code matches the position of the reading range 200, the direction BD of the bar code and the direction RD of the reference bar code RB (reading range 200) are opposite (clockwise). (Clockwise direction) or counterclockwise (counterclockwise direction). In such a case, barcode decoding may fail. In this case, if the position of the barcode matches the position of the reading range 200 and the barcode decoding fails, the direction of the binary image is changed by 180 degrees, and then again. Barcode decoding is performed.

図15は、第3実施例における読み取り処理の一例を示すフロー図である。なお、第1実施例の読み取り処理(図10)で説明した処理と同じ処理については、説明を省略するまたは簡単に説明することにする。   FIG. 15 is a flowchart showing an example of the reading process in the third embodiment. Note that description of the same processing as that described in the reading processing of the first embodiment (FIG. 10) will be omitted or briefly described.

図15に示すように、CPU20は、読み取り処理を開始すると、ステップS35で、撮影画像を2値画像に変換し、ステップS91で、2値画像から複数のバーコードを抽出する。ここでは、それぞれのバーコードの向きおよび位置も抽出される。続くステップS93で、バーコードの向きBDが、基準バーコードRBの向きRDと一致するかどうかを判断する。   As shown in FIG. 15, when starting the reading process, the CPU 20 converts the captured image into a binary image in step S35, and extracts a plurality of barcodes from the binary image in step S91. Here, the direction and position of each barcode are also extracted. In a succeeding step S93, it is determined whether or not the barcode direction BD matches the direction RD of the reference barcode RB.

ステップS93で“YES”であれば、つまり、バーコードの向きBDが、基準バーコードRBの向きRDと一致する場合は、ステップS97に進む。一方、ステップS93で“NO”であれば、つまり、バーコードの向きBDが、基準バーコードRBの向きRDと一致しない場合は、ステップS95で、2値画像におけるバーコードの向きBDと、基準バーコードRBの向きRDとが一致するように、2値画像が回転され、ステップS97に進む。   If “YES” in the step S93, that is, if the barcode direction BD matches the direction RD of the reference barcode RB, the process proceeds to a step S97. On the other hand, if “NO” in the step S93, that is, if the barcode direction BD does not match the direction RD of the reference barcode RB, in step S95, the barcode direction BD in the binary image and the reference The binary image is rotated so that the direction RD of the barcode RB matches, and the process proceeds to step S97.

ステップS97では、2値画像におけるバーコードの位置と、基準バーコードRBの位置が一致するかどうかを判断する。ステップS97で“YES”であれば、つまり、2値画像におけるバーコードの位置と、基準バーコードRBの位置が一致する場合は、ステップS37に進む。一方、ステップS97で“NO”であれば、つまり、2値画像におけるバーコードの位置と、基準バーコードRBの位置が一致しない場合は、ステップS99で、第1基準点RP1および第2基準点RP2を読み出し、ステップS101で切出し範囲CAを設定し、切出し範囲CA内の画像を切り出す。   In step S97, it is determined whether or not the position of the barcode in the binary image matches the position of the reference barcode RB. If “YES” in the step S97, that is, if the position of the barcode in the binary image matches the position of the reference barcode RB, the process proceeds to a step S37. On the other hand, if “NO” in the step S97, that is, if the position of the barcode in the binary image and the position of the reference barcode RB do not coincide with each other, the first reference point RP1 and the second reference point in the step S99. RP2 is read out, a cutout area CA is set in step S101, and an image in the cutout area CA is cut out.

続いて、ステップS103で、切出し範囲CAから第1抽出点P1および第2抽出点P2を抽出し、ステップS105で、切出し画像を移動させ、ステップS37に進む。ステップS105では、第1抽出点P1が第1基準点RP1に重なるように、切出し範囲CAが移動される。また、第1抽出点P1が第1基準点RP1に重なった状態で、第2抽出点P2が第2基準点RP2に重なるように、切出し範囲CAが拡大または縮小される。   Subsequently, in step S103, the first extraction point P1 and the second extraction point P2 are extracted from the cutout range CA. In step S105, the cutout image is moved, and the process proceeds to step S37. In step S105, the cutout range CA is moved so that the first extraction point P1 overlaps the first reference point RP1. Further, in the state where the first extraction point P1 overlaps the first reference point RP1, the cutout range CA is expanded or reduced so that the second extraction point P2 overlaps the second reference point RP2.

なお、ステップS37以降の処理の内容については、第1実施例と同じであるので説明を省略する。   Note that the content of the processing after step S37 is the same as that of the first embodiment, and thus the description thereof is omitted.

この第3実施例によれば、撮影画像におけるバーコードの位置、大きさまたは/および向きが変化された撮影画像からバーコードを読み取るので、撮像処理が実行される際に、読取装置10(撮像装置18)と被写体との距離または撮影画像における被写体の位置がずれたりしても、バーコードの復号を成功させることができる。   According to the third embodiment, since the barcode is read from the captured image in which the position, size or / and orientation of the barcode in the captured image is changed, the reading device 10 (imaging Even if the distance between the apparatus 18) and the subject or the position of the subject in the photographed image shifts, the barcode can be successfully decoded.

なお、第3実施例に示した態様は、第2実施例にも組み合わせて採用することが可能である。この場合、位置、大きさまたは/および向きが変化された2値画像から読取範囲200の画像が抽出され、その抽出画像に対して復号処理が行われる。   The aspect shown in the third embodiment can be employed in combination with the second embodiment. In this case, an image in the reading range 200 is extracted from the binary image whose position, size, and / or orientation has been changed, and decoding processing is performed on the extracted image.

また、上述したように、一次元バーコードに代えて、二次元コードを符号として用いることもできる。二次元コードは、一次元バーコードの場合と同様に、2値画像データから島状の塊として抽出することができる。このため、二次元コードの位置および大きさは、抽出された島状の塊の範囲に基づいて検出される。また、二次元コードの向きについては、スタック型の二次元コードを用いる場合には、一次元バーコードの場合と同様に、二次元コードに含まれる直線に垂直な方向(島状の塊が延びる方向)を、二次元コードの向きとして抽出することができる。さらに、一般的に外形が正方形であるマトリクス型二次元コードを用いる場合には、二次元コードを囲うL字の線の向き、またはファインダパターン(切り出しシンボル)の配置を抽出することによって、二次元コードの向きとして抽出することができる。   As described above, a two-dimensional code can be used as a code instead of the one-dimensional barcode. The two-dimensional code can be extracted from the binary image data as an island-like lump as in the case of the one-dimensional barcode. For this reason, the position and size of the two-dimensional code are detected based on the range of the extracted island-shaped chunks. As for the direction of the two-dimensional code, when a stack type two-dimensional code is used, the direction perpendicular to the straight line included in the two-dimensional code (island-like chunks extend) is the same as the case of the one-dimensional barcode. Direction) can be extracted as the direction of the two-dimensional code. In addition, when using a matrix type two-dimensional code having a generally outer shape, the direction of an L-shaped line surrounding the two-dimensional code or the arrangement of a finder pattern (cutout symbol) is extracted. It can be extracted as the direction of the code.

以上説明したように、本発明を具体的な実施例に則して説明したが、本発明は上述の実施例に限定されるものではない。上で挙げた具体的な実施例は、いずれも単なる一例であり、製品の仕様などの必要に応じて適宜変更可能である。   As described above, the present invention has been described based on specific embodiments, but the present invention is not limited to the above-described embodiments. Each of the specific examples given above is merely an example, and can be appropriately changed according to the necessity of product specifications and the like.

10 …符号読取装置
14 …表示装置
16 …入力装置
18 …撮像装置
20 …CPU
22 …ROM
24 …RAM
26 …ドライバ
200…読取範囲
DESCRIPTION OF SYMBOLS 10 ... Code reader 14 ... Display device 16 ... Input device 18 ... Imaging device 20 ... CPU
22… ROM
24 ... RAM
26 ... Driver 200 ... Reading range

Claims (8)

複数の符号を一度に読み取る符号読取装置であって、
前記複数の符号を含む画像を撮影する撮影画像取得部、
前記撮影画像取得部によって撮像される撮影画像に対して設定される複数の読取範囲および当該複数の読取範囲の各々の読取順序を含む符号読取情報を記憶する記憶部、
前記撮影画像取得部によって撮像された撮影画像のうち、前記複数の読取範囲に含まれる画像の各々を、前記読取順序に従う順序で抽出する画像抽出部、および
前記画像抽出部によって抽出された順序で各画像に含まれる符号を復号する復号部を備える、符号読取装置。
A code reader for reading a plurality of codes at once,
A captured image acquisition unit that captures an image including the plurality of codes;
A storage unit for storing a plurality of reading ranges set for a captured image captured by the captured image acquisition unit and code reading information including a reading order of each of the plurality of reading ranges;
Of the captured images captured by the captured image acquisition unit, each of the images included in the plurality of reading ranges is extracted in an order according to the reading order; and in the order extracted by the image extracting unit A code reading device including a decoding unit that decodes a code included in each image.
前記復号部は、前記抽出部によって抽出された画像に含まれる符号が前記読取範囲内に位置する場合に、当該符号を復号する、請求項1記載の符号読取装置。   The code reading device according to claim 1, wherein the decoding unit decodes the code when the code included in the image extracted by the extraction unit is located within the reading range. 前記撮影画像取得部によって撮像された前記撮影画像と前記複数の読取範囲との位置および向きを合わせるように、当該撮影画像と当該複数の読取範囲との位置および向きの少なくとも一方を変化させる変化部をさらに備える、請求項1または2記載の符号読取装置。   A changing unit that changes at least one of the position and orientation of the captured image and the plurality of reading ranges so as to match the position and orientation of the captured image captured by the captured image acquisition unit and the plurality of reading ranges. The code reader according to claim 1, further comprising: 前記変化部は、前記複数の読取範囲の位置を、前記撮影画像のうち、前記符号が含まれる画像上に移動させる、請求項3記載の符号読取装置。   The code reading device according to claim 3, wherein the changing unit moves the positions of the plurality of reading ranges onto an image including the code in the photographed image. 前記変化部は、前記撮影画像に含まれる複数の符号の大きさを変化させる、請求項3または4記載の符号読取装置。   The code reading device according to claim 3, wherein the changing unit changes the size of a plurality of codes included in the captured image. 前記複数の符号に対応する複数の読取範囲を設定する読取範囲設定部、
前記読取範囲設定部で設定された前記複数の読取範囲の各々の読取順序を設定する順序設定部、および
前記読取範囲設定部によって設定された前記複数の読取範囲の各々の読取位置および前記順序設定部によって設定された当該複数の読取範囲の各々の読取順序を含む前記符号読取情報を生成する符号読取情報生成部をさらに備える、請求項1ないし5のいずれかに記載の符号読取装置。
A reading range setting unit for setting a plurality of reading ranges corresponding to the plurality of codes;
An order setting unit for setting the reading order of each of the plurality of reading ranges set by the reading range setting unit; and a reading position and the order setting for each of the plurality of reading ranges set by the reading range setting unit The code reading device according to claim 1, further comprising a code reading information generation unit configured to generate the code reading information including the reading order of each of the plurality of reading ranges set by the unit.
複数の符号を一度に読み取る符号読取装置で実行される制御プログラムであって、
符号読取装置のプロセッサに、
前記複数の符号を含む画像を撮影した撮影画像を取得する画像取得ステップ、
前記画像取得ステップにおいて取得される撮影画像に対して設定される複数の読取範囲および当該複数の読取範囲の各々の読取順序を含む符号読取情報を記憶する記憶ステップ、
前記画像取得ステップにおいて取得した撮影画像のうち、前記複数の読取範囲に含まれる画像の各々を、前記読取順序に従う順序で抽出する画像抽出ステップ、および
前記画像抽出ステップにおいて抽出した順序で各画像に含まれる符号を復号する復号ステップを実行させる、制御プログラム。
A control program executed by a code reading device that reads a plurality of codes at once,
In the processor of the code reader,
An image acquisition step of acquiring a captured image obtained by capturing an image including the plurality of codes;
A storage step of storing code reading information including a plurality of reading ranges set for the captured image acquired in the image acquisition step and a reading order of each of the plurality of reading ranges;
An image extraction step of extracting each of the images included in the plurality of reading ranges from the captured images acquired in the image acquisition step in an order according to the reading order, and an image extracted in the order extracted in the image extraction step. A control program for executing a decoding step of decoding an included code.
複数の符号を一度に読み取る符号読取装置の制御方法であって、
(a)前記複数の符号を含む画像を撮影した撮影画像を取得するステップ、
(b)前記ステップ(a)において取得される撮影画像に対して設定される複数の読取範囲および当該複数の読取範囲の各々の読取順序を含む符号読取情報を記憶し、
(c)前記ステップ(a)において取得した撮影画像のうち、前記複数の読取範囲に含まれる画像の各々を、前記読取順序に従う順序で抽出するステップ、および
(d)前記ステップ(c)において抽出した順序で各画像に含まれる符号を復号するステップを含む、制御方法。
A method of controlling a code reading device that reads a plurality of codes at once,
(A) acquiring a captured image obtained by capturing an image including the plurality of codes;
(B) storing code reading information including a plurality of reading ranges set for the captured image acquired in step (a) and the reading order of each of the plurality of reading ranges;
(C) extracting each of the images included in the plurality of reading ranges from the captured images acquired in the step (a) in an order according to the reading order; and (d) extracting in the step (c). A control method including a step of decoding a code included in each image in the order that has been performed.
JP2016189031A 2016-09-28 2016-09-28 Code reading device, control program and control method Pending JP2018055304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016189031A JP2018055304A (en) 2016-09-28 2016-09-28 Code reading device, control program and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016189031A JP2018055304A (en) 2016-09-28 2016-09-28 Code reading device, control program and control method

Publications (1)

Publication Number Publication Date
JP2018055304A true JP2018055304A (en) 2018-04-05

Family

ID=61836796

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016189031A Pending JP2018055304A (en) 2016-09-28 2016-09-28 Code reading device, control program and control method

Country Status (1)

Country Link
JP (1) JP2018055304A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000200321A (en) * 1998-12-16 2000-07-18 Matsushita Electric Ind Co Ltd Method for detecting and reading a two-dimensional bar code
JP2001266064A (en) * 2000-03-23 2001-09-28 Denso Corp Information code reader
JP2014219775A (en) * 2013-05-07 2014-11-20 株式会社ウェルキャット Bar-code symbol reader and bar-code symbol reading method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000200321A (en) * 1998-12-16 2000-07-18 Matsushita Electric Ind Co Ltd Method for detecting and reading a two-dimensional bar code
JP2001266064A (en) * 2000-03-23 2001-09-28 Denso Corp Information code reader
JP2014219775A (en) * 2013-05-07 2014-11-20 株式会社ウェルキャット Bar-code symbol reader and bar-code symbol reading method

Similar Documents

Publication Publication Date Title
US20230280878A1 (en) Floating soft trigger for touch displays on electronic device
CN105718833B (en) Pattern recognition device and commodity information processor
US9501163B2 (en) Apparatus and method for activating a trigger mechanism
JP7460728B2 (en) Method for handling large numbers of decodable indicia
US7611059B2 (en) Code reading device and program
JP5613592B2 (en) Bar code reader
US20170316242A1 (en) Image recognition apparatus, commodity information processing apparatus and image recognition method
US11321696B2 (en) Commodity registration device with wireless tag reader and optical reading unit
EP3217325A1 (en) Display method and decoding method for dynamic recognizable two-dimensional code
JP4523975B2 (en) Data code reader
CA2947858C (en) Apparatus and method for performing a variable data capture process
JP5819925B2 (en) Code reading device and code reading program
US10192136B2 (en) Image processing apparatus and image processing method
JP4337597B2 (en) Code symbol reader and program
JP2018026025A (en) Code reading device, control program and control method
JP2018055304A (en) Code reading device, control program and control method
US20170294157A1 (en) Image display device
EP4425371B1 (en) Barcode image recognition method and device using the same
CN105719411B (en) Pattern recognition device, commodity information processor and image-recognizing method
JP5780219B2 (en) Information terminal and program
US20200401862A1 (en) Barcode generation device and barcode generation method
JP2018010555A (en) Code reading apparatus, code reading program, and code reading method
JP2019016219A (en) Code reading apparatus, code reading program, and code reading method
JP7371395B2 (en) Information code reader
JP2017073159A (en) Information terminal and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190320

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190821

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190903

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191025

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20200324