JP2010277169A - Information code reader - Google Patents

Information code reader Download PDF

Info

Publication number
JP2010277169A
JP2010277169A JP2009126672A JP2009126672A JP2010277169A JP 2010277169 A JP2010277169 A JP 2010277169A JP 2009126672 A JP2009126672 A JP 2009126672A JP 2009126672 A JP2009126672 A JP 2009126672A JP 2010277169 A JP2010277169 A JP 2010277169A
Authority
JP
Japan
Prior art keywords
cell
image
cell image
shape
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2009126672A
Other languages
Japanese (ja)
Other versions
JP5218281B2 (en
Inventor
Yuichi Ito
裕一 伊東
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.)
Denso Wave Inc
Original Assignee
Denso Wave Inc
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 Denso Wave Inc filed Critical Denso Wave Inc
Priority to JP2009126672A priority Critical patent/JP5218281B2/en
Publication of JP2010277169A publication Critical patent/JP2010277169A/en
Application granted granted Critical
Publication of JP5218281B2 publication Critical patent/JP5218281B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide an information code reader for discriminating the color of each cell of an information code by an appropriate method corresponding to the imaging state of the information code. <P>SOLUTION: An information code reader includes an "allocation size detection means" and a "size determination means", and the "allocation size detection means" is configured to detect the size of an allocation area allocated to the cell image in the code image of an information code imaged by an imaging means. Also, the "size determination means" is configured to determine the size of a region used as the object of determination in discriminating the color of each cell image on the basis of the detected size of the allocation region. Furthermore, the information code reader includes a "cell color determination means" for discriminating the color of each of cell images configuring a code image by referring to a region equivalent to the size determined by the "size determination means" in each of the cell images, respectively. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、情報コード読取装置に関するものである。   The present invention relates to an information code reader.

現在、複数のセルがマトリックス状に配置されてなる各種情報コードが広く提供されている。この種の情報コードでは、コード領域を構成する各セルにおいて、各セルで表すべき情報に対応した色が付されており、読取装置によって読み取る場合には、各セルの色を正確に認識することが求められている。   At present, various information codes in which a plurality of cells are arranged in a matrix are widely provided. In this type of information code, each cell constituting the code area is given a color corresponding to the information to be represented in each cell, and when reading by a reader, the color of each cell is accurately recognized. Is required.

特開2007−128524公報JP 2007-128524 A

上記情報コードを読み取る読取装置は、読取対象となる情報コードを受光センサで撮像し、得られたコード画像においてセル毎に色判別を行う構成が一般的である。この色判別の方法としては、各セルの代表位置(例えば中心位置)の画素を参照すると共にそれら各代表位置(各参照画素)の色を識別し、それら識別された色を、各セル色と判定する方法が考えられる。   A reading apparatus that reads the information code generally has a configuration in which an information code to be read is captured by a light receiving sensor, and color determination is performed for each cell in the obtained code image. As a method of color discrimination, the pixel at each representative position (for example, the central position) of each cell is referred to, the color at each representative position (each reference pixel) is identified, and the identified color is referred to as each cell color. A method of judging can be considered.

しかしながら、上記のように各セルの特定位置の画素のみを参照する方法を用いた場合、参照位置の画素がセル色を正確に反映していない場合があり、このような場合には各セル色を適切に判別できない虞がある。一方、各セル領域において多くの画素を参照し、各セル色を判別する方法も考えられるが、各セルに対する画素の割り当て(各セルに対する受光素子の割り当て)は、二次元コードのサイズや結像状態によって変わりうるため、各セルに対する画素の割り当てが少ない場合には、このような判別方法は難しくなる。   However, when the method of referring only to the pixel at a specific position of each cell as described above is used, the pixel at the reference position may not accurately reflect the cell color. In such a case, each cell color May not be properly determined. On the other hand, a method of distinguishing each cell color by referring to many pixels in each cell region is also conceivable, but pixel allocation to each cell (light-receiving element allocation to each cell) depends on the size of the two-dimensional code and image formation. Since this can change depending on the state, such a determination method becomes difficult when the number of pixels assigned to each cell is small.

本発明は、上述した課題を解決するためになされたものであり、情報コードの各セルの色判別を、情報コードの撮像状態に応じた適切な方法で行い得る情報コード読取装置を提供すること目的とする。   The present invention has been made to solve the above-described problems, and provides an information code reader capable of performing color discrimination of each cell of an information code by an appropriate method according to the imaging state of the information code. Objective.

請求項1の発明は、複数のセルが配列されてなる情報コードを読み取る情報コード読取装置であって、複数の受光素子を備えた撮像手段と、前記情報コードからの反射光を取り込み、当該情報コードの像を前記撮像手段において結像させる結像手段と、前記撮像手段によって撮像された前記情報コードのコード画像において、セル画像に割り当てられた割当領域の大きさを検出する割当サイズ検出手段と、前記割当サイズ検出手段によって検出された前記割当領域の大きさに基づき、各セル画像の色判別の際に判別対象として用いる領域のサイズを決定するサイズ決定手段と、前記コード画像を構成する前記各セル画像それぞれにおいて、前記サイズ決定手段によって決定された前記サイズに相当する領域を参照し、前記各セル画像の色を判別するセル色判別手段と、を備えたことを特徴とする。   The invention according to claim 1 is an information code reading device for reading an information code in which a plurality of cells are arranged, the imaging means having a plurality of light receiving elements, and reflected light from the information code. An imaging unit that forms an image of a code in the imaging unit; an allocation size detection unit that detects a size of an allocation area allocated to a cell image in the code image of the information code captured by the imaging unit; A size determining unit that determines a size of an area to be used as a discrimination target in color discrimination of each cell image based on the size of the allocation area detected by the allocation size detection unit; and the code image that constitutes the code image In each cell image, the area corresponding to the size determined by the size determining means is referred to determine the color of each cell image. A cell color discriminating means, characterized by comprising a.

請求項2の発明は、請求項1に記載の情報コード読取装置において、前記セル色判別手段が、前記コード画像を構成する前記各セル画像の中心画素を検出する中心画素検出手段と、前記中心画素検出手段によって検出された前記中心画素と、前記サイズ決定手段によって決定された前記サイズとに基づき、前記各セル画像において、その決定された前記サイズに相当する大きさであって且つ前記中心画素を含んだ領域を色判別の対象領域として特定する対象領域特定手段と、を備え、前記対象領域特定手段によって特定された前記対象領域を構成する各画素の色情報に基づいて前記各セル画像の色を判別することを特徴とする。   According to a second aspect of the present invention, there is provided the information code reading device according to the first aspect, wherein the cell color discriminating unit detects a central pixel of the cell image constituting the code image, and the center pixel detecting unit. Based on the center pixel detected by the pixel detection means and the size determined by the size determination means, each cell image has a size corresponding to the determined size and the center pixel. Target area specifying means for specifying an area including the target area for color discrimination, and based on color information of each pixel constituting the target area specified by the target area specifying means, It is characterized by discriminating colors.

請求項3の発明は、請求項1又は請求項2に記載の情報コード読取装置において、更に、前記撮像手段によって撮像された前記情報コードのコード画像から、当該コード画像を構成するセル画像の形状情報を取得する形状情報取得手段と、前記形状情報取得手段によって取得された前記形状情報に基づき、各セル画像の色判別の際に判別対象として用いる領域の形状を決定する形状決定手段と、が設けられており、前記セル色判別手段が、前記コード画像を構成する前記各セル画像それぞれにおいて、前記サイズ決定手段によって決定された前記サイズに相当し且つ前記形状決定手段によって決定された前記形状に相当する領域を参照し、前記各セル画像の色を判別することを特徴とする。   According to a third aspect of the present invention, in the information code reading device according to the first or second aspect, the shape of a cell image constituting the code image from the code image of the information code imaged by the imaging means. Shape information acquisition means for acquiring information, and shape determination means for determining the shape of a region to be used as a determination target when determining the color of each cell image based on the shape information acquired by the shape information acquisition means, The cell color discrimination means is provided for each of the cell images constituting the code image, and corresponds to the size determined by the size determination means and has the shape determined by the shape determination means. The color of each cell image is discriminated by referring to the corresponding area.

請求項4の発明は、複数のセルが配列されてなる情報コードを読み取る情報コード読取装置であって、複数の受光素子を備えた撮像手段と、前記情報コードからの反射光を取り込み、当該情報コードの像を前記撮像手段において結像させる結像手段と、前記撮像手段によって撮像された前記情報コードのコード画像から、当該コード画像を構成するセル画像の形状情報を取得する形状情報取得手段と、前記形状情報取得手段によって取得された前記形状情報に基づき、各セル画像の色判別の際に判別対象として用いる領域の形状を決定する形状決定手段と、前記コード画像を構成する前記各セル画像それぞれにおいて、前記形状決定手段によって決定された前記形状に相当する領域を参照し、前記各セル画像の色を判別するセル色判別手段と、を備えたことを特徴とする。   According to a fourth aspect of the present invention, there is provided an information code reading device for reading an information code in which a plurality of cells are arranged, the imaging means having a plurality of light receiving elements, and reflected light from the information code, An imaging means for forming an image of a code in the imaging means; and a shape information acquisition means for acquiring shape information of a cell image constituting the code image from a code image of the information code picked up by the imaging means; , Shape determining means for determining the shape of a region to be used as a discrimination target in color discrimination of each cell image based on the shape information acquired by the shape information acquiring means, and each cell image constituting the code image Cell color determination means for determining the color of each cell image with reference to the region corresponding to the shape determined by the shape determination means in each Characterized by comprising a.

請求項5の発明は、請求項3又は請求項4に記載の情報コード読取装置において、前記形状決定手段が、前記コード画像において、所定の中心セル画像と、当該中心セル画像の周囲に隣接する隣接セル画像と、を検出するセル画像検出手段と、前記中心セル画像から各隣接セル画像までの各距離を算出する距離算出手段と、を備えており、前記距離算出手段によって算出された前記各距離に基づいて、前記各セル画像の色判別の際に用いる領域の前記形状を決定することを特徴としている。   According to a fifth aspect of the present invention, in the information code reading device according to the third or fourth aspect, the shape determining means is adjacent to a predetermined center cell image and the periphery of the center cell image in the code image. A cell image detecting means for detecting an adjacent cell image, and a distance calculating means for calculating each distance from the central cell image to each adjacent cell image, and each of the calculated by the distance calculating means. Based on the distance, the shape of the region used for color discrimination of each cell image is determined.

請求項6の発明は、請求項5に記載の情報コード読取装置において、更に、前記セル画像検出手段によって検出された前記中心セル画像の中心位置と、前記隣接セル画像の中心位置とを検出する中心位置検出手段が設けられており、前記距離算出手段が、前記中心セル画像の中心位置と、各隣接セル画像の中心位置とに基づいて前記各距離を算出することを特徴としている。   According to a sixth aspect of the present invention, in the information code reading device according to the fifth aspect, the center position of the center cell image detected by the cell image detecting means and the center position of the adjacent cell image are further detected. Center position detection means is provided, and the distance calculation means calculates each distance based on the center position of the center cell image and the center position of each adjacent cell image.

請求項7の発明は、請求項3から請求項6のいずれか一項に記載の情報コード読取装置において、前記中心位置検出手段が、前記中心セル画像の上下左右に隣接する4つの第1隣接セル画像の中心位置、及び前記中心セル画像にそれぞれ斜めに隣接する4つの第2隣接セル画像の中心位置をそれぞれ検出し、前記距離算出手段が、前記中心セル画像の中心位置と、4つの前記第1隣接セル画像の各中心位置との間の第1間隔を前記各距離としてそれぞれ算出している。
更に、各第1隣接セル画像の中心位置と、当該各第1隣接セル画像の両側に隣接する各第2隣接セル画像の中心位置との間の各第2間隔をそれぞれ算出する隣接セル間隔算出手段が設けられており、前記形状決定手段が、前記距離算出手段によって算出された前記第1間隔と、前記隣接セル間隔算出手段によって算出された前記第2間隔とに基づいて前記形状を決定することを特徴としている。
According to a seventh aspect of the present invention, in the information code reading device according to any one of the third to sixth aspects, the center position detecting means includes four first adjacent areas adjacent to each other in the vertical and horizontal directions of the central cell image. Detecting the center position of the cell image and the center positions of the four second adjacent cell images obliquely adjacent to the center cell image, respectively, and the distance calculating means includes the center position of the center cell image and the four A first interval between each center position of the first adjacent cell image is calculated as each distance.
Further, an adjacent cell interval calculation for calculating each second interval between the center position of each first adjacent cell image and the center position of each second adjacent cell image adjacent to both sides of each first adjacent cell image. Means is provided, and the shape determining means determines the shape based on the first interval calculated by the distance calculating means and the second interval calculated by the adjacent cell interval calculating means. It is characterized by that.

請求項1の発明は、撮像手段によって撮像された情報コードのコード画像において、セル画像に割り当てられた割当領域の大きさを検出し、その検出された大きさ(割当領域サイズ)に基づき、各セル画像の色判別の際に判別対象として用いる領域のサイズを決定している。そして、コード画像を構成する各セル画像それぞれにおいて、決定されたサイズに相当する領域を参照し、各セル画像の色を判別している。このようにすると、色判別の際に判別対象として用いる領域のサイズを、セル画像に割り当てられたサイズに応じて変更することができるため、各セルの色判別を、撮像サイズに適した判別方法で行うことができるようになる。   The invention of claim 1 detects the size of the allocation area allocated to the cell image in the code image of the information code captured by the imaging means, and based on the detected size (allocation area size), The size of the area used as a discrimination target when the color of the cell image is discriminated is determined. In each cell image constituting the code image, an area corresponding to the determined size is referred to, and the color of each cell image is determined. This makes it possible to change the size of the region used as a discrimination target in color discrimination according to the size assigned to the cell image. Therefore, the discrimination method suitable for the imaging size is used for the color discrimination of each cell. Will be able to do it.

請求項2の発明は、コード画像を構成する各セル画像の中心画素を検出しており、各セル画像において、サイズ決定手段によって決定されたサイズに相当する大きさであって且つ中心画素を含んだ領域を色判別の対象領域として特定している。そして、その特定された対象領域を構成する各画素の色情報に基づいて各セル画像の色を判別している。このようにすると、信頼性の高い中心画素付近の領域を、認識されたセルサイズに相当する適切な大きさで、色判別の対象領域として用いることができる。   The invention of claim 2 detects the center pixel of each cell image constituting the code image, and each cell image has a size corresponding to the size determined by the size determining means and includes the center pixel. This area is specified as a target area for color discrimination. Then, the color of each cell image is determined based on the color information of each pixel constituting the specified target area. In this way, an area near the central pixel with high reliability can be used as a color discrimination target area with an appropriate size corresponding to the recognized cell size.

請求項3の発明は、撮像された情報コードのコード画像から、当該コード画像を構成するセル画像の形状情報を取得し、この形状情報に基づいて、各セル画像の色判別の際に判別対象として用いる領域の形状を決定している。そして、コード画像を構成する各セル画像それぞれにおいて、サイズ決定手段によって決定されたサイズに相当し且つ形状決定手段によって決定された形状に相当する領域を参照し、各セル画像の色を判別している。このようにすると、色判別の際に判別対象として用いる領域のサイズのみならず、形状についても、撮像状態に応じて適切に変更することができるため、各セルの色判別を、より一層適切な判別方法で行うことができるようになる。   According to the third aspect of the present invention, shape information of the cell image constituting the code image is acquired from the code image of the imaged information code, and a discrimination target is determined when determining the color of each cell image based on the shape information. The shape of the region used as is determined. Then, in each of the cell images constituting the code image, the color corresponding to the size determined by the size determining unit and the region corresponding to the shape determined by the shape determining unit is referred to, and the color of each cell image is determined. Yes. In this way, since not only the size of the region used as a discrimination target in color discrimination but also the shape can be appropriately changed according to the imaging state, the color discrimination of each cell can be made more appropriate. It becomes possible to carry out by the discrimination method.

請求項4の発明は、撮像手段によって撮像された情報コードのコード画像において、当該コード画像を構成するセル画像の形状情報を取得し、その取得された形状情報に基づき、各セル画像の色判別の際に判別対象として用いる領域の形状を決定している。そして、コード画像を構成する各セル画像それぞれにおいて、形状決定手段によって決定された形状に相当する領域を参照し、各セル画像の色を判別している。このようにすると、色判別の際に判別対象として用いる領域の形状を、セル画像の形状に応じて変更することができるため、各セルの色判別を、撮像形状に適した判別方法で行うことができるようになる。   According to the invention of claim 4, in the code image of the information code imaged by the imaging means, the shape information of the cell image constituting the code image is acquired, and the color discrimination of each cell image is performed based on the acquired shape information. In this case, the shape of the region used as a discrimination target is determined. Then, in each cell image constituting the code image, the color corresponding to each cell image is determined with reference to the region corresponding to the shape determined by the shape determining means. In this way, since the shape of the region used as a discrimination target in color discrimination can be changed according to the shape of the cell image, the color discrimination of each cell is performed by a discrimination method suitable for the imaging shape. Will be able to.

請求項5の発明は、コード画像において、所定の中心セル画像と、当該中心セル画像の周囲に隣接する隣接セル画像とを検出し、中心セル画像から各隣接セル画像までの各距離を算出している。そして、それら算出された各距離に基づいて、各セル画像の色判別の際に用いる領域の形状を決定している。このようにすると、複雑な処理方法を用いることなくセル画像の形状を認識することができ、各セル画像の形状情報を迅速且つ簡易に取得できる。   The invention of claim 5 detects a predetermined center cell image and adjacent cell images adjacent to the periphery of the center cell image in the code image, and calculates each distance from the center cell image to each adjacent cell image. ing. And based on each calculated distance, the shape of the area | region used in the color discrimination of each cell image is determined. In this way, the shape of the cell image can be recognized without using a complicated processing method, and the shape information of each cell image can be acquired quickly and easily.

請求項6の発明は、中心セル画像の中心位置と、隣接セル画像の中心位置とを検出し、これら中心位置に基づいて各距離(中心セル画像から各隣接セル画像までの各距離)を算出している。このようにすると、中心セル画像と隣接セル画像がどのような距離関係にあるかを適切に把握でき、その距離関係に基づいて各セル画像の形状を適切に特定できるようになる。   The invention of claim 6 detects the center position of the center cell image and the center position of the adjacent cell image, and calculates each distance (each distance from the center cell image to each adjacent cell image) based on these center positions. is doing. In this way, it is possible to appropriately grasp the distance relationship between the center cell image and the adjacent cell image, and it is possible to appropriately identify the shape of each cell image based on the distance relationship.

請求項7の発明は、中心セル画像の上下左右に隣接する4つの第1隣接セル画像の中心位置、及び中心セル画像にそれぞれ斜めに隣接する4つの第2隣接セル画像の中心位置をそれぞれ検出している。そして、中心セル画像の中心位置と、4つの第1隣接セル画像の各中心位置との間の各第1間隔をそれぞれ算出すると共に、各第1隣接セル画像の中心位置と、当該各第1隣接セル画像の両側に隣接する各第2隣接セル画像の中心位置との間の各第2間隔をそれぞれ算出している。そして、このように算出された各第1間隔及び各第2間隔に基づいてセル形状を決定している。このようにすると、中心セルと、当該中心セルの上下左右に隣接する隣接セル(第1隣接セル)及び斜めに隣接する隣接セル(第2隣接セル)の位置関係を適切に把握でき、その位置関係に基づいて各セル画像の形状をより一層適切に特定できるようになる。   The invention according to claim 7 detects the center positions of the four first adjacent cell images adjacent to the center cell image vertically and horizontally, and the center positions of the four second adjacent cell images obliquely adjacent to the center cell image, respectively. is doing. And while calculating each 1st space | interval between the center position of a center cell image, and each center position of four 1st adjacent cell images, the center position of each 1st adjacent cell image and each said 1st The second intervals between the center positions of the second adjacent cell images adjacent to both sides of the adjacent cell image are calculated. Then, the cell shape is determined based on the first intervals and the second intervals calculated in this way. In this way, it is possible to appropriately grasp the positional relationship between the central cell, the adjacent cell (first adjacent cell) vertically adjacent to the central cell (first adjacent cell), and the diagonally adjacent cell (second adjacent cell). The shape of each cell image can be specified more appropriately based on the relationship.

図1は、本発明の第1実施形態に係る情報コード読取装置の電気的構成を概略的に例示するブロック図である。FIG. 1 is a block diagram schematically illustrating an electrical configuration of the information code reader according to the first embodiment of the present invention. 図2は、図1の情報コード読取装置で行われる読取処理を例示するフローチャートである。FIG. 2 is a flowchart illustrating a reading process performed by the information code reading device of FIG. 図3は、図2の読取処理で行われるデコード処理を例示するフローチャートである。FIG. 3 is a flowchart illustrating the decoding process performed in the reading process of FIG. 図4は、図3のデコード処理で行われるセル色判別処理を例示するフローチャートである。FIG. 4 is a flowchart illustrating a cell color discrimination process performed in the decoding process of FIG. 図5(a)は、図1の情報コード読取装置で読み取られる情報コードのセル配列を概念的に例示する説明図であり、図5(b)は、図5(a)の情報コードを撮像した画像例を示す説明図である。FIG. 5A is an explanatory diagram conceptually illustrating a cell array of information codes read by the information code reader of FIG. 1, and FIG. 5B images the information code of FIG. 5A. It is explanatory drawing which shows the example of an image. 図6(a)は、図5(b)のコード画像においていずれかを着目セル画像とした場合の着目セル画像及びその周囲のセル画像を概念的に示す説明図であり、図6(b)は、着目セル画像(中心セル画像)と各第1隣接セル画像との間の間隔(第1間隔)、及び、隣接セル画像同士の間隔(第2間隔)を説明する説明図である。FIG. 6A is an explanatory diagram conceptually showing the target cell image and the surrounding cell images when any one of the code images in FIG. 5B is used as the target cell image. These are explanatory drawings explaining the space | interval (1st space | interval) between an attention cell image (center cell image) and each 1st adjacent cell image, and the space | interval (2nd space | interval) between adjacent cell images. 図7(a)は、着目セル画像(中心セル画像)と各第1隣接セル画像との間の各距離値(第1間隔)を例示する説明図である。図7(b)は、参照領域を決定する上で基準となる基準領域を概念的に説明する説明図であり、図7(c)は、図7(a)の各距離値(第1間隔)に基づいて基準領域を拡張した例を示す説明図である。FIG. 7A is an explanatory diagram illustrating distance values (first intervals) between a target cell image (center cell image) and each first adjacent cell image. FIG. 7B is an explanatory diagram conceptually illustrating a reference area that serves as a reference in determining the reference area. FIG. 7C illustrates each distance value (first interval) in FIG. 7A. FIG. 6 is an explanatory diagram illustrating an example in which a reference region is expanded based on (). 図8(a)は、隣接セル間の各距離値(第2間隔)を例示する説明図であり、図8(b)は、拡張領域について、中心画素、最上列、最下列、最左列、最右列等の関係を示す説明図である。また、図8(c)は、図8(a)の各距離値(第2間隔)に基づいて図8(b)の拡張領域を更に拡張し、参照領域を定めた例を示す説明図である。FIG. 8A is an explanatory diagram illustrating each distance value (second interval) between adjacent cells, and FIG. 8B illustrates the center pixel, the top row, the bottom row, and the leftmost row for the extended region. It is explanatory drawing which shows relationships, such as a rightmost column. FIG. 8C is an explanatory diagram showing an example in which the extension region in FIG. 8B is further expanded and the reference region is determined based on the distance values (second intervals) in FIG. is there. 図9は、他の実施形態に関し、各セル画像のサイズに基づいて参照領域のサイズを決定する場合の設定例を示す説明図である。FIG. 9 is an explanatory diagram illustrating a setting example in the case where the size of the reference area is determined based on the size of each cell image according to another embodiment.

[第1実施形態]
以下、本発明を具現化した第1実施形態について、図面を参照して説明する。
(全体構成)
まず、第1実施形態に係る情報コード読取装置の全体構成を概説する。
本実施形態に係る情報コード読取装置1は、主に、照明光源21、受光センサ23、フィルタ25、結像レンズ27等の光学系と、メモリ35、制御回路40、操作スイッチ42、液晶表示装置46等のマイクロコンピュータ(以下「マイコン」という)系と、電源スイッチ41、電池49等の電源系と、から構成されている。
[First embodiment]
Hereinafter, a first embodiment embodying the present invention will be described with reference to the drawings.
(overall structure)
First, the overall configuration of the information code reading apparatus according to the first embodiment will be outlined.
The information code reader 1 according to the present embodiment mainly includes an optical system such as an illumination light source 21, a light receiving sensor 23, a filter 25, and an imaging lens 27, a memory 35, a control circuit 40, an operation switch 42, and a liquid crystal display device. And a power supply system such as a power switch 41 and a battery 49.

光学系は、照明光源21、受光センサ23、フィルタ25、結像レンズ27等から構成されている。照明光源21は、照明光Lfを発光可能な照明光源として機能するもので、例えば、LEDとこのLEDの出射側に設けられる拡散レンズ、集光レンズ等とから構成されている。本実施形態では、ハウジングの読取口(図1では図示略)を介して読取対象物Rに向けて照明光Lfを照射可能に構成されている。この読取対象物Rは、例えば、包装容器や包装用紙あるいはラベルといった表示媒体に相当するもので、この読取対象物Rには読取対象となる二次元コード100が印刷等によって形成されている。   The optical system includes an illumination light source 21, a light receiving sensor 23, a filter 25, an imaging lens 27, and the like. The illumination light source 21 functions as an illumination light source capable of emitting the illumination light Lf, and includes, for example, an LED and a diffusing lens, a condensing lens, and the like provided on the emission side of the LED. In this embodiment, the illumination light Lf can be irradiated toward the reading object R through a reading port (not shown in FIG. 1) of the housing. The reading object R corresponds to, for example, a display medium such as a packaging container, wrapping paper, or label, and a two-dimensional code 100 to be read is formed on the reading object R by printing or the like.

受光センサ23は、読取対象物Rや二次元コード100に照射されて反射した反射光Lrを受光可能に構成されるもので、例えば、C−MOSやCCD等の固体撮像素子である受光素子を2次元に配列したエリアセンサが、これに相当する。受光センサ23は、結像レンズ27を介して入射する入射光を受光面23aにて受光し得る構成でプリント配線板(図示略)に実装されている。本実施形態では、受光センサ23が「撮像手段」の一例に相当する。   The light receiving sensor 23 is configured to receive the reflected light Lr irradiated and reflected on the reading object R or the two-dimensional code 100. For example, the light receiving sensor 23 is a solid-state image sensor such as a C-MOS or CCD. An area sensor arranged in two dimensions corresponds to this. The light receiving sensor 23 is mounted on a printed wiring board (not shown) in such a configuration that incident light incident through the imaging lens 27 can be received by the light receiving surface 23a. In the present embodiment, the light receiving sensor 23 corresponds to an example of “imaging means”.

フィルタ25は、反射光Lrの波長相当以下の光の通過を許容し、当該波長相当を超える光の通過を遮断し得る光学的なローパスフィルタであり、反射光Lrの波長相当を超える不要な光が受光センサ23に入射することを抑制している。また、結像レンズ27は、外部から読取口を介して入射する入射光を集光して受光センサ23の受光面23aに像を結像する結像光学系として機能するもので、例えば、鏡筒とこの鏡筒内に収容される複数の集光レンズとにより構成されている。なお、本実施形態では、結像レンズ27が「結像手段」の一例に相当し、二次元コード100(情報コード)からの反射光を取り込み、当該二次元コード100の像を受光センサ23(撮像手段)において結像させるように機能する。   The filter 25 is an optical low-pass filter that allows passage of light that is less than or equal to the wavelength of the reflected light Lr and blocks passage of light that exceeds that of the reflected light Lr. Unnecessary light that exceeds the wavelength of the reflected light Lr Is prevented from entering the light receiving sensor 23. The imaging lens 27 functions as an imaging optical system that collects incident light incident from the outside via a reading port and forms an image on the light receiving surface 23a of the light receiving sensor 23. It is comprised by the cylinder and the some condensing lens accommodated in this barrel. In the present embodiment, the imaging lens 27 corresponds to an example of an “imaging unit”. The reflected light from the two-dimensional code 100 (information code) is taken in, and the image of the two-dimensional code 100 is received by the light receiving sensor 23 ( The imaging means) functions to form an image.

次に、マイコン系の構成概要を説明する。マイコン系は、増幅回路31、A/D変換回路33、メモリ35、アドレス発生回路36、同期信号発生回路38、制御回路40、操作スイッチ42、LED43、ブザー44、液晶表示装置46、通信インタフェース48等から構成されている。このマイコン系は、その名の通り、マイコン(情報処理装置)として機能し得る制御回路40及びメモリ35を中心に構成されるもので、前述した光学系によって撮像された二次元コード100の画像信号をハードウェア的およびソフトウェア的に信号処理し得るものである。また制御回路40は、当該情報コード読取装置1の全体システムに関する制御も行っている。   Next, a configuration outline of the microcomputer system will be described. The microcomputer system includes an amplification circuit 31, an A / D conversion circuit 33, a memory 35, an address generation circuit 36, a synchronization signal generation circuit 38, a control circuit 40, an operation switch 42, an LED 43, a buzzer 44, a liquid crystal display device 46, and a communication interface 48. Etc. As the name suggests, this microcomputer system is composed mainly of a control circuit 40 and a memory 35 that can function as a microcomputer (information processing apparatus). The image signal of the two-dimensional code 100 imaged by the optical system described above. Can be processed in hardware and software. The control circuit 40 also performs control related to the entire system of the information code reader 1.

このマイコン系では、光学系の受光センサ23から出力される画像信号(アナログ信号)を、増幅回路31にて所定ゲインで増幅し、その増幅信号をA/D変換回路33によってアナログ信号からディジタル信号に変換している。このディジタル化された画像信号(即ち、画像データ)は、メモリ35に入力され、画像データ蓄積領域に蓄積される。なお、同期信号発生回路38は、受光センサ23およびアドレス発生回路36に対する同期信号を発生可能に構成されており、またアドレス発生回路36は、この同期信号発生回路38から供給される同期信号に基づいて、メモリ35に格納される画像データの格納アドレスを発生可能に構成されている。   In this microcomputer system, an image signal (analog signal) output from the light receiving sensor 23 of the optical system is amplified by the amplification circuit 31 with a predetermined gain, and the amplified signal is converted from an analog signal to a digital signal by the A / D conversion circuit 33. Has been converted. The digitized image signal (that is, image data) is input to the memory 35 and stored in the image data storage area. The synchronization signal generation circuit 38 is configured to generate a synchronization signal for the light receiving sensor 23 and the address generation circuit 36. The address generation circuit 36 is based on the synchronization signal supplied from the synchronization signal generation circuit 38. Thus, the storage address of the image data stored in the memory 35 can be generated.

メモリ35は、半導体メモリ装置として構成されており、例えばRAM(DRAM、SRAM等)やROM(EPROM、EEPROM等)がこれに相当する。このメモリ35のうちのRAMには、前述した画像データ蓄積領域のほかに、制御回路40が算術演算や論理演算等の各処理時に利用する作業領域や読取条件テーブルなども確保可能に構成されている。またROMには、後述する読取処理等を実行可能な所定プログラムやその他、照明光源21、受光センサ23等の各ハードウェアを制御可能なシステムプログラム等が予め格納されている。   The memory 35 is configured as a semiconductor memory device, and corresponds to, for example, a RAM (DRAM, SRAM, etc.) or a ROM (EPROM, EEPROM, etc.). In addition to the above-described image data storage area, the RAM of the memory 35 is configured so as to be able to secure a work area, a reading condition table, and the like that are used by the control circuit 40 at each processing such as arithmetic operation and logical operation. Yes. The ROM stores in advance a predetermined program that can execute a reading process and the like that will be described later, and a system program that can control each hardware such as the illumination light source 21 and the light receiving sensor 23.

制御回路40は、情報コード読取装置1全体を制御しうるものであり、例えばCPU、システムバス、入出力インタフェース等を備えたマイコンによって構成されている。この制御回路40は、情報処理機能を有しており、内蔵された入出力インタフェースを介して種々の入出力装置(周辺装置)が接続可能とされている。本実施形態では、図1に示すように、電源スイッチ41、操作スイッチ42、LED43、ブザー44、液晶表示装置46、通信インタフェース48などが制御回路40に接続されている。なお、通信インタフェース48には、当該情報コード読取装置1の上位システムに相当するホストコンピュータHST等が接続可能とされている。   The control circuit 40 is capable of controlling the entire information code reader 1 and is constituted by a microcomputer including, for example, a CPU, a system bus, an input / output interface, and the like. The control circuit 40 has an information processing function, and various input / output devices (peripheral devices) can be connected via a built-in input / output interface. In the present embodiment, as shown in FIG. 1, a power switch 41, an operation switch 42, an LED 43, a buzzer 44, a liquid crystal display device 46, a communication interface 48, and the like are connected to the control circuit 40. The communication interface 48 can be connected to a host computer HST or the like corresponding to the host system of the information code reader 1.

電源系は、電源スイッチ41、電池49等によって構成されており、制御回路40のオンオフ制御により、電池49から上述した各装置や各回路に対して供給される駆動電圧の導通や遮断が制御されている。   The power supply system includes a power switch 41, a battery 49, and the like, and the on / off control of the control circuit 40 controls the conduction and interruption of the drive voltage supplied from the battery 49 to the above-described devices and circuits. ing.

(二次元コード)
次に、情報コード読取装置1の読取対象となる二次元コードを説明する。なお、図5(a)は、第1実施形態に係る情報コード読取装置1で読み取られる情報コードのセル配列を概念的に例示する説明図であり、図5(b)は、図5(a)の情報コードを撮像した画像例を示す説明図である。
(Two-dimensional code)
Next, a two-dimensional code to be read by the information code reader 1 will be described. FIG. 5A is an explanatory diagram conceptually illustrating the cell arrangement of information codes read by the information code reader 1 according to the first embodiment, and FIG. 5B is a diagram illustrating FIG. It is explanatory drawing which shows the example of an image which imaged the information code of ().

この二次元コード100は、外形が正方形状のセルCが集合してマトリックス状に配置されたセル集合体として構成されており、図5(a)の例では、セル数が縦横同数(12セル×12セル)となる配列で構成されている。また、二次元コード100のコード領域(セルCが配置される領域)は、外形が矩形状の矩形領域(図5(a)の例では、外形が正方形状の正方形領域)とされている。なお、図5(a)では、一部のセルのみに符号Cを付しており、他のセルの符号は省略している。また、図5(a)では、具体的セル構成は省略して示している。   The two-dimensional code 100 is configured as a cell aggregate in which cells C having a square outer shape are aggregated and arranged in a matrix. In the example of FIG. 5A, the number of cells is the same in the vertical and horizontal directions (12 cells). × 12 cells). The code area of the two-dimensional code 100 (area where the cell C is arranged) is a rectangular area whose outer shape is rectangular (in the example of FIG. 5A, the outer shape is a square area having a square shape). In FIG. 5 (a), only some of the cells are denoted by reference symbol C, and the reference numerals of other cells are omitted. In FIG. 5A, a specific cell configuration is omitted.

図5(a)に示す二次元コード100は、例えば、色彩又は濃度又は輝度の異なる3種類以上のセルを用いたいわゆるカラーコードとして構成されており、コード領域内に、特定パターン(データに関係なく一定のパターン)や、複数のコードブロック(データを表すデータコードブロックや、誤り訂正を行うための誤り訂正コードブロック等)が配置されている。なお、コードブロックでは、数値とセル表示色とが対応付けられており、例えば、データ値「0」に対して第1の色「白」、データ値「1」に対して第2の色「赤」、データ値「2」に対して第3の色「緑」、データ値「3」に対して第4の色「青」、データ値「4」、に対して第5の色「マゼンタ」、データ値「5」に対して第6の色「黄」、データ値「6」に対して第7の色「シアン」、データ値「7」、に対して第8の色「黒」といった具合に対応付けられている。   The two-dimensional code 100 shown in FIG. 5A is configured as a so-called color code using, for example, three or more types of cells having different colors, densities, or luminances. A specific pattern (related to data) is included in the code area. A predetermined pattern) and a plurality of code blocks (a data code block representing data, an error correction code block for error correction, etc.) are arranged. In the code block, the numerical value and the cell display color are associated with each other. For example, the first color “white” with respect to the data value “0” and the second color “with respect to the data value“ 1 ”. The third color “green” for the data value “2”, the fourth color “blue” for the data value “3”, and the fifth color “magenta” for the data value “4”. The sixth color “yellow” for the data value “5”, the seventh color “cyan” for the data value “6”, and the eighth color “black” for the data value “7”. Are associated with each other.

(読取処置)
次に、情報コード読取装置1で行われる読取処理について説明する。
図2は、情報コード読取装置1で行われる読取処理の流れを例示するフローチャートである。図2に示す読取処理は、例えば作業者が所定操作(例えば、操作スイッチ42のオン操作)を行うことで開始され、まず、画像取得処理が行われる(S1)。この処理では、二次元コード100が付された読取対象物R(図1)が受光センサ23によって撮像され、二次元コード100の画像データがメモリ35に記憶される。
(Reading treatment)
Next, a reading process performed by the information code reading device 1 will be described.
FIG. 2 is a flowchart illustrating the flow of reading processing performed by the information code reading device 1. The reading process shown in FIG. 2 is started, for example, when a worker performs a predetermined operation (for example, turning on the operation switch 42), and first, an image acquisition process is performed (S1). In this process, the reading object R (FIG. 1) to which the two-dimensional code 100 is attached is imaged by the light receiving sensor 23, and the image data of the two-dimensional code 100 is stored in the memory 35.

その後、S1にて取得された画像データにおいて二次元コード100のコード領域(矩形領域)を特定する処理を行う(S2)。この特定処理では、例えば外縁が特定図形(例えば略四角形)となっている領域を抽出したり、或いは、外縁の明暗変化、色変化が激しい領域を抽出することで、コード領域(情報コードと推定される領域)を特定する。なお、画像処理の分野において異なる色の領域を区別する技術は各種提供されているため、これら公知の方法を用いて領域を特定してもよい。   Thereafter, a process of specifying a code area (rectangular area) of the two-dimensional code 100 in the image data acquired in S1 is performed (S2). In this specifying process, for example, an area where the outer edge is a specific figure (for example, a substantially quadrilateral shape) is extracted, or an area where the outer edge is light and dark, or a color change is intense, is extracted. Specified area). Since various techniques for distinguishing different color areas are provided in the field of image processing, the areas may be specified using these known methods.

S2の特定処理の後には、S2の処理においてコード領域(矩形領域)が特定できたか否かを判断し(S3)、特定できた場合にはS3にてYesに進み、デコード処理を行う(S4)。一方、特定できなかった場合には、S3にてNoに進み、当該読取処理を終了する。   After the specifying process of S2, it is determined whether or not the code area (rectangular area) can be specified in the process of S2 (S3). If it can be specified, the process proceeds to Yes in S3 and the decoding process is performed (S4). ). On the other hand, if it cannot be specified, the process proceeds to No in S3, and the reading process ends.

次に、S4のデコード処理について説明する。S4のデコード処理は、例えば図3のような流れで行われ、まず、コード領域(矩形領域)をセル単位に分割し、セル位置を特定する処理を行う(S11)。このS11の処理では、コード画像を構成する各セル画像の中心画素を検出している。
なお、S11の処理を実行する制御回路40は、「中心画素検出手段」「中心位置検出手段」「セル画像検出手段」の一例に相当する。
Next, the decoding process in S4 will be described. The decoding process of S4 is performed in the flow as shown in FIG. 3, for example. First, the code area (rectangular area) is divided into cell units, and the process of specifying the cell position is performed (S11). In the process of S11, the center pixel of each cell image constituting the code image is detected.
The control circuit 40 that executes the process of S11 corresponds to an example of “center pixel detection means”, “center position detection means”, and “cell image detection means”.

S11の処理の後には、S11で特定された全セルの内の未選択となっているいずれかのセルを選択する処理を行う(S12)。本実施形態では、コード領域を構成する各セルに対してS13、S14の処理が行われるようになっており、このS12の処理では、S13、S14の処理が未だ行われていないいずれかのセルを選択することになる。S12でいずれかのセルが選択された後には、その選択されたセルの色を判別する処理を行う(S13)。   After the process of S11, the process which selects the cell which is not selected among all the cells specified by S11 is performed (S12). In the present embodiment, the processes of S13 and S14 are performed on each cell constituting the code area. In the process of S12, any cell for which the processes of S13 and S14 have not been performed yet. Will be selected. After any cell is selected in S12, a process of determining the color of the selected cell is performed (S13).

S13のセル色判別処理は、例えば図4のような流れで行われ、まず、S12で選択されたセル(現在の着目セル)と、当該着目セルの周囲の隣接セルとの間の各距離値を算出する処理を行う(S21)。この処理では、S12で選択された着目セルの画像を中心セル画像とし、当該中心セル画像の周囲に隣接する隣接セル画像を検出し、中心セル画像から各隣接セル画像までの各距離値を算出する。具体的には、図6(a)に示すように、S11で特定された各セルの中心位置の座標データの中から、S12で選択されたセル画像(中心セル画像C1)の中心位置P1の座標と、中心セル画像C1の上下左右に隣接する4つの第1隣接セル画像D1、D2、D3、D4の中心位置Q1,Q2,Q3、Q4の座標を読み出し、図6(b)に示すように、着目セル画像(中心セル画像C1)の中心位置P1と、4つの第1隣接セル画像の各中心位置Q1〜Q4との間の各距離値A1、A2、A3、A4(第1間隔)を算出している。   The cell color determination process in S13 is performed, for example, as shown in FIG. 4. First, each distance value between the cell selected in S12 (the current target cell) and neighboring cells around the target cell. Is performed (S21). In this process, the image of the cell of interest selected in S12 is used as a central cell image, adjacent cell images adjacent to the periphery of the central cell image are detected, and each distance value from the central cell image to each adjacent cell image is calculated. To do. Specifically, as shown in FIG. 6A, the center position P1 of the cell image (center cell image C1) selected in S12 from the coordinate data of the center position of each cell specified in S11. The coordinates and the coordinates of the center positions Q1, Q2, Q3, and Q4 of the four first adjacent cell images D1, D2, D3, and D4 that are adjacent in the vertical and horizontal directions of the central cell image C1 are read out as shown in FIG. Further, distance values A1, A2, A3, A4 (first intervals) between the center position P1 of the target cell image (center cell image C1) and the center positions Q1 to Q4 of the four first adjacent cell images. Is calculated.

なお、着目セル画像C1(対象セル画像)と各第1隣接セル画像D1,D2,D3、D4との各距離値A1〜A4は、着目セル画像C1の大きさを反映しており、S21の処理を実行する制御回路40が「割当サイズ検出手段」の一例に相当し、受光センサ23(撮像手段)によって撮像された二次元コード100(情報コード)のコード画像において、各セル画像に割り当てられた割当領域の大きさを検出するように機能する。
また、S21の処理を実行する制御回路40は、「距離算出手段」の一例に相当し、中心セル画像から各隣接セル画像までの各距離値を算出するように機能する。
The distance values A1 to A4 between the target cell image C1 (target cell image) and each of the first adjacent cell images D1, D2, D3, and D4 reflect the size of the target cell image C1, and in S21 The control circuit 40 that executes processing corresponds to an example of “allocation size detection means”, and is assigned to each cell image in the code image of the two-dimensional code 100 (information code) imaged by the light receiving sensor 23 (imaging means). It functions to detect the size of the allocated area.
The control circuit 40 that executes the process of S21 corresponds to an example of a “distance calculation unit”, and functions to calculate each distance value from the center cell image to each adjacent cell image.

図4のS21の処理後には、着目セルの周囲に配される隣接セル同士の距離値を算出する処理を行う(S22)。本実施形態では、上述したように、S11の処理により、中心セル画像C1の上下左右に隣接する4つの第1隣接セル画像D1〜D4の各中心位置Q1〜Q4の座標、及び中心セル画像C1にそれぞれ斜めに隣接する4つの第2隣接セル画像E1〜E4の各中心位置R1〜R4の座標がそれぞれ特定されており、S22では、まず、各第1隣接セル画像D1〜D4の中心位置Q1〜Q4の座標と、各第2隣接セル画像E1〜E4の各中心位置R1〜R4の座標を読み出している。そして、各中心位置Q1〜Q4及び各中心位置R1〜R4において、隣接するセル間の各距離値B1〜B8(各第2間隔)をそれぞれ算出している。   After the process of S21 in FIG. 4, a process of calculating a distance value between adjacent cells arranged around the target cell is performed (S22). In the present embodiment, as described above, by the processing of S11, the coordinates of the center positions Q1 to Q4 of the four first adjacent cell images D1 to D4 adjacent to the center cell image C1 in the vertical and horizontal directions, and the center cell image C1. The coordinates of the center positions R1 to R4 of the four second adjacent cell images E1 to E4 that are obliquely adjacent to each other are respectively specified. In S22, first, the center position Q1 of each of the first adjacent cell images D1 to D4 is specified. The coordinates of .about.Q4 and the coordinates of the center positions R1 to R4 of the second adjacent cell images E1 to E4 are read out. And in each center position Q1-Q4 and each center position R1-R4, each distance value B1-B8 (each 2nd space | interval) between adjacent cells is calculated, respectively.

なお、S22の処理を実行する制御回路40は、「隣接セル間隔算出手段」の一例に相当する。
また、着目セル画像(中心セル画像C1)と各第1隣接セル画像D1〜D4との各距離値A1〜A4、及び隣接セル画像同士の各距離値B1〜B4は、着目セル画像(中心セル画像C1)の形状を反映する「形状情報」に相当する。また、S21、S22の処理を実行する制御回路40は、「形状情報取得手段」の一例に相当し、受光センサ23(撮像手段)によって撮像された二次元コード100(情報コード)のコード画像から、当該コード画像を構成する各セル画像の「形状情報」を取得するように機能する。
The control circuit 40 that executes the process of S22 corresponds to an example of “adjacent cell interval calculation means”.
Further, the distance values A1 to A4 between the target cell image (center cell image C1) and the first adjacent cell images D1 to D4 and the distance values B1 to B4 between the adjacent cell images are the same as the target cell image (center cell). This corresponds to “shape information” reflecting the shape of the image C1). The control circuit 40 that executes the processes of S21 and S22 corresponds to an example of “shape information acquisition unit”, and is based on a code image of the two-dimensional code 100 (information code) captured by the light receiving sensor 23 (imaging unit). , And functions to acquire “shape information” of each cell image constituting the code image.

図4のS22の処理後には、着目セルの色判別の際に参照すべき参照領域のサイズ及び形状を決定する処理を行う(S23)。
この処理では、S21で算出された各距離値A1〜A4(第1間隔)と、S23の処理で算出された各距離値B1〜B8(第2間隔)とに基づいて、着目セル(中心セル)の参照領域のサイズ及び形状を決定している。
After the process of S22 in FIG. 4, a process for determining the size and shape of the reference area to be referred to when the color of the cell of interest is determined (S23).
In this process, based on the distance values A1 to A4 (first interval) calculated in S21 and the distance values B1 to B8 (second interval) calculated in S23, the target cell (center cell) The size and shape of the reference area are determined.

本実施形態では、例えば図7(b)のような基準領域が予め定められており、S23の処理では、まず、S21、S22での距離算出結果に基づいて、この基準領域よりも大きいサイズの拡張領域を設定している。具体的には、中心セル画像C1と上方の第1隣接セル画像D1との距離関係に基づいて、図7(b)の基準領域を上方へどの程度拡張するかを定めており、同様に、中心セル画像C1と下方の第1隣接セル画像D2との距離関係に基づいて、基準領域を下方へどの程度拡張するかを定めている。また、中心セル画像C1と左方の第1隣接セル画像D3との距離関係に基づいて、基準領域の左方へどの程度拡張するかを定めており、中心セル画像C1と右方の第1隣接セル画像D4との距離関係に基づいて、基準領域を左方へどの程度拡張するかを定めている。   In this embodiment, for example, a reference area as shown in FIG. 7B is determined in advance. In the process of S23, first, based on the distance calculation results in S21 and S22, a size larger than this reference area is set. An extended area is set. Specifically, based on the distance relationship between the center cell image C1 and the upper first adjacent cell image D1, it is determined how much the reference region in FIG. Based on the distance relationship between the center cell image C1 and the lower first adjacent cell image D2, it is determined how much the reference region is expanded downward. Further, based on the distance relationship between the center cell image C1 and the first adjacent cell image D3 on the left side, the extent to which the center cell image C1 and the first cell on the right side are expanded is determined. Based on the distance relationship with the adjacent cell image D4, it is determined how much the reference area is expanded to the left.

本実施形態では、S21、S22において距離値を算出する上で基準となる単位サイズ(単位長さ)がNと定められており、各距離値A1〜A4は、各中心間距離がこのNの約何倍であるかを示す値として求めている。例えば、中心セル画像C1の中心位置P1から第1隣接セル画像D1の中心位置Q1までの実際の距離がA1’である場合、A1’/Nの整数部分の値(即ち、A1’/Nの小数部分を切り捨てた値)を距離A1の値としている。同様に、中心位置P1から中心位置Q2までの実際の距離をA2’としたときのA2’/Nの整数部分の値をA2とし、中心位置P1から中心位置Q3までの実際の距離をA3’としたときのA3’/Nの整数部分の値をA3とし、中心位置P1から中心位置Q4までの実際の距離をA4’としたときのA4’/Nの整数部分の値をA4として求めている。   In the present embodiment, the unit size (unit length) serving as a reference in calculating the distance value in S21 and S22 is N, and each distance value A1 to A4 is such that the distance between the centers is N. It is obtained as a value indicating how many times it is. For example, when the actual distance from the center position P1 of the center cell image C1 to the center position Q1 of the first adjacent cell image D1 is A1 ′, the value of the integer part of A1 ′ / N (that is, A1 ′ / N The value obtained by discarding the decimal part) is the value of the distance A1. Similarly, the value of the integer part of A2 ′ / N when the actual distance from the center position P1 to the center position Q2 is A2 ′ is A2, and the actual distance from the center position P1 to the center position Q3 is A3 ′. The value of the integer part of A3 ′ / N is determined as A3, and the value of the integer part of A4 ′ / N is determined as A4 when the actual distance from the center position P1 to the center position Q4 is A4 ′. Yes.

S23では、このようにして得られた各距離値A1、A2、A3、A4の分だけ、基準領域を上下左右に拡張している。上方については、中心画素W1の上方列G2を上方にA1倍拡張し、下方については、中心画素F1の下方列G2を下方にA2倍拡張する。また、左方については、中心画素W1の左方列G3を左方にA3倍拡張し、右方については、中心画素F1の右方列G4を右方にA4倍拡張する。従って、中心画素G1の上方には、A1列配置されることになり、中心画素F1の下方にはA2列配置されることになる。また、中心画素F1の左方には、A3列配置され、中心画素F1の右方にはA4列配置される。そして、全体としてX行Y列(X×Y)の拡張領域が得られる(但し、X=A1+A2+1、Y=A3+A4+1)。   In S23, the reference area is expanded vertically and horizontally by the distance values A1, A2, A3, and A4 thus obtained. For the upper part, the upper column G2 of the center pixel W1 is expanded upward A1 times, and for the lower part, the lower column G2 of the center pixel F1 is expanded downward A2 times. For the left, the left column G3 of the center pixel W1 is expanded A3 times to the left, and for the right, the right column G4 of the center pixel F1 is expanded A4 times to the right. Therefore, the A1 column is arranged above the center pixel G1, and the A2 column is arranged below the center pixel F1. Further, A3 columns are arranged to the left of the center pixel F1, and A4 columns are arranged to the right of the center pixel F1. As a whole, an extended region of X rows and Y columns (X × Y) is obtained (where X = A1 + A2 + 1, Y = A3 + A4 + 1).

図7(a)の例では、S21で得られた各距離値A1〜A4が、A1=1、A2=2、A3=2、A4=2である場合を例示しており、このような場合、基準領域が3行3列(図7(b))のときには、上方列が1倍拡張され(即ち変化はなく)、下方列が2倍に拡張され、左方列が2倍に拡張され、右方列が2倍に拡張される。そして、全体として図7(c)のような4行5列の拡張領域が得られる。   In the example of FIG. 7A, the case where the distance values A1 to A4 obtained in S21 are A1 = 1, A2 = 2, A3 = 2, and A4 = 2 is illustrated. When the reference area is 3 rows and 3 columns (FIG. 7B), the upper column is expanded 1 time (ie, there is no change), the lower column is expanded 2 times, and the left column is expanded 2 times. , The right column is doubled. As a whole, an extended region of 4 rows and 5 columns as shown in FIG. 7C is obtained.

更に、本実施形態では、隣接セル同士の距離関係に基づいて、上記拡張領域の形状変化度合を決定している。具体的には、中心セル画像C1の上方に配置される第1隣接セル画像D1と、各第2隣接セル画像E1、E3との各距離関係を求め、これら各距離関係に基づいて、図8(b)に示す拡張領域の最上列H1の形状変化度合を決定している。同様に、中心セル画像C1の下方に配置される第1隣接セル画像D2と各第2隣接セル画像E2、E4との各距離関係を求め、これら各距離関係に基づいて拡張領域の最下列H2の形状変化度合を決定している。更に、中心セル画像C1の左方に配置される第1隣接セル画像D3と各第2隣接セル画像E1、E2との各距離関係を求め、これら各距離関係に基づいて拡張領域の最左列H3の形状変化度合を決定している。更に、中心セル画像C1の右方に配置される第1隣接セル画像D4と各第2隣接セル画像E3、E4との各距離関係を求め、これら各距離関係に基づいて拡張領域の最右列H4の形状変化度合を決定している。   Furthermore, in this embodiment, the shape change degree of the extended region is determined based on the distance relationship between adjacent cells. Specifically, distance relationships between the first adjacent cell image D1 disposed above the center cell image C1 and the second adjacent cell images E1 and E3 are obtained, and based on these distance relationships, FIG. The shape change degree of the uppermost row H1 of the extended region shown in (b) is determined. Similarly, each distance relationship between the first adjacent cell image D2 and the second adjacent cell images E2 and E4 arranged below the center cell image C1 is obtained, and the lowest row H2 of the extension region is obtained based on these distance relationships. The degree of shape change is determined. Further, the distance relationship between the first adjacent cell image D3 and the second adjacent cell images E1 and E2 arranged on the left side of the center cell image C1 is obtained, and the leftmost column of the extension region is obtained based on these distance relationships. The degree of change in shape of H3 is determined. Further, the distance relationship between the first adjacent cell image D4 and the second adjacent cell images E3 and E4 arranged on the right side of the center cell image C1 is obtained, and the rightmost column of the extension region is determined based on these distance relationships. The degree of change in shape of H4 is determined.

本実施形態では、S22において、各距離値A1〜A4の算出方法と同様の方法で各距離値B1〜B8が求められている。即ち、中心位置Q1から中心位置R1,R3までの実際の距離がそれぞれB1’、B2’である場合、B1’/Nの整数部分の値(即ち、B1’/Nの小数部分を切り捨てた値)を距離値B1とし、B2’/Nの整数部分の値(即ち、B2’/Nの小数部分を切り捨てた値)を距離値B2として求めている。同様に、中心位置Q2から中心位置R2,R4までの実際の距離がそれぞれB5’、B6’である場合、B5’/Nの整数部分の値(即ち、B5’/Nの小数部分を切り捨てた値)を距離値B5とし、B6’/Nの整数部分の値(即ち、B6’/Nの小数部分を切り捨てた値)を距離値B6として求めている。更に、中心位置Q3から中心位置R1,R2までの実際の距離がそれぞれB3’、B4’である場合、B3’/Nの整数部分の値(即ち、B3’/Nの小数部分を切り捨てた値)を距離値B3とし、B4’/Nの整数部分の値(即ち、B4’/Nの小数部分を切り捨てた値)を距離値B4としている。また、中心位置Q4から中心位置R3,R4までの実際の距離がそれぞれB7’、B8’である場合、B7’/Nの整数部分の値(即ち、B7’/Nの小数部分を切り捨てた値)を距離値B7とし、B8’/Nの整数部分の値(即ち、B8’/Nの小数部分を切り捨てた値)を距離値B8としている。   In this embodiment, in S22, each distance value B1-B8 is calculated | required by the method similar to the calculation method of each distance value A1-A4. That is, when the actual distances from the center position Q1 to the center positions R1 and R3 are B1 ′ and B2 ′, respectively, the value of the integer part of B1 ′ / N (that is, the value obtained by rounding down the decimal part of B1 ′ / N) ) Is the distance value B1, and the value of the integer part of B2 ′ / N (that is, the value obtained by discarding the decimal part of B2 ′ / N) is obtained as the distance value B2. Similarly, when the actual distances from the center position Q2 to the center positions R2 and R4 are B5 ′ and B6 ′, respectively, the value of the integer part of B5 ′ / N (that is, the decimal part of B5 ′ / N is rounded down) Value) is the distance value B5, and the value of the integer part of B6 ′ / N (that is, the value obtained by discarding the decimal part of B6 ′ / N) is obtained as the distance value B6. Further, when the actual distances from the center position Q3 to the center positions R1 and R2 are B3 ′ and B4 ′, respectively, the value of the integer part of B3 ′ / N (that is, the value obtained by rounding down the decimal part of B3 ′ / N) ) Is the distance value B3, and the value of the integer part of B4 ′ / N (that is, the value obtained by discarding the decimal part of B4 ′ / N) is the distance value B4. When the actual distances from the center position Q4 to the center positions R3 and R4 are B7 ′ and B8 ′, respectively, the value of the integer part of B7 ′ / N (ie, the value obtained by rounding down the decimal part of B7 ′ / N) ) Is the distance value B7, and the value of the integer part of B8 ′ / N (that is, the value obtained by discarding the decimal part of B8 ′ / N) is the distance value B8.

S23の処理では、このようにして得られた距離値B1〜B8に基づき、拡張領域の最上列H1、最下列H2、最左列H3、最右列H4の画素数を設定している。例えば、最上列については、中心画素F1の列の上端画素J1よりも左方に配置されるべき画素数を、基準数(1)からB1倍した値とし、中心画素F1の列の上端画素J1よりも右方に配置されるべき画素数を、基準数(1)からB2倍した値とするように、最上列H1の形状(画素配列)を新たに設定している。また、下方については、中心画素F1の列の下端画素J2よりも左方に配置されるべき画素数を、基準数(1)からB5倍した値とし、中心画素F1の列の下端画素J2よりも右方に配置されるべき画素数を、基準数(1)からB6倍した値とするように、最下列H2の形状(画素配列)を新たに設定している。また、左方については、中心画素F1の列の左端画素J3よりも上方に配置されるべき画素数を、基準数(1)からB3倍した値とし、中心画素F1の列の左端画素J3よりも下方に配置されるべき画素数を、基準数(1)からB4倍した値とするように、最左列H3の形状(画素配列)を新たに設定している。更に、右方については、中心画素F1の列の右端画素J4よりも上方に配置されるべき画素数を、基準数(1)からB7倍した値とし、中心画素F1の列の右端画素F4よりも下方に配置されるべき画素数を、基準数(1)からB8倍した値とするように、最左列H4の形状(画素配列)を新たに設定している。   In the process of S23, the number of pixels in the uppermost column H1, the lowermost column H2, the leftmost column H3, and the rightmost column H4 of the extended region is set based on the distance values B1 to B8 obtained in this way. For example, for the uppermost column, the number of pixels to be arranged to the left of the upper end pixel J1 in the column of the central pixel F1 is set to a value obtained by multiplying the reference number (1) by B1, and the upper end pixel J1 in the column of the central pixel F1. The shape (pixel arrangement) of the uppermost column H1 is newly set so that the number of pixels to be arranged on the right side is a value obtained by multiplying the reference number (1) by B2. On the lower side, the number of pixels to be arranged to the left of the lower end pixel J2 in the column of the central pixel F1 is set to a value obtained by multiplying the reference number (1) by B5, and the lower pixel J2 in the column of the central pixel F1. Also, the shape (pixel arrangement) of the lowermost row H2 is newly set so that the number of pixels to be arranged on the right side is a value obtained by multiplying the reference number (1) by B6. On the left side, the number of pixels to be arranged above the left end pixel J3 in the column of the center pixel F1 is set to a value obtained by multiplying the reference number (1) by B3, and from the left end pixel J3 in the column of the center pixel F1. Also, the shape (pixel arrangement) of the leftmost column H3 is newly set so that the number of pixels to be arranged below is a value obtained by multiplying the reference number (1) by B4. Further, regarding the right side, the number of pixels to be arranged above the right end pixel J4 in the column of the center pixel F1 is set to a value obtained by multiplying the reference number (1) by B7, and the right end pixel F4 in the column of the center pixel F1. In addition, the shape (pixel arrangement) of the leftmost column H4 is newly set so that the number of pixels to be arranged below is a value obtained by multiplying the reference number (1) by B8.

図8(a)の例では、S22で得られた各距離値B1〜B8が、B1=2、B2=2、B3=1、B4=2、B5=3、B6=3、B7=1、B8=2である場合を例示しており、図8(c)では、図8(a)のような各第2間隔B1〜B8に基づいて、図8(b)の拡張領域(即ち、図7(c)の拡張領域)の形状を変更した例を示している。   In the example of FIG. 8A, the distance values B1 to B8 obtained in S22 are B1 = 2, B2 = 2, B3 = 1, B4 = 2, B5 = 3, B6 = 3, B7 = 1, FIG. 8C illustrates an example in which B8 = 2. In FIG. 8C, based on the second intervals B1 to B8 as illustrated in FIG. 7 (c) shows an example in which the shape of the extended region) is changed.

この例では、まず、中心画素F1を含んだ上下方向の画素列の上端画素J1よりも左方に配置されるべき画素数を基準数(1)から2倍した値(即ち「2」)とする。なお、図8(b)に示す拡張領域の当該位置(即ち、上端画素J1よりも左側の位置)も同じ値なので、この位置の形状は変更しないことになる。同様に、中心画素F1を含んだ上下方向の画素列の上端画素J1よりも右方に配置されるべき画素数を、基準数(1)から2倍した値(即ち「2」)とする。この場合も、図8(b)の拡張領域の当該位置(即ち、上端画素J1よりも右側の位置)が同じ値なので、この位置の形状は変更しないことになる。   In this example, first, a value (ie, “2”) obtained by doubling the number of pixels to be arranged to the left of the upper end pixel J1 of the vertical pixel row including the center pixel F1 from the reference number (1). To do. Note that the position of the extended region shown in FIG. 8B (that is, the position on the left side of the upper end pixel J1) has the same value, and therefore the shape of this position is not changed. Similarly, the number of pixels to be arranged to the right of the upper end pixel J1 in the vertical pixel row including the center pixel F1 is set to a value (ie, “2”) that is twice the reference number (1). Also in this case, since the position of the extended region in FIG. 8B (that is, the position on the right side of the upper end pixel J1) has the same value, the shape of this position is not changed.

また、最下列については、中心画素F1を含んだ上下方向の画素列の下端画素J2よりも左方に配置されるべき画素数を、基準数(1)から3倍した値(即ち「3」)とする。なお、図8(b)の拡張領域では、当該位置(即ち、下端画素J2よりも左側の位置)の画素数が「2」であるため、図8(c)のように1画素分左方に拡張する。また、中心画素F1を含んだ上下方向の画素列の下端画素J2よりも右方に配置されるべき画素数を、基準数(1)から3倍した値とする。図8(b)の拡張領域では、この位置((即ち、下端画素J2よりも右側の位置)の画素数が「2」であるため、図8(c)のように1画素分右方に拡張する。   For the bottom row, the number of pixels to be arranged to the left of the lower end pixel J2 of the vertical pixel row including the center pixel F1 is a value obtained by multiplying the reference number (1) by three (ie, “3”). ). In the extended region in FIG. 8B, the number of pixels at the position (that is, the position on the left side of the lower end pixel J2) is “2”. Extend to Further, the number of pixels that should be arranged to the right of the lower end pixel J2 of the vertical pixel row including the center pixel F1 is set to a value that is three times the reference number (1). In the extended region of FIG. 8B, the number of pixels at this position (that is, the position on the right side of the lower end pixel J2) is “2”, so that it is one pixel to the right as shown in FIG. Expand.

また、最左列については、中心画素F1を含んだ左右方向の画素列の左端画素J3よりも上方に配置されるべき画素数を、基準数(1)から1倍した値とする。なお、図8(b)の拡張領域の当該位置(即ち、左端画素J3よりも上側の位置)も同じ値なので、この位置の形状は変更しないことになる。また、中心画素F1を含んだ左右方向の画素列の左端画素J3よりも下方に配置されるべき画素数を、基準数(1)から2倍した値とする。この場合も、図8(b)の拡張領域の当該位置(即ち、左端画素J3よりも下側の位置)が同じ値なので、この位置の形状は変更しないことになる。   For the leftmost column, the number of pixels that should be arranged above the leftmost pixel J3 in the pixel column in the horizontal direction including the center pixel F1 is set to a value obtained by multiplying the reference number (1) by one. Note that the position of the extended region in FIG. 8B (that is, the position above the left end pixel J3) has the same value, so the shape of this position is not changed. Further, the number of pixels to be arranged below the left end pixel J3 of the pixel column in the left and right direction including the center pixel F1 is set to a value obtained by doubling the reference number (1). Also in this case, since the position of the extended region in FIG. 8B (that is, the position below the left end pixel J3) has the same value, the shape of this position is not changed.

また、最右列については、中心画素F1を含んだ左右方向の画素列の右端画素J4よりも上方に配置されるべき画素数を、基準数(1)から1倍した値とする。図8(b)の拡張領域の当該位置(即ち、右端画素J4よりも上側の位置)も同じ値なので、この位置の形状は変更しないことになる。また、中心画素F1を含んだ左右方向の画素列の右端画素J4よりも下方に配置されるべき画素数を、基準数(1)から2倍した値とする。この場合も、図8(b)の拡張領域の当該位置(即ち、右端画素J4よりも下側の位置)が同じ値なので、この位置の形状は変更しないことになる。   For the rightmost column, the number of pixels that should be arranged above the right end pixel J4 of the pixel column in the left-right direction including the center pixel F1 is set to a value obtained by multiplying the reference number (1) by one. Since the position (that is, the position above the right end pixel J4) in the extended region in FIG. 8B has the same value, the shape of this position is not changed. Further, the number of pixels to be arranged below the right end pixel J4 of the pixel column in the left-right direction including the center pixel F1 is set to a value obtained by doubling the reference number (1). Also in this case, since the position of the extended region in FIG. 8B (that is, the position below the right end pixel J4) has the same value, the shape of this position is not changed.

このようにして拡張領域の最上列H1、最下列H2、最左列H3、最右列H4の画素数を設定することで、図8(c)のような画素領域(参照領域)が得られることとなる。なお、左右方向に延びる列の内、中心画素F1を含む左右方向列、最上列、最下列以外の中間列については、中心画素F1を含む左右方向列、最上列、最下列の中の最も近い画素列の画素数や画素配列と同一としてもよく、中間列の画素数を、中心画素F1を含む左右方向列、最上列、最下列の内の当該中間列の上下両側に配置される列の値の中間値としてもよい。例えば、図8(c)の例では、中心画素を含む左右方向列と最下列の間に中間列が存在するが、この中間列の画素数については、この中間列に最も近い左右方向の列(中心画素を含む左右方向列、或いは最下列)と同一の画素数としてもよく、中間列の画素数を、当該中間列の上下両側に配置される各列(中心画素F1を含む左右方向列及び最下列)の中間値(中間値が少数を含む場合には、当該少数を切り上げ、切り捨て、或いは四捨五入した値)としてもよい。   Thus, by setting the number of pixels in the uppermost column H1, the lowermost column H2, the leftmost column H3, and the rightmost column H4 of the extended region, a pixel region (reference region) as shown in FIG. 8C is obtained. It will be. Of the columns extending in the left-right direction, intermediate columns other than the left-right column including the center pixel F1, the uppermost column, and the lowermost column are closest to the left-right column including the center pixel F1, the uppermost column, and the lowermost column. The number of pixels in the pixel column and the pixel arrangement may be the same, and the number of pixels in the intermediate column may be the same as the number of columns arranged on the upper and lower sides of the intermediate column among the horizontal column, the uppermost column, and the lowermost column including the central pixel F1. It may be an intermediate value. For example, in the example of FIG. 8C, there is an intermediate column between the horizontal column including the central pixel and the lowermost column. The number of pixels in the intermediate column is the horizontal column closest to the intermediate column. The number of pixels may be the same as (the left-right column including the center pixel or the lowermost column), and the number of pixels in the intermediate column is set to each column (the left-right column including the center pixel F1) arranged on both upper and lower sides of the intermediate column. And the bottom row) may be an intermediate value (a value obtained by rounding up, rounding down, or rounding off the decimal number when the intermediate value includes a small number).

なお、S23の処理を実行する制御回路40は、「サイズ決定手段」の一例に相当し、上記「割当サイズ検出手段」によって検出された割当領域の大きさに基づき、各セル画像の色判別の際に判別対象として用いる領域のサイズを決定するように機能する。
また、S23の処理を実行する制御回路40は、「形状決定手段」の一例に相当し、上記「形状情報取得手段」によって取得された「形状情報」に基づき、各セル画像の色判別の際に判別対象として用いる領域の形状を決定するように機能する。具体的には、上記「距離算出手段」によって算出された各距離に基づいて、各セル画像の色判別の際に用いる領域の形状を決定するように機能している。
また、S23の処理を実行する制御回路40は、「対象領域特定手段」の一例に相当し、「中心画素検出手段」によって検出された中心画素と、「サイズ決定手段」によって決定されたサイズとに基づき、各セル画像において、その決定されたサイズに相当する大きさであって且つ中心画素を含んだ領域を色判別の対象領域として特定するように機能する。
The control circuit 40 that executes the process of S23 corresponds to an example of a “size determining unit”, and performs color discrimination of each cell image based on the size of the allocation area detected by the “allocation size detection unit”. It functions to determine the size of the area used as the discrimination target.
The control circuit 40 that executes the process of S23 corresponds to an example of a “shape determination unit”, and performs color determination of each cell image based on the “shape information” acquired by the “shape information acquisition unit”. It functions to determine the shape of the region used as the discrimination target. Specifically, it functions to determine the shape of the region used for color discrimination of each cell image based on each distance calculated by the “distance calculation means”.
The control circuit 40 that executes the process of S23 corresponds to an example of “target region specifying unit”, and the center pixel detected by the “center pixel detecting unit” and the size determined by the “size determining unit”. Based on the above, in each cell image, the area corresponding to the determined size and including the center pixel functions to be specified as a color discrimination target area.

図4のS23の処理後には、対象セルのセル色を判別する処理を行う(S24)。S24では、対象セル(S12で選択された着目セル)のセル画像において、S23で決定された参照領域に相当する領域を対象領域として参照し、当該対照領域を構成する各画素の色情報に基づいて各セル画像の色を判別する。例えば、図8(a)(c)のような場合には、対象セル画像(即ち、中心セル画像C1)において、中心位置P1を中心画素F1とするような図8(c)のような画素領域を「対象領域」として特定し、このような対象領域の各画素の色情報を取得する。例えば、対象領域の全画素におけるR成分の平均値、対象領域の全画素におけるG成分の平均値、対象領域の全画素におけるB成分の平均値をそれぞれ求め、得られたR成分平均値、G成分平均値、B成分平均値に基づいて対象セル(S12選択された着目セル)の色が候補とされる色のいずれかを判別する。なお、セル画像のR成分値、G成分値、B成分値に基づいて色判別を行う方法は公知の様々な方法を用いることができる。   After the process of S23 in FIG. 4, a process of determining the cell color of the target cell is performed (S24). In S24, in the cell image of the target cell (the target cell selected in S12), the area corresponding to the reference area determined in S23 is referred to as the target area, and based on the color information of each pixel constituting the control area. To determine the color of each cell image. For example, in the case of FIGS. 8A and 8C, the pixel as shown in FIG. 8C in which the center position P1 is the center pixel F1 in the target cell image (that is, the center cell image C1). An area is specified as a “target area”, and color information of each pixel in such a target area is acquired. For example, the R component average value for all pixels in the target region, the G component average value for all pixels in the target region, and the B component average value for all pixels in the target region are obtained, and the obtained R component average value, G Based on the component average value and the B component average value, one of the colors for which the color of the target cell (the cell of interest selected in S12) is a candidate is determined. Note that various known methods can be used as a method of performing color discrimination based on the R component value, the G component value, and the B component value of the cell image.

なお、S24の処理を実行する制御回路40は、「セル色判別手段」の一例に相当し、コード画像を構成する各セル画像それぞれにおいて、上記「サイズ決定手段」によって決定されたサイズに相当する領域を参照し、各セル画像の色を判別するように機能する。具体的には、コード画像を構成する各セル画像それぞれにおいて、上記「サイズ決定手段」によって決定されたサイズに相当し且つ上記「形状決定手段」によって決定された形状に相当する領域を参照し、各セル画像の色を判別するように機能する。   The control circuit 40 that executes the process of S24 corresponds to an example of a “cell color determination unit” and corresponds to the size determined by the “size determination unit” in each cell image constituting the code image. It functions to refer to the area and determine the color of each cell image. Specifically, in each of the cell images constituting the code image, referring to the area corresponding to the size determined by the “size determining means” and the shape determined by the “shape determining means”, It functions to discriminate the color of each cell image.

上記のように対象セル(S12で選択された着目セル)について図3のセル色判別処理が行われた後には、S13で判別された対象セルの色を、当該色に対応付けられた値に変換し、バイナリデータとしてメモリ35に記憶する(S14)。その後、全てのセルについてS13、S14の処理が行われたか否かを判断し(S15)、未だ行われていないセルが存在する場合には、S15にてNoに進んでS12に戻り、残っているセルをいずれか一つ選択してS13、S14の処理を繰り返す。一方、全てのセルに対してS13、S14の処理が行われた場合には、S15にてYesに進み、誤り訂正処理を行い、デコード結果を出力する。   After the cell color determination process of FIG. 3 is performed for the target cell (the target cell selected in S12) as described above, the color of the target cell determined in S13 is set to a value associated with the color. The data is converted and stored as binary data in the memory 35 (S14). Thereafter, it is determined whether or not the processes of S13 and S14 have been performed for all the cells (S15). If there is a cell that has not yet been performed, the process proceeds to No in S15, returns to S12, and remains. Any one cell is selected and the processes of S13 and S14 are repeated. On the other hand, if the processes of S13 and S14 have been performed for all the cells, the process proceeds to Yes in S15 to perform error correction processing and output the decoding result.

(本実施形態の主な効果)
また、撮像手段によって撮像された情報コードのコード画像において、セル画像に割り当てられた割当領域の大きさを検出し、その検出された大きさ(割当領域サイズ)に基づき、各セル画像の色判別の際に判別対象として用いる領域のサイズを決定している。そして、コード画像を構成する各セル画像それぞれにおいて、決定されたサイズに相当する領域を参照し、各セル画像の色を判別している。このようにすると、色判別の際に判別対象として用いる領域のサイズを、セル画像に割り当てられたサイズに応じて変更することができるため、各セルの色判別を、撮像サイズに適した判別方法で行うことができるようになる。
(Main effects of this embodiment)
Further, in the code image of the information code imaged by the imaging means, the size of the allocation area allocated to the cell image is detected, and the color discrimination of each cell image is performed based on the detected size (allocation area size). In this case, the size of the area used as a discrimination target is determined. In each cell image constituting the code image, an area corresponding to the determined size is referred to, and the color of each cell image is determined. This makes it possible to change the size of the region used as a discrimination target in color discrimination according to the size assigned to the cell image. Therefore, the discrimination method suitable for the imaging size is used for the color discrimination of each cell. Will be able to do it.

また、コード画像を構成する各セル画像の中心画素を検出しており、各セル画像において、サイズ決定手段によって決定されたサイズに相当する大きさであって且つ中心画素を含んだ領域を色判別の対象領域として特定している。そして、その特定された対象領域を構成する各画素の色情報に基づいて各セル画像の色を判別している。このようにすると、信頼性の高い中心画素付近の領域を、認識されたセルサイズに相当する適切な大きさで、色判別の対象領域として用いることができる。   In addition, the center pixel of each cell image constituting the code image is detected. In each cell image, an area having a size corresponding to the size determined by the size determining means and including the center pixel is color-determined. It is specified as the target area. Then, the color of each cell image is determined based on the color information of each pixel constituting the specified target area. In this way, an area near the central pixel with high reliability can be used as a color discrimination target area with an appropriate size corresponding to the recognized cell size.

また、撮像された情報コードのコード画像から、当該コード画像を構成するセル画像の形状情報を取得し、この形状情報に基づいて、各セル画像の色判別の際に判別対象として用いる領域の形状を決定している。そして、コード画像を構成する各セル画像それぞれにおいて、サイズ決定手段によって決定されたサイズに相当し且つ形状決定手段によって決定された形状に相当する領域を参照し、各セル画像の色を判別している。このようにすると、色判別の際に判別対象として用いる領域のサイズのみならず、形状についても、撮像状態に応じて適切に変更することができるため、各セルの色判別を、より一層適切な判別方法で行うことができるようになる。   Further, the shape information of the cell image constituting the code image is acquired from the code image of the captured information code, and the shape of the region used as a discrimination target in the color discrimination of each cell image based on the shape information Is determined. Then, in each of the cell images constituting the code image, the color corresponding to the size determined by the size determining unit and the region corresponding to the shape determined by the shape determining unit is referred to, and the color of each cell image is determined. Yes. In this way, since not only the size of the region used as a discrimination target in color discrimination but also the shape can be appropriately changed according to the imaging state, the color discrimination of each cell can be made more appropriate. It becomes possible to carry out by the discrimination method.

また、コード画像において、所定の中心セル画像と、当該中心セル画像の周囲に隣接する隣接セル画像とを検出し、中心セル画像から各隣接セル画像までの各距離を算出している。そして、それら算出された各距離に基づいて、各セル画像の色判別の際に用いる領域の形状を決定している。このようにすると、複雑な処理方法を用いることなくセル画像の形状を認識することができ、各セル画像の形状情報を迅速且つ簡易に取得できる。   Further, in the code image, a predetermined center cell image and adjacent cell images adjacent to the periphery of the center cell image are detected, and each distance from the center cell image to each adjacent cell image is calculated. And based on each calculated distance, the shape of the area | region used in the color discrimination of each cell image is determined. In this way, the shape of the cell image can be recognized without using a complicated processing method, and the shape information of each cell image can be acquired quickly and easily.

また、中心セル画像の中心位置と、隣接セル画像の中心位置とを検出し、これら中心位置に基づいて各距離(中心セル画像から各隣接セル画像までの各距離)を算出している。このようにすると、中心セル画像と隣接セル画像がどのような距離関係にあるかを適切に把握でき、その距離関係に基づいて各セル画像の形状を適切に特定できるようになる。   Further, the center position of the center cell image and the center position of the adjacent cell image are detected, and each distance (each distance from the center cell image to each adjacent cell image) is calculated based on these center positions. In this way, it is possible to appropriately grasp the distance relationship between the center cell image and the adjacent cell image, and it is possible to appropriately identify the shape of each cell image based on the distance relationship.

また、中心セル画像の上下左右に隣接する4つの第1隣接セル画像の中心位置、及び中心セル画像にそれぞれ斜めに隣接する4つの第2隣接セル画像の中心位置をそれぞれ検出している。そして、中心セル画像の中心位置と、4つの第1隣接セル画像の各中心位置との間の各第1間隔をそれぞれ算出すると共に、各第1隣接セル画像の中心位置と、当該各第1隣接セル画像の両側に隣接する各第2隣接セル画像の中心位置との間の各第2間隔をそれぞれ算出している。そして、このように算出された各第1間隔及び各第2間隔に基づいてセル形状を決定している。このようにすると、中心セルと、当該中心セルの上下左右に隣接する隣接セル(第1隣接セル)及び斜めに隣接する隣接セル(第2隣接セル)の位置関係を適切に把握でき、その位置関係に基づいて各セル画像の形状をより一層適切に特定できるようになる。   Further, the center positions of the four first adjacent cell images adjacent to the top, bottom, left, and right of the center cell image and the center positions of the four second adjacent cell images obliquely adjacent to the center cell image are detected. And while calculating each 1st space | interval between the center position of a center cell image, and each center position of four 1st adjacent cell images, the center position of each 1st adjacent cell image and each said 1st The second intervals between the center positions of the second adjacent cell images adjacent to both sides of the adjacent cell image are calculated. Then, the cell shape is determined based on the first intervals and the second intervals calculated in this way. In this way, it is possible to appropriately grasp the positional relationship between the central cell, the adjacent cell (first adjacent cell) vertically adjacent to the central cell (first adjacent cell), and the diagonally adjacent cell (second adjacent cell). The shape of each cell image can be specified more appropriately based on the relationship.

[他の実施形態]
本発明は上記記述及び図面によって説明した実施形態に限定されるものではなく、例えば次のような実施形態も本発明の技術的範囲に含まれる。
[Other Embodiments]
The present invention is not limited to the embodiments described with reference to the above description and drawings. For example, the following embodiments are also included in the technical scope of the present invention.

上記実施形態では、拡張領域を設定した後、図8(c)のように更に当該拡張領域の形状を変更していたが、図7(c)のように得られた拡張領域を参照領域として用いてもよい。   In the above embodiment, after setting the extension area, the shape of the extension area is further changed as shown in FIG. 8C, but the extension area obtained as shown in FIG. 7C is used as the reference area. It may be used.

上記実施形態では、基準領域を3行3列の画素領域としたが、これに限定されない。例えば、1画素(1行1列の画素領域)を基準領域としてもよく、5行5列等、他のサイズの画素領域を基準領域としてもよい。   In the above embodiment, the reference region is a pixel region of 3 rows and 3 columns, but is not limited thereto. For example, one pixel (a pixel region of 1 row and 1 column) may be used as a reference region, and a pixel region of another size such as 5 rows and 5 columns may be used as a reference region.

上記実施形態では、各セルに割り当てられた画素領域の大きさと形状を共に検出したが、各セルに割り当てられた画素領域の大きさのみを検出してもよい。例えば、各セル画像に割り当てられた画素領域の大きさを示す値として、各セル画像に割り当てられた画素数を検出し、画素数に応じて参照領域の大きさを定めるようにしてもよい。この例としては、図9のように、割り当てられた画素数が多くなるにつれて参照領域が大きくなるように予め画素数と参照領域サイズとを対応付けて定めておく方法が挙げられる。この場合、各セルの色判別を行う際に、色判別を行おうとするセルの画素数を検出し、その画素数に応じた参照領域サイズを読み出すようにすればよい。そして、その色判別を行おうとするセル画像の中心位置を含んだ対応サイズ(読み出されたサイズ)の領域を参照し、色判別を行うようにすればよい。   In the above embodiment, both the size and shape of the pixel area assigned to each cell are detected, but only the size of the pixel area assigned to each cell may be detected. For example, the number of pixels assigned to each cell image may be detected as a value indicating the size of the pixel area assigned to each cell image, and the size of the reference area may be determined according to the number of pixels. As an example of this, as shown in FIG. 9, there is a method in which the number of pixels and the reference area size are associated with each other in advance so that the reference area increases as the number of assigned pixels increases. In this case, when performing color discrimination of each cell, the number of pixels of the cell to be subjected to color discrimination may be detected, and the reference area size corresponding to the number of pixels may be read out. Then, color discrimination may be performed with reference to a region of a corresponding size (read size) including the center position of the cell image to be subjected to the color discrimination.

1…情報コード読取装置
23…受光センサ(撮像手段)
27…結像レンズ(結像手段)
40…制御回路(割当サイズ検出手段、サイズ決定手段、セル色判別手段、中心画素検出手段、対象領域特定手段、形状情報取得手段、形状決定手段、セル画像検出手段、距離算出手段、中心位置検出手段、隣接セル間隔算出手段)
DESCRIPTION OF SYMBOLS 1 ... Information code reader 23 ... Light receiving sensor (imaging means)
27. Imaging lens (imaging means)
40... Control circuit (allocation size detection means, size determination means, cell color discrimination means, center pixel detection means, target area identification means, shape information acquisition means, shape determination means, cell image detection means, distance calculation means, center position detection Means, adjacent cell interval calculation means)

Claims (7)

複数のセルが配列されてなる情報コードを読み取る情報コード読取装置であって、
複数の受光素子を備えた撮像手段と、
前記情報コードからの反射光を取り込み、当該情報コードの像を前記撮像手段において結像させる結像手段と、
前記撮像手段によって撮像された前記情報コードのコード画像において、セル画像に割り当てられた割当領域の大きさを検出する割当サイズ検出手段と、
前記割当サイズ検出手段によって検出された前記割当領域の大きさに基づき、各セル画像の色判別の際に判別対象として用いる領域のサイズを決定するサイズ決定手段と、
前記コード画像を構成する前記各セル画像それぞれにおいて、前記サイズ決定手段によって決定された前記サイズに相当する領域を参照し、前記各セル画像の色を判別するセル色判別手段と、
を備えたことを特徴とする情報コード読取装置。
An information code reading device for reading an information code in which a plurality of cells are arranged,
An imaging means comprising a plurality of light receiving elements;
Imaging means for capturing reflected light from the information code and forming an image of the information code in the imaging means;
In the code image of the information code imaged by the imaging means, an allocation size detection means for detecting the size of the allocation area allocated to the cell image;
Based on the size of the allocation area detected by the allocation size detection means, a size determination means for determining the size of the area to be used as a determination target when determining the color of each cell image;
Cell color determination means for determining the color of each cell image with reference to the area corresponding to the size determined by the size determination means in each of the cell images constituting the code image;
An information code reading device comprising:
前記セル色判別手段は、
前記コード画像を構成する前記各セル画像の中心画素を検出する中心画素検出手段と、
前記中心画素検出手段によって検出された前記中心画素と、前記サイズ決定手段によって決定された前記サイズとに基づき、前記各セル画像において、その決定された前記サイズに相当する大きさであって且つ前記中心画素を含んだ領域を色判別の対象領域として特定する対象領域特定手段と、
を備え、
前記対象領域特定手段によって特定された前記対象領域を構成する各画素の色情報に基づいて前記各セル画像の色を判別することを特徴とする請求項1に記載の情報コード読取装置。
The cell color discrimination means
Center pixel detecting means for detecting a center pixel of each cell image constituting the code image;
Based on the center pixel detected by the center pixel detection means and the size determined by the size determination means, each cell image has a size corresponding to the determined size and the Target area specifying means for specifying the area including the center pixel as a target area for color discrimination;
With
The information code reading apparatus according to claim 1, wherein the color of each cell image is determined based on color information of each pixel constituting the target area specified by the target area specifying unit.
前記撮像手段によって撮像された前記情報コードのコード画像から、当該コード画像を構成するセル画像の形状情報を取得する形状情報取得手段と、
前記形状情報取得手段によって取得された前記形状情報に基づき、各セル画像の色判別の際に判別対象として用いる領域の形状を決定する形状決定手段と、
を備え、
前記セル色判別手段は、前記コード画像を構成する前記各セル画像それぞれにおいて、前記サイズ決定手段によって決定された前記サイズに相当し且つ前記形状決定手段によって決定された前記形状に相当する領域を参照し、前記各セル画像の色を判別することを特徴とする請求項1又は請求項2に記載の情報コード読取装置。
Shape information acquisition means for acquiring shape information of a cell image constituting the code image from a code image of the information code imaged by the imaging means;
Based on the shape information acquired by the shape information acquisition means, a shape determination means for determining the shape of a region to be used as a determination target when determining the color of each cell image;
With
The cell color determining means refers to an area corresponding to the size determined by the size determining means and corresponding to the shape determined by the shape determining means in each of the cell images constituting the code image. 3. The information code reading apparatus according to claim 1, wherein a color of each cell image is discriminated.
複数のセルが配列されてなる情報コードを読み取る情報コード読取装置であって、
複数の受光素子を備えた撮像手段と、
前記情報コードからの反射光を取り込み、当該情報コードの像を前記撮像手段において結像させる結像手段と、
前記撮像手段によって撮像された前記情報コードのコード画像から、当該コード画像を構成するセル画像の形状情報を取得する形状情報取得手段と、
前記形状情報取得手段によって取得された前記形状情報に基づき、各セル画像の色判別の際に判別対象として用いる領域の形状を決定する形状決定手段と、
前記コード画像を構成する前記各セル画像それぞれにおいて、前記形状決定手段によって決定された前記形状に相当する領域を参照し、前記各セル画像の色を判別するセル色判別手段と、
を備えたことを特徴とする情報コード読取装置。
An information code reading device for reading an information code in which a plurality of cells are arranged,
An imaging means comprising a plurality of light receiving elements;
Imaging means for capturing reflected light from the information code and forming an image of the information code in the imaging means;
Shape information acquisition means for acquiring shape information of a cell image constituting the code image from a code image of the information code imaged by the imaging means;
Based on the shape information acquired by the shape information acquisition means, a shape determination means for determining the shape of a region to be used as a determination target when determining the color of each cell image;
Cell color determination means for determining the color of each cell image with reference to the region corresponding to the shape determined by the shape determination means in each of the cell images constituting the code image;
An information code reading device comprising:
前記形状決定手段は、
前記コード画像において、所定の中心セル画像と、当該中心セル画像の周囲に隣接する隣接セル画像と、を検出するセル画像検出手段と、
前記中心セル画像から各隣接セル画像までの各距離を算出する距離算出手段と、
を備え、
前記距離算出手段によって算出された前記各距離に基づいて、前記各セル画像の色判別の際に用いる領域の前記形状を決定することを特徴とする請求項3又は請求項4に記載の情報コード読取装置。
The shape determining means includes
Cell image detection means for detecting a predetermined center cell image and adjacent cell images adjacent to the periphery of the center cell image in the code image;
Distance calculating means for calculating each distance from the central cell image to each adjacent cell image;
With
5. The information code according to claim 3, wherein the shape of the region used for color determination of each cell image is determined based on each distance calculated by the distance calculation unit. Reader.
前記セル画像検出手段によって検出された前記中心セル画像の中心位置と、前記隣接セル画像の中心位置とを検出する中心位置検出手段を備え、
前記距離算出手段は、前記中心セル画像の中心位置と、各隣接セル画像の中心位置とに基づいて前記各距離を算出することを特徴とする請求項5に記載の情報コード読取装置。
A center position detecting means for detecting a center position of the center cell image detected by the cell image detecting means and a center position of the adjacent cell image;
6. The information code reading apparatus according to claim 5, wherein the distance calculating unit calculates the distances based on a center position of the center cell image and a center position of each adjacent cell image.
前記中心位置検出手段は、前記中心セル画像の上下左右に隣接する4つの第1隣接セル画像の中心位置、及び前記中心セル画像にそれぞれ斜めに隣接する4つの第2隣接セル画像の中心位置をそれぞれ検出し、
前記距離算出手段は、前記中心セル画像の中心位置と、4つの前記第1隣接セル画像の各中心位置との間の第1間隔を前記各距離としてそれぞれ算出しており、
更に、各第1隣接セル画像の中心位置と、当該各第1隣接セル画像の両側に隣接する各第2隣接セル画像の中心位置との間の各第2間隔をそれぞれ算出する隣接セル間隔算出手段を備え、
前記形状決定手段は、前記距離算出手段によって算出された前記第1間隔と、前記隣接セル間隔算出手段によって算出された前記第2間隔とに基づいて前記形状を決定することを特徴とする請求項3から請求項6のいずれか一項に記載の情報コード読取装置。
The center position detecting means is configured to determine a center position of four first adjacent cell images adjacent to the top, bottom, left and right of the center cell image, and a center position of four second adjacent cell images diagonally adjacent to the center cell image. Detect each
The distance calculation means calculates a first interval between the center position of the center cell image and each center position of the four first adjacent cell images as the distance, respectively.
Further, an adjacent cell interval calculation for calculating each second interval between the center position of each first adjacent cell image and the center position of each second adjacent cell image adjacent to both sides of each first adjacent cell image. With means,
The shape determining unit determines the shape based on the first interval calculated by the distance calculating unit and the second interval calculated by the adjacent cell interval calculating unit. The information code reading device according to any one of claims 3 to 6.
JP2009126672A 2009-05-26 2009-05-26 Information code reader Expired - Fee Related JP5218281B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009126672A JP5218281B2 (en) 2009-05-26 2009-05-26 Information code reader

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009126672A JP5218281B2 (en) 2009-05-26 2009-05-26 Information code reader

Publications (2)

Publication Number Publication Date
JP2010277169A true JP2010277169A (en) 2010-12-09
JP5218281B2 JP5218281B2 (en) 2013-06-26

Family

ID=43424106

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009126672A Expired - Fee Related JP5218281B2 (en) 2009-05-26 2009-05-26 Information code reader

Country Status (1)

Country Link
JP (1) JP5218281B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08180125A (en) * 1994-12-26 1996-07-12 Nippondenso Co Ltd Two-dimensional code reader
JPH10240855A (en) * 1996-12-24 1998-09-11 Denso Corp Two-dimensional code reader and storage medium
JP2002334297A (en) * 2001-05-08 2002-11-22 Ricoh Co Ltd Device and method for generating image, computer readable recording medium on which program for performing the method with computer is recorded, the program and code
JP2008004101A (en) * 2006-06-23 2008-01-10 Colorzip Media Inc Method of discriminating colors of color based image code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08180125A (en) * 1994-12-26 1996-07-12 Nippondenso Co Ltd Two-dimensional code reader
JPH10240855A (en) * 1996-12-24 1998-09-11 Denso Corp Two-dimensional code reader and storage medium
JP2002334297A (en) * 2001-05-08 2002-11-22 Ricoh Co Ltd Device and method for generating image, computer readable recording medium on which program for performing the method with computer is recorded, the program and code
JP2008004101A (en) * 2006-06-23 2008-01-10 Colorzip Media Inc Method of discriminating colors of color based image code

Also Published As

Publication number Publication date
JP5218281B2 (en) 2013-06-26

Similar Documents

Publication Publication Date Title
JP3996520B2 (en) Two-dimensional information code and generation method thereof
JP4752413B2 (en) Two-dimensional code division display method, two-dimensional code reading method, and two-dimensional code reading apparatus
CN103404123A (en) Image pick-up device and defective pixel correction method
JP6027777B2 (en) Pixel information management device and imaging device using the same
CN101093537A (en) Apparatus for optically reading information stored in graphic symbol
JP4254628B2 (en) Optical information reader
JP5187383B2 (en) Two-dimensional code division display method, two-dimensional code reading method, and two-dimensional code reading apparatus
JP5913506B2 (en) Color correction apparatus and method
JP5381944B2 (en) Optical information reader
JP5218281B2 (en) Information code reader
TWI725329B (en) Two-dimensional code and two-dimensional code reading device
JP5720623B2 (en) Two-dimensional code reader
JP2011054211A (en) Two-dimensional code dividing and displaying method, two-dimensional code reading method, and two-dimensional code reader
JP5267323B2 (en) Two-dimensional code reader
JP2014116706A (en) Two-dimensional color code display apparatus, display method, reading device, and reading method
JP2008186487A (en) Display method for two-dimensional information code
JP4241803B2 (en) Two-dimensional information code reading method and reading apparatus
JP5104557B2 (en) Optical information reader
JP5888199B2 (en) Bar code reader
JP5780192B2 (en) Information code reader
JP4378491B2 (en) Code image output device
JP5807602B2 (en) Information code reader
JP2010276481A (en) Image processing device
JP4488008B2 (en) Two-dimensional information code
JP5454276B2 (en) Composite information code and optical information reader

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110822

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121108

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121127

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130116

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130205

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130218

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

Free format text: PAYMENT UNTIL: 20160315

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5218281

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees