JP7430554B2 - Optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recording device - Google Patents

Optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recording device Download PDF

Info

Publication number
JP7430554B2
JP7430554B2 JP2020050009A JP2020050009A JP7430554B2 JP 7430554 B2 JP7430554 B2 JP 7430554B2 JP 2020050009 A JP2020050009 A JP 2020050009A JP 2020050009 A JP2020050009 A JP 2020050009A JP 7430554 B2 JP7430554 B2 JP 7430554B2
Authority
JP
Japan
Prior art keywords
value
code
optical information
information reading
input value
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.)
Active
Application number
JP2020050009A
Other languages
Japanese (ja)
Other versions
JP2021149655A (en
Inventor
太一 田近
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.)
Keyence Corp
Original Assignee
Keyence 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 Keyence Corp filed Critical Keyence Corp
Priority to JP2020050009A priority Critical patent/JP7430554B2/en
Publication of JP2021149655A publication Critical patent/JP2021149655A/en
Application granted granted Critical
Publication of JP7430554B2 publication Critical patent/JP7430554B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、光学式情報読取装置、光学式情報読取方法、光学式情報読取プログラム及びコンピュータで読取可能な記録媒体並びに記録した機器に関する。 The present invention relates to an optical information reading device, an optical information reading method, an optical information reading program, a computer readable recording medium, and a recording device.

読取対象となるバーコードやQRコード等、コードやシンボル等と呼ばれるマーク(以下「コード」と呼ぶ。)からの光を受光し、結像モジュールによりコードの画像データを取得し、その画像データを解析することでコードに応じた情報を読み取る、コードリーダなどと呼ばれる光学式情報読取装置が知られている。例えば物流業界では、配送される様々な搬送物がコンベアで搬送される過程で、各搬送物に付されたバーコードを読み取る定置式コードリーダが用いられている。このような定置式コードリーダは、コンベア上を搬送される搬送物を、離れた位置から照明光を照射し、カメラで撮像して、得られた画像中からバーコードを探しだし、復号化している。 It receives light from a mark called a code or symbol (hereinafter referred to as a "code") such as a barcode or QR code to be read, acquires image data of the code using an imaging module, and converts the image data into 2. Description of the Related Art Optical information reading devices called code readers are known, which read information according to a code by analyzing it. For example, in the logistics industry, stationary code readers are used to read barcodes attached to various items to be delivered while the items are being conveyed on a conveyor. This kind of stationary code reader illuminates the object being transported on a conveyor with illumination light from a remote location, captures the image with a camera, searches for the barcode in the obtained image, and decodes it. There is.

撮像部がコードを含む搬送物の画像を撮像素子で撮像して画像データを生成する際に、撮像素子の有するビット数の高い入力値を、よりビット数の低い出力値に変換する。このようなビット数の変換に際して、変換特性を切り替えることのできるコードリーダが知られている(特許文献1)。標準の変換特性から、ダイナミックレンジの拡大を目的とした変換特性に変更することにより、撮像部が有するダイナミックレンジを有効に拡大し、デコードに必要なコントラストを有するコード画像を得ることができる。 When the imaging unit captures an image of a conveyed object including a code with an imaging device to generate image data, the imaging device converts an input value with a high number of bits into an output value with a lower number of bits. A code reader is known that can switch conversion characteristics when converting the number of bits (Patent Document 1). By changing the standard conversion characteristic to a conversion characteristic aimed at expanding the dynamic range, it is possible to effectively expand the dynamic range of the imaging unit and obtain a code image having the contrast necessary for decoding.

しかしながら、コードが付された荷物の高低差などによって、画像データの明るさが大きく変動する場合や、コード自体が低コントラストである場合は、上記の方法では必ずしも十分なコントラストを有するコード画像が得られない場合があった。 However, if the brightness of the image data fluctuates greatly due to differences in height of the baggage to which the code is attached, or if the code itself has low contrast, the above method does not necessarily yield a code image with sufficient contrast. There were cases where it was not possible.

特開2018-136853号公報Japanese Patent Application Publication No. 2018-136853

本発明の目的の一は、コードの読み取りを安定して行えるようにした光学式情報読取装置、光学式情報読取方法、光学式情報読取プログラム及びコンピュータで読取可能な記録媒体並びに記録した機器を提供することにある。 One object of the present invention is to provide an optical information reading device, an optical information reading method, an optical information reading program, a computer readable recording medium, and a recording device that can stably read codes. It's about doing.

課題を解決するための手段及び発明の効果Means for solving the problem and effects of the invention

本発明の第1の側面に係る光学式情報読取装置によれば、搬送ライン上を移動する搬送物に付されたコードを読み取る光学式情報読取装置であって、コードに光を照射する照明部と、前記照明部から照射されコードで反射された光を受光して入力画像を取得する撮像部と、前記撮像部で得られた入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなる特性変換式に基づいて、入力値から階調数を削減した出力値を算出し、各画素が前記出力値を有するコード画像を生成する変換部と、前記変換部で生成したコード画像に基づいて、コードにエンコードされた情報のデコードを行うデコード部とを備え、前記特性変換式が、前記入力値が0の位置では前記出力値がマイナス方向となるように、前記入力値と出力値の関係を示すグラフ上でオフセットされており、前記変換部は、前記入力値が、前記特性変換式が前記オフセットされる量に基づいて定められた閾値よりも大きな画素については、前記特性変換式に基づいて、当該入力値の大きさに基づいて変化すると共に、前記入力値が前記閾値から大きくなるほど当該入力値の変化に対して前記出力値の変化幅が小さくなるような出力値を出力し、前記入力値が前記閾値よりも小さな画素については、前記特性変換式によらず、前記入力値が前記閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力するよう構成できる。上記構成により、コードのコントラストが変化しても安定的に読み取りを行うことができる。
According to a first aspect of the present invention, the optical information reading device reads a code attached to a conveyance object moving on a conveyance line, and the illumination unit irradiates the code with light. an imaging unit that receives light emitted from the illumination unit and reflected by the code to obtain an input image; and a larger input value for each pixel forming the input image obtained by the imaging unit; a conversion unit that calculates an output value by reducing the number of gradations from the input value based on a characteristic conversion formula in which the width of change in the output value becomes smaller with respect to a change in the value, and generates a code image in which each pixel has the output value; and a decoding unit that decodes information encoded in the code based on the code image generated by the conversion unit, and the characteristic conversion formula is such that at a position where the input value is 0, the output value is in a negative direction. The input value is offset on a graph showing the relationship between the input value and the output value so that For pixels larger than , the output value changes based on the magnitude of the input value based on the characteristic conversion formula , and the larger the input value becomes from the threshold value, the more the output value changes with respect to the change in the input value. For a pixel that outputs an output value whose width is smaller and the input value is smaller than the threshold, the input value is relatively smaller than the pixel whose input value is larger than the threshold, regardless of the characteristic conversion formula. It can be configured to output a fixed value as an output value. With the above configuration, stable reading can be performed even if the contrast of the code changes.

また、第2の側面に係る光学式情報読取装置によれば、上記構成に加えて、前記特性変換式を、前記入力値となる輝度値が0から所定値までの範囲で、前記出力値となる輝度値階調数の1/5以下となるように設定することができる。上記構成により、撮像部の入力値が低い、暗い画素については出力値制限することとなり、入力値が小さい領域では出力値の表現が制約を受けるものの、コード読み取りにおいて重要な暗部と明部のコントラストを確保できる利点が得られる。
According to the optical information reading device according to the second aspect, in addition to the above configuration, the characteristic conversion formula is set to the output value when the luminance value serving as the input value is in a range from 0 to a predetermined value . The brightness value can be set to be 1/5 or less of the number of gradations . With the above configuration, the output value is limited for dark pixels with a low input value of the imaging section, and although the expression of the output value is restricted in areas where the input value is small, the difference between dark and bright areas, which is important in code reading, is restricted. This provides the advantage of ensuring contrast.

さらに、第3の側面に係る光学式情報読取装置によれば、上記何れかの構成に加えて、前記特性変換式を、上に凸な曲線状とすることができる。 Furthermore, according to the optical information reading device according to the third aspect, in addition to any of the above configurations, the characteristic conversion formula can have an upwardly convex curved shape.

さらにまた、第の側面に係る光学式情報読取装置によれば、上記何れかの構成に加えて、さらに、前記閾値が互いに異なる複数の前記特性変換式から、運用時に用いる特性変換式を決定するためのチューニング部を備え、前記チューニング部は、前記複数の前記特性変換式のそれぞれに基づいて前記変換部により生成された前記コード画像の前記デコード部による各読取結果を参照して、前記運用時に用いる特性変換式を決定するよう構成できる。
Furthermore, according to the optical information reading device according to the fourth aspect, in addition to any of the above configurations , a characteristic conversion formula to be used during operation is further determined from the plurality of characteristic conversion formulas in which the threshold values are different from each other. The tuning section includes a tuning section for performing the operation by referring to each reading result by the decoding section of the code image generated by the converting section based on each of the plurality of characteristic conversion formulas. It can be configured to determine the characteristic conversion formula that is sometimes used.

さらにまた、第の側面に係る光学式情報読取装置によれば、上記何れかの構成に加えて、さらに、予め作成された、オフセット量の異なる複数の変換特性曲線から、前記コード画像の明暗の変動とコントラスト差の低いコード画像への対応力に基づいて、いずれかを選択するためのチューニング部を備えることができる。
Furthermore, according to the optical information reading device according to the fifth aspect, in addition to any of the above configurations, the brightness and darkness of the code image is determined from a plurality of conversion characteristic curves having different offset amounts created in advance. It is possible to include a tuning unit for selecting one of them based on the variation in the code image and its ability to respond to a code image with a low contrast difference.

さらにまた、第の側面に係る光学式情報読取装置によれば、上記何れかの構成に加えて、前記チューニング部は、前記オフセット量の異なる複数の変換特性曲線に基づいて、前記変換部で階調変換を行って得られたコード画像に対して、それぞれ前記デコード部でデコードして、その読取結果に基づいて、前記複数の変換特性曲線のパラメータを決定するよう構成できる。
Furthermore, according to the optical information reading device according to the sixth aspect, in addition to any one of the above configurations, the tuning section is configured to adjust the conversion characteristic curve in the conversion section based on a plurality of conversion characteristic curves having different offset amounts. The code images obtained by performing gradation conversion may be decoded by the decoding section, and the parameters of the plurality of conversion characteristic curves may be determined based on the reading results.

さらにまた、第の側面に係る光学式情報読取装置によれば、上記何れかの構成に加えて、前記チューニング部は、前記複数の変換特性曲線の内で、互いのパラメータが近い変換特性曲線の読み取り結果を参照して、いずれかの変換特性曲線を選択するよう構成できる。上記構成により、コード画像の明暗の変動へのロバスト性を高めることができる。
さらにまた、第8の側面に係る光学式情報読取装置によれば、搬送ライン上を移動する搬送物に付されたコードを読み取る光学式情報読取装置であって、コードに光を照射する照明部と、前記照明部から照射されコードで反射された光を受光して入力画像を取得する撮像部と、前記撮像部で得られた入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなる特性変換式に基づいて、入力値から階調数を削減した出力値を算出し、各画素が前記出力値を有するコード画像を生成する変換部と、前記変換部で生成したコード画像に基づいて、コードにエンコードされた情報のデコードを行うデコード部と、異なる複数の前記特性変換式から、運用時に用いる特性変換式を決定するためのチューニング部と、を備え、前記変換部は、前記入力値が前記特性変換式ごとに異なる閾値よりも大きな画素については、前記特性変換式に基づいて、当該入力値の大きさに基づいて変化する出力値を出力し、前記入力値が前記閾値よりも小さな画素については、前記入力値が前記閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力し、前記チューニング部は、前記複数の前記特性変換式のそれぞれに基づいて前記変換部により生成された前記コード画像の前記デコード部による各読取結果を参照して、前記運用時に用いる特性変換式を決定するよう構成できる。
Furthermore, according to the optical information reading device according to the seventh aspect, in addition to any of the above configurations, the tuning section selects conversion characteristic curves whose parameters are close to each other among the plurality of conversion characteristic curves. The configuration can be configured to select one of the conversion characteristic curves by referring to the reading results. With the above configuration, it is possible to increase the robustness to variations in brightness of the code image.
Furthermore, according to the optical information reading device according to the eighth aspect, the optical information reading device reads a code attached to a conveyed object moving on a conveyance line, and the illumination unit irradiates the code with light. an imaging unit that receives light emitted from the illumination unit and reflected by the code to obtain an input image; and a larger input value for each pixel forming the input image obtained by the imaging unit; a conversion unit that calculates an output value by reducing the number of gradations from the input value based on a characteristic conversion formula in which the width of change in the output value becomes smaller with respect to a change in the value, and generates a code image in which each pixel has the output value; a decoding unit that decodes information encoded in the code based on the code image generated by the conversion unit; and a tuning unit that determines a characteristic conversion formula to be used during operation from among the plurality of different characteristic conversion formulas. and, for a pixel in which the input value is larger than a different threshold value for each characteristic conversion formula, the conversion unit converts an output value that changes based on the magnitude of the input value based on the characteristic conversion formula. , and for a pixel for which the input value is smaller than the threshold value, outputs a constant value that is relatively smaller than a pixel for which the input value is larger than the threshold value, and the tuning unit The characteristic conversion formula used during the operation can be determined by referring to each reading result by the decoding unit of the code image generated by the conversion unit based on each of the plurality of characteristic conversion formulas.

さらにまた、第9の側面に係る光学式情報読取方法によれば、搬送ライン上を移動する搬送物に付されたコードを読み取る光学式情報読取装置を用いた光学式情報読取方法であって、照明部からコードに照明光を照射し、コードで反射された反射光を撮像部で受光して入力画像を取得する工程と、前記得られた入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなり、前記入力値が0の位置では前記出力値がマイナス方向となるように、前記入力値と出力値の関係を示すグラフ上でオフセットされる特性変換式に基づいて、入力値から階調数を削減し、各画素が前記出力値を有する出力値を算出したコード画像を生成する際、前記入力値が、前記特性変換式が前記オフセットされる量に基づいて定められた閾値よりも大きな画素は、前記特性変換式に基づいて、当該入力値の大きさに基づいて変化すると共に、前記入力値が前記閾値から大きくなるほど当該入力値の変化に対して前記出力値の変化幅が小さくなるような出力値を出力し、前記入力値が前記閾値よりも小さな画素は、前記特性変換式によらず、前記入力値が前記閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力することで、画素毎に前記出力値を有するコード画像を変換部で生成する工程と、前記撮像部で生成したコード画像に基づいて、デコード部でコードにエンコードされた情報のデコード処理を行う工程とを含むことができる。これにより、コードのコントラストが変化しても安定的に読み取りを行うことができる。
Furthermore, according to the optical information reading method according to the ninth aspect, the optical information reading method uses an optical information reading device that reads a code attached to a conveyed object moving on a conveyance line, A step of irradiating the code with illumination light from the illumination unit and receiving the reflected light reflected by the code at the imaging unit to obtain an input image, and a step of obtaining a large input value for each pixel constituting the obtained input image. On the graph showing the relationship between the input value and the output value, the width of change in the output value becomes smaller with respect to the change in the input value, and the output value is in the negative direction at the position where the input value is 0. When generating a code image in which the number of gradations is reduced from the input value and an output value in which each pixel has the output value is calculated based on the characteristic conversion formula to be offset , the input value is A pixel larger than a threshold value determined based on the offset amount changes based on the magnitude of the input value based on the characteristic conversion formula , and the larger the input value is from the threshold value, the more the input value changes. A pixel that outputs an output value such that the width of change in the output value becomes smaller with respect to a change in value , and the input value is smaller than the threshold value is a pixel whose input value is smaller than the threshold value , regardless of the characteristic conversion formula. A step of generating a code image having the output value for each pixel by outputting a constant value relatively smaller than that of a large pixel as an output value, and a step of generating a code image having the output value for each pixel, and The method may include a step of decoding information encoded into a code in a decoding unit based on the information encoded in the code. This allows stable reading even if the contrast of the code changes.

さらにまた、第10の側面に係る光学式情報読取プログラムによれば、搬送ライン上を移動する搬送物に付されたコードを読み取る光学式情報読取装置を用いたコード読取を行う光学式情報読取プログラムであって、照明部からコードに照明光を照射し、コードで反射された反射光を撮像部で受光して入力画像を取得する機能と、前記得られた入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなり、前記入力値が0の位置では前記出力値がマイナス方向となるように、前記入力値と出力値の関係を示すグラフ上でオフセットされる特性変換式に基づいて、入力値から階調数を削減した出力値を算出し、各画素が前記出力値を有するコード画像を生成する際、前記入力値が、前記特性変換式が前記オフセットされる量に基づいて定められた閾値よりも大きな画素は、前記特性変換式に基づいて、当該入力値の大きさに基づいて変化すると共に、前記入力値が前記閾値から大きくなるほど当該入力値の変化に対して前記出力値の変化幅が小さくなるような出力値を出力し、前記入力値が前記閾値よりも小さな画素は、前記特性変換式によらず、前記入力値が前記閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力することで、画素毎に前記出力値を有するコード画像を変換部で生成する機能と、前記撮像部で生成したコード画像に基づいて、デコード部でコードにエンコードされた情報のデコード処理を行う機能とをコンピュータに実現させることができる。上記構成により、コードのコントラストが変化しても安定的に読み取りを行うことができる。 Furthermore, according to the optical information reading program according to the tenth aspect, the optical information reading program reads a code using an optical information reading device that reads a code attached to a conveyed object moving on a conveyance line. The function includes a function of emitting illumination light from an illumination unit to a code, receiving reflected light reflected by the code at an imaging unit to obtain an input image, and for each pixel constituting the obtained input image, The relationship between the input value and the output value is set so that the larger the input value is, the smaller the change width of the output value is with respect to the change in the input value, and the output value is in the negative direction at the position where the input value is 0. An output value obtained by reducing the number of gradations from an input value is calculated based on a characteristic conversion formula that is offset on the graph shown in FIG. A pixel whose characteristic conversion formula is larger than a threshold determined based on the offset amount is changed based on the magnitude of the input value based on the characteristic conversion formula , and the input value is changed from the threshold. An output value is output such that the larger the input value is, the smaller the change width of the output value is with respect to a change in the input value, and a pixel whose input value is smaller than the threshold value is determined by the input value regardless of the characteristic conversion formula. A function of generating a code image having the output value for each pixel in a conversion unit by outputting a constant value that is relatively smaller than a pixel whose output value is larger than the threshold value, and a function of generating a code image in the imaging unit. Based on the encoded code image, the computer can realize a function of decoding information encoded into a code in a decoding section. With the above configuration, stable reading can be performed even if the contrast of the code changes.

さらにまた、第11の側面に係るコンピュータで読み取り可能な記録媒体または記憶した機器は、上記プログラムを格納したものである。記録媒体には、CD-ROM、CD-R、CD-RWやフレキシブルディスク、磁気テープ、MO、DVD-ROM、DVD-RAM、DVD-R、DVD+R、DVD-RW、DVD+RW、Blu-ray、HD DVD(AOD)、UHD(いずれも商品名)等の磁気ディスク、光ディスク、光磁気ディスク、半導体メモリその他のプログラムを格納可能な媒体が含まれる。またプログラムには、上記記録媒体に格納されて配布されるものの他、インターネット等のネットワーク回線を通じてダウンロードによって配布される形態のものも含まれる。さらに記憶した機器には、上記プログラムがソフトウェアやファームウェア等の形態で実行可能な状態に実装された汎用もしくは専用機器を含む。さらにまたプログラムに含まれる各処理や機能は、コンピュータで実行可能なプログラムソフトウエアにより実行してもよいし、各部の処理を所定のゲートアレイ(FPGA、ASIC)等のハードウエア、又はプログラムソフトウエアとハードウェアの一部の要素を実現する部分的ハードウエアモジュールとが混在する形式で実現してもよい。 Furthermore, the computer-readable recording medium or device storing the computer-readable recording medium according to the eleventh aspect stores the above-mentioned program. Recording media include CD-ROM, CD-R, CD-RW, flexible disk, magnetic tape, MO, DVD-ROM, DVD-RAM, DVD-R, DVD+R, DVD-RW, DVD+RW, Blu-ray, HD. Included are magnetic disks such as DVD (AOD) and UHD (all product names), optical disks, magneto-optical disks, semiconductor memories, and other media capable of storing programs. In addition to programs that are stored and distributed in the recording medium described above, programs that are distributed by downloading through a network such as the Internet are also included. Further, the stored device includes a general-purpose or dedicated device in which the program is implemented in an executable state in the form of software, firmware, or the like. Furthermore, each process and function included in the program may be executed by computer-executable program software, or the processing of each part may be executed by hardware such as a predetermined gate array (FPGA, ASIC) or program software. It may also be realized in a mixed format with a partial hardware module that realizes some of the hardware elements.

本発明の実施形態1に係る光学式情報読取システムの構成を示す模式図である。1 is a schematic diagram showing the configuration of an optical information reading system according to Embodiment 1 of the present invention. 光学式情報読取装置の斜視図である。FIG. 2 is a perspective view of an optical information reading device. 図2の光学式情報読取装置の正面図である。3 is a front view of the optical information reading device of FIG. 2. FIG. 図2の光学式情報読取装置の側面図である。3 is a side view of the optical information reading device of FIG. 2. FIG. 図2の光学式情報読取装置の天面図である。3 is a top view of the optical information reading device of FIG. 2. FIG. 図2の光学式情報読取装置の底面図である。3 is a bottom view of the optical information reading device of FIG. 2. FIG. 図1の光学式情報読取装置のブロック図である。FIG. 2 is a block diagram of the optical information reading device of FIG. 1. FIG. 光学式情報読取装置と読取対象物との距離に応じて読取面積や光量が変化する様子を示す模式図である。FIG. 3 is a schematic diagram showing how the reading area and the amount of light change depending on the distance between the optical information reading device and the object to be read. 近くに置かれたコードと、遠くに置かれたコードとで、明るさや大きさが変化する様子を示すイメージ図である。It is an image diagram showing how the brightness and size change between a cord placed nearby and a cord placed far away. HDR変換式を表すグラフである。It is a graph showing an HDR conversion formula. 標準変換特性で生成したコード画像のイメージ図である。FIG. 3 is an image diagram of a code image generated using standard conversion characteristics. HDR変換特性で生成したコード画像のイメージ図である。FIG. 3 is an image diagram of a code image generated using HDR conversion characteristics. 12ビットの入力値を8ビットに変換する変換式を示すグラフである。It is a graph showing a conversion formula for converting a 12-bit input value into 8-bit. 図13の白部分の輝度値に対するコントラストを示す片対数グラフである。14 is a semi-logarithmic graph showing the contrast with respect to the brightness value of the white part in FIG. 13. FIG. 標準コントラストコードを図14の標準変換特性で読み取る場合のダイナミックレンジを示す片対数グラフである。15 is a semi-log graph showing a dynamic range when a standard contrast code is read using the standard conversion characteristics shown in FIG. 14. FIG. 標準コントラストコードを図14のHDR変換特性で読み取る場合のダイナミックレンジを示す片対数グラフである。15 is a semi-log graph showing a dynamic range when a standard contrast code is read using the HDR conversion characteristics shown in FIG. 14. FIG. 低コントラストコードを図14の標準変換特性で読み取る場合のダイナミックレンジを示す片対数グラフである。15 is a semi-log graph showing a dynamic range when a low contrast code is read using the standard conversion characteristics shown in FIG. 14. FIG. 低コントラストコードを図14のHDR変換特性で読み取る場合のダイナミックレンジを示す片対数グラフである。15 is a semi-log graph showing a dynamic range when a low contrast code is read using the HDR conversion characteristics shown in FIG. 14. FIG. HDR1、2、3の変換特性曲線を示すグラフである。It is a graph which shows the conversion characteristic curve of HDR1, 2, and 3. 図19において仮想的に出力値がマイナスの領域を示すグラフである。20 is a graph showing a hypothetical region in which the output value is negative in FIG. 19. 図19の変換特性曲線について、コードの白部分の輝度値と、コントラストの関係を示す片対数グラフである。20 is a semi-logarithmic graph showing the relationship between the brightness value of the white portion of the code and the contrast regarding the conversion characteristic curve of FIG. 19. 図21の標準変換特性で標準コントラストコードを読み取る場合のダイナミックレンジを示す片対数グラフである。22 is a semi-log graph showing the dynamic range when reading a standard contrast code with the standard conversion characteristics shown in FIG. 21. FIG. 図21のHDR1で標準コントラストコードを読み取る場合のダイナミックレンジを示す片対数グラフである。22 is a semi-log graph showing the dynamic range when reading a standard contrast code with HDR1 in FIG. 21. FIG. 図19の標準変換特性で低コントラストコードを読み取る場合のダイナミックレンジを示す片対数グラフである。20 is a semi-logarithmic graph showing the dynamic range when reading a low contrast code using the standard conversion characteristics shown in FIG. 19. 図19のHDR1で低コントラストコードを読み取る場合のダイナミックレンジを示す片対数グラフである。20 is a semi-logarithmic graph showing the dynamic range when reading a low contrast code with HDR1 in FIG. 19. ガンマ補正の変換式を示すグラフである。It is a graph showing a conversion formula for gamma correction. γ=4、8、16、32、64としたHDR変換式の曲線を示すグラフである。It is a graph showing curves of HDR conversion formulas with γ=4, 8, 16, 32, and 64. 図27のHDR変換式において、コードの白部分の輝度値と、コントラストの関係を示す片対数グラフである。28 is a semi-logarithmic graph showing the relationship between the brightness value of the white portion of the code and the contrast in the HDR conversion formula of FIG. 27. パラメータ値βを変化させたHDR変換式を示すグラフである。It is a graph showing an HDR conversion formula in which parameter value β is changed. チューニング時のHDRの最適化方法を示すフローチャートである。7 is a flowchart showing a method for optimizing HDR during tuning. 図31A~図31Eは、コード画像の明るさを変化させた場合に、輝度値の分布が変化する様子を示す分布図である。FIGS. 31A to 31E are distribution charts showing how the distribution of brightness values changes when the brightness of the code image is changed. 光学式情報読取プログラムのチューニング画面の一例を示すイメージ図である。It is an image diagram showing an example of a tuning screen of an optical information reading program. 実施例1に係る光学式情報読取装置と、比較例に係る光学式情報読取装置で、搬送物との距離が変化した場合に得られる画像データを示すイメージ図である。FIG. 6 is an image diagram showing image data obtained when the distance to the conveyed object changes with the optical information reading device according to the first embodiment and the optical information reading device according to the comparative example.

以下、本発明の実施の形態を図面に基づいて説明する。ただし、以下に示す実施の形態は、本発明の技術思想を具体化するための光学式情報読取装置及び光学式情報読取方法を例示するものであって、本発明は光学式情報読取装置及び光学式情報読取方法を以下のものに特定しない。また、本明細書は特許請求の範囲に示される部材を、実施の形態の部材に特定するものでは決してない。特に実施の形態に記載されている構成部品の寸法、材質、形状、その相対的配置等は特に特定的な記載がない限りは、本発明の範囲をそれのみに限定する趣旨ではなく、単なる説明例にすぎない。なお、各図面が示す部材の大きさや位置関係等は、説明を明確にするため誇張していることがある。さらに以下の説明において、同一の名称、符号については同一もしくは同質の部材を示しており、詳細説明を適宜省略する。さらに、本発明を構成する各要素は、複数の要素を同一の部材で構成して一の部材で複数の要素を兼用する態様としてもよいし、逆に一の部材の機能を複数の部材で分担して実現することもできる。
[実施形態1]
Embodiments of the present invention will be described below based on the drawings. However, the embodiments shown below illustrate an optical information reading device and an optical information reading method for embodying the technical idea of the present invention, and the present invention is not limited to the optical information reading device and the optical information reading method. The formula information reading method is not specified as follows. Moreover, this specification does not in any way specify the members shown in the claims to the members of the embodiments. In particular, the dimensions, materials, shapes, relative positions, etc. of the components described in the embodiments are not intended to limit the scope of the present invention, unless otherwise specified, and are merely illustrative. Just an example. Note that the sizes, positional relationships, etc. of members shown in each drawing may be exaggerated for clarity of explanation. Furthermore, in the following description, the same names and symbols indicate the same or homogeneous members, and detailed descriptions will be omitted as appropriate. Furthermore, each element constituting the present invention may be configured so that a plurality of elements are made of the same member so that one member serves as a plurality of elements, or conversely, the function of one member may be performed by a plurality of members. It can also be accomplished by sharing.
[Embodiment 1]

本発明の実施形態1に係る光学式情報読取システム1000を、図1の模式図に示す。光学式情報読取システム1000は、バーコードや二次元コードなどのコードやシンボルと呼ばれるマーク(以下、集合的に「コード」と呼ぶ。)を読み取って、データの登録、照合を行う。図1に示す光学式情報読取システム1000は、光学式情報読取装置1と、コンピュータ100と、プログラマブル・ロジック・コントローラ(PLC)101と、搬送用ベルトコンベアBCを備える。 An optical information reading system 1000 according to Embodiment 1 of the present invention is shown in the schematic diagram of FIG. The optical information reading system 1000 registers and verifies data by reading marks called codes and symbols (hereinafter collectively referred to as "codes") such as barcodes and two-dimensional codes. The optical information reading system 1000 shown in FIG. 1 includes an optical information reading device 1, a computer 100, a programmable logic controller (PLC) 101, and a conveyor belt BC.

この例では、運用時において複数のワークWKが搬送用ベルトコンベアBCの上面に載置された状態で図1における矢印Yの方向へ搬送されており、そのワークWKから上方へ離れた所に、実施形態1に係る光学式情報読取装置1が設置されている。ワークWKは、例えば荷物等の搬送物であり、バーコードや二次元コード等のコードが付されている。コードには、例えば荷物の名称、送り先などの情報が符号化されて記録されている。また、ワークWKが製品の場合は、製品の名称や製造番号、価格などをコードに記録して、トレーサビリティ対応としている。 In this example, during operation, a plurality of workpieces WK are placed on the upper surface of the conveyor belt BC and are transported in the direction of arrow Y in FIG. An optical information reading device 1 according to Embodiment 1 is installed. The workpiece WK is, for example, a conveyed object such as a baggage, and is attached with a code such as a bar code or a two-dimensional code. Information such as the name of the package and the destination is encoded and recorded in the code. Furthermore, if the work WK is a product, the product name, serial number, price, etc. are recorded in a code to ensure traceability.

光学式情報読取装置1は、ワークWKに付されているコードを撮像し、撮像された画像に含まれるコードを複合化(デコード処理)して情報を読み取ることができるように構成されたコードリーダである。光学式情報読取装置1は、その運用時に動かないようにブラケット等に固定して使用してもよいし、ロボットや使用者等が把持して動かしながら運用してもよい。また、静止状態にあるワークWKのコードを光学式情報読取装置1によって読み取るようにしてもよい。なお運用時とは、搬送用ベルトコンベアBCによって搬送されるワークWKのコードを順に読み取る動作を行っているときである。 The optical information reading device 1 is a code reader configured to image a code attached to a workpiece WK, decode the code included in the captured image (decode processing), and read the information. It is. The optical information reading device 1 may be used by being fixed to a bracket or the like so that it does not move during operation, or may be held and operated by a robot, a user, or the like. Further, the code of the workpiece WK in a stationary state may be read by the optical information reading device 1. Note that during operation, the operation is performed to sequentially read the codes of the workpieces WK conveyed by the conveyor belt BC.

各ワークWKにはコードが付されている。コードには、バーコード等の一次元コードや、二次元コードが利用できる。二次元コードとしては、例えばQRコード、マイクロQRコード、データマトリクス(Data matrix;Data code)、ベリコード(Veri code)、アズテックコード(Aztec code)、PDF417、マキシコード(Maxi code)などが挙げられる(いずれも商品名)。二次元コードにはスタック型とマトリクス型があるが、本発明はいずれの二次元コードに対しても適用できる。コードは、ワークWKに直接印刷あるいは刻印することで付してもよいし、ラベルに印刷した後にワークWKに貼付することによって付してもよく、その手段、方法は問わない。 A code is attached to each workpiece WK. A one-dimensional code such as a barcode or a two-dimensional code can be used as the code. Examples of two-dimensional codes include QR code, micro QR code, Data matrix (Data code), Veri code, Aztec code, PDF417, Maxi code, etc. (all product names). Two-dimensional codes include stack type and matrix type, and the present invention can be applied to either type of two-dimensional code. The code may be attached by directly printing or stamping on the workpiece WK, or may be attached by printing on a label and then pasting it on the workpiece WK, and the means and method thereof are not limited.

光学式情報読取装置1は、コンピュータ100及びプログラマブル・ロジック・コントローラ(PLC)101にそれぞれ信号線100a、101aによって有線接続されているが、これに限らず、光学式情報読取装置1、コンピュータ100及びPLC101に通信モジュールを内蔵し、光学式情報読取装置1と、コンピュータ100及びPLC101とを無線接続するようにしてもよい。PLC101は、搬送用ベルトコンベアBC及び光学式情報読取装置1をシーケンス制御するための制御装置であり、汎用のPLCを利用することができる。コンピュータ100は、汎用あるいは専用の電子計算機や携帯型端末等を利用することができる。 The optical information reading device 1 is wire-connected to the computer 100 and the programmable logic controller (PLC) 101 through signal lines 100a and 101a, respectively, but the invention is not limited to this. A communication module may be built into the PLC 101, and the optical information reading device 1, the computer 100, and the PLC 101 may be wirelessly connected. The PLC 101 is a control device for sequentially controlling the transport belt conveyor BC and the optical information reading device 1, and a general-purpose PLC can be used. The computer 100 can be a general-purpose or dedicated computer, a portable terminal, or the like.

また光学式情報読取装置1は、その運用時において、PLC101から信号線101aを介して、コード読取の開始タイミングを規定する読取開始トリガ信号を受信する。そして、光学式情報読取装置1は、この読取開始トリガ信号に基づいてコードの撮像やデコードを行う。その後、デコードした結果は、信号線101aを介してPLC101へ送信される。このように、光学式情報読取装置1の運用時には、光学式情報読取装置1とPLC101等の外部制御装置との間で、信号線101aを介して読取開始トリガ信号の入力とデコード結果の出力が繰り返し行われる。なお、読取開始トリガ信号の入力やデコード結果の出力は、上述したように、光学式情報読取装置1とPLC101との間の信号線101aを介して行ってもよいし、それ以外の信号線を介して行ってもよい。例えば、ワークWKの到着を検知するためのセンサと光学式情報読取装置1とを直接的に接続し、そのセンサから光学式情報読取装置1へ読取開始トリガ信号を入力するようにしてもよい。 Further, during operation, the optical information reading device 1 receives a reading start trigger signal that defines the start timing of code reading from the PLC 101 via the signal line 101a. The optical information reading device 1 then images and decodes the code based on this reading start trigger signal. Thereafter, the decoded result is transmitted to the PLC 101 via the signal line 101a. In this way, when the optical information reading device 1 is in operation, the reading start trigger signal is input and the decoding result is output between the optical information reading device 1 and an external control device such as the PLC 101 via the signal line 101a. It is done repeatedly. Note that the input of the reading start trigger signal and the output of the decoding result may be performed via the signal line 101a between the optical information reading device 1 and the PLC 101, as described above, or via other signal lines. It may also be done through For example, a sensor for detecting the arrival of the workpiece WK and the optical information reading device 1 may be directly connected, and a reading start trigger signal may be input from the sensor to the optical information reading device 1.

光学式情報読取装置1の外観を、図2~図6に示す。これらの図において、図2は光学式情報読取装置1の斜視図、図3は図2の光学式情報読取装置1の正面図、図4は図2の光学式情報読取装置1の側面図、図5は図2の光学式情報読取装置1の天面図、図6は図2の光学式情報読取装置1の底面図を、それぞれ示している。 The appearance of the optical information reading device 1 is shown in FIGS. 2 to 6. In these figures, FIG. 2 is a perspective view of the optical information reading device 1, FIG. 3 is a front view of the optical information reading device 1 of FIG. 2, and FIG. 4 is a side view of the optical information reading device 1 of FIG. 5 shows a top view of the optical information reading device 1 of FIG. 2, and FIG. 6 shows a bottom view of the optical information reading device 1 of FIG. 2.

光学式情報読取装置1は、照明部4と、撮像部5と、表示部6と、電源コネクタ7と、信号線コネクタ8とが設けられている。さらに、装置本体2には、図5に示すインジケータ9と、図3に示すエイマー10と、図5に示すセレクトボタン11と、エンターボタン12とが設けられている。 The optical information reading device 1 includes an illumination section 4, an imaging section 5, a display section 6, a power supply connector 7, and a signal line connector 8. Furthermore, the device body 2 is provided with an indicator 9 shown in FIG. 5, an aimer 10 shown in FIG. 3, a select button 11 shown in FIG. 5, and an enter button 12.

装置本体2は、上下方向に長い略矩形箱状をなすケーシング2aを備えている。ケーシング2aの内部には、図7に示す制御ユニット29やデコード部31等が設けられている。ケーシング2aの前面には、光学式情報読取装置1の前方へ向けて光を照射することによってワークWKの少なくともコードを照明する照明部4と、光学式情報読取装置1の前方にあるワークWKの少なくともコードを撮像する撮像部5とが設けられている。さらにケーシング2aの前面には、発光ダイオード(LED)等の発光体で構成されたエイマー10が設けられている。このエイマー10は、光学式情報読取装置1の前方へ向けて光を照射することによって撮像部5による撮像範囲や照明部4の光軸の目安を示すためのものである。使用者は、エイマー10から照射される光を参照して光学式情報読取装置1を設置することもできる。 The device main body 2 includes a casing 2a having a substantially rectangular box shape that is elongated in the vertical direction. A control unit 29, a decoding section 31, etc. shown in FIG. 7 are provided inside the casing 2a. On the front side of the casing 2a, there is an illumination section 4 that illuminates at least the code of the workpiece WK by irradiating light toward the front of the optical information reading device 1, and a lighting section 4 that illuminates at least the code of the workpiece WK in front of the optical information reading device 1. An imaging unit 5 for imaging at least the code is provided. Further, an aimer 10 made of a light emitting body such as a light emitting diode (LED) is provided on the front surface of the casing 2a. The aimer 10 is used to indicate the imaging range of the imaging section 5 and the optical axis of the illumination section 4 by emitting light toward the front of the optical information reading device 1 . The user can also install the optical information reading device 1 by referring to the light emitted from the aimer 10.

ケーシング2aの上面には、図5に示すように表示部6が設けられている。またケーシング2aの上面には、光学式情報読取装置1の設定時等に使用するセレクトボタン11及びエンターボタン12とが設けられている。セレクトボタン11及びエンターボタン12は制御ユニット29に接続されていて、制御ユニット29はセレクトボタン11及びエンターボタン12の操作状態を検出可能になっている。セレクトボタン11は、表示部6に表示された複数の選択肢の中から1つを選択する際に操作するボタンである。エンターボタン12は、セレクトボタン11で選択した結果を確定する際に操作するボタンである。 A display section 6 is provided on the upper surface of the casing 2a, as shown in FIG. Further, on the upper surface of the casing 2a, a select button 11 and an enter button 12, which are used when setting the optical information reading device 1, etc., are provided. The select button 11 and the enter button 12 are connected to a control unit 29, and the control unit 29 can detect the operation states of the select button 11 and the enter button 12. The select button 11 is a button that is operated when selecting one from a plurality of options displayed on the display section 6. The enter button 12 is a button operated when confirming the result selected with the select button 11.

さらに、ケーシング2aの上面の左右両側には、図4に示すようにそれぞれインジケータ9が設けられている。インジケータ9は、制御ユニット29に接続されており、例えば発光ダイオード等の発光体で構成することができる。光学式情報読取装置1の作動状態をインジケータ9の点灯状態によって外部に報知することができる。 Further, as shown in FIG. 4, indicators 9 are provided on both left and right sides of the upper surface of the casing 2a. The indicator 9 is connected to the control unit 29 and can be composed of a light emitting body such as a light emitting diode. The operating state of the optical information reading device 1 can be notified to the outside by the lighting state of the indicator 9.

ケーシング2aの下面には、図6に示すように光学式情報読取装置1に電力を供給するための電力配線が接続される電源コネクタ7と、コンピュータ100及びPLC101に接続される信号線100a、101a用のイーサネット(商品名)コネクタ8とが設けられている。尚、Ethernet規格は一例であり、Ethernet規格以外の規格の信号線を利用することもできる。
(照明部4)
On the lower surface of the casing 2a, as shown in FIG. 6, there are a power connector 7 to which power wiring for supplying power to the optical information reading device 1 is connected, and signal lines 100a and 101a connected to the computer 100 and PLC 101. An Ethernet (trade name) connector 8 is provided. Note that the Ethernet standard is just one example, and signal lines of standards other than the Ethernet standard can also be used.
(Lighting section 4)

照明部4は、図3に示すように複数の第1発光ダイオード16及び複数の第2発光ダイオード17とを備えている。第1発光ダイオード16と第2発光ダイオード17とは、制御ユニット29に電気的に接続されていて制御ユニット29により個別に制御され、別々に点灯及び消灯させることができるようになっている。 The illumination unit 4 includes a plurality of first light emitting diodes 16 and a plurality of second light emitting diodes 17, as shown in FIG. The first light emitting diode 16 and the second light emitting diode 17 are electrically connected to a control unit 29 and individually controlled by the control unit 29, so that they can be turned on and off separately.

光学式情報読取装置1の構成を示すブロック図を、図7に示す。この図に示すように、光学式情報読取装置1は、照明部4と、撮像部5と、変換部30と、デコード部31とを備える。照明部4は、コードに光を照射する。撮像部5は、照明部4から照射されコードで反射された光を受光して、入力画像を取得する。変換部30は、撮像部5で得られた入力画像から、コード画像を生成する。コード画像は、入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなる特性変換式を用いて、入力値から階調数を削減した出力値を算出したものである。特性変換式は、後述するHDR変換式が利用できる。変換部30は、入力値が予め定められた閾値よりも大きな画素については、特性変換式に基づいて、この入力値の大きさに基づいて変化する出力値を出力する。ここで入力値とは、入力画像を構成する各画素の画素値を示す。入力値の例としては輝度値が挙げられる。一方で、入力値が閾値よりも小さな画素については、入力値が閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力するように構成している。ここで、相対的に小さな一定の値とは、コードの読取に際して無視できる程度の多少の変動を許容する。 A block diagram showing the configuration of the optical information reading device 1 is shown in FIG. As shown in this figure, the optical information reading device 1 includes an illumination section 4, an imaging section 5, a conversion section 30, and a decoding section 31. The illumination unit 4 irradiates the cord with light. The imaging unit 5 receives the light emitted from the illumination unit 4 and reflected by the code, and acquires an input image. The converting unit 30 generates a code image from the input image obtained by the imaging unit 5. The code image is an output that reduces the number of gradations from the input value by using a characteristic conversion formula for each pixel that makes up the input image, in which the larger the input value, the smaller the change width of the output value in response to a change in the input value. This is the calculated value. The HDR conversion formula described later can be used as the characteristic conversion formula. For pixels whose input value is larger than a predetermined threshold, the conversion unit 30 outputs an output value that changes based on the magnitude of the input value based on the characteristic conversion formula. Here, the input value refers to the pixel value of each pixel forming the input image. An example of the input value is a brightness value. On the other hand, a pixel whose input value is smaller than the threshold value is configured to output a relatively smaller constant value as an output value than a pixel whose input value is larger than the threshold value. Here, the relatively small constant value allows for some negligible variation when reading the code.

最後にデコード部31は、変換部30で生成したコード画像に基づいて、コードにエンコードされた情報のデコードを行う。このようにすることで、コードのコントラストが変化しても安定的に読み取りを行うことができる。特に、コード画像の明るさが変動する場合であっても、コードの白部と黒部のコントラスト値を一定に保持する変換特性を用いてコード画像を生成することで、コードの読取り対応力が向上する。これによりワークの高低差が大きい場合の対応力を向上させることができる。
(撮像部5の構成)
Finally, the decoding unit 31 decodes the information encoded into the code based on the code image generated by the converting unit 30. By doing so, stable reading can be performed even if the contrast of the code changes. In particular, code images are generated using conversion characteristics that maintain a constant contrast value between white and black areas of the code even when the brightness of the code image fluctuates, improving code readability. do. This makes it possible to improve the ability to respond to cases where the height difference between the workpieces is large.
(Configuration of imaging unit 5)

撮像部5は、ワークWKに付されており、照明部4によって照明されているコードを撮像する撮像素子5aと、レンズ等を有する光学系5bと、オートフォーカス機構(AF機構)5cとを備えている。光学系5bには、ワークWKのコードが付された部分から反射した光が入射するようになっている。撮像素子5aは、光学系5bを通して得られたコードの画像を電気信号に変換するCCD(charge-coupled device)やCMOS(complementary metal oxide semiconductor)等の受光素子からなるイメージセンサである。撮像素子5aは制御ユニット29に接続されていて、撮像素子5aによって変換された電気信号は、制御ユニット29に入力される。また、AF機構5cは、光学系5bを構成するレンズのうち、合焦用レンズの位置や屈折率を変更することによってピント合わせを行う機構である。AF機構5cも制御ユニット29に接続され、制御ユニット29のAF制御部29aにより制御される。
(表示部6)
The imaging unit 5 is attached to the workpiece WK and includes an imaging element 5a that images the code illuminated by the illumination unit 4, an optical system 5b having a lens, etc., and an autofocus mechanism (AF mechanism) 5c. ing. Light reflected from the coded portion of the workpiece WK is incident on the optical system 5b. The image sensor 5a is an image sensor made of a light receiving element such as a CCD (charge-coupled device) or a CMOS (complementary metal oxide semiconductor) that converts an image of the code obtained through the optical system 5b into an electrical signal. The image sensor 5a is connected to a control unit 29, and the electrical signal converted by the image sensor 5a is input to the control unit 29. Further, the AF mechanism 5c is a mechanism that performs focusing by changing the position and refractive index of a focusing lens among the lenses constituting the optical system 5b. The AF mechanism 5c is also connected to the control unit 29 and is controlled by the AF control section 29a of the control unit 29.
(Display section 6)

表示部6は、例えば有機ELディスプレイや液晶ディスプレイ等で構成される。表示部6は、制御ユニット29に接続され、例えば撮像部5で撮像されたコード、コードのデコード結果である文字列、読み取り成功率、マッチングレベル等を表示させることができる。読み取り成功率とは、複数回読み取り処理を実行したときの平均読み取り成功率である。マッチングレベルとは、デコードが成功したコードの読み取りのしやすさを示す読取余裕度である。これはデコード時に発生した誤り訂正の数等から求めることができ、例えば数値で表すことができる。誤り訂正が少なければ少ないほど読取余裕度が高くなり、一方、誤り訂正が多ければ多いほど読取余裕度が低くなる。
(変換部30)
The display section 6 is composed of, for example, an organic EL display or a liquid crystal display. The display section 6 is connected to the control unit 29, and can display, for example, the code imaged by the imaging section 5, a character string that is a decoding result of the code, a reading success rate, a matching level, and the like. The read success rate is the average read success rate when reading processing is executed multiple times. The matching level is a reading margin indicating the ease of reading a code that has been successfully decoded. This can be determined from the number of error corrections that occur during decoding, and can be expressed, for example, as a numerical value. The fewer error corrections are made, the higher the reading margin is, while the more error corrections are made, the lower the reading margin is.
(Conversion unit 30)

光学式情報読取装置1は変換部30を備えている。変換部30は、制御ユニット29に接続されている。変換部30は、撮像素子5aにより取得された第1画像の画素値を所定の変換特性に応じた画素値に変換することにより第2画像を生成する部分である。第1画像は変換前画像と呼ぶこともできる。第2画像は変換後画像と呼ぶこともできる。変換部30が第1画像の画素値を変換する際に使用する変換特性は、後述する記憶装置35の変換特性記憶部35dに予め記憶されている。
(デコード部31)
The optical information reading device 1 includes a converting section 30. The conversion section 30 is connected to the control unit 29. The conversion unit 30 is a part that generates a second image by converting pixel values of the first image acquired by the image sensor 5a into pixel values according to predetermined conversion characteristics. The first image can also be called a pre-conversion image. The second image can also be called a converted image. The conversion characteristics used by the conversion section 30 when converting the pixel values of the first image are stored in advance in a conversion characteristic storage section 35d of the storage device 35, which will be described later.
(Decode unit 31)

光学式情報読取装置1は、白黒の二値化されたデータをデコードするデコード部31を有している。デコードには、符号化されたデータの対照関係を示すテーブルを使用することができる。さらに、デコード部31は、デコードした結果が正しいか否かを所定のチェック方式に従ってチェックする。データに誤りが発見された場合にはエラー訂正機能を使用して正しいデータを演算する。エラー訂正機能はコードの種類によって異なる。 The optical information reading device 1 includes a decoding section 31 that decodes black and white binary data. For decoding, a table showing the contrast of encoded data can be used. Further, the decoding unit 31 checks whether the decoded result is correct according to a predetermined checking method. If an error is found in the data, the error correction function is used to calculate correct data. The error correction function differs depending on the type of code.

この実施形態では、デコード部31が変換部30により変換された第2画像に含まれるコードをデコードする。デコード部31は、コードをデコードして得られたデコード結果を記憶装置35に書き込むように構成されている。また、デコード部31では、デコード前の第2画像に対して各種画像処理フィルタ等の画像処理を行う。
(通信部32)
In this embodiment, the decoding unit 31 decodes the code included in the second image converted by the converting unit 30. The decoding unit 31 is configured to decode the code and write the obtained decoding result into the storage device 35. Further, the decoding unit 31 performs image processing such as various image processing filters on the second image before decoding.
(Communication department 32)

光学式情報読取装置1は通信部32を有している。通信部32は、コンピュータ100及びPLC101と通信を行う部分である。通信部32は、コンピュータ100及びPLC101と接続されるI/O部、RS232C等のシリアル通信部、無線LANや有線LAN等のネットワーク通信部を有していてもよい。
(制御ユニット29)
The optical information reading device 1 has a communication section 32 . The communication unit 32 is a part that communicates with the computer 100 and PLC 101. The communication unit 32 may include an I/O unit connected to the computer 100 and the PLC 101, a serial communication unit such as RS232C, and a network communication unit such as a wireless LAN or wired LAN.
(control unit 29)

図7に示す制御ユニット29は、光学式情報読取装置1の各部を制御するためのユニットであり、CPUやMPU、システムLSI、DSPや専用ハードウエア等で構成することができる。制御ユニット29は、後述するように様々な機能を搭載しているが、これらは論理回路によって実現されていてもよいし、ソフトウエアを実行することによって実現されていてもよい。 The control unit 29 shown in FIG. 7 is a unit for controlling each part of the optical information reading device 1, and can be configured with a CPU, MPU, system LSI, DSP, dedicated hardware, etc. The control unit 29 is equipped with various functions as described below, but these may be realized by a logic circuit or by executing software.

制御ユニット29は、AF制御部29aと、撮像制御部29bと、チューニング部29cと、UI管理部29eとを有している。AF制御部29aは、AF機構5cを制御するユニットであり、従来から周知のコントラストAFや位相差AFによって光学系5bのピント合わせを行うことができるように構成されている。 The control unit 29 includes an AF control section 29a, an imaging control section 29b, a tuning section 29c, and a UI management section 29e. The AF control section 29a is a unit that controls the AF mechanism 5c, and is configured to be able to focus the optical system 5b using conventionally well-known contrast AF or phase difference AF.

撮像制御部29bは、ゲインを調整したり、照明部4の光量を制御したり、撮像素子5aの露光時間(シャッタースピード)を制御するユニットである。ここで、ゲインとは、撮像素子5aから出力された画像の明るさをデジタル画像処理によって増幅する際の増幅率(倍率とも呼ばれる)のことである。照明部4の光量については、第1発光ダイオード16と第2発光ダイオード17を別々に制御して変更することができる。ゲイン、照明部4の光量及び露光時間は、撮像部5の撮像条件である。 The imaging control section 29b is a unit that adjusts the gain, controls the light amount of the illumination section 4, and controls the exposure time (shutter speed) of the imaging device 5a. Here, the gain is an amplification factor (also called magnification) when the brightness of the image output from the image sensor 5a is amplified by digital image processing. The amount of light from the illumination unit 4 can be changed by controlling the first light emitting diode 16 and the second light emitting diode 17 separately. The gain, the amount of light of the illumination section 4, and the exposure time are the imaging conditions of the imaging section 5.

チューニング部29cは、ゲイン、照明部4の光量及び露光時間等の撮像条件や、デコード部31における画像処理条件を変更するユニットである。デコード部31における画像処理条件とは、画像処理フィルタの係数(フィルタの強弱)や、複数の画像処理フィルタがある場合に画像処理フィルタの切替、種類の異なる画像処理フィルタの組み合わせ等である。搬送時のワークWKに対する外光の影響や、コードが付されている面の色及び材質等によって適切な撮像条件及び画像処理条件は異なる。よって、チューニング部29cは、より適切な撮像条件及び画像処理条件を探索して、AF制御部29a、撮像制御部29b、デコード部31による処理を設定する。画像処理フィルタは、従来から周知の各種フィルタを使用することができる。またチューニング部29cによるチューニングに際しては、オフセット量の異なる複数の変換特性曲線に基づいて、変換部30で階調変換を行って得られたコード画像に対して、それぞれデコード部31でデコードして、その読取結果に基づいて、複数の変換特性曲線のパラメータを決定することができる。 The tuning unit 29c is a unit that changes imaging conditions such as gain, light amount and exposure time of the illumination unit 4, and image processing conditions in the decoding unit 31. The image processing conditions in the decoding unit 31 include the coefficients of the image processing filter (strength and weakness of the filter), switching of the image processing filter when there is a plurality of image processing filters, a combination of different types of image processing filters, and the like. Appropriate imaging conditions and image processing conditions vary depending on the influence of external light on the workpiece WK during transportation, the color and material of the surface to which the code is attached, etc. Therefore, the tuning section 29c searches for more appropriate imaging conditions and image processing conditions, and sets the processing by the AF control section 29a, the imaging control section 29b, and the decoding section 31. As the image processing filter, various conventionally known filters can be used. In addition, during tuning by the tuning unit 29c, the code images obtained by performing gradation conversion in the conversion unit 30 are decoded by the decoding unit 31, respectively, based on a plurality of conversion characteristic curves having different offset amounts. Based on the reading results, parameters of a plurality of conversion characteristic curves can be determined.

チューニング部29cは、光学式情報読取装置1を運用する前に行われる光学式情報読取装置1の設定時に撮像部5により取得された第1画像を用いて、変換部30に、変換特性記憶部35dに記憶された複数の異なる変換特性の各々に応じた第2画像を生成させ、生成された第2画像に含まれるコードをデコード部31によってそれぞれデコードした結果を解析することにより、複数の異なる変換特性の中から1つを選択するように構成されている。このチューニング部29cによる処理手順については後述するフローチャートに基づいて詳細に説明するが、概略は次のとおりである。 The tuning unit 29c uses the first image acquired by the imaging unit 5 at the time of setting the optical information reading device 1 before operating the optical information reading device 1, and instructs the conversion unit 30 to perform conversion characteristic storage. By generating a second image according to each of a plurality of different conversion characteristics stored in the 35d, and analyzing the results of decoding codes included in the generated second image by the decoding section 31, a plurality of different conversion characteristics can be generated. It is configured to select one of the conversion characteristics. The processing procedure by the tuning unit 29c will be explained in detail based on the flowchart described later, but the outline is as follows.

すなわち、光学式情報読取装置1を運用する前には、運用準備段階として、光学式情報読取装置1の設定が行われる。光学式情報読取装置1の設定時には、光学式情報読取装置1に信号線101aを介して接続されたコンピュータ100から、設定用の各種コマンドを送信することにより、各種設定を行う。この設定時に、チューニング部29cによるチューニングが行われる。チューニングを行う際、ワークWKに付されているコードを撮像部5により撮像して第1画像を得る。得られた第1画像の画素値を、変換特性記憶部35dに記憶されている変換特性のうちの一の変換特性に応じた画素値に変換することにより第2画像を生成させる。また、得られた第1画像の画素値を、変換特性記憶部35dに記憶されている変換特性のうちの他の変換特性に応じた画素値に変換することにより第2画像を生成させる。変換特性記憶部35dに記憶されている変換特性が3以上であれば、変換部30に、第2画像を3以上生成させることもできる。 That is, before operating the optical information reading device 1, settings of the optical information reading device 1 are performed as a preparation stage for operation. When setting the optical information reading device 1, various settings are performed by transmitting various setting commands from the computer 100 connected to the optical information reading device 1 via the signal line 101a. At the time of this setting, tuning is performed by the tuning section 29c. When tuning, the code attached to the workpiece WK is imaged by the imaging unit 5 to obtain a first image. A second image is generated by converting the pixel values of the obtained first image into pixel values according to one of the conversion characteristics stored in the conversion characteristic storage section 35d. Further, a second image is generated by converting the pixel values of the obtained first image into pixel values corresponding to other conversion characteristics among the conversion characteristics stored in the conversion characteristic storage section 35d. If the number of conversion characteristics stored in the conversion characteristic storage section 35d is three or more, the conversion section 30 can be caused to generate three or more second images.

そして、生成された複数の第2画像に含まれるコードをデコード部31でそれぞれデコードし、チューニング部29cでは、デコードが成功したコードの読み取りのしやすさを示す読取余裕度を解析する。チューニング部29cは、読取余裕度を解析した結果、読取余裕度の高かった第2画像の変換特性を選択する。光学式情報読取装置1の設定が終了した後、光学式情報読取装置1運用時には、変換部30が、撮像部5により取得された第1画像を用いて、上記チューニング部29cにより選択された変換特性に応じた第2画像を生成してデコード部31がデコードする。 Then, the codes included in the plurality of generated second images are each decoded by the decoding unit 31, and the tuning unit 29c analyzes the reading margin indicating the ease of reading the codes that have been successfully decoded. The tuning unit 29c selects the conversion characteristic of the second image that has a high reading margin as a result of analyzing the reading margin. After the settings of the optical information reading device 1 are completed, when the optical information reading device 1 is in operation, the conversion unit 30 uses the first image acquired by the imaging unit 5 to perform the conversion selected by the tuning unit 29c. A second image according to the characteristics is generated and decoded by the decoding unit 31.

チューニング部29cは、光学式情報読取装置1の設定時、撮像部5に1つの第1画像を取得させ、変換部30に、1つの第1画像を用いて変換特性記憶部35dに記憶された複数の異なる変換特性の各々に応じた複数の第2画像を生成させるように構成されていてもよい。この場合、光学式情報読取装置1の設定時に、変換特性記憶部35dに記憶されている変換特性の数だけ第2画像が生成されることになる。 When setting the optical information reading device 1, the tuning unit 29c causes the imaging unit 5 to acquire one first image, and causes the conversion unit 30 to use the one first image and store it in the conversion characteristic storage unit 35d. It may be configured to generate a plurality of second images according to each of a plurality of different conversion characteristics. In this case, when setting the optical information reading device 1, as many second images as the number of conversion characteristics stored in the conversion characteristic storage section 35d are generated.

また、チューニング部29cは、光学式情報読取装置1の設定時、撮像部5に複数の第1画像を取得させ、変換部30に、複数の第1画像のそれぞれについて変換特性記憶部35dに記憶された複数の異なる変換特性の各々に応じた複数の第2画像を生成させるように構成されていてもよい。この場合、光学式情報読取装置1の設定時に第1画像が複数得られることになるので、その第1画像の数と、変換特性記憶部35dに記憶されている変換特性の数とを乗じた数の第2画像が生成されることになる。 Further, when setting the optical information reading device 1, the tuning unit 29c causes the imaging unit 5 to acquire a plurality of first images, and causes the conversion unit 30 to store each of the plurality of first images in the conversion characteristic storage unit 35d. The plurality of second images may be generated in accordance with each of the plurality of different conversion characteristics. In this case, since a plurality of first images are obtained when setting the optical information reading device 1, the number of first images is multiplied by the number of conversion characteristics stored in the conversion characteristic storage section 35d. A number of second images will be generated.

また、チューニング部29cは、光学式情報読取装置1の設定時、撮像部5に、撮像条件を変えて複数回撮像させて複数の第1画像を取得させるように構成されていてもよい。撮像条件は、ゲイン、照明部4の光量及び露光時間等である。 Further, the tuning unit 29c may be configured to cause the imaging unit 5 to capture a plurality of images under different imaging conditions to obtain a plurality of first images when setting the optical information reading device 1. The imaging conditions include the gain, the light amount of the illumination unit 4, the exposure time, and the like.

図7に示すUI管理部29eは、表示部6に、各種インターフェース、撮像部5で撮像されたコード、コードのデコード結果である文字列、読み取り成功率、マッチングレベル等を表示させたり、セレクトボタン11及びエンターボタン12からの入力を受け付けたり、エイマー10の点灯を制御するユニットである。
(記憶装置35)
The UI management unit 29e shown in FIG. 7 causes the display unit 6 to display various interfaces, codes imaged by the imaging unit 5, character strings that are decoding results of the code, reading success rate, matching level, etc., and selects a select button. 11 and the enter button 12, and controls lighting of the aimer 10.
(Storage device 35)

記憶装置35は、メモリやハードディスク等で構成されている。記憶装置35には、デコード結果記憶部35aと、画像データ記憶部35bと、パラメータセット記憶部35cと、変換特性記憶部35dとが設けられている。デコード結果記憶部35aは、デコード部31によりデコードされた結果であるデコード結果を記憶する部分である。画像データ記憶部35bは、撮像素子5aによって撮像された画像を記憶する部分である。 The storage device 35 is composed of a memory, a hard disk, and the like. The storage device 35 is provided with a decoding result storage section 35a, an image data storage section 35b, a parameter set storage section 35c, and a conversion characteristic storage section 35d. The decoding result storage section 35a is a section that stores the decoding result that is the result of decoding by the decoding section 31. The image data storage section 35b is a section that stores images captured by the image sensor 5a.

変換特性記憶部35dは、変換部30で第1画像の画素値の変換時に用いられる複数の異なる変換特性を記憶する部分である。変換特性は階調変換特性であり、この実施形態では、後述する図19に示すように、3つの変換特性を変換特性記憶部35dに予め記憶させている。 The conversion characteristic storage section 35d is a section that stores a plurality of different conversion characteristics used by the conversion section 30 when converting pixel values of the first image. The conversion characteristics are gradation conversion characteristics, and in this embodiment, three conversion characteristics are stored in advance in the conversion characteristic storage section 35d, as shown in FIG. 19, which will be described later.

図7に示すパラメータセット記憶部35cは、コンピュータ100等の設定装置によって設定された設定情報やセレクトボタン11及びエンターボタン12によって設定された設定情報等を記憶する部分である。このパラメータセット記憶部35cには、撮像部5の撮像条件(ゲイン、照明部4の光量及び露光時間等)と、デコード部31における画像処理条件(画像処理フィルタの種類等)との少なくとも一方を構成する複数のパラメータを含むパラメータセットを記憶することができる。 The parameter set storage unit 35c shown in FIG. 7 is a part that stores setting information set by a setting device such as the computer 100, setting information set by the select button 11 and the enter button 12, and the like. The parameter set storage unit 35c stores at least one of the imaging conditions of the imaging unit 5 (gain, light amount and exposure time of the illumination unit 4, etc.) and the image processing conditions of the decoding unit 31 (type of image processing filter, etc.). A parameter set including a plurality of constituent parameters can be stored.

近年、製品の管理情報を短時間で認識するために、製品名やシリアル番号、価格などの情報を記録した、バーコードなどの1次元コードや、QRコード等の2次元コードが広く用いられている。このようなコードを読み取ってデコードし、コードに記録されたデータの登録や照合等の処理を行う部材として、光学式情報読取装置が用いられている。光学式情報読取装置は、手持ち式のハンディスキャナ、ハンディターミナル、業務用PDA等や、定置式のコードリーダに大別される。 In recent years, one-dimensional codes such as barcodes and two-dimensional codes such as QR codes, which record information such as product name, serial number, and price, have been widely used to quickly recognize product management information. There is. An optical information reading device is used as a member that reads and decodes such codes and performs processing such as registration and verification of data recorded in the codes. Optical information reading devices are broadly classified into handheld scanners, handy terminals, business-use PDAs, and stationary code readers.

定置式の光学式情報読取装置は、物流配送センター等で広く使用されている。物流配送センターにおいては、各搬送物に付された、届け先情報が含まれるコードを読み取り、コンベア等で搬送される搬送物の自動仕分けに用いられている。このためコードを確実に読み取ることが求められ、さらに光学式情報読取装置を複数台、適切に配置することが必要となる。また年々、配送量が増加する背景もあるため、搬送物を高速で読み取らなくてはならない。 Stationary optical information reading devices are widely used in distribution centers and the like. At logistics distribution centers, codes that include destination information attached to each item are read and used for automatic sorting of items transported on conveyors or the like. Therefore, it is required to read the code reliably, and it is also necessary to appropriately arrange a plurality of optical information reading devices. Additionally, because the amount of deliveries is increasing year by year, it is necessary to read conveyed items at high speed.

しかしながら、物流配送センターにおいて搬送される搬送物のサイズは不定であり、背の高い大型の荷物から、背の低い小型の荷物まで様々存在する。このような不定形の荷物のコードを高速で読み取って荷物の仕分けをする用途に光学式情報読取装置を用いる場合、安定して読み取りを行うためには、以下の2つの課題が存在する。
(課題1:荷物の高さの高低差による明るさ変動抑制)
However, the size of the objects to be transported at the distribution center is not fixed, and varies from large and tall objects to small and short objects. When using an optical information reading device for sorting packages by reading codes on irregularly shaped packages at high speed, the following two issues exist in order to perform stable reading.
(Issue 1: Suppressing brightness fluctuations due to height differences in luggage)

安定したコードの読み取りをするためには、移動する荷物を鮮明に撮影する必要がある。しかしながら、荷物の高さが異なることや、光学式情報読取装置とコンベア間の距離などによって、撮影距離に大きなばらつきが生じる。一般的に、図8に示すように明るさは光学式情報読取装置1からの距離の二乗に比例して減少することが知られている。よって、図9において右下に示すように、コードが近方にある場合は明るすぎる画像になる傾向があり、逆に図9において左上に示すようにコードが遠方にある場合は暗すぎる画像になる傾向がある。 In order to read the code reliably, it is necessary to clearly photograph the moving baggage. However, the photographing distance varies greatly due to differences in the height of the baggage, the distance between the optical information reader and the conveyor, and other factors. Generally, it is known that brightness decreases in proportion to the square of the distance from the optical information reading device 1, as shown in FIG. Therefore, as shown in the lower right corner of Figure 9, when the code is close, the image tends to be too bright; conversely, when the cord is far away, as shown in the upper left corner of Figure 9, the image tends to be too dark. There is a tendency to

また、リニアな画像を取得した場合、撮像対象が明るくなると、コードと、コード以外のコントラストも上がる。このため、画像が暗いと、コントラストが小さくなってデコードできなくなる。一方で画像が明るいと、コードのコントラストと共にコード以外のコントラストも上がって、処理時間がかかるという問題があった。
(課題2:低コントラストコードへの対応)
Furthermore, when a linear image is acquired, as the object to be imaged becomes brighter, the contrast between the code and other parts also increases. Therefore, if the image is dark, the contrast will be low and it will not be possible to decode it. On the other hand, when the image is bright, the contrast of the code and the contrast of other parts increases, causing a problem in that processing time is increased.
(Issue 2: Dealing with low contrast codes)

また、別の問題として、コード自体が低コントラストになっている場合が挙げられる。例えばコードを印字する時点でインク残量が少なくなった、又は高速移動印字により十分なインクの塗布ができなかった場合などで、黒地のナローバーが薄くなっていることがある。あるいは、搬送物に付されたコードの印字面が、搬送物の搬送中に様々なものに擦れることで表面を剥ぎ取られ、事後的にコントラストが低くなる場合もある。 Another problem is when the code itself has low contrast. For example, the narrow bar on the black background may become thinner if the amount of ink remaining is low when printing the code, or if sufficient ink cannot be applied due to high-speed printing. Alternatively, the printed surface of the code attached to the conveyed object may be rubbed off by various objects during the conveyance of the conveyed object, and the surface may be peeled off, resulting in a subsequent reduction in contrast.

課題1においては、仮に自動焦点機構などを用いてピンボケを改善したとしても、依然として残る課題であり、解決することが望ましい。 Regarding problem 1, even if an automatic focusing mechanism or the like is used to improve out-of-focus, this problem still remains, and it is desirable to solve it.

また課題2においても、コード側での改善が困難であるため、コード読み取り性能を向上させることで対処することが望ましい。 In addition, issue 2 is difficult to improve on the code side, so it is desirable to deal with it by improving the code reading performance.

このような課題に対して、従来は、撮像部5で読み取ったビット数の高い画像データを、変換部30で扱い易い低ビット数の画像データに変換する変換処理に際し、変換特性を工夫することでコントラストが損なわれないようにしていた。具体的には、図10に示すような変換特性(HDRカーブやLOGカーブ等とも呼ばれる。)を用意して、コントラスト差を確保していた。ここで、標準変換特性で生成したコード画像を図11、HDR変換特性で生成したコード画像を図12に、それぞれ示す。このように、HDRカーブで表現することで白潰れや黒潰れ部分は大幅に改善され、大きなダイナミックレンジを確保してコントラストの明確なコード画像を得ることができる。 In order to solve this problem, conventional techniques have been used to devise conversion characteristics when converting image data with a high number of bits read by the imaging unit 5 into image data with a low number of bits that can be easily handled by the converting unit 30. to avoid loss of contrast. Specifically, a conversion characteristic (also called an HDR curve, a LOG curve, etc.) as shown in FIG. 10 was prepared to ensure a contrast difference. Here, a code image generated using standard conversion characteristics is shown in FIG. 11, and a code image generated using HDR conversion characteristics is shown in FIG. 12, respectively. In this way, by expressing the image using an HDR curve, it is possible to significantly improve white collapse and black collapse, ensure a large dynamic range, and obtain a code image with clear contrast.

ここで変換特性について、図10~図13に基づいて説明する。図10はガンマ変換のガンマ値を変えた4つの変換特性を示している。この図に示す変換特性は、ガンマ値を1.0よりも大きな値(例えば2.0)にしたHDR特性(第一変換特性)と、HDR特性のガンマ値よりも大きなガンマ値にした超HDR特性(第一変換特性)と、ガンマ値を1.0にした標準特性と、ガンマ値を1.0未満(例えば0.5)にしたコントラスト強調特性(第二変換特性)である。各変換特性のガンマ値は例示であり、上記した値に限定されるものではない。HDR特性及び超HDR特性は、ガンマ値が1.0よりも大きな値であるため、いわゆるログ変換であり、光学式情報読取装置1の運用時に撮像部5により取得された第1画像の明るさ変動を抑制するための略対数曲線からなる特性である。ワークWKのコードの明るさが変化したとしても、デコードするための第2画像の明るさ変動が抑制される。また、HDR特性及び超HDR特性を用いることにより、ハレーションが起こり難くなるので、情報が欠落し難くなる。例えば、撮像部5の有効視野が広い場合や長深度化した場合には、ワークWKと撮像部5との距離のバラつきが大きくなり、このことで光学式情報読取装置1の運用時に撮像部5により取得された第1画像の明るさが大きく変動することが考えられるが、HDR特性及び超HDR特性を選択することで、明るさ変動が抑制された第2画像を得ることができ、読み取り精度が高まる。 Here, the conversion characteristics will be explained based on FIGS. 10 to 13. FIG. 10 shows four conversion characteristics in which the gamma value of gamma conversion is changed. The conversion characteristics shown in this figure are HDR characteristics (first conversion characteristics) with a gamma value larger than 1.0 (for example, 2.0), and super HDR characteristics with a gamma value larger than the gamma value of the HDR characteristics. A characteristic (first conversion characteristic), a standard characteristic with a gamma value of 1.0, and a contrast enhancement characteristic (second conversion characteristic) with a gamma value of less than 1.0 (for example, 0.5). The gamma value of each conversion characteristic is an example, and is not limited to the above values. Since the HDR characteristic and the super HDR characteristic have a gamma value larger than 1.0, they are so-called log conversion, and the brightness of the first image acquired by the imaging unit 5 during operation of the optical information reading device 1 This is a characteristic consisting of a substantially logarithmic curve for suppressing fluctuations. Even if the brightness of the code of the workpiece WK changes, the brightness fluctuation of the second image for decoding is suppressed. Furthermore, by using HDR characteristics and super HDR characteristics, halation is less likely to occur, so information is less likely to be lost. For example, when the effective field of view of the imaging section 5 is wide or when the depth becomes long, the distance between the workpiece WK and the imaging section 5 will vary widely. It is conceivable that the brightness of the first image obtained by increases.

標準特性は、ガンマ値が1.0であるため、光学式情報読取装置1の運用時に撮像部5により取得された第1画像の画素値をそのまま出力する。標準特性は、HDR特性とコントラスト強調特性の間の特性を持っている。第1画像のビット数が多ければ多いほど多くの情報を圧縮して取得できるため、撮像素子5aからの入力は10ビット入力よりも12ビット入力の方が表現豊かになる。これにより明るさ変動が抑制されて読み取り精度が高まるので、好ましい。尚、撮像素子5aから12ビットまたは10ビットで入力した信号は8ビットに変換している。 Since the standard characteristic is that the gamma value is 1.0, the pixel values of the first image acquired by the imaging unit 5 during operation of the optical information reading device 1 are output as they are. The standard characteristics have characteristics between HDR characteristics and contrast enhancement characteristics. The greater the number of bits in the first image, the more information can be compressed and acquired, so 12-bit input from the image sensor 5a is richer in expression than 10-bit input. This is preferable because brightness fluctuations are suppressed and reading accuracy is increased. Note that the signal input from the image sensor 5a in 12 bits or 10 bits is converted to 8 bits.

コントラスト強調特性は、ガンマ値が1.0未満であるため、光学式情報読取装置1の運用時に撮像部5により取得された第1画像のコントラストを強調するための略指数曲線からなる特性である。ある特定の入力値として二次元コードのセル部分(黒部分)の画素値が120で、スペース部分(白部分)の画素値が130である場合のようにセル部分とスペース部分とのコントラストが小さいケースのとき、コントラスト強調特性で変換することで、出力値としてセル部分(黒部分)の画素値が23で、スペース部分(白部分)の画素値が164になり、コントラストを強調できる。 Since the gamma value is less than 1.0, the contrast enhancement characteristic is a characteristic consisting of a substantially exponential curve for enhancing the contrast of the first image acquired by the imaging unit 5 during operation of the optical information reading device 1. . As a certain input value, the contrast between the cell part and the space part is small, such as when the pixel value of the cell part (black part) of a two-dimensional code is 120 and the pixel value of the space part (white part) is 130. In this case, by converting using the contrast enhancement characteristic, the pixel value of the cell portion (black portion) becomes 23 and the pixel value of the space portion (white portion) becomes 164 as output values, so that the contrast can be emphasized.

ただし、このような一般的なHDR変換でも対応できる範囲には限りがあり、特に物流業界で扱うような高低差が大きい搬送物や、読み取り距離が長い場合、明るさのばらつきが大きい場合等には、コードの読み取りを安定して行うには依然として不十分であった。 However, there is a limit to the range that can be supported even with such general HDR conversion, especially when conveyed objects with large height differences such as those handled in the logistics industry, when the reading distance is long, or when there are large variations in brightness. was still insufficient for stable code reading.

例えば、撮像素子で撮影して得られる画像について、画像データを構成する画素毎に12ビット(4096諧調)の入力値を、ある変換特性により8ビット(256諧調)に変換して出力する場合を考える。この場合の変換式は、図13に示すようなグラフとなる。また、このときのコードの白部分の輝度値を横軸とし、その白部分からどれだけ黒部分との差分輝度値、すなわちコントラストが取れるかを縦軸に示したグラフは、図14のようになる。 For example, for an image taken with an image sensor, a 12-bit (4096 tones) input value for each pixel that makes up the image data is converted to 8 bits (256 tones) using a certain conversion characteristic and output. think. The conversion formula in this case becomes a graph as shown in FIG. In addition, a graph in which the horizontal axis is the brightness value of the white part of the code at this time and the vertical axis shows the difference in brightness value from the white part to the black part, that is, the contrast can be obtained, is as shown in Figure 14. Become.

コードを安定して読み取るためには、ある程度のコントラスト(コードの白部分と黒部分の輝度差)が必要である。ここで、コードを読み取るために必要なコントラスト値のしきい値を、エッジ強度と呼ぶ。このエッジ強度が高い場合はコードを認識し易くなり、高速読み取りが可能であるものの、輝度値が変化するとたちまち読み取りできなくなる。すなわち、読取対象の輝度値の変化の対応力が弱い。一方で、エッジ強度が低い場合は、コードのコントラスト値がノイズに埋もれて読み取りが困難となる。一般に撮像部5に用いられるCMOSセンサ等の撮像素子が持つノイズ成分が、一定量、撮像された画像に対して重畳されるため、エッジ強度を低くし過ぎると、読み取りが難しくなる。すなわち、高速読取には不適となる。半面、輝度値の変化に対する対応力は高くなる。このように、高速読取と輝度値変化対応力はトレードオフの関係にあるため、適切なしきい値を設定することが重要となる。 In order to read a code stably, a certain degree of contrast (brightness difference between the white and black parts of the code) is required. Here, the contrast value threshold required for reading the code is called edge strength. When this edge strength is high, the code is easy to recognize and can be read at high speed, but when the brightness value changes, it quickly becomes impossible to read. That is, the ability to respond to changes in the brightness value of the object to be read is weak. On the other hand, when the edge strength is low, the contrast value of the code is buried in noise, making it difficult to read. Generally, a certain amount of noise components included in an image sensor such as a CMOS sensor used in the image capturing section 5 are superimposed on the captured image, so if the edge strength is made too low, reading becomes difficult. In other words, it is not suitable for high-speed reading. On the other hand, the ability to respond to changes in brightness values is improved. In this way, there is a trade-off relationship between high-speed reading and the ability to respond to changes in luminance value, so it is important to set an appropriate threshold value.

ここで、図14のグラフに対して、撮像素子のノイズ成分を斜線で重ねたグラフを図15、図16に示す。ここでは、一般的なコード(例示としてPCS=0.85、MTF=0.15を「標準コントラストコード」と呼ぶ。)を、標準的な明るさで読み取る場合を示している。ここでPCS(Print Contrast Signal)とは、バーコードの品質、一般的にはコントラストを表す指標である。PCS={(白の反射率)-(黒の反射率)}/(白の反射率)で計算され、理想的なコードはPCS=1.0である。またMTF(Modulation Transfer Function)とは、撮像したときのボケ度合を示す指標である。MTFはコードでなく、レンズとピント位置によって決まる値となる。MTF=0.15は、ボケが無ければ100%のコントラストが得られるところが、ボケによって15%のコントラストしか得られないことを示す。またエッジ強度は、6に設定している(縦軸において破線で示す)。図15は、標準コントラストコードを図14の標準変換特性で読み取る場合のダイナミックレンジを示す片対数グラフ、図16は同じく標準コントラストコードを、図14のHDR変換特性で読み取る場合のダイナミックレンジを示す片対数グラフである。これらの図に示すように、標準カーブよりHDRカーブの方がコントラストは大きく取りにくいが、ダイナミックレンジは幅広く確保することが可能となる。例えば図15において実線で示す標準カーブの場合は、輝度値512~4096の幅で読み取りが可能となり、ダイナミックレンジは8倍となる。また図16において破線で示すHDRカーブの場合は、輝度値が256~4096の幅で読み取りが可能となり、ダイナミックレンジは16倍となる。 Here, FIGS. 15 and 16 show graphs in which noise components of the image sensor are overlapped with diagonal lines on the graph of FIG. 14. Here, a case is shown in which a general code (for example, PCS=0.85 and MTF=0.15 is referred to as a "standard contrast code") is read at standard brightness. Here, PCS (Print Contrast Signal) is an index representing the quality of a barcode, generally the contrast. It is calculated as PCS={(white reflectance)-(black reflectance)}/(white reflectance), and the ideal code is PCS=1.0. Further, MTF (Modulation Transfer Function) is an index indicating the degree of blur when capturing an image. The MTF is not a code, but a value determined by the lens and focus position. MTF=0.15 indicates that 100% contrast would be obtained without blur, but only 15% contrast would be obtained due to blur. Furthermore, the edge strength is set to 6 (indicated by a broken line on the vertical axis). FIG. 15 is a semi-log graph showing the dynamic range when a standard contrast code is read using the standard conversion characteristics shown in FIG. 14, and FIG. 16 is a semi-log graph showing the dynamic range when reading a standard contrast code using the HDR conversion characteristics shown in FIG. It is a logarithmic graph. As shown in these figures, although it is difficult to obtain a large contrast with the HDR curve than with the standard curve, it is possible to secure a wide dynamic range. For example, in the case of the standard curve shown by the solid line in FIG. 15, reading is possible in a range of brightness values from 512 to 4096, and the dynamic range is eight times as large. Furthermore, in the case of the HDR curve shown by the broken line in FIG. 16, it is possible to read the luminance value in a range of 256 to 4096, and the dynamic range is 16 times larger.

ただし、読取対象が低いコントラストのコード(例示としてPCS=0.70、MTF=0.12を「低コントラストコード」と呼ぶ。)になると、図17、図18のようになる。低コントラストコードでは標準コントラストコードと比べ、PCSが0.85から0.70に低下しており、よりコントラストが低いコードとなっている。またMTFは0.15から0.12に低下しており、ピンボケがさらに大きくなる条件で撮像されたものを想定している。例えば図17において実線で示す標準カーブの場合は、輝度値700~4096の幅で読み取りが可能となり、図15の標準コントラストコードのダイナミックレンジ(図17において破線で示す矢印)よりも狭くなっていることがわかる。また図18において破線で示すHDRカーブの場合は、輝度値が512~4096の幅で読み取りが可能となり、図16の標準コントラストコードのダイナミックレンジ(図18において破線で示す矢印)よりも狭くなっていることがわかる。 However, if the object to be read is a low contrast code (for example, PCS=0.70 and MTF=0.12 is called a "low contrast code"), the results will be as shown in FIGS. 17 and 18. Compared to the standard contrast code, the low contrast code has a lower PCS from 0.85 to 0.70, making it a code with lower contrast. Furthermore, the MTF has decreased from 0.15 to 0.12, assuming that the image was captured under conditions where the out-of-focus condition becomes even greater. For example, in the case of the standard curve shown by the solid line in Fig. 17, it is possible to read within a luminance value range of 700 to 4096, which is narrower than the dynamic range of the standard contrast code in Fig. 15 (indicated by the broken line arrow in Fig. 17). I understand that. Furthermore, in the case of the HDR curve shown by the broken line in Fig. 18, it is possible to read the brightness value in the range of 512 to 4096, which is narrower than the dynamic range of the standard contrast code in Fig. 16 (indicated by the arrow shown by the broken line in Fig. 18). I know that there is.

このように、低コントラストコードの場合は、標準的なコードと比較してダイナミックレンジが減少するため、読み取りの安定度が低下する。このため、このような低コントラストコードを含めて対応できるように、幅広いダイナミックレンジを確保できる光学式情報読取装置が望まれている。 Thus, low-contrast codes have a reduced dynamic range compared to standard codes, resulting in less stable reading. Therefore, there is a need for an optical information reading device that can ensure a wide dynamic range so as to be able to handle such low contrast codes.

そこで、本実施形態に係る光学式情報読取装置においては、明るさが半分になると、傾きが倍になるような変換特性を用意している。これにより、明るさが変動してもコントラストを維持することが可能となる。具体的には、変換特性式が、撮像部5の入力値が0から所定値までの範囲で、出力値がゼロとなるように設定されている。入力値が0から所定値までの範囲とは、コードの読み取りができないレベルの暗さであり、光学式情報読取装置の設置される環境、例えば周囲の明るさや要求される精度などに応じて設定される。元々、コードの読み取りができない明るさについては、出力値があっても実質的に利用できないことから、ゼロとしても実用上の差し支えはない。また本発明は出力値を必ずしもゼロに限定するものでなく、所定の値としてもよい。この所定の値も、実質上読み取り困難な低い輝度の範囲で設定された固定値とすることが好ましい。例えば8ビット256階調の場合、0~50といった、階調数の1/5以下の範囲とする。また、固定値とする例に限らず、可変値としてもよい。ただし、可変値の上限は、例えば上述した0~50といった実質上コード読み取りが困難な輝度値とする。 Therefore, in the optical information reading device according to the present embodiment, a conversion characteristic is provided in which the slope doubles when the brightness is halved. This makes it possible to maintain contrast even if brightness changes. Specifically, the conversion characteristic equation is set so that the output value is zero when the input value of the imaging unit 5 is in the range from 0 to a predetermined value. The input value range from 0 to a predetermined value is a level of darkness that makes it impossible to read the code, and it is set depending on the environment in which the optical information reader is installed, such as the surrounding brightness and the required accuracy. be done. Originally, for brightness that makes it impossible to read codes, even if there is an output value, it is virtually unusable, so there is no practical problem even if it is set to zero. Further, in the present invention, the output value is not necessarily limited to zero, but may be a predetermined value. This predetermined value is also preferably a fixed value set in a low luminance range that is substantially difficult to read. For example, in the case of 8 bits and 256 gradations, the range is 0 to 50, which is 1/5 or less of the number of gradations. Further, the value is not limited to a fixed value, but may be a variable value. However, the upper limit of the variable value is set to a luminance value such as the above-mentioned 0 to 50, which makes it virtually difficult to read the code.

ここでは、図19に示すように、高ビット数(例えば12ビット)の入力値を低ビット数(例えば8ビット)の出力値に変換する変換特性としてHDR1、2、3の変換特性曲線を用意している。なお、図19においては比較のため、入力値を出力値に線形に変換する標準変換特性も実線で示している。この標準変換特性は、入力値0、出力値0の原点を通るのに対し、HDR1、2、3は原点を通らない。これは、図19において仮想的に出力値がマイナスの領域を示した図20に示すように、HDR1、2、3の変換特性曲線を縦軸においてマイナス方向となるようにオフセットさせているためである。換言すると、HDR1、2、3は、入力値が0のとき、出力値がマイナス方向となるようにオフセットされている。 Here, as shown in Figure 19, conversion characteristic curves for HDR1, 2, and 3 are prepared as conversion characteristics for converting an input value with a high number of bits (for example, 12 bits) to an output value with a low number of bits (for example, 8 bits). are doing. Note that in FIG. 19, for comparison, a standard conversion characteristic for linearly converting an input value into an output value is also shown by a solid line. This standard conversion characteristic passes through the origin of input value 0 and output value 0, whereas HDR1, 2, and 3 do not pass through the origin. This is because the conversion characteristic curves of HDR1, 2, and 3 are offset in the negative direction on the vertical axis, as shown in FIG. 20, which shows a hypothetical region in which the output value is negative in FIG. be. In other words, HDR1, 2, and 3 are offset so that when the input value is 0, the output value is in the negative direction.

このように変換特性をオフセットさせることで、撮像素子の能力を一部犠牲にすることになるものの、対応可能な明暗範囲を拡大することができる。このような思想は、撮像素子の能力を最大限活用しようとする、カメラ等の光学画像を高解像度で撮像して再現しようとする技術分野では通常見られないものである。換言すると、光学画像とは異なり、定置式光学情報読取装置に特有の事情に起因する。光学画像を観察する場合は、入力値が小さい領域でも、出力値が求められる。これに対して本実施形態に係る構成によれば、入力値が小さい領域では、輝度値が0となって全く表現できなくなる。いわば、撮像素子の能力を一部捨てた状態となっている。しかしながら、光学式情報読取の分野においては、コードの読み取りが重要であって、このためには暗部と明部(一般には白部分と黒部分)のコントラストこそが重要であり、暗部が見えないことでも実用上問題が生じない。本発明は、このようなコードの読み取りに特化した変換特性を持たせることにより、光学画像の観察では採用しない、暗部の輝度値を捨てるという特有の構成を採用した結果、様々な環境下でもコントラストを確保してコードの安定読み取りを実現したものである。 By offsetting the conversion characteristics in this way, it is possible to expand the range of brightness and darkness that can be handled, although some of the performance of the image sensor is sacrificed. Such a concept is not normally seen in the technical field, which attempts to take full advantage of the capabilities of an image sensor and reproduce optical images captured with high resolution by cameras and the like. In other words, unlike optical images, this is due to circumstances unique to stationary optical information reading devices. When observing an optical image, output values can be determined even in areas where input values are small. On the other hand, according to the configuration according to the present embodiment, in an area where the input value is small, the brightness value becomes 0 and cannot be expressed at all. In other words, some of the capabilities of the image sensor are discarded. However, in the field of optical information reading, reading the code is important, and for this purpose, the contrast between dark and bright areas (generally white and black areas) is important; dark areas cannot be seen. However, there is no problem in practical use. The present invention adopts a unique configuration that discards brightness values in dark areas, which are not used in optical image observation, by providing conversion characteristics specialized for reading such codes.As a result, it can be used even under various environments. This ensures stable code reading by ensuring contrast.

ここで、これらの変換特性曲線について、コードの白部分の輝度値と、コントラスト、すなわちコードの白部分と黒部分の輝度差の関係を示すグラフを、図21に示す。この図においても、比較のため変換特性を実線で示している。 FIG. 21 is a graph showing the relationship between the brightness value of the white part of the code and the contrast, that is, the difference in brightness between the white part and the black part of the code, for these conversion characteristic curves. In this figure as well, the conversion characteristics are shown by solid lines for comparison.

さらに、この図21の変換特性曲線の内、実線で示した標準変換特性を用いて、一般的なコード(PCS=0.85、MTF=0.15)を、標準位置で読み取る場合のダイナミックレンジを、図22に示す。この図において、読み取りのしきい値となるエッジ強度を5に設定すると、縦軸5を示す破線と標準変換特性の曲線が交差する点が、読み取りの下限となる。よって、輝度値512~4096の幅で読み取りが可能となり、ダイナミックレンジは8倍となる。 Furthermore, the dynamic range when reading a general code (PCS=0.85, MTF=0.15) at the standard position using the standard conversion characteristic shown by the solid line in the conversion characteristic curve in FIG. is shown in FIG. In this figure, when the edge strength, which is the reading threshold, is set to 5, the point where the broken line indicating the vertical axis 5 and the standard conversion characteristic curve intersect becomes the lower limit of reading. Therefore, it is possible to read in a range of brightness values from 512 to 4096, and the dynamic range is eight times as large.

これに対して、図21の変換特性曲線の内、破線で示したHDR1の変換特性を用いて、同じく一般的なコードを標準位置で読み取る場合のダイナミックレンジを、図23に示す。この図において、エッジ強度5を示す横方向の破線と、HDR1変換特性を示す縦方向の破線が交差する点が、読み取りの下限となるので、輝度値64~4096の幅で読み取りが可能となり、ダイナミックレンジは64倍となる。 On the other hand, FIG. 23 shows the dynamic range when a general code is read at the standard position using the HDR1 conversion characteristic indicated by the broken line in the conversion characteristic curve of FIG. 21. In this figure, the point where the horizontal broken line indicating edge strength 5 intersects with the vertical broken line indicating HDR1 conversion characteristics is the lower limit of reading, so reading is possible within a brightness value range of 64 to 4096. The dynamic range is 64 times greater.

次に、図19の変換特性曲線を用いて、低コントラストコード(PCS=0.70、MTF=0.12)を読み取る場合を、図24、図25に示す。まず、図19の変換特性曲線の内、標準変換特性で低コントラストコードを読み取る場合のダイナミックレンジを、図24の片対数グラフに示す。この図に示すように、エッジ強度5を示す破線と標準変換特性が交差する点が、読み取りの下限となるので、輝度値700~4096の幅で読み取りが可能となり、ダイナミックレンジは6倍となる。 Next, the case where a low contrast code (PCS=0.70, MTF=0.12) is read using the conversion characteristic curve of FIG. 19 is shown in FIGS. 24 and 25. First, among the conversion characteristic curves in FIG. 19, the dynamic range when reading a low contrast code with the standard conversion characteristic is shown in the semi-logarithmic graph of FIG. As shown in this figure, the lower limit of reading is the point where the dashed line indicating edge strength 5 intersects with the standard conversion characteristic, so reading is possible in the range of brightness values from 700 to 4096, and the dynamic range is six times larger. .

一方、図19の変換特性曲線の内、HDR1で低コントラストコードを読み取る場合のダイナミックレンジを、図25の片対数グラフに示す。この図に示すように、エッジ強度5を示す破線と、HDR1変換特性を示す実線の曲線が交差する点が、読み取りの下限となるので、輝度値64~4096の幅で読み取りが可能となり、ダイナミックレンジは64倍となる。すなわち、図23に示した標準コントラストコードと同様のダイナミックレンジを、低コントラストコードの読み取りにおいても確保できる。 On the other hand, among the conversion characteristic curves in FIG. 19, the dynamic range when reading a low contrast code with HDR1 is shown in the semi-logarithmic graph in FIG. As shown in this figure, the lower limit of reading is the point where the broken line indicating edge strength 5 intersects with the solid curve indicating HDR1 conversion characteristics, so reading is possible in the range of brightness values 64 to 4096, and dynamic The range will be 64 times. That is, the same dynamic range as the standard contrast code shown in FIG. 23 can be secured even when reading a low contrast code.

このように、変換特性曲線としてHDR1を選択すると、広いダイナミックレンジを確保できる。半面、閾値およびノイズに対して余裕がないため、低コントラストの入力画像を安定度高く読み取ることが困難である。低コントラストの入力画像を安定度高く読み取りするためには、変換特性曲線としてHDR2を選択する。この場合、ダイナミックレンジはHDR1に比べて狭くなる。このようなトレードオフがあるため、安定度高く読取りするためには、読み取りたいコードと使用環境に合わせて適切な変換特性を選択する必要がある。 In this way, by selecting HDR1 as the conversion characteristic curve, a wide dynamic range can be ensured. On the other hand, since there is no margin for threshold values and noise, it is difficult to read low-contrast input images with high stability. In order to read a low contrast input image with high stability, HDR2 is selected as the conversion characteristic curve. In this case, the dynamic range is narrower than in HDR1. Because of this trade-off, in order to read with high stability, it is necessary to select appropriate conversion characteristics according to the code to be read and the usage environment.

そこで、チューニング部29cにより、対応可能な明暗範囲すなわちダイナミックレンジと、低コントラストコードへの対応力のトレードオフを最適化し、安定度の高い読取りを実現する。例えば、複数本の変換特性曲線を試行して、互いのマージンを確保したものを最適値とするよう、チューニング部29cでチューニングを行う。換言すると、実際の搬送物や周囲の明るさ等の条件に応じて、最適な変換式を選択するようにチューニングを行うことで、様々な異なる環境下でもこれに応じた適切な読み取りを行えるようになる。
(ガンマ補正)
Therefore, the tuning unit 29c optimizes the trade-off between the available brightness and darkness range, that is, the dynamic range, and the ability to handle low contrast codes, thereby realizing highly stable reading. For example, the tuning unit 29c performs tuning by trying out a plurality of conversion characteristic curves so that the optimum value is determined by ensuring a mutual margin. In other words, by tuning the system to select the optimal conversion formula according to conditions such as the actual conveyed object and surrounding brightness, it is possible to perform appropriate readings under various different environments. become.
(gamma correction)

ここで、特性変換式の一例として、ガンマ補正について説明する。ガンマ補正は、コントラスト調整に用いられる非線形補正である。入力画像の画素値をIin、出力画像の画素値をIout、最大輝度をImaxとすると、ガンマ補正の変換式は数1で定義される。 Here, gamma correction will be explained as an example of a characteristic conversion formula. Gamma correction is a nonlinear correction used for contrast adjustment. When the pixel value of the input image is I in , the pixel value of the output image is I out , and the maximum brightness is I max , the conversion formula for gamma correction is defined by Equation 1.

Figure 0007430554000001
Figure 0007430554000001

数1で定義されるガンマ補正の変換曲線は、図26のようになる。この図に示すように、γ>1のとき、変換曲線は上に凸な曲線となる。また変換後の画像は、明部の差は小さく、暗部の差は大きくなり、コントラストが全体的に明るくなる。 The gamma correction conversion curve defined by Equation 1 is as shown in FIG. As shown in this figure, when γ>1, the conversion curve becomes an upwardly convex curve. Furthermore, in the image after conversion, the difference in bright areas is small, the difference in dark areas is large, and the contrast becomes brighter overall.

γ=1のときは、変換曲線が直線状となり、変換後の画像のコントラストは無変換となる。 When γ=1, the conversion curve becomes linear, and the contrast of the image after conversion is unchanged.

γ<1のとき、変換曲線は下に凸な曲線となる。また変換後の画像は、明部の差は大きく、暗部の差は小さくなり、コントラストが全体的に暗くなる。
(HDR変換式)
When γ<1, the conversion curve becomes a downwardly convex curve. Furthermore, in the image after conversion, the difference in bright areas is large, the difference in dark areas is small, and the contrast becomes darker overall.
(HDR conversion formula)

次に、ガンマ補正を利用した特性変換式の一例として、12ビットの入力値を8ビットの出力値に変換するHDR(ガンマ補正)変換式を数2に示す。 Next, as an example of a characteristic conversion formula using gamma correction, an HDR (gamma correction) conversion formula for converting a 12-bit input value into an 8-bit output value is shown in Equation 2.

数2において、
Y:出力値
X:入力値
1/γ:ガンマ係数
255:8ビット
4095:12ビット
を示している。
(コントラストと白部分輝度値の数式)
In number 2,
Y: Output value X: Input value 1/γ: Gamma coefficient 255: 8 bits 4095: 12 bits.
(Formula for contrast and white brightness value)

このようなガンマ補正を利用した本実施形態に係る光学式情報読取装置で用いるHDRの変換特性は、数3で表される。 The HDR conversion characteristic used in the optical information reading device according to the present embodiment using such gamma correction is expressed by Equation 3.

Figure 0007430554000003
Figure 0007430554000003

数3において、
X:入力値(0~4095の諧調)
Y:出力値(0~255の諧調)
α、β:HDRカーブを調整するパラメータ値
を、それぞれ示している。
ここでも、12ビット画像を8ビット画像に変換する変換式を示している。なお、数3においてY<0のときはY=0とする。
(コントラストの計算方法)
In number 3,
X: Input value (gradation from 0 to 4095)
Y: Output value (gradation from 0 to 255)
α, β: Parameter values for adjusting the HDR curve are respectively shown.
Here, too, a conversion formula for converting a 12-bit image into an 8-bit image is shown. Note that in Equation 3, when Y<0, Y=0.
(Contrast calculation method)

また、コントラストの計算方法を説明する。ここで、12ビット画像の白輝度値W_12、12ビット画像の黒輝度値をB_12、8ビット画像の白輝度値をW_8、8ビット画像の黒輝度値をB_Wと規定すると、12ビット画像のコントラストはContrast=W_12-B_12、8ビット画像のコントラストはContrast=W_8-B_8と、それぞれ定義される。 Also, a method of calculating contrast will be explained. Here, if we define the white luminance value of the 12-bit image as W_12, the black luminance value of the 12-bit image as B_12, the white luminance value of the 8-bit image as W_8, and the black luminance value of the 8-bit image as B_W, then the contrast of the 12-bit image is defined as Contrast=W_12-B_12, and the contrast of an 8-bit image is defined as Contrast=W_8-B_8, respectively.

12ビット画像を8ビット画像に変換した後の白輝度及び黒輝度は、それぞれ数4、数5で表される。 The white luminance and black luminance after converting a 12-bit image into an 8-bit image are expressed by Equation 4 and Equation 5, respectively.

Figure 0007430554000004
Figure 0007430554000004

Figure 0007430554000005
Figure 0007430554000005

以上から、コントラストは数6で表される。 From the above, the contrast is expressed by equation 6.

Figure 0007430554000006
Figure 0007430554000006

ただし、W_8<0、B_8<0は除く。
However, W_8<0 and B_8<0 are excluded.

このようなHDR変換式を用いることで、入力画像の明るさが半分になると、変換特性でその明るさを倍にする。これにより、傾きを一定に維持できる。この詳細を、以下説明する。まず、上記数3のパラメータ値αをγで置き換えると、次式で表現できる。 By using such an HDR conversion formula, when the brightness of an input image is halved, the brightness is doubled using the conversion characteristics. This allows the slope to be maintained constant. The details will be explained below. First, if the parameter value α in Equation 3 above is replaced by γ, it can be expressed by the following equation.

Figure 0007430554000007
Figure 0007430554000007

両辺をxで微分すると次式が得られる。 By differentiating both sides with respect to x, the following equation is obtained.

Figure 0007430554000008
Figure 0007430554000008

ここで、入力値であるxがa倍された状態を表現するため、xをaxに置き換えると、次式が得られる Here, in order to express the state where the input value x is multiplied by a, if x is replaced by ax, the following formula is obtained.

Figure 0007430554000009
Figure 0007430554000009

これを変形して、次式が得られる Transforming this, we get the following formula

Figure 0007430554000010
Figure 0007430554000010

さらに変形して、次式が得られる。 Further transformation yields the following equation.

Figure 0007430554000011
Figure 0007430554000011

ここでγを∞とすると、次式が得られる。 Here, if γ is set to ∞, the following equation is obtained.

Figure 0007430554000012
Figure 0007430554000012

このように、γが無限大の理想状態では、入力値がa倍のときに、傾き(ここではコントラストに近似できる)が1/aとなることがわかる。したがって、この変換式を使うことで、入力値によらずコントラストを一定に保つことができる。さらに、Y=0のときにY’(x)<1となるようにα値とβ値を調整することで、8ビット(256段階)の諧調値を全て使える変換式を実現している。 In this way, it can be seen that in an ideal state where γ is infinite, when the input value is multiplied by a, the slope (which can be approximated to contrast here) becomes 1/a. Therefore, by using this conversion formula, the contrast can be kept constant regardless of the input value. Furthermore, by adjusting the α and β values so that Y'(x)<1 when Y=0, a conversion formula that can use all 8-bit (256 steps) gradation values is realized.

また、数3においてパラメータ値αを大きくすると、入力値が小さいときの出力値の大きさが顕著に増大するため、輝度値の表現力が低下することになる。つまりパラメータ値αを大きくすると、コントラスト値に換算したときにより水平になる。そこで、パラメータ値βを調整することで、カーブの0点をオフセットして調整している。
(パラメータ値α)
Furthermore, when the parameter value α in Equation 3 is increased, the magnitude of the output value when the input value is small increases significantly, and the expressive power of the luminance value decreases. In other words, when the parameter value α is increased, the image becomes more horizontal when converted into a contrast value. Therefore, by adjusting the parameter value β, the zero point of the curve is offset and adjusted.
(parameter value α)

数3において、パラメータ値αは、一般的なガンマ補正(数1や数2)でいうパラメータ値γに相当する。 In Equation 3, the parameter value α corresponds to the parameter value γ in general gamma correction (Equation 1 and Equation 2).

ここで数3において、パラメータ値αを4、8、16、32、64としたHDR変換式の曲線を、図27のグラフに示す。また、このHDR変換式を用いた、コードの白部分の輝度値と、白部分と黒部分の輝度差、すなわちコントラストの関係を示す片対数グラフを、図28に示す。 Here, in Equation 3, the curve of the HDR conversion formula with parameter values α of 4, 8, 16, 32, and 64 is shown in the graph of FIG. Further, FIG. 28 shows a semi-logarithmic graph showing the relationship between the brightness value of the white part of the code and the brightness difference between the white part and the black part, that is, the contrast, using this HDR conversion formula.

図27に示す入力値と出力値の関係において、パラメータ値αを大きくすると、より上に凸状のHDRカーブとなる。つまり、入力値が小さい区間において、少しの入力値変化で大きな出力値となる。よって、その区間では出力輝度値は間引かれて、明るさの表現力が落ちることとなり、好ましくない。 In the relationship between the input value and the output value shown in FIG. 27, increasing the parameter value α results in a more upwardly convex HDR curve. In other words, in a section where the input value is small, a small change in the input value results in a large output value. Therefore, the output luminance value is thinned out in that section, and the expressive power of brightness deteriorates, which is not preferable.

逆に、パラメータ値αを小さくすると、より直線に近づいたHDRカーブとなる。すなわち、入力値が小さい区間においても、緩やかな入力-出力変換が行われるため、明るさの表現力は高く、好ましいと言える。 Conversely, when the parameter value α is decreased, the HDR curve becomes closer to a straight line. That is, even in the section where the input value is small, gradual input-output conversion is performed, so the expressive power of brightness is high, which is preferable.

一方で、図28に示すコード白部分の輝度値に対するコントラスト値においては、パラメータ値αを大きくすると、コントラスト変化が小さくなる。よって、幅広いコード白部分の輝度値変化に対して、一定量のコントラストが得られ、好ましい。 On the other hand, regarding the contrast value with respect to the luminance value of the white part of the code shown in FIG. 28, when the parameter value α is increased, the contrast change becomes smaller. Therefore, a certain amount of contrast can be obtained with respect to a wide range of brightness value changes in the white portion of the code, which is preferable.

逆に、パラメータ値αを小さくすると、コントラスト変化が大きくなる。すなわち、コード白部分の輝度値変化に応じて、コントラストもばらつくため、好ましくない。 Conversely, when the parameter value α is decreased, the contrast change increases. That is, the contrast also varies depending on the change in the brightness value of the white part of the code, which is not preferable.

このように、パラメータ値αは、明るさの表現力と、コードの白部分の輝度値の変化に対するコントラストの維持という観点において、トレードオフの関係性を示す。このため、これらの点を考慮して最適値を求める必要がある。 In this way, the parameter value α shows a trade-off relationship in terms of the expressiveness of brightness and the maintenance of contrast against changes in the brightness value of the white portion of the code. Therefore, it is necessary to take these points into account and find the optimum value.

図28に示すコントラストの均一性の観点からは、なるべくコントラスト変化が小さい方が望ましい。このため、パラメータ値αは8以上が望ましい。また、γ値が32であるとより望ましい。 From the viewpoint of contrast uniformity shown in FIG. 28, it is desirable that the contrast change be as small as possible. Therefore, it is desirable that the parameter value α is 8 or more. Further, it is more desirable that the γ value is 32.

一方で、図27に示す出力値の間引きの観点からは、なるべくγ値は小さい方が望ましい。 On the other hand, from the viewpoint of thinning out the output values shown in FIG. 27, it is desirable that the γ value be as small as possible.

以上のような観点を考慮して、本実施形態に係る光学式情報読取装置においては、数3のパラメータ値αを固定値として、パラメータ値βを変化させている。ここではα=5としている。 Considering the above viewpoints, in the optical information reading device according to the present embodiment, the parameter value α in Equation 3 is set as a fixed value, and the parameter value β is changed. Here, α=5.

また、パラメータ値βを変化させたHDR変換式のグラフを、図29に示す。この例では、パラメータ値βを、11、12、13、14、15、17、19、21、23、25、27、30、34、39、45、52の16通りに変化させた場合のHDR変換式の曲線を、それぞれ示している。これらのHDR変換式の曲線を、チューニングで最適化している。なお、図29の各グラフは、パラメータ値βを11x(-128)=-1408;12x(-128)=-1536;13x(-128)=-1664;14x(-128)=-1792・・・と変化させたものである。またパラメータ値βを11x(-128)=-1408よりも小さい値にすると、変換式の傾きが1を超え、8ビットで表現できなくなるため、そのようなβは最適化の対象から省いている。また図29で、HDR5_19のカーブは、α=5(つまりγ=25=32)、β=19x(-128)=-2432であることを示している。
(チューニング時のHDRの最適化方法)
Further, FIG. 29 shows a graph of the HDR conversion formula in which the parameter value β is changed. In this example, HDR when parameter value β is changed in 16 ways: 11, 12, 13, 14, 15, 17, 19, 21, 23, 25, 27, 30, 34, 39, 45, 52. The curves of the conversion equations are shown respectively. The curves of these HDR conversion equations are optimized through tuning. In addition, each graph of FIG. 29 has parameter values β as 11x (-128) = -1408; 12x (-128) = -1536; 13x (-128) = -1664; 14x (-128) = -1792...・This is a change. Furthermore, if the parameter value β is set to a value smaller than 11x (-128) = -1408, the slope of the conversion equation exceeds 1 and cannot be expressed in 8 bits, so such β is omitted from the optimization target. . Further, in FIG. 29, the curve of HDR5_19 shows that α=5 (that is, γ=2 5 =32) and β=19x(−128)=−2432.
(How to optimize HDR during tuning)

ここで、チューニング時のHDRの最適化方法を、図30のフローチャートに基づいて説明する。まずステップS3001において、明るさの仮決めを行う。 Here, a method for optimizing HDR during tuning will be explained based on the flowchart of FIG. 30. First, in step S3001, brightness is tentatively determined.

次に、ステップS3002において、パラメータの初期化を行う。ここでは、HDRインデックス値を0としパラメータ値β(index)を0、連続成功回数を0とする。各変換特性曲線にはHDRナンバーが割り当てられており、それぞれ異なるβの値が割り当てられている。例えば、HDR値が小さいほど明るさの変化には強いが、低コントラストのコードに対しては弱いなど、HDRナンバーが変化するごとにエッジ強度が高くなるようにβの値が割り当てられている。 Next, in step S3002, parameters are initialized. Here, the HDR index value is 0, the parameter value β (index) is 0, and the number of successive successes is 0. An HDR number is assigned to each conversion characteristic curve, and a different value of β is assigned to each conversion characteristic curve. For example, the value of β is assigned so that the smaller the HDR value is, the stronger it is against changes in brightness, but the weaker it is against codes with low contrast, so that the edge strength increases each time the HDR number changes.

次に、ステップS3003において、設定されたパラメータ値βを用いて撮像部5で撮像を行い、変換部30でコード画像を生成し、ステップS3004において読取処理を実行する。そしてステップS3005において、設定されたパラメータ値βにおいて読み取り可能か否かを判定する。読み取りができない場合は、ステップS3006に進み、連続成功回数を0とする。このようにステップS3006において連続成功回数を0とするのは、連続して読み取りできることを評価するためである。一度でも読み取れない場合は、ゼロに初期化することで、連続して読み取りできる回数を計数する。上述のように、エッジ強度が低いと、低コントラストの画像を安定度高く読むことができないが、明るさの変化には強いというトレードオフが存在するため、連続読取り回数を計数することで、環境やコードのコントラストに対応して安定度高く読取りすることが可能であるかを評価する。そしてステップS3007に進み、パラメータ値βを変化させる。つまり、HDRナンバーに1を加算する。その上でステップS3003に戻り、上記の工程を繰り返す。 Next, in step S3003, the image capturing unit 5 captures an image using the set parameter value β, the converting unit 30 generates a code image, and a reading process is executed in step S3004. Then, in step S3005, it is determined whether reading is possible at the set parameter value β. If reading is not possible, the process advances to step S3006, and the number of successive successes is set to zero. The reason why the number of successive successes is set to 0 in step S3006 is to evaluate that continuous reading is possible. If it cannot be read even once, initialize it to zero to count the number of times it can be read continuously. As mentioned above, if the edge strength is low, there is a trade-off that makes it impossible to read low-contrast images with high stability, but it is resistant to changes in brightness. Therefore, by counting the number of consecutive readings, it is possible to Evaluate whether it is possible to read the code with high stability in response to the contrast of the code. Then, the process advances to step S3007, and the parameter value β is changed. That is, 1 is added to the HDR number. Thereafter, the process returns to step S3003 and the above steps are repeated.

一方、ステップS3005において、設定されたパラメータ値βで読み取り可能であった場合は、ステップS3008に進み、連続成功回数をカウントする。ここでは、連続成功回数に1を加算する。そしてステップS3009において、連続成功回数が所定のしきい値に至ったか否かを判定する。本実施形態においては、連続成功回数のしきい値を4としている。連続成功回数が連続成功回数しきい値に至らない場合は、ステップS3007においてパラメータ値βを大きくする、つまりHDRナンバーを段階的に大きくして、ステップS3003に戻って上記の工程を繰り返す。例えば、ステップS3007を経過する度にパラメータ値βを、11x(-128)=-1408、12x(-128)=-1536、13x(-128)=-1664、14x(-128)=-1792、・・・と順に大きくしていく。 On the other hand, in step S3005, if reading is possible with the set parameter value β, the process advances to step S3008, and the number of consecutive successes is counted. Here, 1 is added to the number of consecutive successes. Then, in step S3009, it is determined whether the number of consecutive successes has reached a predetermined threshold. In this embodiment, the threshold value for the number of consecutive successes is set to 4. If the number of successive successes does not reach the threshold number of successive successes, the parameter value β is increased in step S3007, that is, the HDR number is increased stepwise, and the process returns to step S3003 to repeat the above steps. For example, each time step S3007 is passed, the parameter value β is changed to 11x(-128)=-1408, 12x(-128)=-1536, 13x(-128)=-1664, 14x(-128)=-1792, ...increase in order.

そして、ステップS3009において連続成功回数が連続成功回数しきい値以上となった場合は、ステップS3010に進み、このパラメータ値βを採用する。
(チューニング時の明るさの最適化方法)
If the number of successive successes exceeds the threshold number of successive successes in step S3009, the process advances to step S3010, and this parameter value β is adopted.
(How to optimize brightness during tuning)

次に、チューニング部29cによるチューニング実行時の明るさの最適化方法について説明する。上述の通り、コード画像の明るさは、露光時間や照明強度等で調整する。ここで、コード画像の明るさを変化させた場合に、輝度値の分布が変化する様子を、図31A~図31Eに示す。これらの図において、図31Aから図31Eに向かって、次第にコード画像の明るさが明るくなっている。なお、輝度値が0未満の頻度は0に加算される。 Next, a method of optimizing brightness when performing tuning by the tuning section 29c will be described. As described above, the brightness of the code image is adjusted by adjusting the exposure time, illumination intensity, etc. Here, FIGS. 31A to 31E show how the distribution of brightness values changes when the brightness of the code image is changed. In these figures, the brightness of the code image gradually becomes brighter from FIG. 31A to FIG. 31E. Note that the frequency of the brightness value being less than 0 is added to 0.

これらの図に示すように、HDR曲線を固定した状態で、撮像画像の明るさを明るく変化させていくと、画像データ中のコードの領域(コード領域)の画像の輝度分布は、輝度値の広がりが一定のまま、暗い部分から明るい部分にシフトしていく形となる。このような特性から、図31Cに示すような、輝度値の分布が輝度中央値の128付近を中心とするような明るさを選択することが好ましい。 As shown in these figures, when the brightness of the captured image is changed to brighter while the HDR curve is fixed, the brightness distribution of the image in the code area (code area) in the image data changes as the brightness value changes. While the spread remains constant, it shifts from dark to bright areas. In view of these characteristics, it is preferable to select brightness such that the distribution of brightness values is centered around the median brightness value of 128, as shown in FIG. 31C.

このような傾向から、チューニング時に明るさを最適に設定するには、コード領域の白部分と黒部分の輝度値がバランス良く分布している状態となるようにする。具体的には、コード画像の読み取りが成功した後に、コード領域におけるバー領域(黒部分)の代表値をblackValue、スペース領域(白部分)の代表値をwhiteValueとした場合に、 Based on this tendency, in order to optimally set the brightness during tuning, the brightness values of the white part and the black part of the code area should be distributed in a well-balanced manner. Specifically, after the code image has been successfully read, if the representative value of the bar area (black part) in the code area is set to blackValue, and the representative value of the space area (white part) is set to whiteValue,

intensityBalance=ABS(128-(whiteValue+blackValue/2)
を計算する。そして、上式のintensityBalanceがゼロに近いほど、白部分と黒部分の輝度値のバランスが良いと見なす。このような観点から、最適な明るさとなるようにチューニング部29cで設定する。
(チューニングに用いるスコアの計算方法)
intensityBalance=ABS(128-(whiteValue+blackValue/2)
Calculate. It is assumed that the closer the intensityBalance in the above equation is to zero, the better the balance between the brightness values of the white part and the black part is. From this point of view, the tuning unit 29c sets the brightness to be optimal.
(Method of calculating scores used for tuning)

ここで、実際のチューニングの際に用いるスコアの計算には、次式を用いる。 Here, the following equation is used to calculate the score used during actual tuning.

contrast=whiteValue-blackValue; contrast=whiteValue-blackValue;

score=contrast-intensityBalance/2 score=contrast-intensityBalance/2

ここで、contrast値は明るさの変化によって変化しない値のため、実質的にintensityBalanceのみが最適な明るさを決めることになる。なお、contrast値をスコアに入れる理由は、コントラストの余裕度を表現するためである。 Here, since the contrast value is a value that does not change with changes in brightness, only the intensityBalance substantially determines the optimal brightness. Note that the reason why the contrast value is included in the score is to express the margin of contrast.

なお以上の例では、連続して読み取りに成功したか否かでロバスト性を判断している。この構成であれば、連続して読み取りに成功した場合は、その時点までのパラメータを選択することが可能となり、パラメータの変更回数を少なくできる利点がある。ただ本発明は、この方法に限定されるものでない。例えば、パラメータの変更を一通り行った上で、読み取りに成功した内で最もよい結果を示すパラメータを選択してもよい。また、連続して読み取りに成功していなくとも、類似するパラメータの変換特性曲線の結果も踏まえて判断することで、ロバスト性を考慮できる。
(チューニング画面)
Note that in the above example, robustness is determined based on whether or not reading was successive successively. With this configuration, when successive readings are successful, it is possible to select the parameters up to that point, which has the advantage of reducing the number of parameter changes. However, the present invention is not limited to this method. For example, after changing the parameters once, the parameter that shows the best result among those that were successfully read may be selected. Furthermore, even if reading is not successive successively, robustness can be considered by making a judgment based on the results of conversion characteristic curves of similar parameters.
(Tuning screen)

チューニング部29cで最適なパラメータ値を設定するためのチューニングを実行するには、例えば光学式情報読取プログラムを操作して、表示部にチューニング画面を表示させて行う。このようなチューニング画面の一例を、図32に示す。この図において、左側には各種の操作を行うボタン等のツール類を配置した操作領域、右上に画像データを表示する画像表示領域、右下にグラフ表示領域を、それぞれ設けている。「読み取り」タブを選択した状態で、操作領域には、「モニタ開始」ボタン、「オートフォーカス」ボタン、「チューニング開始」ボタンが表示されている。画像表示領域には、撮像部5で実際に撮像された、コードを含む搬送物の画像データが表示される。グラフ表示領域には、チューニングを実行した際に得られたデータ領域の明るさと、HDRの最適化を実行して得られた評価値であるスコア(読み取り余裕度)の関係を示すグラフが表示されている。読取り余裕度が高いほど、安定度高くコード画像の読み取りが可能である。この画面において、ユーザが「チューニング開始」ボタンを押下すると、画像表示領域に表示された画像データに対してチューニングが開始され、図30で示したHDRの最適化方法が実行されると共に、チューニング結果がグラフ表示領域に順次プロットされる。また、画像表示領域に表示された画像データ中から、コードとして認識されたコード領域が枠で囲んで表示される。 Tuning for setting optimal parameter values in the tuning unit 29c is performed by, for example, operating an optical information reading program to display a tuning screen on the display unit. An example of such a tuning screen is shown in FIG. 32. In this figure, there are provided an operation area on the left side in which tools such as buttons for various operations are arranged, an image display area on the upper right side for displaying image data, and a graph display area on the lower right side. With the "reading" tab selected, the operation area displays a "start monitoring" button, an "autofocus" button, and a "start tuning" button. In the image display area, image data of the conveyed object including the code, which is actually imaged by the imaging unit 5, is displayed. The graph display area displays a graph showing the relationship between the brightness of the data area obtained when tuning is performed and the score (reading margin), which is the evaluation value obtained when HDR optimization is performed. ing. The higher the reading margin, the more stable the code image can be read. On this screen, when the user presses the "Start Tuning" button, tuning starts for the image data displayed in the image display area, the HDR optimization method shown in FIG. 30 is executed, and the tuning results are are sequentially plotted in the graph display area. Further, a code area recognized as a code from among the image data displayed in the image display area is displayed surrounded by a frame.

具体的には、「チューニング開始」ボタンを押下すると、図32において右下に設けられたグラフ表示領域に示すグラフ中に、読み取りができた個所に黒丸がプロットされる。このグラフの横軸は、画像の明るさを、縦軸は読み取り余裕度を、それぞれ示している。画像の明るさは、光学式情報読取装置で予め設定した総合明るさ(露光時間やゲインの組み合わせ)をインデックス化して出している。また読み取りやすさは、コントラストが明確に表れているか等を示す、読み取り易さの指標である。 Specifically, when the "Start Tuning" button is pressed, black circles are plotted in the graph shown in the graph display area provided at the lower right in FIG. 32 at the locations where the reading has been completed. The horizontal axis of this graph represents the brightness of the image, and the vertical axis represents the reading margin. The brightness of the image is determined by indexing the total brightness (combination of exposure time and gain) preset by the optical information reading device. Furthermore, readability is an index of readability that indicates whether contrast is clearly displayed.

また光量は、光学式情報読取装置と搬送物の距離の二乗に反比例する。このため、スコアの山の極大を取る部分に明るさを決定することで、運用時においては、近距離側または遠距離側への変化の両方にバランスよく余裕度を確保した明るさを設定することができる。 Further, the amount of light is inversely proportional to the square of the distance between the optical information reading device and the conveyed object. Therefore, by determining the brightness at the part where the score peak is the maximum, during operation, the brightness can be set to ensure a well-balanced margin for changes to both the near and far sides. be able to.

ここで、実施例1に係るHDR変換特性と、従来技術である図10のHDR変換を用いて搬送物との距離が変化した場合に得られる画像データを、図33に示す。左側は図10のHDR変換によって生成したコード画像、右側は上述したチューニング部29cによって最適化された変換特性によって生成したコード画像である。これらの図に示すように、搬送物と光学式情報読取装置の距離が変化しても、一定量の明るさを維持できていることが確認される。 Here, FIG. 33 shows image data obtained when the distance to the conveyed object changes using the HDR conversion characteristics according to Example 1 and the HDR conversion of FIG. 10, which is a conventional technique. The left side is a code image generated by HDR conversion in FIG. 10, and the right side is a code image generated by the conversion characteristics optimized by the tuning unit 29c described above. As shown in these figures, it is confirmed that a certain amount of brightness can be maintained even if the distance between the conveyed object and the optical information reading device changes.

本発明の光学式情報読取装置、光学式情報読取方法、光学式情報読取プログラム及びコンピュータで読取可能な記録媒体並びに記録した機器は、倉庫や工場、店舗、病院等で使用される、バーコードや二次元コードなどのシンボルを読み取ってデータの登録、照合を行う定置式コードリーダや、ハンディスキャナ、ハンディターミナル、業務用PDA等に好適に利用できる。 The optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recorded equipment of the present invention can be used in barcodes, etc. used in warehouses, factories, stores, hospitals, etc. It can be suitably used for stationary code readers, handheld scanners, handheld terminals, business PDAs, etc. that read symbols such as two-dimensional codes to register and verify data.

1…光学式情報読取装置
2…装置本体
2a…ケーシング
4…照明部
5…撮像部
5a…撮像素子
5b…光学系
5c…オートフォーカス機構
6…表示部
7…電源コネクタ
8…信号線コネクタ;8b…イーサネットコネクタ;8c…USBコネクタ
9…インジケータ
10…エイマー
11…セレクトボタン
12…エンターボタン
16…第一発光ダイオード
17…第二発光ダイオード
29…制御ユニット
29a…AF制御部
29b…撮像制御部
29c…チューニング部
29e…UI管理部
30…変換部
31…デコード部
32…通信部
35…記憶装置
35a…デコード結果記憶部
35b…画像データ記憶部
35c…パラメータセット記憶部
35d…変換特性記憶部
40…チューニング画面
41…操作領域
42…画像表示領域
43…グラフ表示領域
44…「読み取り」タブ
45…「モニタ開始」ボタン
46…「オートフォーカス」ボタン
47…「チューニング開始」ボタン
100…コンピュータ
100a…信号線
101…PLC
101a…信号線
1000…光学式情報読取システム
BC…搬送用ベルトコンベア
CD1、CD2…コード
CI1、CI2…コード画像
WK…ワーク
1...Optical information reading device 2...Device body 2a...Casing 4...Illumination section 5...Imaging section 5a...Imaging element 5b...Optical system 5c...Autofocus mechanism 6...Display section 7...Power connector 8...Signal line connector; 8b ...Ethernet connector; 8c...USB connector 9...Indicator 10...Aimer 11...Select button 12...Enter button 16...First light emitting diode 17...Second light emitting diode 29...Control unit 29a...AF control section 29b...Imaging control section 29c... Tuning section 29e...UI management section 30...Converting section 31...Decoding section 32...Communication section 35...Storage device 35a...Decoding result storage section 35b...Image data storage section 35c...Parameter set storage section 35d...Conversion characteristic storage section 40...Tuning Screen 41...Operation area 42...Image display area 43...Graph display area 44..."Read" tab 45..."Monitor start" button 46..."Autofocus" button 47..."Tuning start" button 100...Computer 100a...Signal line 101 ...PLC
101a...Signal line 1000...Optical information reading system BC...Transportation belt conveyor CD1, CD2...Code CI1, CI2...Code image WK...Work

Claims (11)

搬送ライン上を移動する搬送物に付されたコードを読み取る光学式情報読取装置であって、
コードに光を照射する照明部と、
前記照明部から照射されコードで反射された光を受光して入力画像を取得する撮像部と、
前記撮像部で得られた入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなる特性変換式に基づいて、入力値から階調数を削減した出力値を算出し、各画素が前記出力値を有するコード画像を生成する変換部と、
前記変換部で生成したコード画像に基づいて、コードにエンコードされた情報のデコードを行うデコード部と、
を備え、
前記特性変換式が、前記入力値が0の位置では前記出力値がマイナス方向となるように、前記入力値と出力値の関係を示すグラフ上でオフセットされており、
前記変換部は、
前記入力値が、前記特性変換式が前記オフセットされる量に基づいて定められた閾値よりも大きな画素については、前記特性変換式に基づいて、当該入力値の大きさに基づいて変化すると共に、前記入力値が前記閾値から大きくなるほど当該入力値の変化に対して前記出力値の変化幅が小さくなるような出力値を出力し、
前記入力値が前記閾値よりも小さな画素については、前記特性変換式によらず、前記入力値が前記閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力するよう構成してなる光学式情報読取装置。
An optical information reading device that reads a code attached to a conveyed object moving on a conveyance line,
a lighting section that irradiates the cord with light;
an imaging unit that receives light emitted from the illumination unit and reflected by the code to obtain an input image;
For each pixel constituting the input image obtained by the imaging unit, the number of gradations is calculated from the input value based on a characteristic conversion formula in which the larger the input value, the smaller the change width of the output value with respect to the change in the input value. a conversion unit that calculates the reduced output value and generates a code image in which each pixel has the output value;
a decoding unit that decodes information encoded in the code based on the code image generated by the conversion unit;
Equipped with
The characteristic conversion formula is offset on a graph showing the relationship between the input value and the output value so that the output value is in a negative direction at a position where the input value is 0,
The conversion unit is
For pixels for which the input value is larger than a threshold value determined based on the amount by which the characteristic conversion formula is offset , the characteristic conversion formula is changed based on the magnitude of the input value , and outputting an output value such that the larger the input value becomes from the threshold value, the smaller the change width of the output value with respect to the change in the input value ;
For a pixel whose input value is smaller than the threshold value, the pixel is configured to output a relatively smaller fixed value as an output value than a pixel whose input value is larger than the threshold value, regardless of the characteristic conversion formula. Optical information reading device.
請求項1に記載の光学式情報読取装置であって、
前記特性変換式が、前記入力値となる輝度値が0から所定値までの範囲で、前記出力値となる輝度値階調数の1/5以下となるように設定されてなる光学式情報読取装置。
The optical information reading device according to claim 1,
Optical information in which the characteristic conversion formula is set such that the luminance value serving as the input value is in the range from 0 to a predetermined value and the luminance value serving as the output value is 1/5 or less of the number of gradations. reading device.
請求項1又は2に記載の光学式情報読取装置であって、
前記特性変換式が、上に凸な曲線状である光学式情報読取装置。
The optical information reading device according to claim 1 or 2,
The optical information reading device, wherein the characteristic conversion formula has an upwardly convex curved shape.
請求項1~3のいずれか一項に記載の光学式情報読取装置であって、さらに、
前記閾値が互いに異なる複数の前記特性変換式から、運用時に用いる特性変換式を決定するためのチューニング部を備え、
前記チューニング部は、前記複数の前記特性変換式のそれぞれに基づいて前記変換部により生成された前記コード画像の前記デコード部による各読取結果を参照して、前記運用時に用いる特性変換式を決定するよう構成してなる光学式情報読取装置。
The optical information reading device according to any one of claims 1 to 3 , further comprising:
comprising a tuning unit for determining a characteristic conversion formula to be used during operation from a plurality of characteristic conversion formulas having different threshold values;
The tuning unit determines the characteristic conversion formula to be used during the operation by referring to each reading result by the decoding unit of the code image generated by the conversion unit based on each of the plurality of characteristic conversion formulas. An optical information reading device configured as follows.
請求項に記載の光学式情報読取装置であって、さらに、
予め作成された、オフセット量の異なる複数の変換特性曲線から、前記コード画像の明暗の変動とコントラスト差の低いコード画像への対応力に基づいて、いずれかを選択するためのチューニング部を備えてなる光学式情報読取装置。
The optical information reading device according to claim 1 , further comprising:
A tuning unit is provided for selecting one of a plurality of conversion characteristic curves created in advance with different offset amounts based on the ability to respond to variations in brightness and darkness of the code image and to a code image with a low contrast difference. An optical information reading device.
請求項に記載の光学式情報読取装置であって、
前記チューニング部は、前記オフセット量の異なる複数の変換特性曲線に基づいて、前記変換部で階調変換を行って得られたコード画像に対して、それぞれ前記デコード部でデコードして、その読取結果に基づいて、前記複数の変換特性曲線のパラメータを決定するよう構成してなる光学式情報読取装置。
The optical information reading device according to claim 5 ,
The tuning unit decodes each code image obtained by performing gradation conversion in the conversion unit based on the plurality of conversion characteristic curves having different offset amounts in the decoding unit, and reads the reading results. An optical information reading device configured to determine parameters of the plurality of conversion characteristic curves based on.
請求項に記載の光学式情報読取装置であって、
前記チューニング部は、前記複数の変換特性曲線の内で、互いのパラメータが近い変換特性曲線の読み取り結果を参照して、いずれかの変換特性曲線を選択するよう構成してなる光学式情報読取装置。
The optical information reading device according to claim 6 ,
The optical information reading device is configured such that the tuning unit selects one of the plurality of conversion characteristic curves by referring to reading results of conversion characteristic curves having similar parameters. .
搬送ライン上を移動する搬送物に付されたコードを読み取る光学式情報読取装置であって、 An optical information reading device that reads a code attached to a conveyed object moving on a conveyance line,
コードに光を照射する照明部と、 a lighting section that irradiates the cord with light;
前記照明部から照射されコードで反射された光を受光して入力画像を取得する撮像部と、 an imaging unit that receives light emitted from the illumination unit and reflected by the code to obtain an input image;
前記撮像部で得られた入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなる特性変換式に基づいて、入力値から階調数を削減した出力値を算出し、各画素が前記出力値を有するコード画像を生成する変換部と、 For each pixel constituting the input image obtained by the imaging unit, the number of gradations is calculated from the input value based on a characteristic conversion formula in which the larger the input value, the smaller the change width of the output value with respect to the change in the input value. a conversion unit that calculates the reduced output value and generates a code image in which each pixel has the output value;
前記変換部で生成したコード画像に基づいて、コードにエンコードされた情報のデコードを行うデコード部と、 a decoding unit that decodes information encoded in the code based on the code image generated by the conversion unit;
異なる複数の前記特性変換式から、運用時に用いる特性変換式を決定するためのチューニング部と、 a tuning unit for determining a characteristic conversion formula to be used during operation from the plurality of different characteristic conversion formulas;
を備え、Equipped with
前記変換部は、 The conversion unit is
前記入力値が前記特性変換式ごとに異なる閾値よりも大きな画素については、前記特性変換式に基づいて、当該入力値の大きさに基づいて変化する出力値を出力し、 For pixels for which the input value is larger than a different threshold value for each characteristic conversion formula, outputting an output value that changes based on the magnitude of the input value based on the characteristic conversion formula;
前記入力値が前記閾値よりも小さな画素については、前記入力値が前記閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力し、 For pixels where the input value is smaller than the threshold, output a relatively smaller fixed value as an output value than pixels where the input value is larger than the threshold;
前記チューニング部は、前記複数の前記特性変換式のそれぞれに基づいて前記変換部により生成された前記コード画像の前記デコード部による各読取結果を参照して、前記運用時に用いる特性変換式を決定するよう構成してなる光学式情報読取装置。 The tuning unit determines the characteristic conversion formula to be used during the operation by referring to each reading result by the decoding unit of the code image generated by the conversion unit based on each of the plurality of characteristic conversion formulas. An optical information reading device configured as follows.
搬送ライン上を移動する搬送物に付されたコードを読み取る光学式情報読取装置を用いた光学式情報読取方法であって、
照明部からコードに照明光を照射し、コードで反射された反射光を撮像部で受光して入力画像を取得する工程と、
前記得られた入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなり、前記入力値が0の位置では前記出力値がマイナス方向となるように、前記入力値と出力値の関係を示すグラフ上でオフセットされる特性変換式に基づいて、入力値から階調数を削減した出力値を算出し、各画素が前記出力値を有するコード画像を生成する際、
前記入力値が、前記特性変換式が前記オフセットされる量に基づいて定められた閾値よりも大きな画素は、前記特性変換式に基づいて、当該入力値の大きさに基づいて変化すると共に、前記入力値が前記閾値から大きくなるほど当該入力値の変化に対して前記出力値の変化幅が小さくなるような出力値を出力し、
前記入力値が前記閾値よりも小さな画素は、前記特性変換式によらず、前記入力値が前記閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力することで、
画素毎に前記出力値を有するコード画像を変換部で生成する工程と、
前記撮像部で生成したコード画像に基づいて、デコード部でコードにエンコードされた情報のデコード処理を行う工程と、
を含む光学式情報読取方法。
An optical information reading method using an optical information reading device that reads a code attached to a conveyed object moving on a conveyance line,
irradiating the code with illumination light from the illumination unit and receiving the reflected light reflected by the code at the imaging unit to obtain an input image;
For each pixel constituting the obtained input image, the larger the input value, the smaller the change width of the output value with respect to the change in the input value , and at the position where the input value is 0, the output value is in the negative direction. An output value is calculated by reducing the number of gradations from the input value based on a characteristic conversion formula that is offset on a graph showing the relationship between the input value and the output value , so that each pixel has the output value. When generating the code image,
A pixel whose input value is larger than a threshold determined based on the amount by which the characteristic conversion formula is offset is changed based on the magnitude of the input value based on the characteristic conversion formula , and outputting an output value such that the larger the input value is from the threshold, the smaller the range of change in the output value with respect to the change in the input value ;
A pixel whose input value is smaller than the threshold value outputs a relatively smaller constant value as an output value than a pixel whose input value is larger than the threshold value, regardless of the characteristic conversion formula ,
a step of generating a code image having the output value for each pixel in a conversion unit;
a step of decoding information encoded into a code by a decoding unit based on the code image generated by the imaging unit;
Optical information reading method including.
搬送ライン上を移動する搬送物に付されたコードを読み取る光学式情報読取装置を用いたコード読取を行う光学式情報読取プログラムであって、
照明部からコードに照明光を照射し、コードで反射された反射光を撮像部で受光して入力画像を取得する機能と、
前記得られた入力画像を構成する画素毎に、入力値が大きいほど入力値の変化に対して出力値の変化幅が小さくなり、前記入力値が0の位置では前記出力値がマイナス方向となるように、前記入力値と出力値の関係を示すグラフ上でオフセットされる特性変換式に基づいて、入力値から階調数を削減した出力値を算出し、各画素が前記出力値を有するコード画像を生成する際、
前記入力値が、前記特性変換式が前記オフセットされる量に基づいて定められた閾値よりも大きな画素は、前記特性変換式に基づいて、当該入力値の大きさに基づいて変化すると共に、前記入力値が前記閾値から大きくなるほど当該入力値の変化に対して前記出力値の変化幅が小さくなるような出力値を出力し、
前記入力値が前記閾値よりも小さな画素は、前記特性変換式によらず、前記入力値が前記閾値よりも大きな画素よりも、相対的に小さな一定の値を出力値として出力することで、
画素毎に前記出力値を有するコード画像を変換部で生成する機能と、
前記撮像部で生成したコード画像に基づいて、デコード部でコードにエンコードされた情報のデコード処理を行う機能と、
をコンピュータに実現させる光学式情報読取プログラム。
An optical information reading program that reads a code using an optical information reading device that reads a code attached to a conveyed object moving on a conveyance line,
A function of emitting illumination light from the illumination unit to the code and receiving the reflected light reflected by the code at the imaging unit to obtain an input image;
For each pixel constituting the obtained input image, the larger the input value, the smaller the change width of the output value with respect to the change in the input value , and at the position where the input value is 0, the output value is in the negative direction. An output value is calculated by reducing the number of gradations from the input value based on a characteristic conversion formula that is offset on a graph showing the relationship between the input value and the output value , so that each pixel has the output value. When generating the code image,
A pixel whose input value is larger than a threshold determined based on the amount by which the characteristic conversion formula is offset is changed based on the magnitude of the input value based on the characteristic conversion formula , and outputting an output value such that the larger the input value is from the threshold, the smaller the range of change in the output value with respect to the change in the input value ;
A pixel whose input value is smaller than the threshold value outputs a relatively smaller constant value as an output value than a pixel whose input value is larger than the threshold value, regardless of the characteristic conversion formula ,
a function of generating a code image having the output value for each pixel in a conversion unit;
a function of decoding information encoded into a code by a decoding unit based on the code image generated by the imaging unit;
An optical information reading program that enables computers to realize
請求項10に記載のプログラムを記録したコンピュータで読み取り可能な記録媒体又は記憶した機器。 A computer-readable recording medium or a device storing the program according to claim 10.
JP2020050009A 2020-03-19 2020-03-19 Optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recording device Active JP7430554B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020050009A JP7430554B2 (en) 2020-03-19 2020-03-19 Optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recording device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020050009A JP7430554B2 (en) 2020-03-19 2020-03-19 Optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recording device

Publications (2)

Publication Number Publication Date
JP2021149655A JP2021149655A (en) 2021-09-27
JP7430554B2 true JP7430554B2 (en) 2024-02-13

Family

ID=77851329

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020050009A Active JP7430554B2 (en) 2020-03-19 2020-03-19 Optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recording device

Country Status (1)

Country Link
JP (1) JP7430554B2 (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000057255A (en) 1998-08-04 2000-02-25 Chubu Electric Power Co Inc Type reader for type display surface of watt-hour meter nameplate or the like
JP2002175499A (en) 2000-12-06 2002-06-21 Canon Inc Image processor, image reading device, image forming device, base removal density setting method and its storage medium and program
JP2003256773A (en) 2002-02-27 2003-09-12 Minolta Co Ltd Document image processor, imaging device and document image processing program
WO2004004361A1 (en) 2002-06-28 2004-01-08 Nokia Corporation Information terminal
JP2011076517A (en) 2009-10-01 2011-04-14 Keyence Corp Optical information reading device and method for setting imaging condition thereof
JP2013077306A (en) 2012-11-28 2013-04-25 Toshiba Corp Targeted object recognition device and targeted object recognition method
JP2016146536A (en) 2015-02-06 2016-08-12 株式会社ソニー・インタラクティブエンタテインメント Imaging apparatus, information processing system, mat, and picture generation method
JP2016163277A (en) 2015-03-04 2016-09-05 日本電産コパル株式会社 Imaging device, image processing method and program
JP2018136853A (en) 2017-02-23 2018-08-30 株式会社キーエンス Optical information reading apparatus

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000057255A (en) 1998-08-04 2000-02-25 Chubu Electric Power Co Inc Type reader for type display surface of watt-hour meter nameplate or the like
JP2002175499A (en) 2000-12-06 2002-06-21 Canon Inc Image processor, image reading device, image forming device, base removal density setting method and its storage medium and program
JP2003256773A (en) 2002-02-27 2003-09-12 Minolta Co Ltd Document image processor, imaging device and document image processing program
WO2004004361A1 (en) 2002-06-28 2004-01-08 Nokia Corporation Information terminal
JP2011076517A (en) 2009-10-01 2011-04-14 Keyence Corp Optical information reading device and method for setting imaging condition thereof
JP2013077306A (en) 2012-11-28 2013-04-25 Toshiba Corp Targeted object recognition device and targeted object recognition method
JP2016146536A (en) 2015-02-06 2016-08-12 株式会社ソニー・インタラクティブエンタテインメント Imaging apparatus, information processing system, mat, and picture generation method
JP2016163277A (en) 2015-03-04 2016-09-05 日本電産コパル株式会社 Imaging device, image processing method and program
JP2018136853A (en) 2017-02-23 2018-08-30 株式会社キーエンス Optical information reading apparatus

Also Published As

Publication number Publication date
JP2021149655A (en) 2021-09-27

Similar Documents

Publication Publication Date Title
EP3040906B1 (en) Visual feedback for code readers
US8800874B2 (en) Systems and methods of optical code reading using a color imager
JP7245218B2 (en) Local tone mapping for symbol reading
EP3000073B1 (en) Identifying one- or two-dimensional bar codes via weighted image data combination
JP3923866B2 (en) Two-dimensional code reading device setting method, two-dimensional code reading setting device, two-dimensional code reading device setting program, and computer-readable recording medium
US10699091B2 (en) Region of interest location and selective image compression
CN102640165B (en) Imaging-based scanner including border searching for image acquisition
JP2011513818A (en) Image capture device with integrated barcode scanning
EP1719068B1 (en) Section based algorithm for image enhancement
EP3559855B1 (en) White illumination for barcode scanners with improved power efficiency and cost
JP2018136853A (en) Optical information reading apparatus
JP5017988B2 (en) Code reader and program
JP7430554B2 (en) Optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recording device
JP2004054871A (en) Two-dimensional code reader, two-dimensional code reader setting method, two-dimensional code reader reading test method, two-dimensional code reader illumination distribution confirmation method, two-dimensional code reader setting program and computer-readable recording medium
JP4749382B2 (en) Two-dimensional code reading apparatus and method
JP2004054645A (en) Two-dimensional code reader, two-dimensional code reading method, two-dimensional code reading program and computer-readable recording medium
JP5427828B2 (en) Two-dimensional code reading apparatus and method
WO2021096607A1 (en) Systems and methods of processing image data using color image sensors
JP6977425B2 (en) Image processing equipment, binary image production method and image processing program
CN101877046A (en) Image sensor device and method for identifying visible mark
JP2021149656A (en) Optical information reader, optical information reading method, optical information reading program, and computer readable recording medium, and recorded instrument
JP4176007B2 (en) Code reader having distance measuring function
JP2011159178A (en) Optical information reading device, optical information reading method and method of preparing digital filter
JP2011233099A (en) Optical information reader and optical information reading method
EP3614298A1 (en) Portable terminal apparatus, information recording method and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20221216

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230925

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20231003

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20231124

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240131

R150 Certificate of patent or registration of utility model

Ref document number: 7430554

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150