JP2022111040A - Optical information reader - Google Patents
Optical information reader Download PDFInfo
- Publication number
- JP2022111040A JP2022111040A JP2021164234A JP2021164234A JP2022111040A JP 2022111040 A JP2022111040 A JP 2022111040A JP 2021164234 A JP2021164234 A JP 2021164234A JP 2021164234 A JP2021164234 A JP 2021164234A JP 2022111040 A JP2022111040 A JP 2022111040A
- Authority
- JP
- Japan
- Prior art keywords
- image
- code
- unit
- read
- decoding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Image Processing (AREA)
- Character Input (AREA)
Abstract
【課題】コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させながら、幅広いピクセル分解能のコードを含む画像の修復を可能にする。
【解決手段】プロセッサは、コードを構成するモジュールのピクセル分解能が特定範囲内となるように拡大または縮小した読取画像を、記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、読取画像の修復を試行し、修復された読取画像に対してデコード処理を実行する。
【選択図】図12
Kind Code: A1 A neural network structure specialized for restoring an image containing codes is used to improve processing speed while restoring images containing codes with a wide range of pixel resolutions.
A processor inputs a read image enlarged or reduced so that the pixel resolution of modules constituting the code is within a specific range, to a neural network configured with a structure and parameters stored in a storage unit. attempts to restore the read image, and decodes the restored read image.
[Selection drawing] Fig. 12
Description
本発明は、情報を光学的に読み取る光学的情報読取装置に関する。 The present invention relates to an optical information reader that optically reads information.
近年、たとえば物品の流通経路を製造段階から消費段階あるいは廃棄段階まで追跡可能にする、いわゆるトレーサビリティが重要視されてきており、このトレーサビリティを目的としたコードリーダが普及してきている。また、トレーサビリティ以外にもコードリーダは様々な分野で利用されている。 BACKGROUND ART In recent years, so-called traceability, which enables, for example, traceability of a distribution route of an article from a manufacturing stage to a consumption stage or a disposal stage, has been emphasized, and code readers for the purpose of this traceability have become popular. Code readers are also used in various fields other than traceability.
一般的に、コードリーダは、ワークに付されたバーコードや二次元コード等のコードをカメラによって撮影し、得られた画像に含まれるコードを画像処理によって切り出して二値化し、デコード処理して情報を読み取ることができるように構成されており、情報を光学的に読み取る装置であることから光学的情報読取装置とも呼ばれている。 Generally, a code reader photographs a code such as a bar code or a two-dimensional code attached to a workpiece with a camera, extracts the code contained in the obtained image by image processing, binarizes it, and decodes it. It is configured to be able to read information, and is also called an optical information reader because it is a device for optically reading information.
この種の光学的情報読取装置としては、例えば特許文献1に開示されているように、ロボットの視覚センサにより取得したコードの画像と、理想的なコードの画像との関係を示すモデル構造を学習する機械学習装置を備えたものが知られている。特許文献1には、運用時に視覚センサにより取得したコードの画像に、機械学習装置による学習結果を適用することで、読み取りに適した画像に修復することが記載されている。
As disclosed in
ところで、コードの特徴を十分に捉え、読み取りに適した画像に修復するためには、一定量のモジュール数をカバーする範囲で特徴量を抽出する必要がある。例えば、ニューラルネットワークから得られる1つの特徴値が6×6モジュールの範囲から抽出される値であるとし、1つのモジュールが20ピクセルで撮影された画像の場合、120×120ピクセルの範囲から集約された特徴値を算出するようにニューラルネットワークを設計しなければならない。 By the way, in order to fully capture the features of the code and restore the image to be suitable for reading, it is necessary to extract feature quantities within a range that covers a certain number of modules. For example, if one feature value obtained from the neural network is a value extracted from a range of 6×6 modules, and one module is an image captured with 20 pixels, it is aggregated from a range of 120×120 pixels. A neural network must be designed to calculate feature values that
つまり、カバーしたいピクセル範囲が広ければ広い程、ニューラルネットワークの階層を深くしなければならず、例えば上述した120×120ピクセルの範囲から特徴値を集約しようとすると、6回の畳み込み層が必要となる。 In other words, the wider the pixel range to be covered, the deeper the layer of the neural network must be. For example, to aggregate the feature values from the 120×120 pixel range described above, six convolution layers are required. Become.
しかし、コードは白色のモジュールと黒色のモジュールとがランダムに配列されることによって構成されているため、広範囲でのピクセル値の関係は希薄であり、カバーするピクセル範囲を一定以上に広げても修復効果は殆ど向上しない。 However, since the code is composed of white modules and black modules arranged randomly, the relationship between pixel values over a wide range is weak. The effect is hardly improved.
本発明は、かかる点に鑑みてなされたものであり、その目的とするところは、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させながら、幅広いピクセル分解能のコードを含む画像の修復を可能にすることにある。 The present invention has been made in view of this point, and its object is to improve the processing speed as a neural network structure specialized for inpainting images containing codes, including codes with a wide range of pixel resolutions. To enable restoration of an image.
上記目的を達成するために、本開示の一態様では、ワークに付されたコードを読み取る光学的情報読取装置を前提とすることができる。光学的情報読取装置は、コードを撮影し、読取画像を生成するカメラと、コードの読み取りに不適切な部分を有する複数の不良画像と、当該複数の不良画像にそれぞれ対応する複数の理想画像とのうち、コードを構成するモジュールのピクセル分解能が特定範囲内である前記不良画像及び前記理想画像を機械学習させることにより予め生成されたニューラルネットワークの構造及びパラメータを記憶する記憶部と、前記カメラにより生成された読取画像の中のコードを構成するモジュールのピクセル分解能が前記特定範囲内となるように拡大または縮小した前記読取画像を、前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、前記記憶部に記憶された構造及びパラメータに従って前記読取画像の修復を試行し、前記修復された読取画像に対してデコード処理を実行するプロセッサとを備えている。 In order to achieve the above object, one aspect of the present disclosure can presuppose an optical information reading device that reads a code attached to a work. An optical information reader includes a camera that captures a code and generates a read image, a plurality of defective images having portions inappropriate for reading the code, and a plurality of ideal images corresponding to the plurality of defective images. Among them, a storage unit that stores the structure and parameters of a neural network generated in advance by machine learning the defective image and the ideal image in which the pixel resolution of the modules constituting the code is within a specific range, and the camera A neural network configured with the structure and parameters stored in the storage unit for the generated read image, which is enlarged or reduced so that the pixel resolution of the modules constituting the code in the generated read image is within the specific range. and a processor that attempts to restore the read image according to the structure and parameters stored in the storage unit by inputting to and performs decoding processing on the restored read image.
この構成によれば、ニューラルネットワークの構造及びパラメータを生成する際に、コードを構成するモジュールのピクセル分解能が特定範囲内である不良画像及び理想画像を機械学習させる。特定範囲は、修復効果の高いピクセル分解能を含み、かつ、修復効果が殆ど向上しないピクセル分解能を除外する範囲であり、複数のモジュールで構成されたコードを含む画像の修復を前提として設定することができる。これにより、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させることができる。 According to this configuration, when generating the structure and parameters of the neural network, machine learning is performed on a defective image and an ideal image in which the pixel resolution of the modules constituting the code is within a specific range. The specific range is a range that includes pixel resolutions with a high restoration effect and excludes pixel resolutions that hardly improve the restoration effect, and can be set on the premise of restoration of an image containing a code composed of multiple modules. can. As a result, the processing speed can be improved as a neural network structure specialized for restoration of images containing codes.
また、カメラにより生成された読取画像の中のコードを構成するモジュールのピクセル分解能が前記特定範囲外にある場合には、特定範囲内となるように読取画像を拡大または縮小してからニューラルネットワークに入力するので、幅広いピクセル分解能のコードを含む画像の修復が可能になる。 In addition, if the pixel resolution of the modules that compose the code in the read image generated by the camera is outside the specific range, the read image is enlarged or reduced so that it falls within the specific range, and then sent to the neural network. input, allowing restoration of images containing codes with a wide range of pixel resolutions.
尚、コードに含まれるファインダパターンなど決まったモジュールパターンの配置やコード全体として四角形状であることは広範囲特徴になる得るが、モジュールと背景とを大まかに分離するだけであれば、広範囲特徴を用いることなく、狭範囲特徴のみを用いても十分に修復可能である。 The arrangement of fixed module patterns such as the finder pattern included in the code and the rectangular shape of the entire code can be wide-range features, but if the module and the background are only roughly separated, the wide-range feature is used. It is also possible to recover satisfactorily using narrow-range features alone, without
本開示の他の態様では、前記ニューラルネットワークの構造及びパラメータは、コードを構成するモジュールのピクセル数が特定範囲内である前記不良画像及び前記理想画像を機械学習させることにより予め生成されており、前記プロセッサは、前記カメラにより生成された読取画像の中のコードを構成するモジュールのピクセル数が前記特定範囲内となるように拡大または縮小した前記読取画像を、前記ニューラルネットワークに入力することができる。 In another aspect of the present disclosure, the structure and parameters of the neural network are generated in advance by machine-learning the defective image and the ideal image in which the number of pixels of the modules constituting the code is within a specific range, The processor can input to the neural network the read image generated by the camera, which is enlarged or reduced so that the number of pixels of the modules constituting the code in the read image is within the specific range. .
この構成によれば、特定範囲内のピクセル数に限定してニューラルネットワークを生成することで、コードを含む画像の修復により一層特化したニューラルネットワーク構造とすることができる。ピクセル数の特定範囲としては、例えば4PPC以上6PPC以下とすることができるが、4PPC未満であってもよいし、6PPCよりも多くてもよい。PPCは、1つのモジュールが何ピクセル(画素)であるかを示す単位である。 According to this configuration, by generating a neural network by limiting the number of pixels within a specific range, it is possible to obtain a neural network structure that is more specialized for restoration of images containing codes. The specific range of the number of pixels can be, for example, 4 PPC or more and 6 PPC or less, but it may be less than 4 PPC or more than 6 PPC. PPC is a unit that indicates how many pixels (picture elements) are in one module.
また、例えば特定範囲を4PPC以上6PPC以下に限定して機械学習することで、学習に用いる画像から余分なスケールの変動を排除することができ、ニューラルネットワーク構造の適正化を図ることもできる。 In addition, for example, by limiting the specific range to 4 PPC or more and 6 PPC or less for machine learning, it is possible to eliminate unnecessary scale fluctuations from the image used for learning, and to optimize the neural network structure.
本開示の他の態様では、前記カメラにより生成された読取画像を前記拡大または縮小する前に、当該読取画像に対して画像処理フィルタを実行するフィルタ処理部を更に備えているので、読取画像の拡大または縮小前に適切な画像処理を実行しておくことができ、その結果、読取画像の修復がよい的確なものになる。画像処理フィルタとしては、例えばノイズ除去フィルタ等を挙げることができる。 According to another aspect of the present disclosure, a filter processing unit that executes an image processing filter on the read image generated by the camera before the enlargement or reduction of the read image is further provided. Appropriate image processing can be performed prior to enlargement or reduction, resulting in better and more accurate restoration of the read image. Examples of image processing filters include noise removal filters.
本開示の他の態様では、前記光学的情報読取装置の設定時に、拡大率を変えた複数の読取画像または縮小率を変えた複数の読取画像を生成し、生成した複数の読取画像を前記ニューラルネットワークに入力して各読取画像の修復を試行し、修復された各読取画像に対してデコード処理を実行して読取余裕度を求め、求めた読取余裕度が所定よりも高い読取画像の拡大率または縮小率を、運用時に使用する拡大率または縮小率として特定するチューニング実行部を光学的情報読取装置が更に備えている。前記プロセッサは、前記光学的情報読取装置の運用時に、前記チューニング実行部が特定した拡大率または縮小率に前記読取画像を拡大または縮小することができる。 In another aspect of the present disclosure, when the optical information reading device is set, a plurality of read images with different enlargement ratios or a plurality of read images with different reduction ratios are generated, and the generated plurality of read images are processed by the neural network. Input to the network and try to restore each read image, execute decoding processing for each restored read image to obtain the read margin, and enlarge the read image whose read margin is higher than the predetermined read margin Alternatively, the optical information reading device further includes a tuning execution unit that specifies the reduction ratio as the enlargement ratio or reduction ratio to be used during operation. The processor can enlarge or reduce the read image to the enlargement ratio or reduction ratio specified by the tuning execution unit when the optical information reading device is operated.
すなわち、前記特定範囲にある程度の広さがある場合、その特定範囲内であっても拡大率や縮小率を変えると、読取余裕度が変化することが考えられる。本構成では、読取余裕度が所定よりも高くなるように、運用時における読取画像の拡大率または縮小率を特定することができるので、処理速度及び読み取り精度が向上する。 That is, when the specific range has a certain extent, it is conceivable that the reading margin will change even within the specific range if the enlargement ratio or the reduction ratio is changed. With this configuration, it is possible to specify the enlargement ratio or reduction ratio of the read image during operation so that the reading margin is higher than the predetermined value, so that the processing speed and reading accuracy are improved.
本開示の他の態様では、前記チューニング実行部は、各読取画像の読取余裕度のうち、最も高い読取余裕度の読取画像の拡大率または縮小率を、運用時に使用する拡大率または縮小率として特定するので、処理速度及び読み取り精度が更に向上する。 In another aspect of the present disclosure, the tuning execution unit sets the enlargement ratio or reduction ratio of the read image with the highest read margin among the read margins of the read images as the enlargement ratio or reduction ratio to be used during operation. Since it is specified, processing speed and reading accuracy are further improved.
本開示の他の態様では、前記記憶部が、層の数または画像処理フィルタの数が異なる複数のニューラルネットワークの構造及びパラメータと、コード条件とを関連付けて記憶している。前記カメラにより生成された読取画像に含まれるコード条件を設定し、設定したコード条件に関連付けられたニューラルネットワークの構造及びパラメータを前記記憶部から読み出して運用時に使用するニューラルネットワークとして特定するチューニング実行部を光学的情報読取装置が更に備えている。前記プロセッサは、前記光学的情報読取装置の運用時に、前記チューニング実行部が特定したニューラルネットワークで前記読取画像の修復を試行することができる。 In another aspect of the present disclosure, the storage unit associates and stores structures and parameters of a plurality of neural networks with different numbers of layers or different numbers of image processing filters and code conditions. A tuning execution unit that sets code conditions included in the read image generated by the camera, reads the structure and parameters of a neural network associated with the set code conditions from the storage unit, and specifies a neural network to be used during operation. is further provided by the optical information reader. The processor can attempt restoration of the read image with the neural network specified by the tuning execution unit during operation of the optical information reading device.
すなわち、ニューラルネットワークの層の数またはフィルタの数は、コード条件、特にPPCによって最適な数を事前に特定しておくことができるので、これらを関連付けておくことができる。そして、光学的情報読取装置の設定時にコード条件を特定すれば、そのコード条件に関連付けられたニューラルネットワークの構造及びパラメータも特定することができる。したがって、コード条件に最適なニューラルネットワークの構造及びパラメータで修復を試行できるので、読み取り精度を高めることができる。 That is, the optimal number of layers of the neural network or the number of filters can be pre-specified according to the code conditions, especially the PPC, so that they can be associated. Then, if code conditions are specified when setting up the optical information reader, the structure and parameters of the neural network associated with the code conditions can also be specified. As a result, it is possible to attempt restoration with the optimum neural network structure and parameters for the code conditions, thereby improving reading accuracy.
本開示の他の態様では、前記チューニング実行部は、前記カメラにより生成された読取画像に含まれるコード条件を設定し、設定したコード条件であるモジュールのピクセル数を取得し、取得したピクセル数が前記特定範囲内である場合には、前記プロセッサによる前記拡大または縮小を非実行にするので、モジュールのピクセル数が特定範囲外にあるときのみ拡大または縮小することができる。 In another aspect of the present disclosure, the tuning execution unit sets code conditions included in the read image generated by the camera, acquires the number of pixels of the module that is the set code conditions, and the number of pixels acquired is If it is within the specified range, the enlargement or reduction by the processor is not executed, so that the enlargement or reduction can be performed only when the number of pixels of the module is outside the specified range.
本開示の他の態様では、前記記憶部は、前記プロセッサによる前記拡大率が異なる複数のパラメータセットまたは前記プロセッサによる前記縮小率が異なる複数のパラメータセットを記憶するように構成されている。前記プロセッサは、前記記憶部に記憶された複数のパラメータセットの中から任意の一のパラメータセットを適用してデコード処理を実行することができる。これにより、例えばコードのモジュールのピクセル数が変化した場合に、ピクセル数に対応した拡大率または縮小率のパラメータを適用して光学的情報読取装置を運用することができる。 In another aspect of the present disclosure, the storage unit is configured to store a plurality of parameter sets with different enlargement ratios by the processor or a plurality of parameter sets with different reduction ratios by the processor. The processor can perform decoding processing by applying any one parameter set from among the plurality of parameter sets stored in the storage unit. As a result, for example, when the number of pixels in a code module changes, the optical information reader can be operated by applying the parameter of the enlargement rate or reduction rate corresponding to the number of pixels.
本開示の他の態様では、前記プロセッサが、拡大または縮小した前記読取画像に対して、コードを特定するための情報に基づいてコードを探索し、探索されたコードを含む領域をコードが存在する可能性が高いコード候補領域として抽出し、抽出したコード候補領域に対応する部分画像を前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、前記記憶部に記憶された構造及びパラメータに従って前記部分画像の修復を試行し、前記修復された部分画像に対してデコード処理を実行する。 In another aspect of the present disclosure, the processor searches for a code in the enlarged or reduced read image based on information for specifying the code, and detects a region including the searched code in which the code exists. By extracting a chord candidate region with a high probability and inputting a partial image corresponding to the extracted chord candidate region to a neural network configured with the structure and parameters stored in the storage unit, the partial image is stored in the storage unit. An attempt is made to inpaint the partial image according to the structure and parameters obtained, and a decoding process is performed on the inpainted partial image.
この構成によれば、ニューラルネットワークに入力する画像のサイズを小さくすることができる。これにより、プロセッサの演算負荷が軽くなり、ひいては処理速度の高速化が実現される。また、部分画像は、コードが存在する可能性が高い領域に対応しているので、読み取りに必要な情報、即ちコードの全体を含んだ画像とすることが可能である。このコードの全体を含んだ画像をニューラルネットワークに入力するので、読み取り精度の低下は抑制される。 With this configuration, the size of the image input to the neural network can be reduced. As a result, the computation load on the processor is lightened, and the processing speed is increased. In addition, since the partial image corresponds to an area where the code is highly likely to exist, it is possible to create an image containing the information required for reading, that is, the entire code. Since the image containing the entire code is input to the neural network, a decrease in reading accuracy is suppressed.
本開示の他の態様では、ニューラルネットワークに読取画像を入力し、読取画像を修復した修復画像を生成する推論処理を実行する画像修復部と、カメラにより生成された読取画像に対する第1デコード処理を実行する第1デコード処理部と、画像修復部が生成した修復画像に対する第2デコード処理を実行する第2デコード処理部とをさらに備えている。第2デコード処理部は、読取画像からコード候補領域を抽出するとともに、画像修復部に対し、推論処理を実行するようトリガ信号を送出する。画像修復部は、第2デコード処理部から送出されたトリガ信号を受信すると、コード候補領域に対応する部分画像をニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行する。第2デコード処理部は、修復画像に基づいてコードの各セル位置を示すグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコードを実行することができる。つまり、推論処理されていない通常の読取画像のデコードを第1デコード処理部が実行し、また、推論処理による修復画像の生成を画像修復部が実行し、また、推論処理により修復された修復画像のデコードを第2デコード処理部が実行することで、それぞれに適した処理回路を構築して処理速度の高速化を図ることができる。加えて、画像修復部は、コード候補領域に対応する部分画像を修復すればよいので、処理速度の更なる高速化が可能になる。 In another aspect of the present disclosure, an image restoration unit that inputs a read image to a neural network and performs an inference process to generate a restored image obtained by restoring the read image, and a first decoding process for the read image generated by the camera. and a second decoding processing unit for executing second decoding processing on the restored image generated by the image restoration unit. The second decoding processing section extracts a code candidate region from the read image and sends a trigger signal to the image restoration section to execute inference processing. When receiving the trigger signal sent from the second decoding processing unit, the image restoration unit inputs the partial image corresponding to the code candidate area to the neural network, and executes inference processing to generate a restored image by restoring the partial image. do. The second decoding processing unit can determine grid positions indicating each cell position of the code based on the restored image, and decode the restored image based on the determined grid positions. That is, the first decoding processing unit decodes a normal read image that is not subjected to inference processing, the image restoration unit generates a restored image by inference processing, and the restored image restored by inference processing By having the second decoding processing unit execute the decoding of , it is possible to construct a processing circuit suitable for each of them and to increase the processing speed. In addition, since the image restoration section only needs to restore the partial image corresponding to the code candidate area, the processing speed can be further increased.
本開示の他の態様では、画像修復部による推論処理と、第1デコード処理部による第1デコード処理を並列に実行することで、処理速度の高速化を図ることができる。また、第2デコード処理部が第2デコード処理を実行している期間の少なくとも一部は、画像修復部による推論処理が実行されない休止期間を有しているので、画像修復部の負荷低減や、発熱を抑制できる。この場合、第2デコード処理部は、複数のコアで構成されていてもよい。 In another aspect of the present disclosure, processing speed can be increased by executing inference processing by the image restoration unit and first decoding processing by the first decoding processing unit in parallel. In addition, since at least a part of the period during which the second decoding processing unit is executing the second decoding processing has a pause period during which the inference processing by the image restoration unit is not executed, the load on the image restoration unit can be reduced, Heat generation can be suppressed. In this case, the second decoding processing section may be configured with a plurality of cores.
本開示の他の態様では、第1デコード処理部は、第2デコード処理にかかる時間よりも短い時間で第1デコード処理を実行できる。また、設定部により、第2デコード処理を実行するか否か、即ち、修復画像のデコード処理を実行するか否かを切り替えることができる。第2デコード処理は、修復画像のデコード処理を実行するため、通常の読取画像のデコード処理を実行する第1デコード処理に比べて処理にかかる時間が長い。これを前提としたとき、第2デコード処理を実行すると設定されている場合は、第2デコード処理の実行に必要な時間よりも長いデコードタイムアウト時間(デコード制限時間)を設定することができる。一方、第2デコード処理を実行しないと設定されている場合は、第2デコード処理の実行に必要な時間よりも短いデコードタイムアウト時間を設定することができるので、修復画像に対するデコードがデコードタイムアウト時間を超過すると、速やかに次に撮像された画像のデコード処理に移行できる。 In another aspect of the present disclosure, the first decoding processing section can execute the first decoding process in a shorter time than the time required for the second decoding process. Further, the setting unit can switch whether or not to execute the second decoding process, that is, whether or not to execute the restored image decoding process. Since the second decoding process is for decoding the restored image, it takes longer than the first decoding process for decoding the normal read image. On this premise, if it is set to execute the second decoding process, it is possible to set a decoding timeout time (decoding limit time) longer than the time required to execute the second decoding process. On the other hand, if it is set not to execute the second decoding process, a decode timeout period shorter than the time required to execute the second decoding process can be set. When it exceeds, it is possible to quickly shift to the decoding process of the next captured image.
本開示の他の態様に係るデコード処理部は、カメラにより生成された読取画像に対する第1デコード処理と並列に、修復画像に対する第2デコード処理を実行できるので、読取画像と修復画像とが混在していても、処理速度を高速化できる。このデコード処理部は、設定部により第2デコード処理を実行しないと設定されている場合は、第2デコード処理に使われる処理のリソースを第1デコード処理に振り分けることができる。処理のリソースとは、例えばメモリの使用領域や、マルチコアCPUを構成しているコア等であり、第2デコード処理に使われる処理のリソースとしてメモリ領域やコアが予め設定されている場合に、第2デコード処理を実行しないと設定されると、そのメモリ領域やコアを第1デコード処理に使うことができるので、第1デコード処理をより一層高速化できる。 The decoding processing unit according to another aspect of the present disclosure can execute the second decoding process on the restored image in parallel with the first decoding process on the read image generated by the camera. processing speed can be increased. When the setting unit has set not to execute the second decoding process, the decoding process part can allocate processing resources used for the second decoding process to the first decoding process. The processing resource is, for example, a memory usage area, a core constituting a multi-core CPU, or the like. When the second decoding process is set not to be executed, the memory area and the core can be used for the first decoding process, so that the first decoding process can be further speeded up.
本開示の他の態様に係るデコード処理部は、読取画像からコードが存在する可能性が高いコード候補領域を抽出する。画像修復部は、コード候補領域に対応する部分画像をニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する。デコード処理部は、画像修復部が生成した修復画像に基づいてグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコードを実行する。すなわち、修復画像の生成には時間がかかる場合が多いので、修復画像の生成前に、例えばコードらしさを示す特徴量に基づいてコード候補領域を抽出しておくことで、修復画像の生成に要する時間を短縮できる。また、グリッド位置の決定は修復後の画像に基づいて高精度に実行できるので、読取性能が向上する。 A decoding processing unit according to another aspect of the present disclosure extracts a code candidate area in which a code is likely to exist from a read image. The image restoration unit inputs a partial image corresponding to the code candidate area to the neural network and generates a restored image by restoring the partial image. The decoding processing unit determines a grid position based on the restored image generated by the image restoration unit, and decodes the restored image based on the determined grid position. That is, since it often takes a long time to generate a repaired image, by extracting a code candidate region based on, for example, a feature value indicating code-likeness before generating a repaired image, Save time. Also, since the grid position can be determined with high accuracy based on the restored image, reading performance is improved.
本開示の他の態様では、最適な撮像条件及びデコード条件を決定するとともに、読取対象のコードの大きさを設定するチューニング処理を実行する。デコード処理部は、チューニング処理で設定されたコードの大きさに基づき、読取画像の中からコード候補領域を含む抽出画像のサイズを決定できる。その抽出画像を予め定められたサイズの画像に拡大・縮小してニューラルネットワークに入力することで、ニューラルネットワークに入力されるコード画像のPPCを所定の範囲内に収めることができ、ニューラルネットワークによる画像修復効果を安定的に引き出すことができる。また、読取対象のコードサイズは様々であることが考えられるが、最終的にニューラルネットワークに入力されるコードのサイズを固定できるので、処理の高速性とデコードのし易さのバランスを一定以上に保つことができる。 In another aspect of the present disclosure, tuning processing is performed to determine the optimum imaging conditions and decoding conditions and to set the size of the code to be read. The decoding processing unit can determine the size of the extracted image including the code candidate area from the read image based on the size of the code set in the tuning process. By enlarging/reducing the extracted image to an image of a predetermined size and inputting it to the neural network, the PPC of the code image input to the neural network can be kept within a predetermined range. Restoration effect can be stably drawn out. In addition, although the size of the code to be read may vary, since the size of the code that is finally input to the neural network can be fixed, the balance between high speed processing and ease of decoding can be achieved. can keep.
本開示の他の態様に係るカメラは、第1偏光板を通過し、コードから反射した光を第2偏光板を介して受光し、第1偏光板及び第2偏光板を介さない場合に比べて低コントラストな読取画像を生成する。偏光板を使用することで、ワークの正反射成分が除去されるので、正反射成分の影響が軽減された読取画像を取得できる。例えば金属ワークを撮像した場合のように正反射成分が多くなる画像に偏光板は適しているものの、光量の低下によって読取画像が暗くなり、コントラストが低下することがある。このような場合に、ニューラルネットワークの推論処理によって高コントラストな修復画像に変換することで、読取性能が向上する。 A camera according to another aspect of the present disclosure receives light that passes through the first polarizing plate and is reflected from the code through the second polarizing plate. to generate a low-contrast read image. By using the polarizing plate, the specular reflection component of the workpiece is removed, so that a read image can be acquired with reduced influence of the specular reflection component. For example, a polarizing plate is suitable for an image with many regular reflection components, such as when an image of a metal workpiece is captured, but a decrease in the amount of light may darken the read image and lower the contrast. In such a case, reading performance is improved by converting the image into a high-contrast restored image through neural network inference processing.
本開示の他の態様では、チューニング実行部により、第1の撮像条件及びコード条件と、第2の撮像条件及びコード条件とを含む複数の撮像条件及びコード条件を設定することができる。デコード処理部は、第1の撮像条件及びコード条件で生成された読取画像をニューラルネットワークに入力して修復画像を生成し、当該修復画像のデコード処理に失敗した場合は、第1の撮像条件及びコード条件とは異なる第2の撮像条件及びコード条件で生成された読取画像をニューラルネットワークに入力して修復画像を生成し、当該修復画像のデコードを実行することができる。 In another aspect of the present disclosure, the tuning execution unit can set a plurality of imaging conditions and code conditions including a first imaging condition and code condition and a second imaging condition and code condition. The decode processing unit inputs the read image generated under the first imaging condition and the code condition to the neural network to generate the restored image, and if the decode processing of the restored image fails, the first imaging condition and the code condition are generated. A read image generated under second imaging conditions and code conditions different from the code conditions is input to the neural network to generate a restored image, and the restored image can be decoded.
以上説明したように、コードを構成するモジュールのピクセル分解能が特定範囲内である不良画像及び理想画像を機械学習させることにより予め生成されたニューラルネットワークに、読取画像の中のコードを構成するモジュールのピクセル分解能が特定範囲内となるように拡大または縮小した読取画像を入力し、当該ニューラルネットワークにより読取画像の修復を試行することができる。これにより、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させながら、幅広いピクセル分解能のコードを含む画像の修復を試行できる。 As described above, a neural network generated in advance by machine-learning a defective image and an ideal image in which the pixel resolution of the modules composing the code is within a specific range is applied to the modules composing the code in the read image. By inputting a read image that has been enlarged or reduced so that the pixel resolution is within a specific range, the neural network can attempt to restore the read image. This makes it possible to attempt restoration of images containing codes with a wide range of pixel resolutions while improving processing speed as a neural network structure specialized for restoration of images containing codes.
以下、本発明の実施形態を図面に基づいて詳細に説明する。尚、以下の好ましい実施形態の説明は、本質的に例示に過ぎず、本発明、その適用物或いはその用途を制限することを意図するものではない。 BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, embodiments of the present invention will be described in detail based on the drawings. It should be noted that the following description of preferred embodiments is essentially merely illustrative, and is not intended to limit the invention, its applications, or its uses.
(定置式の光学的情報読取装置)
図1は、本発明の実施形態に係る定置式の光学的情報読取装置1の運用時を模式的に示す図である。この例では、複数のワークWが搬送用ベルトコンベアBの上面に載置された状態で図1における矢印Yの方向へ搬送されており、そのワークWから上方へ離れた所に、実施形態に係る光学的情報読取装置1が設置されている。光学的情報読取装置1は、ワークWに付されているコードを撮影し、撮影された画像に含まれるコードをデコード処理して情報を読み取ることができるように構成されたコードリーダである。図1に示す例では、光学的情報読取装置1が定置式の場合である。この定置式の光学的情報読取装置1の運用時には、光学的情報読取装置1が動かないようにブラケット等(図示せず)に固定して使用する。尚、定置式の光学的情報読取装置1をロボット(図示せず)が把持した状態で使用してもよい。また、静止状態にあるワークWのコードを光学的情報読取装置1によって読み取るようにしてもよい。定置式の光学的情報読取装置1の運用時とは、搬送用ベルトコンベアBによって搬送されるワークWのコードを順に読み取る動作を行っている時である。
(Stationary Optical Information Reader)
FIG. 1 is a diagram schematically showing operation of a stationary
また、各ワークWの外面にはコードが付されている。コードには、バーコード及び二次元コードの両方が含まれる。二次元コードとしては、たとえば、QRコード(登録商標)、マイクロQRコード、データマトリクス(Data matrix;Data code)、ベリコード(Veri code)、アズテックコード(Aztec code)、PDF417、マキシコード(Maxi code)などがある。二次元コードにはスタック型とマトリクス型があるが、本発明はいずれの二次元コードに対しても適用できる。コードは、ワークWに直接印刷あるいは刻印することによって付してもよいし、ラベルに印刷した後にワークWに貼付することによって付してもよく、その手段、方法は問わない。 A code is attached to the outer surface of each work W. As shown in FIG. Codes include both barcodes and two-dimensional codes. Examples of two-dimensional codes include QR code (registered trademark), micro QR code, data matrix (Data code), Veri code, Aztec code, PDF417, and Maxi code. and so on. Two-dimensional codes include stack type and matrix type, but the present invention can be applied to any two-dimensional code. The code may be attached by printing or stamping it directly on the work W, or by attaching it to the work W after being printed on a label.
光学的情報読取装置1は、コンピュータ100及びプログラマブル・ロジック・コントローラ(PLC)101にそれぞれ信号線100a、101aによって有線接続されているが、これに限らず、光学的情報読取装置1、コンピュータ100及びPLC101に通信モジュールを内蔵し、光学的情報読取装置1と、コンピュータ100及びPLC101とを無線接続するようにしてもよい。PLC101は、搬送用ベルトコンベアB及び光学的情報読取装置1をシーケンス制御するための制御装置であり、汎用のPLCを利用することができる。コンピュータ100は、汎用あるいは専用の電子計算機や携帯型端末等を利用することができる。
The
また、光学的情報読取装置1は、その運用時において、PLC101から信号線101aを介して、コード読取の開始タイミングを規定する読取開始トリガ信号を受信する。そして、光学的情報読取装置1は、この読取開始トリガ信号に基づいてコードの撮像やデコードを行う。その後、デコードした結果は、信号線101aを介してPLC101へ送信される。このように、光学的情報読取装置1の運用時には、光学的情報読取装置1とPLC101等の外部制御装置との間で、信号線101aを介して読取開始トリガ信号の入力とデコード結果の出力が繰り返し行われる。なお、読取開始トリガ信号の入力やデコード結果の出力は、上述したように、光学的情報読取装置1とPLC101との間の信号線101aを介して行ってもよいし、それ以外の図示しない信号線を介して行ってもよい。例えば、ワークWの到着を検知するためのセンサと光学的情報読取装置1とを直接的に接続し、そのセンサから光学的情報読取装置1へ読取開始トリガ信号を入力するようにしてもよい。
During operation, the
図2に示すように、光学的情報読取装置1は、箱状のハウジング2と、偏光フィルタアタッチメント3と、照明部4と、カメラ5と、表示部6と、電源コネクタ7と、信号線コネクタ8とが設けられている。さらに、ハウジング2には、インジケータ9と、エイマー光照射部(光照射部)10と、操作ボタン11、12とが設けられており、インジケータ9、エイマー光照射部10及び操作ボタン11、12も光学的情報読取装置1の構成要素である。
As shown in FIG. 2, the
ハウジング2は、所定方向に長い形状となっているが、ハウジング2の形状は図示した形状に限られるものではない。ハウジング2の前側の外面には、偏光フィルタアタッチメント3が脱着可能に取り付けられている。このハウジング2の内部に、照明部4、カメラ5、エイマー光照射部10、プロセッサ20、記憶部30、ROM40、RAM41等が収容されている。プロセッサ20、記憶部30、ROM40及びRAM41も光学的情報読取装置1の構成要素である。
The
ハウジング2の前側には、照明部4が設けられている。照明部4は、光学的情報読取装置1の前方へ向けて光を照射することによってワークWの少なくともコードを照明するための部分である。図3にも示すように、照明部4は、複数の発光ダイオード((LED:Light Emission Diode)からなる第1照明部4aと、複数の発光ダイオードからなる第2照明部4bと、第1照明部4a及び第2照明部4bを駆動するLEDドライバ等からなる照明駆動部4cとを備えている。第1照明部4a及び第2照明部4bは、照明駆動部4cにより個別に駆動され、別々に点灯及び消灯させることができるようになっている。照明駆動部4cはプロセッサ20に接続されており、プロセッサ20によって照明駆動部4cが制御されるようになっている。尚、第1照明部4a及び第2照明部4bのうち、一方を省略してもよい。
A
図2に示すように、ハウジング2の前側の中央部には、カメラ5が設けられている。カメラ5の光軸方向は、照明部4による光の照射方向と略一致している。カメラ5は、コードを撮影し、読取画像を生成する部分である。図3に示すように、カメラ5は、ワークWに付されていて上記照明部4によって照明されているコードからの反射光を受光する撮像素子5aと、レンズ等を有する光学系5bと、AFモジュール(オートフォーカスモジュール)5cとを備えている。光学系5bには、ワークWのコードが付された部分から反射した光が入射するようになっており、入射した光は撮像素子5aへ向けて出射されて撮像素子5aの撮像面上で結像する。
As shown in FIG. 2, a
撮像素子5aは、光学系5bを通して得られたコードの画像を電気信号に変換するCCD(charge-coupled device)やCMOS(complementary metal oxide semiconductor)等の受光素子からなるイメージセンサである。撮像素子5aはプロセッサ20に接続されていて、撮像素子5aによって変換された電気信号は、読取画像のデータとしてプロセッサ20に入力される。また、AFモジュール5cは、光学系5bを構成するレンズのうち、合焦用レンズの位置や屈折率を変更することによってピント合わせを行う機構である。AFモジュール5cもプロセッサ20に接続され、プロセッサ20により制御される。
The
図2に示すように、ハウジング2の側面には表示部6が設けられている。表示部6は、たとえば有機ELディスプレイや液晶ディスプレイ等からなるものである。表示部6は、プロセッサ20に接続され、たとえば撮像部5で撮像されたコード、コードのデコード結果である文字列、読み取り成功率、マッチングレベル等を表示させることができる。読み取り成功率とは、複数回読み取り処理を実行したときの平均読み取り成功率である。マッチングレベルとは、デコードが成功したコードの読み取りのしやすさを示す読取余裕度である。これはデコード時に発生した誤り訂正の数等から求めることができ、たとえば数値で表すことができる。誤り訂正が少なければ少ないほどマッチングレベル(読取余裕度)が高くなり、一方、誤り訂正が多ければ多いほどマッチングレベル(読取余裕度)が低くなる。
As shown in FIG. 2, a
電源コネクタ7には、光学的情報読取装置1に外部から電源を供給するための電源ケーブル(図示せず)が接続される。また、信号線コネクタ8には、コンピュータ100及びPLC101と通信を行うための信号線100a、101a等が接続される。信号線コネクタ8は、例えばEthernetコネクタ、RS232C等のシリアル通信用コネクタ、USBコネクタ等で構成することができる。
A power cable (not shown) for supplying power to the
ハウジング2には、インジケータ9が設けられている。インジケータ9は、プロセッサ20に接続されていて、たとえば発光ダイオード等の発光体で構成することができる。光学的情報読取装置1の作動状態をインジケータ9の点灯状態によって外部に報知することができる。
An
ハウジング2の前側には、カメラ5を挟むように一対のエイマー光照射部10が設けられている。図3に示すように、エイマー光照射部10は、発光ダイオード等からなるエイマー10aと、エイマー10aを駆動するエイマー駆動部10bとを備えている。エイマー10aは、光学的情報読取装置1の前方へ向けて光(エイマー光)を照射することによってカメラ5の撮影範囲や視野中心、照明部4の光軸の目安等を示すためのものである。具体的には、エイマー10aは、カメラ5の撮影視野範囲内へ向けて環境光とは異なる色(例えば赤色や緑色等)の可視光を照射し、その可視光が照射された面に肉眼で視認可能な目印を形成する。目印は各種図形や記号、文字等であってもよい。ユーザは、エイマー10aから照射される光を参照して光学的情報読取装置1を設置することもできる。
A pair of aimer
図2に示すように、ハウジング2の側面には、光学的情報読取装置1の設定時等に使用する操作ボタン11、12が設けられている。操作ボタン11、12は、例えばセレクトボタンやエンターボタン等を含んでいる。操作ボタン11、12以外にも、例えばタッチパネル式の操作手段が設けられていてもよい。操作ボタン11、12はプロセッサ20に接続されていて、プロセッサ20は操作ボタン11、12の操作状態を検出可能になっている。操作ボタン11、12の操作により、表示部6に表示された複数の選択肢の中から1つを選択することや、選択した結果を確定することができる。
As shown in FIG. 2, the side surface of the
(手持ち式の光学的情報読取装置)
上述した例では、光学的情報読取装置1が定置式である場合を示したが、本発明は定置式の光学的情報読取装置1以外にも適用可能である。図4は、手持ち式の光学的情報読取装置1Aを示すものであり、この図に示すような手持ち式の光学的情報読取装置1Aにも本発明を適用することができる。
(hand-held optical information reader)
In the above example, the
手持ち式の光学的情報読取装置1Aのハウジング2Aは、上下方向に長い形状とされている。尚、光学的情報読取装置1Aの使用時の向きは図示した向きに限定されるものではなく、様々な向きで使用可能であるが、説明の便宜上、光学的情報読取装置1Aの上下方向を特定している。
A
ハウジング2Aの上側部分には、表示部6Aが設けられている。表示部6Aは、定置式の光学的情報読取装置1の表示部6と同様に構成されている。ハウジング2Aの下側部分は、運用時にユーザが把持するための把持部2Bである。把持部2Bは、一般的な成人が片手で握るようにして持つことが可能な部分であり、形状や大きさは自由に設定できる。この把持部2Bを持つことで、光学的情報読取装置1Aを携帯して移動することができる。つまり、この光学的情報読取装置1Aは、携帯型端末装置であり、例えばハンディターミナルと呼ぶこともできるものである。
A
定置式の光学的情報読取装置1と同様に、手持ち式のハウジング2Aにも、照明部、カメラ、エイマー光照射部、プロセッサ、記憶部、ROM、RAM等(図示せず)が収容されている。照明部の光軸、カメラの光軸、エイマー光照射部の光軸は、ハウジング2Aの上端近傍から斜め上方に向いている。また、手持ち式のハウジング2Aには、ブザー(図示せず)も設けられている。
Similar to the stationary
把持部2Bやその近傍には、複数の操作ボタン11A及びトリガーキー11Bが設けられている。操作ボタン11Aは、定置式の光学的情報読取装置1の操作ボタン11等と同様である。ユーザが光学読取装置1Aの先端(上端)をワークWに向けてトリガーキー11Bを押下すれば、光学読取装置1Aの先端からエイマー光が照射される。ユーザは、ワークWの表面で反射されるエイマー光を目視しながら光学読取装置1Aの向きを調整し、エイマー光を読取対象のコードに合わせれば、コードの読み取り及びデコード処理が自動的に行われる。読み取りが完了すると、ブザーから完了報知音が発せられる。
A plurality of
手持ち式の光学的情報読取装置1Aの使用例として、物流倉庫内におけるピッキング作業に手持ち式の光学的情報読取装置1Aを用いる例がある。例えば、受注した商品を物流倉庫から発送する場合、商品倉庫内の商品棚から必要な商品がピッキングされる。このピッキング作業は、コードが記載された受注伝票を持ったユーザが、商品棚まで移動した後、受注伝票のコードと、商品又は商品棚に付されたコードとを照合しながら行われる。この場合、受注伝票のコードと、商品又は商品棚に付されたコードとを交互に手持ち式の光学的情報読取装置1Aで読み取る。
As an example of use of the handheld
(プロセッサの構成)
以下の説明は、定置式の光学的情報読取装置1と、手持ち式の光学的情報読取装置1Aとで共通しており、特に断りがなければ、いずれの装置1、1Aでも適用できる。図3に示すように、プロセッサ20は、CPUコア21と、DSPコア22と、AIチップ23とを備えている。CPUコア21、DSPコア22及びAIチップ23は、いわゆるSystem-on-a-chip(SoC,SOC)であり、1つの基板上に実装されている。尚、DSPコア22やAIチップ23は、SoCでなくてもよく、その場合は同じ基板上に実装されない形態となるが、その場合も本発明の範囲に含まれる。
(Processor configuration)
The following description is common to the stationary
CPUコア21、DSPコア22及びAIチップ23には、高速なRAM41が接続されており、CPUコア21、DSPコア22及びAIチップ23のいずれもRAM41にアクセス可能となっている。また、プロセッサ20には、ROM40が接続されており、CPUコア21、DSPコア22及びAIチップ23のいずれもROM40にアクセス可能となっている。
A high-
CPUコア21は、汎用プロセッサであり、例えばAF制御、照明制御、カメラ制御、読取画像に対するデコード処理等を実行する部分である。DSPコア22は、例えば読取画像に対して各種フィルタ処理等を実行する部分である。AIチップ23は、ニューラルネットワークによる読取画像の修復の試行専用の集積回路であり、ニューラルネットワークによる処理に必要な積和演算を超高速に実行することに特化したものである。
The
図5に示すように、プロセッサ20により、AF制御部20a、撮像制御部20b、フィルタ処理部20c、チューニング実行部20d、デコード処理部20f、抽出部20g、縮小部20h、拡大部20i及び画像修復部20jが構成される。AF制御部20a、撮像制御部20b、フィルタ処理部20c、チューニング実行部20d、デコード処理部20f、抽出部20g、縮小部20h及び拡大部20iは、CPUコア21またはDSPコア22の演算処理によって構成される部分である。一方、画像修復部20jは、AIチップ23によって構成される部分である。
As shown in FIG. 5, the
(AF制御部の構成)
AF制御部20aは、図3に示すAFモジュール5cを制御するユニットであり、従来から周知のコントラストAFや位相差AFによって光学系5bのピント合わせを行うことができるように構成されている。
(Configuration of AF control unit)
The
(撮像制御部の構成)
撮像制御部20bは、カメラ5のゲインを調整したり、照明部4の光量を制御したり、撮像素子5aの露光時間(シャッタースピード)を制御するユニットである。ここで、カメラ5のゲインとは、撮像素子5aから出力された画像の明るさをデジタル画像処理によって増幅する際の増幅率(倍率とも呼ばれる)のことである。照明部4の光量については、第1照明部4aと第2照明部4bを別々に制御して変更することができる。ゲイン、照明部4の光量及び露光時間は、カメラ5の撮像条件である。
(Configuration of imaging control unit)
The
(フィルタ処理部の構成)
フィルタ処理部20cは、読取画像に対して画像処理フィルタを実行する部分である。フィルタ処理部20cは、カメラ5により生成された画像に含まれるノイズを除去するノイズ除去フィルタや、コントラストを補正するコントラスト補正フィルタ、平均化フィルタ等を実行する。フィルタ処理部20cが実行する画像処理フィルタは、ノイズ除去フィルタ、コントラスト補正フィルタ、平均化フィルタに限られるものではなく、他の画像処理フィルタを含んでいてもよい。
(Configuration of filter processing unit)
The
フィルタ処理部20cは、後述する画像修復前の読取画像に対して画像処理フィルタを実行するように構成されている。また、フィルタ処理部20cは、後述する拡大、縮小前の読取画像に対して画像処理フィルタを実行するように構成されている。尚、フィルタ処理部20cは、画像修復後の読取画像に対して画像処理フィルタを実行するように構成されていてもよいし、拡大、縮小後の読取画像に対して画像処理フィルタを実行するように構成されていてもよい。
The
(チューニング実行部の構成)
図5に示すチューニング実行部20dは、カメラ5の撮像条件及びデコード処理のデコード条件を変化させて、撮像及びデコード処理を繰り返し、各撮像条件及びデコード条件にて算出されたコードの読み取りのしやすさを示すマッチングレベルに基づいて、最適な撮像条件及びデコード条件を決定するとともに、読取対象のコードの大きさを設定するチューニング処理を実行する。具体的には、チューニング実行部20dは、光学的情報読取装置1、1Aの設定時に、カメラ5のゲイン、照明部4の光量及び露光時間等の撮像条件や、フィルタ処理部20cにおける画像処理条件を変更してデコードに適した条件となるように各種条件(チューニングパラメータ)を設定する部分である。フィルタ処理部20cにおける画像処理条件とは、画像処理フィルタの係数(フィルタの強弱)や、複数の画像処理フィルタがある場合に画像処理フィルタの切替、種類の異なる画像処理フィルタの組み合わせ等である。搬送時のワークWに対する外光の影響や、コードが付されている面の色及び材質等によって適切な撮像条件及び画像処理条件は異なる。よって、チューニング実行部20dは、より適切な撮像条件及び画像処理条件を探索して、AF制御部20a、撮像制御部20b、フィルタ処理部20cによる処理を設定する。
(Configuration of Tuning Execution Unit)
The
チューニング実行部20dは、カメラ5により生成された読取画像に含まれるコードのサイズを取得可能に構成されている。コードのサイズを取得する場合、始めに、チューニング実行部20dは、コードらしさを示す特徴量に基づいてコードを探索する。次いで、チューニング実行部20dは、探索したコードのPPC、コード種、コードサイズ等を取得する。PPC、コード種、コードサイズ等は、コードパラメータまたはコード条件に含まれるものであり、従って、チューニング実行部20dは、探索したコードのコードパラメータまたはコード条件を取得可能に構成されている。
The
二次元コードは、複数の白色のモジュールと黒色のモジュールとがランダムに配列されることによって構成されている。例えば、QRコードのモデル2ではモジュール数は21×21~177×177まである。定置式の光学的情報読取装置1の場合は事前に読み取り対象のコードを読み取ることで、モジュール数やPPCを限定し、コードの大きさ(ピクセルサイズ)をモジュール数×PPCに限定して運用する。
The two-dimensional code is constructed by randomly arranging a plurality of white modules and black modules. For example,
コードを構成するモジュールのうち、1つのモジュールに着目した時、そのモジュールがいくつのピクセル(画素)で構成されているかを示すコードパラメータがPPCである。チューニング実行部20dは、1つのモジュールを特定した後、1つのモジュールを構成している画素数をカウントすることで、PPCを取得できる。
PPC is a code parameter that indicates how many pixels (picture elements) constitute one module among the modules that constitute the code. After identifying one module, the
コード種は、例えばQRコード、データマトリクスコード、ベリコードといったコードの種類のことである。各コードには特徴があるので、チューニング実行部20dは、例えばファインダパターンの有無等によってコード種を判別することが可能である。
The code type is the type of code such as QR code, data matrix code, Vericode, for example. Since each chord has its own characteristics, the
また、コードサイズは、コードの縦または横方向に並ぶモジュールの数とPPCとによって算出できる。チューニング実行部20dは、コードの縦または横方向に並ぶモジュールの数を算出するとともに、PPCを算出し、縦または横方向に並ぶモジュールの数とPPCとを積算することによってコードサイズを取得できる。
Also, the code size can be calculated from the number of modules arranged in the vertical or horizontal direction of the code and the PPC. The
(デコード処理部の構成)
デコード処理部20fは、白黒の二値化されたデータをデコードする部分である。デコードには、符号化されたデータの対照関係を示すテーブルを使用することができる。さらに、デコード処理部20fは、デコードした結果が正しいか否かを所定のチェック方式に従ってチェックする。データに誤りが発見された場合にはエラー訂正機能を使用して正しいデータを演算する。エラー訂正機能はコードの種類によって異なる。
(Structure of decoding processing unit)
The
この実施形態では、デコード処理部20fは、後述する画像修復後の読取画像に含まれるコードをデコードするが、画像修復前の読取画像に含まれるコードをデコードすることもできる。デコード処理部20fは、コードをデコードして得られたデコード結果を図3に示す記憶部30のデコード結果記憶部30bに書き込むように構成されている。
In this embodiment, the
(抽出部の構成)
抽出部20gは、カメラ5により生成された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出する部分である。コード候補領域は、コードらしさを示す特徴量に基づいて抽出することができ、この場合、コードらしさを示す特徴量はコードを特定するための情報となる。例えば、抽出部20gは、読取画像を取得し、取得した読取画像に対して、コードらしさを示す特徴量に基づいてコードを探索することができる。具体的には、取得した読取画像の中に、コードらしさを示す特徴量を所定以上持った部分が存在するか否かを探索し、その結果、コードらしさを示す特徴量を持った部分を探索することができれば、その部分を含む領域をコード候補領域として抽出する。コード候補領域には、コード以外の領域が含まれていてもよいが、少なくともコードである可能性が所定以上高い部分を含んでいる。尚、コード候補領域は、あくまでもコードが存在する可能性が高い領域であることから、結果的にコードが含まれない領域の場合もあり得る。
(Structure of extraction part)
The
抽出部20gは、エイマー光照射部10から照射されたエイマー光の位置情報を、コードを特定するための情報として利用し、コード候補領域を抽出することもできる。この場合、抽出部20gは、読取画像の中から、エイマー光照射部10により形成された目印に対応する部分を特定し、当該特定された部分をコード候補領域として抽出する。すなわち、上述したように、エイマー光はカメラ5の撮影範囲や視野中心を示すためのものであることから、エイマー光によって形成される目印は、予めカメラ5の視野中心と一致させておくことが可能である。特に、手持ち式の光学的情報読取装置1Aの場合、ユーザはエイマー光を読取対象のコードに合わせるので、エイマー光によって形成される目印は、コードと重なっている確率が高い。つまり、エイマー光照射部10により形成された目印に対応する部分をカメラ5の視野中心と一致させておくことで、抽出部20gがカメラ5の視野中心を含む領域を抽出すると、その領域はコードが存在する可能性が高い領域となる。この場合、エイマー光照射部10により形成された目印に対応する部分をカメラ5の視野中心と完全に一致させておかなくてもよく、視野の縦方向または横方向に多少ずれていてもよい。また、コードは所定の大きさを有しているので、抽出部20gが抽出する領域は、カメラ5の視野中心だけではなく、視野中心を含む所定の大きさを持った領域である。
The
抽出部20gは、読取画像の中心部分を特定し、当該中心部分をコード候補領域として抽出することもできる。例えば、カメラ5の視野中心を、コードを特定するための情報として予め取得しておくことで、このカメラ5の視野中心となる部分を読取画像上で特定することができる。特に、手持ち式の光学的情報読取装置1Aの場合、読取画像上で特定した中心部分は、エイマー光照射部10により形成された目印に対応しているので、その中心部分はコードが存在する可能性が高い領域となる。
The
抽出部20gは、読取画像の中から、ユーザによる所定の部分の指定を受け付けるように構成することができ、当該指定された部分をコード候補領域として抽出することができる。すなわち、ユーザは読取画像上の任意の位置(座標)で任意の大きさの領域指定を行うと、抽出部20gは、その位置の座標及び大きさの情報に基づいて読取画像の中から所定の部分の指定を受け付ける。抽出部20gは、受け付けた部分をコード候補領域として抽出する。例えば、定置式の光学的情報読取装置1の場合、図1に示すように搬送用ベルトコンベアBによって搬送されているワークWを撮影してコードのデコード処理を実行することになるが、搬送用ベルトコンベアBの幅方向中央部にワークWが存在しているとは限らず、端にワークWが存在していることがあり、この場合には、読取画像の中から、搬送用ベルトコンベアBの端に対応する部分を指定することで、コードが存在する可能性が高い領域として的確な抽出が可能になる。その他にも、大きなワークWで、その中央部から離れた端近傍にコードが表示されている場合もあり、この場合には、読取画像の中から、ワークWの端近傍に対応する部分を指定することで、コードが存在する可能性が高い領域として的確な抽出が可能になる。
The
(記憶部の構成)
図3に示す記憶部30は、例えばSSD(ソリッドステートドライブ)等のような読み書き可能な記憶装置で構成することができるが、以下に示す各記憶部30a、30b、30c、30dは、上記記憶装置ではなく、ROM40に設けられていてもよい。すなわち、本実施形態では、画像データ記憶部30aと、デコード結果記憶部30bと、パラメータセット記憶部30cと、ニューラルネットワーク記憶部30dとがROM40に含まれている形態も対象である。画像データ記憶部30aは、カメラ5で生成された読取画像を記憶する部分である。デコード結果記憶部30bは、デコード処理部20fで実行されたコードのデコード結果を記憶する部分である。パラメータセット記憶部30cは、チューニング実行部20dが実行したチューニングの結果、設定された各種条件やユーザが設定した各種条件を記憶する部分である。ニューラルネットワーク記憶部30dは、後述する学習済みのニューラルネットワークの構造及びパラメータを記憶する部分である。
(Structure of storage unit)
The
(ニューラルネットワークを利用した画像修復)
光学的情報読取装置1、1Aは、カメラ5で取得した読取画像を、ニューラルネットワークを利用して修復する画像修復機能を有している。本実施形態では、光学的情報読取装置1、1Aで機械学習を行うのではなく、既に学習が終わったニューラルネットワークの構造及びパラメータを光学的情報読取装置1、1Aが予め保持しておき、その保持している構造及びパラメータで構成されたニューラルネットワークを利用して画像修復を行うように構成されている点で、従来の光学的情報読取装置とは相違している。
(Image restoration using neural networks)
The
ニューラルネットワークは、図6に示すように、入力データ(本例では画像データ)が入力される入力層と、出力データを出力する出力層と、入力層及び出力層の間に設けられる中間層とを有している。中間層は例えば複数設けることができ、これにより、多層構造のニューラルネットワークとすることができる。 As shown in FIG. 6, the neural network has an input layer to which input data (image data in this example) is input, an output layer to output output data, and an intermediate layer provided between the input layer and the output layer. have. For example, a plurality of intermediate layers can be provided, thereby forming a multi-layered neural network.
(ニューラルネットワークの学習)
始めに、図7に示すフローチャートに基づいてニューラルネットワークの学習時の基本手順について説明する。ニューラルネットワークの学習は、光学的情報読取装置1、1A以外の学習用として用意したコンピュータを用いて行うことができるが、学習用以外の汎用コンピュータを用いて行ってもよい。また、ニューラルネットワークの学習方法は従来から周知の方法を用いてもよい。
(Neural network learning)
First, the basic procedure for neural network learning will be described based on the flow chart shown in FIG. Learning of the neural network can be performed using a computer prepared for learning other than the optical
スタート後のステップSA1では予め準備している不良画像のデータを読み込む。不良画像は、コードの読み取りに不適切な部分を有する画像であり、図8の左側に示すような画像を例示することができる。不適切な部分とは、例えば汚れた部分や着色された部分等である。その後、ステップSA2に進み、予め準備している理想画像のデータを読み込む。理想画像は、コードの読み取りに適切な画像であり、図8の右側に示すような画像を例示することができる。不良画像と理想画像とはペアとしておき、このようなペアを複数準備しておく。 In step SA1 after the start, data of defective images prepared in advance are read. A defective image is an image having a portion inappropriate for code reading, and can be exemplified by the image shown on the left side of FIG. The inappropriate part is, for example, a dirty part, a colored part, or the like. After that, the process advances to step SA2 to read the ideal image data prepared in advance. The ideal image is an image suitable for reading the code, and can be exemplified by the image shown on the right side of FIG. A defective image and an ideal image are paired, and a plurality of such pairs are prepared.
ステップSA2では、損失関数を計算し、不良画像と理想画像との差分を求める。ステップSA3では、ステップSA2で求めた差分を反映させてニューラルネットワークのパラメータを更新する。 At step SA2, a loss function is calculated to find the difference between the defective image and the ideal image. At step SA3, the parameters of the neural network are updated by reflecting the difference obtained at step SA2.
ステップSA4では機械学習の完了条件を満たすか否かを判定する。機械学習の完了条件とは、ステップSA2で求めた差分に基づいて設定することができ、例えば差分が所定以下であれば、機械学習の完了条件を満たすと判定できる。ステップSA4でYESと判定されて機械学習の完了条件を満たしている場合には機械学習を終了する。一方、ステップSA4でNOと判定されて機械学習の完了条件を満たしていない場合にはステップSA1に戻り、別の不良画像を読み込んだ後、ステップSA2に進んで当該別の不良画像とペアになっている別の理想画像を読み込む。 At step SA4, it is determined whether or not the machine learning completion condition is satisfied. The machine learning completion condition can be set based on the difference obtained in step SA2. For example, if the difference is a predetermined value or less, it can be determined that the machine learning completion condition is satisfied. If it is determined YES in step SA4 and the machine learning completion condition is satisfied, the machine learning is terminated. On the other hand, if it is determined NO in step SA4 and the machine learning completion condition is not satisfied, the process returns to step SA1, another defective image is read, and then the process proceeds to step SA2 to pair with the other defective image. Load another ideal image that is
このようにして、複数の不良画像と、当該複数の不良画像にそれぞれ対応する複数の理想画像とを機械学習させることにより、学習済みのニューラルネットワークを予め生成することができる。学習済みのニューラルネットワークの構造及びパラメータを光学的情報読取装置1、1Aが保持しておくことで、光学的情報読取装置1、1A内で学習済みのニューラルネットワークを構築することができる。すなわち、機械学習を行う際には、膨大な数の不良画像と理想画像とをニューラルネットワークに入力することになるので、その際の演算能力としては極めて高いものが要求される。光学的情報読取装置1、1A内でそのような高い演算能力を確保するのは、装置の小型軽量化の要求を満たすことができなくなるおそれがあり、困難である。本例のように、光学的情報読取装置1、1A外で機械学習を行い、その結果得られたニューラルネットワークの構造及びパラメータを光学的情報読取装置1、1Aで保持しておけば、光学的情報読取装置1、1Aの小型軽量化を実現しながら、ニューラルネットワークによる画像修復が可能になる。
In this manner, a learned neural network can be generated in advance by performing machine learning on a plurality of defective images and a plurality of ideal images corresponding to the plurality of defective images. By holding the structure and parameters of the trained neural network in the
図9は、上述のようにして構成された畳み込みニューラルネットワーク(CNN:Convolutional Neural Network)の概念図である。「Convolution」では、入力された画像の特徴の抽出を行う。この層は、画像処理フィルタのような畳み込み演算で構成される。フィルタの重みをカーネルと呼び、カーネルに合わせた特徴量の抽出を行う。畳み込み層は一般的に複数の異なるカーネルを持ち、カーネル数に応じてマップ数(D)が増えていく。カーネルサイズは、例えば3×3、5×5などを取ることができる。 FIG. 9 is a conceptual diagram of a convolutional neural network (CNN) configured as described above. "Convolution" extracts the features of the input image. This layer consists of convolution operations such as image processing filters. The weight of the filter is called a kernel, and the feature quantity is extracted according to the kernel. A convolutional layer generally has a plurality of different kernels, and the number of maps (D) increases according to the number of kernels. The kernel size can take, for example, 3×3, 5×5, and so on.
「pooling」では、縮小処理を行って各カーネルの反応をまとめる。「Deconvolution」では、逆畳み込みフィルタにより、特徴値から画像を再構成する。「Unpooling」では、拡大処理を行って反応値を先鋭化する。 In "pooling", the reduction process is performed to combine the reactions of each kernel. "Deconvolution" reconstructs an image from feature values using a deconvolution filter. "Unpooling" sharpens the reaction value by performing expansion processing.
学習済みのニューラルネットワークの構造及びパラメータは、図3に示す記憶部30のニューラルネットワーク記憶部30dに記憶される。ニューラルネットワークの構造とは、入力層と出力層との間に設けられる中間層の数(D)や、画像処理フィルタの数等である。ニューラルネットワークのパラメータは、図7に示すフローチャートのステップSA3で設定されたパラメータである。
The structure and parameters of the trained neural network are stored in the neural
また、ニューラルネットワーク記憶部30dには、層の数または画像処理フィルタの数が異なる複数のニューラルネットワークの構造及びパラメータを記憶することが可能になっている。この場合、複数のニューラルネットワークの構造及びパラメータと、コード条件とを関連付けた状態でニューラルネットワーク記憶部30dに記憶することができる。例えば、第1のニューラルネットワークを構成するための当該ニューラルネットワークの構造及びパラメータと、第1のニューラルネットワークに対応する第1のコード条件とを関連付ける。関連付けを行う際、第1のニューラルネットワークの層の数またはフィルタの数は、第1のコード条件、特に第1のPPCによって最適な数を事前に特定しておくことができるものなので、この関係が保たれるように関連付けておく。同様に、第1のニューラルネットワークとは異なる第2のニューラルネットワークの構造及びパラメータと、第1のコード条件とは異なる第2のコード条件とを関連付ける。
Further, the neural
複数のニューラルネットワークの構造及びパラメータをニューラルネットワーク記憶部30dに記憶している場合には、光学的情報読取装置1、1Aの設定時に、次のようにチューニング実行部20dが動作する。すなわち、チューニング実行部20dは、カメラ5により生成された読取画像に含まれるコード条件を設定する際、設定したコード条件に関連付けられたニューラルネットワークの構造及びパラメータをニューラルネットワーク記憶部30dから読み出して運用時に使用するニューラルネットワークとして特定する。例えば、チューニング実行部20dが読取画像に含まれるコード条件をして第1のコード条件を設定した場合には、第1のコード条件と関連付けられた第1のニューラルネットワークの構造及びパラメータをニューラルネットワーク記憶部30dから読み出す。そして、第1のニューラルネットワークの構造及びパラメータを光学的情報読取装置1、1Aの運用時に使用するニューラルネットワークとして特定する。これにより、コード条件に最適なニューラルネットワークの構造及びパラメータで読取画像の修復を試行できるので、読み取り精度を高めることができる。
When the structures and parameters of a plurality of neural networks are stored in the neural
ニューラルネットワークの学習にあたっては、コードを構成するモジュールのピクセル分解能が特定範囲内である不良画像及び理想画像を機械学習させることもできる。モジュールのピクセル分解能は、例えばコードを構成する1つのモジュールのピクセル数(PPC)で表すことができ、PPCが特定範囲内にある不良画像及び理想画像のみでニューラルネットワークの機械学習を行ってもよい。 In learning the neural network, it is also possible to machine-learn a defective image and an ideal image in which the pixel resolution of the modules constituting the code is within a specific range. The pixel resolution of a module can be represented, for example, by the number of pixels (PPC) of one module that constitutes the code, and machine learning of the neural network may be performed only with defective images and ideal images in which the PPC is within a specific range. .
上記特定範囲は、読取画像の修復効果の高いピクセル分解能を含み、かつ、読取画像の修復効果が殆ど向上しないピクセル分解能を除外する範囲であり、複数のモジュールで構成されたコードを含む画像の修復を前提として設定することができる。これにより、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させることができる。 The specific range includes pixel resolutions at which the reading image has a high restoration effect and excludes pixel resolutions at which the reading image restoration effect hardly improves. can be set as a premise. As a result, the processing speed can be improved as a neural network structure specialized for restoration of images containing codes.
上記ピクセル数の特定範囲としては、例えば4PPC以上6PPC以下とすることができるが、4PPC未満であってもよいし、6PPCよりも多くてもよい。また、例えば特定範囲を4PPC以上6PPC以下に限定して機械学習することで、学習に用いる画像から余分なスケールの変動を排除することができ、学習済みニューラルネットワーク構造の適正化を図ることもできる。 The specific range of the number of pixels can be, for example, 4 PPC or more and 6 PPC or less, but it may be less than 4 PPC or more than 6 PPC. In addition, for example, by limiting the specific range to 4 PPC or more and 6 PPC or less for machine learning, it is possible to eliminate unnecessary scale fluctuations from the image used for learning, and it is also possible to optimize the trained neural network structure. .
(修復の試行)
図5に示すように、光学的情報読取装置1、1Aのプロセッサ20には、AIチップ23によって構成される画像修復部20jが設けられている。画像修復部20jは、記憶部30のニューラルネットワーク記憶部30dに記憶されたニューラルネットワークの構造及びパラメータを読み出し、読み出したニューラルネットワークの構造及びパラメータで光学的情報読取装置1、1A内にニューラルネットワークを構成する。光学的情報読取装置1、1A内に構成されたニューラルネットワークは、図7のフローチャートに示す手順で学習した学習済みニューラルネットワークと同じものである。
(Repair attempt)
As shown in FIG. 5, the
画像修復部20jは、カメラ5により生成された読取画像をニューラルネットワークに入力することにより、ニューラルネットワーク記憶部30dに記憶されたニューラルネットワークの構造及びパラメータに従って読取画像の修復を試行する。そして、修復された読取画像に対してデコード処理部20fがデコード処理を実行する。
The
フィルタ処理部20cは、カメラ5により生成された読取画像を画像修復部20jがニューラルネットワークに入力する前に、読取画像に対して画像処理フィルタを実行するように構成されている。これにより、ニューラルネットワークによる修復を試行する前に適切な画像処理を実行しておくことができ、その結果、読取画像の修復がより的確なものになる。
The
デコード処理部20fでデコード処理する全ての読取画像に対して画像修復部20jが画像修復を試行してもよいし、デコード処理部20fでデコード処理する一部の読取画像に対してのみ画像修復部20jが画像修復を試行してもよい。例えば、デコード処理部20fは、修復を試行する前の読取画像に対してデコード処理を実行し、デコードが成功したか否かを判定する。デコードに成功した場合には、修復が不要な読取画像であったということであり、そのまま結果を出力する。一方、デコードに失敗した場合には、画像修復部20jが読取画像の修復を試行し、修復された読取画像に対してデコード処理部20fがデコード処理を実行する。
The
(部分画像の入力)
画像修復部20jがニューラルネットワークに入力する画像は、カメラ5により生成された読取画像の全部であってもよいが、入力する画像のサイズが大きければ大きいほどニューラルネットワークによる演算量が増大し、プロセッサ20の演算負荷が重くなり、ひいては処理速度の低下を招くおそれがある。具体的には、図9に示すようなFCN(Fully Convolutional Network)型のニューラルネットワークでは、構造が等しいと仮定した場合、演算量は入力画像サイズに比例した量となり、入力画像サイズはコードの大きさの二乗に比例するため、演算量もコードの大きさの二乗に比例することになる。
(Input partial image)
The image that the
一方、カメラ5により生成された読取画像の全体にコードが存在しているケースは皆無といってよく、通常の運用時には読取画像の一部の領域にのみコードが存在しており、その領域のみニューラルネットワークによる修復を行うことができれば、読み取り精度を高めることができる。
On the other hand, it can be said that there are no cases where the code exists in the entire read image generated by the
そこで、画像修復部20jがニューラルネットワークに入力する画像は、カメラ5により生成された読取画像の一部、即ちコードを含んだ部分画像とすることができる。具体的には、画像修復部20jは、抽出部20gが抽出したコード候補領域に対応する部分画像を、カメラ5により生成された読取画像から切り出す。画像修復部20jは切り出した部分画像をニューラルネットワークに入力することにより、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータに従って部分画像の修復を試行する。そして、修復された部分画像に対してデコード処理部20fがデコード処理を実行する。
Therefore, the image input to the neural network by the
上述したように読取画像の全体にコードが存在しているケースは殆ど無いので、コード候補領域に対応する部分画像のサイズは、読取画像のサイズよりも小さくなる。これにより、ニューラルネットワークに入力する画像のサイズが小さくなるので、プロセッサ20の演算負荷が軽くなり、ひいては処理速度の高速化が実現される。また、部分画像は、コードが存在する可能性が高い領域に対応しているので、読み取りに必要な情報、即ちコードの全体を含んだ画像とすることが可能である。このコードの全体を含んだ画像をニューラルネットワークに入力するので、読み取り精度の低下は抑制される。
Since there are almost no cases where the code exists in the entire read image as described above, the size of the partial image corresponding to the code candidate area is smaller than the size of the read image. As a result, the size of the image to be input to the neural network is reduced, so that the computational load on the
画像修復部20jは、チューニング実行部20dで取得したコードサイズに基づいて部分画像のニューラルネットワークへの入力サイズを決定することができる。上述したように、チューニング実行部20dはコードサイズを取得することができる。画像修復部20jは、ニューラルネットワークへ入力する部分画像の入力サイズを、チューニング実行部20dで取得したコードサイズよりも所定量だけ大きくする。
The
すなわち、部分画像をニューラルネットワークへ入力することで演算負荷を軽くすることができる反面、例えばコードが回転していたり、コードの位置が精密に検出できなかった場合には、部分画像中のコードの一部が欠けてしまい、デコード処理に失敗する可能性もある。本実施形態では、ニューラルネットワークへの入力サイズがチューニング実行部20dで取得したコードサイズと同じではなく、コードサイズよりも所定量だけ大きいので、部分画像中でコードの一部が欠けるのを抑制できる。尚、コードサイズよりも所定量だけ大きくしていることで、ニューラルネットワークへの入力サイズに上限を持たせることができ、よって、演算負荷が重くならないようにすることができる。「所定量」とは、例えばニューラルネットワークへ入力される部分画像の横(または縦)の長さが、チューニング実行部20dで取得したコードの横(または縦)の長さの1.5倍以上、または2.0倍以上、または3.0倍以上であってもよい。
That is, inputting the partial image to the neural network can reduce the computational load, but on the other hand, if, for example, the code is rotated or the position of the code cannot be detected precisely, the code in the partial image cannot be detected. It is also possible that part of the data is missing and the decoding process fails. In this embodiment, since the input size to the neural network is not the same as the code size obtained by the
画像修復部20jがニューラルネットワークへ入力する部分画像の入力サイズを決定する際、チューニング実行部20dで取得したコードを構成する1つのモジュールのピクセル数と当該コードの縦または横方向に並ぶモジュール数とに基づいて決定することができる。
When the
また、チューニング実行部20dでは上述したようにコード条件を設定することができる。画像修復部20jは、チューニング実行部20dで設定されたコード条件に基づいて、ニューラルネットワークに入力する読取画像のサイズを設定することもできる。例えば、チューニング実行部20dで設定されたコード条件のうち、コードサイズを画像修復部20jが取得すると、取得したコードサイズよりも所定量だけ大きなサイズの部分画像をニューラルネットワークに入力する。コードサイズが大きければニューラルネットワークに入力する部分画像のサイズが大きくなる一方、コードサイズが小さければニューラルネットワークに入力する部分画像のサイズが小さくなる。つまり、ニューラルネットワークに入力する部分画像のサイズをコード条件に応じて変えることができる。
Also, the
(縮小・拡大機能)
ここで、図9に示すような畳み込みニューラルネットワークにおいてコードの特徴を十分に捉え、デコードに適した画像に修復するためには、一定量のモジュール数をカバーする範囲で特徴量を抽出する必要がある。例えば、ニューラルネットワークから得られる1つの特徴値が6×6モジュールの範囲から抽出される値であるとし、1つのモジュールが20ピクセルで撮影された画像の場合、120×120ピクセルの範囲から集約された特徴値を算出するようにニューラルネットワークを設計しなければならない。つまり、カバーしたいピクセル範囲が広ければ広い程、ニューラルネットワークの階層を深くしなければならず、例えば上述した120×120ピクセルの範囲から特徴値を集約しようとすると、6回の畳み込み層が必要となる。
(reduction/enlargement function)
Here, in order to fully capture the features of the code in the convolutional neural network as shown in FIG. 9 and restore the image to be suitable for decoding, it is necessary to extract feature quantities within a range that covers a certain number of modules. be. For example, if one feature value obtained from the neural network is a value extracted from a range of 6×6 modules, and one module is an image captured with 20 pixels, it is aggregated from a range of 120×120 pixels. A neural network must be designed to calculate feature values that In other words, the wider the pixel range to be covered, the deeper the layer of the neural network must be. For example, to aggregate the feature values from the 120×120 pixel range described above, six convolution layers are required. Become.
しかし、コードは白色のモジュールと黒色のモジュールとがランダムに配列されることによって構成されているため、広範囲でのピクセル値の関係は希薄であり、カバーするピクセル範囲を一定以上に広げても修復効果は殆ど向上しない。このような特徴を、本明細書では狭範囲特徴と呼ぶ。 However, since the code is composed of white modules and black modules arranged randomly, the relationship between pixel values over a wide range is weak. The effect is hardly improved. Such features are referred to herein as narrow range features.
また、コードに含まれるファインダパターンなど決まったモジュールパターンの配置やコード全体として四角形状であることは広範囲特徴になり得るが、モジュールと背景とを大まかに分離するだけであれば、広範囲特徴を用いることなく、狭範囲特徴のみを用いても十分に修復可能である。尚、広範囲特徴とは、広範囲に渡って決まった形状を持つ特徴と定義することができる。 In addition, the arrangement of fixed module patterns such as the finder pattern included in the code and the rectangular shape of the entire code can be wide-range features. It is also possible to recover satisfactorily using narrow-range features alone, without A wide range feature can be defined as a feature having a fixed shape over a wide range.
そこで、図7に示すニューラルネットワークの学習の際、コードのPPCが特定範囲にある画像を用いることができる。これにより、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させることができる反面、PPCが特定範囲外にある読取画像に対する修復効果は低下する懸念がある。尚、ニューラルネットワークの学習の際、コードのPPCが特定範囲外にある画像を用いてもよい。 Therefore, when learning the neural network shown in FIG. 7, an image in which the PPC of the code is within a specific range can be used. As a result, it is possible to improve the processing speed as a neural network structure specializing in restoration of images including codes, but there is a concern that the restoration effect for read images in which the PPC is outside the specific range will be reduced. When learning the neural network, an image in which the PPC of the code is outside the specific range may be used.
本実施形態の光学的情報読取装置1、1Aでは、読取画像のPPCが特定範囲に入るようにするために、読取画像の縮小・拡大機能を備えている。図5に示すように、プロセッサ20には、縮小部20h及び拡大部20iが構成されている。縮小部20hは、カメラ5により生成された読取画像の中のコードを構成するモジュールのピクセル分解能が上述した特定範囲内となるように縮小した読取画像を生成する部分であり、また、拡大部20iは、カメラ5により生成された読取画像の中のコードを構成するモジュールのピクセル分解能が上述した特定範囲内となるように拡大した読取画像を生成する部分である。
The optical
縮小部20h及び拡大部20iは、例えばカメラ5により生成された読取画像におけるコードのPPCが特定範囲(4PPC以上6PPC以下)外にあるか否かを判定し、特定範囲内である場合には、縮小または拡大を非実行にする一方、特定範囲外である場合には、縮小または拡大を実行する。縮小または拡大を実行することで、画像修復部20jがニューラルネットワークへ入力する部分画像におけるコードのPPCが特定範囲内に入る。
The reducing
画像修復部20jは、特定範囲内となるように拡大または縮小した読取画像を、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、その構造及びパラメータに従って読取画像の修復を試行する。そして、修復された読取画像に対してデコード処理部20fがデコード処理を実行する。
The
抽出部20gは、拡大部20iにより拡大した読取画像または縮小部20hにより縮小した読取画像に対してコードを探索し、探索されたコードを含む領域をコードが存在する可能性が高いコード候補領域として抽出するように構成してもよい。この場合、画像修復部20jは、抽出部20gが抽出したコード候補領域に対応する部分画像を、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、その構造及びパラメータに従って読取画像の修復を試行する。
The extracting
光学的情報読取装置1、1Aの設定時には、チューニング実行部20dが、拡大率を変えた複数の読取画像(拡大画像)を生成すること、及び縮小率を変えた複数の読取画像(縮小画像)を生成することができる。チューニング実行部20dは、生成した複数の読取画像(拡大画像または縮小画像)をニューラルネットワークに入力して各読取画像の修復を試行し、修復された各読取画像に対してデコード処理を実行し、コードの読み取りのしやすさを示す読取余裕度を求める。チューニング実行部20dは、求めた読取余裕度が所定よりも高い読取画像の拡大率または縮小率を、運用時に使用する拡大率または縮小率として特定する。チューニング実行部20dが拡大率または縮小率を特定した場合、光学的情報読取装置1、1Aの運用時には、縮小部20h及び拡大部20iは、チューニング実行部20dが特定した拡大率または縮小率で読取画像を拡大または縮小する。
When setting the optical
すなわち、例えば特定範囲にある程度の広さがある場合、その特定範囲内であっても拡大率や縮小率を変えると、読取余裕度が変化することが考えられる。チューニング実行部20dが求めた読取余裕度が所定よりも高くなるように、運用時における読取画像の拡大率または縮小率を特定することができるので、処理速度及び読み取り精度が向上する。
That is, for example, if the specific range has a certain extent, it is conceivable that the reading margin will change even within the specific range if the enlargement ratio or the reduction ratio is changed. Since the enlargement ratio or reduction ratio of the read image during operation can be specified so that the read margin obtained by the
チューニング実行部20dは、各読取画像の読取余裕度を求めた後、求めた複数の読取余裕度のうち、最も高い読取余裕度の読取画像の拡大率または縮小率を、運用時に使用する拡大率または縮小率として特定することができる。これにより、処理速度及び読み取り精度を更に向上させることができる。
After obtaining the reading slack for each read image, the
また、縮小部20h及び拡大部20iで読取画像を縮小及び拡大できることを利用して、パラメータセットの種類を増やすこともできる。縮小部20hによる縮小率が異なる複数のパラメータセットと、拡大部20iによる拡大率が異なる複数のパラメータセットを生成し、これらパラメータセットを記憶部30のパラメータセット記憶部30cに記憶させることができる。例えば、縮小部20hによる縮小率が1/2、1/4、1/8のように複数設定可能な場合、縮小率が1/2のパラメータセット、縮小率が1/4のパラメータセット、縮小率が1/8のパラメータセットをパラメータセット記憶部30cに記憶させることができる。また、拡大部20iによる拡大率が2倍、4倍、8倍のように複数設定可能な場合、拡大率が2倍のパラメータセット、拡大率が4倍のパラメータセット、拡大率が8倍のパラメータセットをパラメータセット記憶部30cに記憶させることができる。そして、パラメータセット記憶部30cに記憶された複数のパラメータセットの中から任意の一のパラメータセットを適用することができる。
Further, by utilizing the fact that the read image can be reduced and enlarged by the
(画像修復フィルタ)
画像修復部20jは、ニューラルネットワークを利用して読取画像の修復を試行する画像修復フィルタを実行する部分であってもよい。画像修復フィルタは、読取画像を、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータに従って読取画像の修復を試行するフィルタであり、上述した画像修復と同じ機能を発揮する。
(Image Restoration Filter)
The
画像修復フィルタを実行可能にする場合、画像修復フィルタを設定するための設定部20e(図5に示す)を設けることができる。設定部20eは、ユーザによる画像修復フィルタの設定を受付可能に構成されている。設定部20eは、例えば光学的情報読取装置1、1Aの設定時に、「画像修復フィルタの適用」と「画像修復フィルタの非適用」との一方をユーザが選択可能なユーザインターフェースを生成して表示部6に表示させ、ユーザによる選択を受け付けるように構成することができる。したがって、画像修復部20jは、設定部20eにより設定された画像修復フィルタを読取画像に適用することで、当該読取画像に対して修復を試行する。
When the image restoration filter is made executable, a
設定部20eは、チューニング実行部20dに含まれていてもよいし、チューニング実行部20dとは別に構成されていてもよい。設定部20eがチューニング実行部20dに含まれている場合、チューニング時に画像修復フィルタに関するパラメータを設定することが可能になる。画像修復フィルタに関するパラメータとしては、「画像修復フィルタの適用」と「画像修復フィルタの非適用」とを含むことができる。「画像修復フィルタの適用」とは、画像修復フィルタを実行可能に設定することであり、「画像修復フィルタの非適用」とは、画像修復フィルタを設定しないことである。
The
画像修復フィルタに関するパラメータは、画像修復フィルタに関する情報でもあり、この場合、画像修復フィルタの設定に関する情報を含むパラメータセットをパラメータセット記憶部30cに記憶することができる。画像修復フィルタに関するパラメータは、「画像修復フィルタの適用」と「画像修復フィルタの非適用」とがあるので、パラメータセット記憶部30cに記憶されるパラメータセットには、画像修復フィルタを実行可能に設定する第1のパラメータセットと、画像修復フィルタを設定しない第2のパラメータセットと含まれる。光学的情報読取装置1、1Aの運用時には、第1のパラメータセットと、第2のパラメータセットとの中から選択された一方のパラメータセットが適用される。第1のパラメータセットが適用された場合には、画像修復フィルタによって画像修復が実行された読取画像に対してデコード処理部20fによるデコード処理が実行される一方、第2のパラメータセットが適用された場合には、画像修復が実行されない読取画像に対してデコード処理部20fによるデコード処理が実行される。
The parameters related to the image restoration filter are also information related to the image restoration filter, and in this case, a parameter set including information related to setting of the image restoration filter can be stored in the parameter set
パラメータセット記憶部30cに記憶されるパラメータセットには、カメラ5により生成された読取画像に含まれるコード条件を設定する項目も含まれる。コード条件を設定する項目では、チューニング実行部20dが取得したPPC、コード種、コードサイズ等が設定される。例えば、1つのパラメータセットには、コード条件を設定する項目としてのPPC、コード種、コードサイズと、撮像条件としてのカメラ5のゲイン、照明部4の光量、露光時間と、フィルタ処理部20cが適用する画像処理フィルタの項目としての画像処理フィルタ種類、当該画像処理フィルタのパラメータと、画像修復フィルタの適用項目とを含むことができる。これら各項目は、チューニング実行部20dが設定した値等をそのまま用いてもよいし、ユーザが任意に変更することもできる。
The parameter sets stored in the parameter set
(チューニング工程の手順の一例)
光学的情報読取装置1、1Aの設定時にチューニング実行部20dによって行われるチューニング工程の手順の一例について、図10に示すフローチャートに基づいて具体的に説明する。図10に示すフローチャートのスタート後のステップSB1では、チューニング実行部20dが照明部4及びカメラ5を制御してカメラ5に読取画像を生成させ、チューニング実行部20dが読取画像を取得する。このとき、デコード処理前に実行される画像処理フィルタの有無や種類、ニューラルネットワークによる画像修復を適用するためのデコード処理パラメータは任意のパラメータに設定されている。次いでステップSB2に進み、取得した読取画像に対してチューニング実行部20dがデコード処理部20fにデコード処理を実行させる。
(Example of tuning process procedure)
An example of the procedure of the tuning process performed by the
デコード処理後、ステップSB3に進み、ステップSB2のデコード処理が成功したか否かをチューニング実行部20dが判定する。ステップSB3でNOと判定されてステップSB2のデコード処理が失敗した場合、即ちコードの読み取りができなかった場合には、ステップSB4に進み、デコード処理パラメータを別のパラメータに変更した後、ステップSB2で再度デコード処理を実行する。全てのデコード処理パラメータでデコード処理を失敗した場合にはこのフローを終了してユーザに報知する。
After the decoding process, the process proceeds to step SB3, and the
一方、ステップSB3でYESと判定されてステップSB2のデコード処理が成功した場合には、ステップSB5に進み、チューニング実行部20dがコードパラメータ(PPC、コード種、コードサイズ等)を決定する。チューニング実行部20dがコードパラメータを決定すると、コードパラメータと関連付けられてニューラルネットワーク記憶部30dに記憶されているニューラルネットワークの構造及びパラメータも決定される(ステップSB6)。ステップSB6では、ニューラルネットワーク記憶部30dから読み出した構造及びパラメータでニューラルネットワークを構成する。
On the other hand, if YES is determined in step SB3 and the decoding process in step SB2 succeeds, the process proceeds to step SB5, where the
ステップSB7では、画像修復部20jが、ステップSB6で構成されたニューラルネットワークに読取画像を入力することにより、読取画像の修復を試行し、前記修復された読取画像に対してデコード処理部20fがデコード処理を実行する。その後、ステップSB8に進み、チューニング実行部20dがステップSB7のデコード処理結果に基づいて読取余裕度を評価し、一旦記憶しておく。
At step SB7, the
ステップSB9では、全てのデコード処理パラメータでデコード処理の実行が完了したか否かを判定する。ステップSB9でNOと判定されて、全てのデコード処理パラメータでデコード処理の実行が完了していない場合にはステップSB10に進み、デコード処理パラメータを別のパラメータに変更した後、ステップSB7に進む。 At Step SB9, it is determined whether or not the decoding process has been completed with all the decoding process parameters. If NO is determined in step SB9 and execution of the decoding process has not been completed with all the decoding process parameters, the process proceeds to step SB10, changes the decoding process parameters to other parameters, and then proceeds to step SB7.
一方、ステップSB9でYESと判定されて全てのデコード処理パラメータでデコード処理の実行が完了するとステップSB11に進む。ステップSB11では、チューニング実行部20dが、全てのデコード処理パラメータの中から読取余裕度が最も高いデコード処理パラメータを選択し、その選択したデコード処理パラメータを運用時に適用するパラメータとして決定する。尚、チューニング工程では、撮像条件等も適切な条件に設定される。
On the other hand, when it is judged as YES in step SB9 and execution of the decoding process is completed with all the decoding process parameters, the process proceeds to step SB11. At step SB11, the
(縮小率及び拡大率決定前のデコード処理手順)
次に、縮小率及び拡大率決定前のデコード処理手順の一例について、図11に示すフローチャートに基づいて具体的に説明する。図11に示すフローチャートで特定される処理は、図10に示すフローチャートのステップSB2で実行することができる。
(Decoding processing procedure before determination of reduction ratio and enlargement ratio)
Next, an example of the decoding processing procedure before determining the reduction rate and the enlargement rate will be specifically described with reference to the flowchart shown in FIG. The processing specified in the flowchart shown in FIG. 11 can be executed in step SB2 of the flowchart shown in FIG.
図11に示すフローチャートのスタート後のステップSC1では、チューニング実行部20dが、複数の画像処理フィルタの中から任意の画像処理フィルタを選択する。この画像処理フィルタは、フィルタ処理部20cで実行されるフィルタである。その後、ステップSC2では、ステップSC1で選択した画像処理フィルタを読取画像に対してフィルタ処理部20cが実行する。
At step SC1 after the start of the flowchart shown in FIG. 11, the
次いで、ステップSC3に進み、画像ピラミッドを作成する。画像ピラミッドは、元の読取画像、元の読取画像を1/2に縮小した画像、元の読取画像を1/4に縮小した画像、元の読取画像を1/8に縮小した画像、…で構成されている。読取画像の縮小は、縮小部20hで実行される。また、画像ピラミッドは、元の読取画像、元の読取画像を2倍に拡大した画像、元の読取画像を4倍に拡大した画像、元の読取画像を8倍に拡大した画像、…で構成することもできる。読取画像の拡大は、拡大部20iで実行される。尚、縮小した画像と、拡大した画像とのうち、一方を省略してもよい。
Next, at step SC3, an image pyramid is created. The image pyramid consists of an original read image, an image reduced to 1/2 of the original read image, an image reduced to 1/4 of the original read image, an image reduced to 1/8 of the original read image, and so on. It is configured. Reduction of the read image is performed by the
画像ピラミッドを作成した後、ステップSC4に進み、画像ピラミッドを構成する複数の読取画像の中から任意の読取画像を選択する。この選択された画像の中には、縮小及び拡大されていない元の読取画像が含まれる場合もある。ステップSC5では、抽出部20gが、ステップSC4で選択した読取画像の中からコードが存在する可能性が高いコード候補領域を抽出する。その後、ステップSC6に進み、画像修復部20jが、ステップSC5で抽出されたコード候補領域に対応する部分画像をニューラルネットワークに入力して読取画像の修復を試行する。ニューラルネットワークに入力する部分画像のサイズは、上述したコード条件によって決定する。
After creating the image pyramid, the process advances to step SC4 to select an arbitrary read image from among the plurality of read images forming the image pyramid. This selected image may include the original scanned image that has not been scaled down or scaled up. At step SC5, the
読取画像の修復後、ステップSC7に進み、コードの輪郭やコードを構成しているモジュールの位置決め処理を実行する。位置決め処理後、ステップSC8に進み、コードを構成している各モジュールが白であるか、黒であるかを判別する。白黒の判別後、ステップSC9に進み、修復された読取画像に対してデコード処理部20fがデコード処理を実行する。デコード処理では、例えばモジュールの0-1マトリックスから文字列を復元する手法を採用することができる。
After the read image is restored, the process proceeds to step SC7 to execute positioning processing of the outline of the code and the modules forming the code. After the positioning process, the process proceeds to step SC8 to determine whether each module constituting the code is white or black. After determining whether the image is black or white, the process proceeds to step SC9, and the
その後、ステップSC10に進み、ステップSC9のデコード処理が成功したか否かをチューニング実行部20dが判定する。ステップSC10でNOと判定されてステップSC9のデコード処理が失敗した場合には、ステップSC11に進み、画像ピラミッドを構成している全ての読取画像が選択されたか否かを判定する。ステップSC11でNOと判定されて画像ピラミッドを構成している全ての読取画像が選択されていない場合にはステップSC4に進み、画像ピラミッドを構成している別の縮小された読取画像または別の拡大された読取画像を選択し、ステップSC5に進む。
Thereafter, the process proceeds to step SC10, and the
一方、ステップSC11でYESと判定されて画像ピラミッドを構成している全ての読取画像が選択された場合にはこのフローを終了し、デコードが成功した条件を記憶しておく。 On the other hand, if YES is determined in step SC11 and all the read images forming the image pyramid have been selected, this flow is terminated and the conditions for successful decoding are stored.
(縮小率及び拡大率決定後のデコード処理手順)
次に、縮小率及び拡大率決定後のデコード処理手順の一例について、図12に示すフローチャートに基づいて具体的に説明する。図12に示すフローチャートで特定される処理は、図10に示すフローチャートのステップSB7及び光学的情報読取装置1、1Aの運用時に実行することができる。
(Decode processing procedure after determination of reduction ratio and enlargement ratio)
Next, an example of the decoding processing procedure after determining the reduction rate and the enlargement rate will be specifically described with reference to the flowchart shown in FIG. The processing specified in the flowchart shown in FIG. 12 can be executed during operation of step SB7 of the flowchart shown in FIG. 10 and the
図12に示すフローチャートのスタート後のステップSD1では、図11に示すフローチャートのステップSC1で選択した画像処理フィルタを読取画像に対してフィルタ処理部20cが実行する。このとき、図13の上側に示すような読取画像に対してフィルタ処理部20cが平均化フィルタを実行した場合には、図13の下側に示すような画像処理フィルタ実行後の画像が得られる。
At step SD1 after the start of the flow chart shown in FIG. 12, the
その後、ステップSD2に進み、必要に応じて読取画像の縮小・拡大処理を実行する。具体的には、画像処理フィルタ実行後の読取画像におけるコードのPPCが特定範囲内である場合には、縮小または拡大を非実行にする一方、特定範囲外である場合には、縮小または拡大を実行し、PPCが特定範囲内に入るようにする。図14の上側に、縮小処理後の読取画像の例を示している。 After that, the process advances to step SD2 to execute reduction/enlargement processing of the read image as necessary. Specifically, when the PPC of the code in the read image after execution of the image processing filter is within a specific range, reduction or enlargement is not executed, and when it is outside the specific range, reduction or enlargement is not executed. Execute and make sure the PPC is within a certain range. The upper part of FIG. 14 shows an example of a read image after reduction processing.
次いで、ステップSD3では、抽出部20gが、ステップSD2で縮小または拡大された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出する。図14の下側に、コード候補領域抽出画像の例を示している。尚、ステップSD2で縮小または拡大されていない場合には、ステップSD3で元の読取画像に対して抽出処理が実行されることになる。
Next, in step SD3, the extracting
その後、ステップSD4に進み、画像修復部20jが、ステップSD3で抽出されたコード候補領域に対応する部分画像をニューラルネットワークに入力して読取画像の修復を試行する。図15に修復前の読取画像と修復後の読取画像の例を示している。読取画像の修復後、ステップSD5~SD7を経てこのフローが終了する。ステップSD5~SD7は、図11に示すフローチャートのステップSC7~SC9と同じである。
After that, in step SD4, the
(実施形態の作用効果)
以上説明したように、この実施形態によれば、光学的情報読取装置1、1Aの運用時に、カメラ5により生成された読取画像をニューラルネットワークに入力すると、読取画像の修復が試行されるので、コードの読み取りに適した画像となるように修復された修復試行後の読取画像が得られる。この修復試行後の読取画像に対してデコード処理が実行されるので、読み取り精度が高まる。
(Action and effect of the embodiment)
As described above, according to this embodiment, when the read image generated by the
修復に利用されるニューラルネットワークは、複数の不良画像と複数の理想画像とを予め機械学習させることによって得られた構造及びパラメータによって構成されたものであることから、光学的情報読取装置1、1Aでは学習処理を行うことなく、ニューラルネットワークによる推論処理のみ行えばよく、これにより、プロセッサ20の演算負荷が軽くなる。その結果、手持ち式の光学的情報読取装置1Aの小型軽量化が可能になるとともに、定置式の光学的情報読取装置1の処理速度を高速化できる。
Since the neural network used for restoration is composed of a structure and parameters obtained by previously machine-learning a plurality of defective images and a plurality of ideal images, the
また、光学的情報読取装置1、1Aの運用時に、読取画像の中からコード候補領域が抽出されると、そのコード候補領域に対応する部分画像がニューラルネットワークに入力されて部分画像の修復が試行される。これにより、ニューラルネットワークに入力する画像のサイズが小さくなるので、プロセッサ20の演算負荷が軽くなり、ひいては処理速度の高速化が実現される。また、部分画像は、コードが存在する可能性が高い領域に対応しているので、読み取りに必要な情報、即ちコードの全体を含んだ画像とすることが可能である。このコードの全体を含んだ画像をニューラルネットワークに入力するので、読み取り精度の低下は抑制される。
When a code candidate area is extracted from the read image during operation of the
さらに、ニューラルネットワークの構造及びパラメータを生成する際に、コードを構成するモジュールのピクセル分解能が特定範囲内である不良画像及び理想画像を機械学習させるようにしているので、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させることができる。そして、読取画像の中のコードを構成するモジュールのピクセル分解能が特定範囲外にある場合には、特定範囲内となるように読取画像を拡大または縮小してからニューラルネットワークに入力するので、幅広いピクセル分解能のコードを含む画像の修復が可能になる。 In addition, when generating the structure and parameters of the neural network, machine learning is performed on defective images and ideal images in which the pixel resolution of the modules that make up the code is within a specific range, so it is possible to restore images containing codes. Processing speed can be improved as a specialized neural network structure. If the pixel resolution of the modules that make up the code in the read image is outside the specified range, the read image is enlarged or reduced so that it falls within the specified range before being input to the neural network. It enables restoration of images containing resolution codes.
(その他の実施形態)
図16は、その他の実施形態に係る光学的情報読取装置1の運用時における処理の手順の一例を説明する図である。この実施形態では、プロセッサ20により、前記画像修復部20jの他に、前処理部200と、後処理部201と、第1デコード処理部202と、第2デコード処理部203とが構成されている。前処理部200は、上記フィルタ処理部20cと同様に、カメラ5により生成された読取画像に対してノイズ除去フィルタ、コントラスト補正フィルタ、平均化フィルタ等を実行する部分である。
(Other embodiments)
FIG. 16 is a diagram for explaining an example of the processing procedure during operation of the
第1デコード処理部202は、カメラ5により生成された読取画像に対するデコード処理を実行する部分であり、この第1デコード処理部202によるデコード処理を第1デコード処理ともいう。プロセッサ20が複数のコア(N個のコア)を有している場合、そのうちのコア0~コアiによって第1デコード処理部202が構成される。1つのコアで第1デコード処理部202が構成されていてもよい。
The first
また、第2デコード処理部203は、画像修復部20jが生成した修復画像に対するデコード処理を実行する部分であり、この第2デコード処理部203によるデコード処理を第2デコード処理ともいう。プロセッサ20がN個のコアを有している場合、そのうちのコアi+1~コアN-1によって第2デコード処理部203が構成される。1つのコアで第2デコード処理部203が構成されていてもよい。
The second
図17にも示すように、コア0~コアiによって第1デコード処理部202が構成されている場合、コア0~コアiの各々がカメラ5により生成された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出した後、コードの輪郭やコードを構成しているモジュールの位置決め処理を実行し、その後、コードを構成している各モジュールが白であるか、黒であるかを判別し、デコード処理を実行する。処理結果は後処理部201に出力される。
As shown in FIG. 17, when the first
一方、図17に示すように、コアi+1~コアN-1によって第2デコード処理部203が構成されている場合、コアi+1~コアN-1の各々が、読取画像からコードが存在する可能性が高いコード候補領域を修復用コード領域として抽出するとともに、画像修復部20jに対し、推論処理を実行するようトリガ信号を送出する。この図17では、2つのコアによって1つのタスクを実行するように記載しているが、任意の1つ以上のコアによって1つのタスクを実行すればよい。
On the other hand, as shown in FIG. 17, when the second
具体的には、第2デコード処理部203を構成しているコアN-2及びコアN-1が修復用コード候補領域を抽出すると、トリガ信号(トリガ1)を画像修復部20jに出力し、画像修復部20jに対して推論処理を実行させる。画像修復部20jは、コアN-2及びコアN-1から送出されたトリガ信号(トリガ1)を受信すると、コアN-2及びコアN-1が抽出した修復用コード候補領域に対応する部分画像をニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行する(画像修復1)。画像修復1で生成した修復画像は、コアN-2及びコアN-1へ送られる。コアN-2及びコアN-1は、画像修復1で生成した修復画像に基づいてコードの各セル位置を示すグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコード処理を実行する。
Specifically, when the cores N-2 and N-1 constituting the second
一方、第2デコード処理部203を構成しているコアi+1及びコアi+2が修復用コード候補領域を抽出すると、トリガ信号(トリガ2)を画像修復部20jに出力し、画像修復部20jに対して推論処理を実行させる。画像修復部20jは、コアi+1及びコアi+2から送出されたトリガ信号(トリガ2)を受信すると、コアi+1及びコアi+2が抽出した修復用コード候補領域に対応する部分画像をニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行する(画像修復2)。画像修復2で生成した修復画像は、コアi+1及びコアi+2へ送られる。コアi+1及びコアi+2は、画像修復2で生成した修復画像に基づいてコードの各セル位置を示すグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコード処理を実行する。
On the other hand, when the core i+1 and core i+2 constituting the second
以下、同様にして、コアN-2及びコアN-1から送出されたトリガ信号(トリガ3)により画像修復3が実行され、コアi+1及びコアi+2から送出されたトリガ信号(トリガ4)により画像修復4が実行され、コアN-2及びコアN-1から送出されたトリガ信号(トリガ5)により画像修復5が実行され、コアi+1及びコアi+2から送出されたトリガ信号(トリガ6)により画像修復6が実行され、コアN-2及びコアN-1から送出されたトリガ信号(トリガ7)により画像修復7が実行される。
Thereafter, in the same manner,
このタイムチャートに示すように、画像修復部20jによる推論処理と第1デコード処理部202による第1デコード処理とは並列的に実行される。例えば、第1デコード処理部202がコード領域抽出、グリッド位置決め、デコード処理を継続して行う間、画像修復部20jによる推論処理が1回または複数回実行される。また、第1デコード処理部202がコード領域抽出、グリッド位置決め、デコード処理を継続して行う間、第2デコード処理部203による修復用コード領域の抽出、トリガ信号の出力、グリッド位置決め、第2デコード処理が実行される。このように、画像修復部20jは、修復用コード候補領域に対応する部分画像の修復に特化すればよいので、推論処理速度を高速化できる。
As shown in this time chart, the inference processing by the
第2デコード処理部が第2デコード処理を実行している期間の少なくとも一部は、画像修復部20jによる推論処理が実行されない休止期間を有している。すなわち、図17に示すように、画像修復部20jの画像修復1の終了後、第2デコード処理部203が第2デコード処理を開始するのであるが、画像修復部20jが次の画像修復2を開始するまでの間に、所定の期間が設けられており、この所定の期間は、画像修復部20jが画像修復を行わない休止期間とされている。この休止期間は画像修復部20jが推論処理を行わない期間であり、休止期間を設けることにより、画像修復部20jの負荷を低減して、AIチップ23の発熱を抑制できる。なお、グリッド位置決めの処理時間は、処理対象の修復画像によって長い場合や短い場合が存在する。図17では各コアの処理が交互に実行される例を記載しているが、グリッド位置決めの処理時間によっては、各コアの処理は必ずしも交互に実行されない。すなわち、処理が空いているコアから順にトリガ発出や、グリッド位置決めを実行してもよい。
At least part of the period during which the second decoding processing section is executing the second decoding processing has a pause period during which the inference processing by the
上述したように、設定部20eは、「画像修復フィルタの適用」と「画像修復フィルタの非適用」との一方をユーザが選択可能に構成されている。画像修復フィルタを適用するということは、画像修復を行うということであり、また、画像修復フィルタを非適用にするということは、画像修復を行わないということなので、設定部20eは、第2デコード処理部203が第2デコード処理を実行するか否かを設定する部分にも相当する。この設定はユーザによって実行されるので、設定部20eはユーザによる操作を受け付けることができるように構成されている。画像修復フィルタの適用、非適用という設定形態に限定されるものではなく、例えば推論処理(修復処理)の適用、非適用、AIによる処理の適用、非適用といった設定形態であってもよい。ユーザによる操作は、例えばユーザインターフェース画面に表示したボタン等の操作を挙げることができる。
As described above, the
光学的情報読取装置1では、露光時間やゲインなどの撮像条件、画像処理フィルタなどの設定をあらかじめ決定するチューニング処理行ってから運用される。例えばワークWがラベルのような場合では、コードが鮮明に印字されているので、チューニング処理により適切な条件設定がなされれば、高い読み取り率を実現できる。しかし、金属や樹脂などのワークWにおいては、チューニング処理時の最適な条件が設定されるものの、微弱な外乱光による読取画像の変化などが原因で読み取りにくい状態になったり、そもそも光学設計とアルゴリズム設計上、超低コントラストで読み取れないケースが発生してしまうことがある。
The optical
本例の画像修復部20jが実行する画像修復アルゴリズムを、画像修復しないでデコード処理する場合と並列に実施することで、従来の読み取り性能を維持しながら金属や樹脂などのワークWに対しての読み取り性能を向上させ、読み取り安定性を高めることができる。また、従来の光学設計とアルゴリズムでは読めないワークWに対しても、画像修復アルゴリズムを適用することにより読み取りが可能になる。
By executing the image restoration algorithm executed by the
具体例を示すと、ある工場で箱に付されたシール上に印字されたコードを読み取る工程で、光学的情報読取装置1の設置条件に制約がなく、最適な設置が可能な場合においては、従来の読み取り性能でも安定した運用が可能であることから、画像修復フィルタを非適用にしてタクトを優先することができる。
To give a specific example, in the process of reading a code printed on a sticker attached to a box in a certain factory, if there are no restrictions on the installation conditions of the
また、ある工場において、金属にはっきりと印字されたコードを読み取る工程があり、読み取り設定時のチューニング処理においては最適な条件が決定されるものの、実際に運用してみると、金属表面の傷、読み取り位置・角度のばらつき、周囲環境の明るさ変化などで読み取りが不安定になるケースがある。このようなケースでは、画像修復フィルタを適用して、画質改善することで、上記のような条件のばらつきに強くなり、読み取り性能が向上する。 Also, in a certain factory, there is a process to read codes clearly printed on metal, and although the optimum conditions are determined in the tuning process at the time of reading setting, when actually operating, scratches on the metal surface, In some cases, reading may become unstable due to variations in reading position/angle, changes in the brightness of the surrounding environment, etc. In such a case, by applying an image restoration filter to improve the image quality, it becomes resistant to the above-described variations in conditions, and the reading performance is improved.
また、一部のワークでは、従来のアルゴリズムでの読み取りが不可能であるが、そのようなケースでは画像修復フィルタを適用することで、読み取りができるようになるケースがある。例えば、コードの損傷が著しかったり、コントラストが明確でない場合でも、画像修復フィルタを適用することによって、コントラストや傷を修復し、読み取りが可能になる。 Also, some workpieces cannot be read by the conventional algorithm, but in such cases, applying an image restoration filter may make it possible to read them. For example, even if the code is severely damaged or the contrast is not clear, by applying an image restoration filter, the contrast and flaws can be restored and the code can be read.
画像修復フィルタを適用した場合に実行される第2デコード処理は、修復画像に対してデコード処理を実行するため、通常の読取画像のデコード処理を実行する第1デコード処理に比べて処理にかかる時間が長い場合が多い。したがって、第1デコード処理部202は、第2デコード処理部203による第2デコード処理にかかる時間よりも短い時間で第1デコード処理を実行可能である。本例では、このことを前提とし、デコード処理の制限時間である、デコードタイムアウト時間を設定部20eが変更可能になっている。
Since the second decoding process executed when the image restoration filter is applied executes the decoding process on the restored image, it takes longer time than the first decoding process which executes the decoding process of the normal read image. is often long. Therefore, the first
具体的には、設定部20eは、第2デコード処理を実行すると設定されている場合は、第2デコード処理の実行に必要な時間よりも長いデコードタイムアウト時間を設定可能に構成されるとともに、第2デコード処理を実行しないと設定されている場合は、第2デコード処理の実行に必要な時間よりも短いデコードタイムアウト時間を設定可能に構成されている。これにより、運用時には、第2デコード処理を実行する場合、一般的な第2デコード処理の実行に必要な時間よりも長いデコードタイムアウト時間を設定することができるので、修復画像に対するデコード処理を確実に実行できる。一方、第2デコード処理を実行しないと設定されている場合は、一般に第2デコード処理よりも短い時間でデコード処理が可能な第1デコード処理のみを実行することになるので、第1デコード処理に対応した短いデコードタイムアウト時間を設定できる。このようにデコードタイムアウト時間を変更することで、第1デコード処理及び第2デコード処理のそれぞれに対応したデコードタイムアウト時間にすることができる。
Specifically, when the
また、図17では、第1デコード処理部202と第2デコード処理部203とを別にしているが、図18に示すように、第1デコード処理部202と第2デコード処理部203とをまとめてデコード処理部210としてもよい。デコード処理部210は、カメラ5により生成された読取画像に対する第1デコード処理と並列に、修復画像に対する第2デコード処理を実行する。このようにデコード処理を実行する部分は、ハードウエア上で任意に分けることもできるし、統合することもできる。以下、デコード処理を実行する部分を1つに統合した例で説明するが、これに限らず、複数に分けた場合にも同様に適用できる。
17, the first
デコード処理部210は、設定部20eにより第2デコード処理を実行しないと設定されている場合には、第2デコード処理に使われる処理のリソースを第1デコード処理に振り分け、第2デコード処理を実行すると設定されている場合に比べ、第1デコード処理を高速化するように構成されている。処理のリソースとは、例えばメモリの使用領域や、マルチコアCPUを構成しているコア等である。具体的には、第2デコード処理を実行しないと設定されている場合には、第2デコード処理を実行すると設定されている場合に比べて、第1デコード処理を受け持つコアの数を多くする。また、第2デコード処理を実行しないと設定されている場合には、第2デコード処理を実行すると設定されている場合に比べて、第1デコード処理で使用するメモリの領域を拡大する。コアの数を多くすることと、メモリの領域を拡大することとは、併用してもよいし、いずれか一方のみ実行してもよい。これにより、マルチコアCPUの性能を最大限に引き出して第1デコード処理を高速化できる。
When the
デコード処理部210は、画像修復に先立ち、読取画像からコードが存在する可能性が高いコード候補領域を抽出する。すなわち、ニューラルネットワークを用いた画像修復時に当該ニューラルネットワークに入力する画像が大きいと演算時間が長時間化してしまうという問題がある。また、処理の高速化の観点からは、デコードの試行回数もできるだけ少なくしたい。これらのことに対し、本例では、コード候補領域を多少時間がかかっても確実に抽出可能にするために、ラインサーチベースではなく、ヒートマップベースのサーチ手法を採用している。例えば、デコード処理部210は、コードの特徴量を定量化し、特徴量の大きさを各画素値に割り当てたヒートマップを生成し、当該ヒートマップ上で、コードが存在する可能性が高いコード候補領域を抽出する。具体例としては、ヒートマップにおいて相対的に熱く(特徴量が大きく)示されている領域で2次元コードの特徴部分(例:ファインダパターン等)を取得する方法がある。特徴部分が複数取得された場合には、優先づけをして抽出し、RAM41や記憶部30等に記憶させておくことができる。
The
デコード処理部210がコード候補領域を抽出した後、抽出したコード候補領域に対応する部分画像を画像修復部20jに出力する。画像修復部20jは、デコード処理部210が抽出したコード候補領域に対応する部分画像をニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行する。これにより、演算時間を短縮できる。
After the
また、デコード処理部210は、上述したチューニング処理により設定された読取対象のコードを包含できるサイズで、かつ読取画像の中でコードが存在する可能性が高いコード候補領域を抽出し、当該抽出された画像を、予め定められたサイズとなるように縮小又は拡大してからニューラルネットワークに入力し、当該ニューラルネットワークで修復した修復画像をデコードするように構成されていてもよい。抽出された画像を予め定められたサイズの画像に拡大・縮小してニューラルネットワークに入力することで、ニューラルネットワークに入力されるコード画像のPPCを所定の範囲内に収めることができ、ニューラルネットワークによる画像修復効果を安定的に引き出すことができる。また、読取対象のコードサイズは様々であることが考えられるが、最終的にニューラルネットワークに入力されるコードのサイズを固定できるので、処理の高速性とデコードのし易さのバランスを一定以上に保つことができる。
Further, the
以下、第1デコード処理及び第2デコード処理のフローチャートについて、図19に基づいて詳細に説明する。スタート後のステップSE1では、プロセッサ20がカメラ5に読取画像を生成させ、読取画像を取得する。ステップSE1で取得された読取画像は、デコード処理部210に入力される。ステップSE2では、ステップSE1で取得された読取画像に対して画像修復を施すことなく、第1デコード処理を実行する。第1デコード処理が成功すれば、ステップSE4に進んで終了処理、即ちデコード結果の出力処理を実行する。ステップSE2で第1デコード処理が失敗すれば、ステップSE2に戻り、第1デコード処理を再度実行する。所定のデコードタイムアウト時間が経過すると、当該読取画像に対する第1デコード処理を中止する。
Flowcharts of the first decoding process and the second decoding process will be described in detail below with reference to FIG. At step SE1 after the start, the
一方、ステップSE1からステップSE5に進むルートでは、デコード処理部210が読取画像から修復用コード領域を抽出する。具体的には、チューニング処理により設定された読取対象のコードを包含できるサイズで、かつ読取画像の中でコードが存在する可能性が高いコード候補領域を抽出する。このとき、修復用コード領域が複数抽出された場合には、候補領域R1、R2、…として一時的に保存しておく。抽出された修復用コード領域の一例を図20に示す。その後、ステップSE6に進み、kの値を1にしておく。
On the other hand, in the route from step SE1 to step SE5, the
ステップSE7では、候補領域Rkに対応する部分画像に対してリサイズ処理を実行する。リサイズ処理は、ステップSE5で抽出された修復用コード領域に対応する部分画像を、予め定められたサイズとなるように縮小又は拡大する処理である。このリサイズ処理により、後述するニューラルネットワークに入力する画像の大きさを予め所定の大きさにしておくことができる。図20に示す例では、ニューラルネットワークに入力する部分画像の大きさが256ピクセル×256ピクセルである場合について示しているが、部分画像の大きさはこれに限られるものではなく、処理速度等を勘案して任意の大きさにリサイズすることができる。 At step SE7, the partial image corresponding to the candidate area Rk is resized. The resizing process is a process of reducing or enlarging the partial image corresponding to the restoration code area extracted in step SE5 to a predetermined size. With this resizing process, the size of an image to be input to a neural network, which will be described later, can be set to a predetermined size in advance. In the example shown in FIG. 20, the size of the partial image to be input to the neural network is 256 pixels×256 pixels. You can resize it to any size you want.
ステップSE8では、白黒反転設定が「両方」になっているか否かを判定する。すなわち、画像修復は、数学的には写像を行っているだけであり、白から黒、黒から白、黒から黒、白から白の写像を単一のニューラルネットワークで実現することは難易度が高い場合がある。そのため、白地に黒印字された画像となるようにプロパティに基づいて白黒反転処理を実行する。ニューラルネットワークの学習のさせ方によっては、黒地に白印字された画像であってもよい。白黒反転処理の一例を図20に示す。白黒反転処理の詳細については後述する。 At step SE8, it is determined whether or not the black/white reversal setting is "both". In other words, image inpainting is only a mapping mathematically, and it is difficult to realize white-to-black, black-to-white, black-to-black, and white-to-white mappings with a single neural network. can be expensive. Therefore, black-and-white reversal processing is executed based on the property so that the image is printed in black on a white background. Depending on how the neural network is trained, the image may be printed in white on a black background. FIG. 20 shows an example of black-and-white reversal processing. Details of the black-and-white reversal processing will be described later.
ステップSE8でYESと判定されて白黒反転設定が「両方」になっている場合にはステップSE9に進み、リサイズ処理後の画像を画像修復部20jに入力して画像修復を実行する。その後、ステップSE10に進み、デコード処理部210が修復後の画像に対して第2デコード処理を実行する。ステップSE10で第2デコード処理が成功すれば、ステップSE4に進んで終了処理を実行する。ステップSE10で第2デコード処理が失敗すれば、ステップSE11に進み、リサイズ処理後の画像を白黒反転処理する。その後、ステップSE11で白黒反転処理後の画像を画像修復部20jに入力して画像修復を実行する(図20参照)。次いで、ステップSE13に進み、デコード処理部210が修復後の画像に対して第2デコード処理を実行する。ステップSE13で第2デコード処理が成功すれば、ステップSE4に進んで終了処理を実行する。ステップSE13で第2デコード処理が失敗すれば、ステップSE14に進む。ステップSE14では、ステップSE5で抽出した候補領域がまだあるか否かを判定し、候補領域がない場合にはステップSE4に進んで終了処理を実行する。
If the determination in step SE8 is YES and the black/white inversion setting is set to "both", the process proceeds to step SE9, and the image after resizing is input to the
一方、ステップSE8でNOと判定されて白黒反転設定が「両方」になっていない場合にはステップSE15に進み、白黒反転設定が「OFF」になっているか否かを判定する。ステップSE15でNOと判定されて白黒反転設定が「OFF」になっていない場合には、ステップSE16に進んでリサイズ処理後の画像を白黒反転する処理する。その後、ステップSE17で白黒反転処理後の画像を画像修復部20jに入力して画像修復を実行する。次いで、ステップSE18に進み、デコード処理部210が修復後の画像に対して第2デコード処理を実行する。ステップSE18で第2デコード処理が成功すれば、ステップSE4に進んで終了処理を実行する。ステップSE18で第2デコード処理が失敗すれば、ステップSE14に進む。ステップSE14で候補領域がまだあるか否かを判定し、候補領域がない場合にはステップSE4に進んで終了処理を実行する。
On the other hand, if NO is determined in step SE8 and the black/white inversion setting is not "both", the process proceeds to step SE15 to determine whether or not the black/white inversion setting is "OFF". If NO is determined in step SE15 and the black/white inversion setting is not "OFF", the process proceeds to step SE16 to invert the black/white of the resized image. After that, in step SE17, the image after black-and-white inversion processing is input to the
ステップSE14で候補領域がまだあると判定された場合には、ステップSE19に進み、kの値に1を加えてステップSE7に進む。ステップSE7では、前回のフローからkの値が1つ増えているので、次の候補領域Rkに対応する部分画像に対して同様にリサイズ処理を実行する。ステップSE8以降は上述したとおりである。つまり、第1デコード処理または第2デコード処理の一方でデコードが成功すれば、成功した時点でデコード結果を出力して他の候補領域に対するデコード処理は行わず、次のワークWを撮像した読取画像を取得し、同様な処理を実行する。 If it is determined in step SE14 that there is still a candidate area, the process proceeds to step SE19, adds 1 to the value of k, and proceeds to step SE7. At step SE7, since the value of k is increased by one from the previous flow, the partial image corresponding to the next candidate region Rk is similarly resized. Step SE8 and subsequent steps are as described above. That is, if the decoding is successful in either the first decoding process or the second decoding process, the decoding result is output at the time of success, and the decoding process is not performed for the other candidate areas, and the read image of the next work W is picked up. and perform similar processing.
図20に示す後処理部201は、リサイズ処理後に画像修復していない部分画像と、リサイズ処理後に画像修復部20jが画像修復した部分画像とを合成する処理を実行する。すなわち、ニューラルネットワークを用いた画像修復では、修復前のコードが人間の目視で確認できるのに、画像修復がうまくいかないことや、画像修復するとセルが丸くなることが起こり得る。これらのことに対して、画像修復していない部分画像と、画像修復した部分画像とを適切な割合で重ね合わせると、その後のデコード処理が容易になる場合がある。画像修復していない部分画像と、画像修復した部分画像とを重ね合わせる割合は、所定の固定値であってもよいし、固定値以外であってもよく、例えば画像修復部20jによるの修復の安定度に基づいて、読み取り時に動的に、あるいは事前評価(チューニング)で最適化して決定してもよい。例えば事前評価において、その割合をユーザがスケールバー等で調整可能にし、合成後の画像をユーザに提示しながら調整が行えるようにしてもよい。
The
(バンク切り替え機能)
本実施形態では、例えばカメラ5の撮像条件を構成するパラメータ及びデコード処理部210における処理条件等を構成するパラメータがセットになったパラメータセットを上記パラメータセット記憶部30cに記憶することができるように構成されている。パラメータセットは、バンクと呼ぶことができる。バンクは複数設けられており、それぞれに異なるパラメータが記憶されている。例えば、パラメータセット記憶部30cには、チューニング実行部20dにより設定された第1の撮像条件及びコード条件と、第2の撮像条件及びコード条件とを含む複数の撮像条件及びコード条件とがそれぞれ別のパラメータセットとして記憶されている。
(Bank switching function)
In the present embodiment, for example, the parameter set
この光学的情報読取装置1では、パラメータセット記憶部35cに記憶されている複数のパラメータセットのうち、第1の撮像条件及びコード条件を含む一のパラメータセットから、第2の撮像条件及びコード条件を含む他のパラメータセットへ切り替えることや、その反対の切り替えができるように構成されている。パラメータセットの切替は、プロセッサ20が行うことや、ユーザが行うこともできるし、PLC101等の外部制御装置からの切替信号によって行うように構成することもできる。パラメータセットの切替をユーザが行う場合には、例えばユーザインターフェースに組み込まれているパラメータセット切替部を操作すればよい。パラメータセット切替部を「有効」にすることで、そのバンクのパラメータセットが光学的情報読取装置1の運用時に使用され、また、パラメータセット切替部を「無効」にすることで、そのバンクのパラメータセットが光学的情報読取装置1の運用時に使用されないようになる。つまり、パラメータセット切替部は、一のパラメータセットから他のパラメータセットに切り替えるためのものである。
In this optical
本例のデコード処理部210は、一のパラメータセットを使用して運用している時に、修復画像に対する第2デコード処理に失敗すると、他のパラメータセットに切り替えてから、別の条件で撮像された読取画像に対して画像修復、第2デコード処理を実行する。例えば、デコード処理部210が第2デコード処理に失敗したことを検出すると、現在しているパラメータセット以外のパラメータセットに切り替えた後、画像修復、第2デコード処理を実行し、このパラメータセットでも第2デコード処理に失敗したことを検出すると、これまで使用していない他のパラメータセットに切り替えた後、画像修復、第2デコード処理を実行する。パラメータセットを切り替えると、カメラ5の撮像条件だけなく、読取対象のコードサイズも変更される場合があり、この場合にはコードが存在する可能性が高いコード候補領域を抽出する際のサイズも変わることになる。その結果、ニューラルネットワークに入力する画像の縮小率又は拡大率も変わり、画像修復の結果も変わることになる。
When the
(白黒反転対応)
次に、図21及び図22に基づいてコードの白黒反転対応について説明する。図21は、2つのニューラルネットワーク、即ち、白地に黒印字のコードで学習したニューラルネットワークと、黒地に白印字のコードで学習したニューラルネットワークとを用いてコードの白黒反転に対応する場合について説明する図である。FIG.21Aは、読取画像(左端の画像)を、白地に黒印字のコードで学習したニューラルネットワークと、黒地に白印字のコードで学習したニューラルネットワークとにそれぞれ入力し、各ニューラルネットワークからデコード結果を出力させる方式を示しており、この方式を並行実施方式と呼ぶ。読取画像は、白地に黒印字のコードを撮像した画像なので、白地に黒印字のコードで学習したニューラルネットワークによる修復画像ではデコード処理に成功するが、黒地に白印字のコードで学習したニューラルネットワークによる修復画像ではデコード処理に失敗する。
(Supports black and white inversion)
Next, correspondence to white/black inversion of codes will be described with reference to FIGS. 21 and 22. FIG. FIG. 21 illustrates a case where two neural networks, namely, a neural network trained with a code printed in black on a white background and a neural network trained with a code printed in white on a black background, are used to handle black-and-white inversion of a code. It is a diagram. FIG. 21A inputs the read image (leftmost image) to a neural network trained with a black-on-white code and a neural network trained by a white-on-black code, and outputs decoded results from each neural network. This method is called a parallel execution method. Since the read image is an image of a black-printed code on a white background, decoding is successful in the restored image by a neural network trained with a black-printed code on a white background, but the decoded image is successfully decoded by a neural network trained with a white-printed code on a black background. Decoding fails on the restored image.
FIG.21Bは、読取画像(左端の画像)を、まず、黒地に白印字のコードで学習したニューラルネットワークのみに入力し、修復画像のデコード処理を試みる。デコード処理に失敗した場合のみ、読取画像を、白地に黒印字のコードで学習したニューラルネットワークに入力して修復画像を生成する。この方式は、失敗後に別ネットワークを使用する方式である。 FIG. 21B first inputs the read image (the image at the left end) only to the neural network trained with the white-on-black code, and attempts to decode the restored image. Only when the decoding process fails, the read image is input to a neural network that has been trained with black-on-white code to generate a restored image. This method is a method of using another network after a failure.
FIG.21Cは、ユーザによる設定に基づいて、読取画像を入力するニューラルネットワークを選択する方式である。左側に示すケースは、読取画像が白地に黒印字のコードを撮像した画像であると設定されている場合である。この場合、ネットワーク選択モジュールが白地に黒印字のコードで学習したニューラルネットワークを選択する。そして、読取画像(左端の画像)を白地に黒印字のコードで学習したニューラルネットワークに入力する。一方、右側に示すケースは、読取画像が黒地に白印字のコードを撮像した画像であると設定されている場合である。この場合、ネットワーク選択モジュールが黒地に白印字のコードで学習したニューラルネットワークを選択する。そして、読取画像(左端の画像)を黒地に白印字のコードで学習したニューラルネットワークに入力する。 FIG. 21C is a method of selecting a neural network for inputting a read image based on user settings. The case shown on the left side is a case where the read image is set to be an image of a black-printed code on a white background. In this case, the network selection module selects a neural network trained with black-on-white code. Then, the read image (image at the left end) is input to a neural network that has been trained with black-printed codes on a white background. On the other hand, the case shown on the right side is a case where the read image is set to be an image of a white-printed code on a black background. In this case, the network selection module selects a neural network trained with white-on-black code. Then, the read image (image at the left end) is input to a neural network that has been trained with white-printed code on a black background.
図22は、1つのニューラルネットワークのみを用いてコードの白黒反転に対応する場合について説明する図である。FIG.22Aでは、読取画像(左端の画像)を白黒反転処理することにより、白黒反転画像を生成する場合について示している。白黒反転処理しない画像と、白黒反転処理した画像とをそれぞれ白地に黒印字のコードで学習したニューラルネットワークに入力する。読取画像は、黒地に白印字のコードを撮像した画像なので、白地に黒印字のコードで学習したニューラルネットワークによる修復画像ではデコード処理に失敗するが、白黒反転処理した後の画像を使用することで、デコード処理に成功する。 FIG. 22 is a diagram for explaining a case where only one neural network is used to handle code inversion. FIG. 22A shows a case where a black-and-white inverted image is generated by subjecting the read image (image at the left end) to black-and-white inversion processing. An image without white-black reversal processing and an image with black-white reversal processing are input to a neural network that has been trained with a code for black printing on a white background, respectively. Since the read image is an image of a white-printed code on a black background, the decoding process fails with the restored image by the neural network trained with the black-printed code on a white background. , the decoding process succeeds.
FIG.22Bの上に示す例では、読取画像(左端の画像)が黒地に白印字されたコードの画像であるため、白地に黒印字のコードで学習したニューラルネットワークに入力すると、デコード処理に失敗する。その後、白黒反転処理した画像を生成して白地に黒印字のコードで学習したニューラルネットワークに入力すると、デコード処理に成功する。 FIG. In the example shown in the upper part of 22B, the read image (leftmost image) is an image of a code printed in white on a black background. After that, a black-and-white reversed image is generated and input to a neural network that has learned black-on-white code, and the decoding process succeeds.
FIG.22Bの下に示す例では、読取画像(左端の画像)が白地に黒印字されたコードの画像であるため、黒地に白印字のコードで学習したニューラルネットワークに入力すると、デコード処理に失敗する。その後、白黒反転処理した画像を生成して黒地に白印字のコードで学習したニューラルネットワークに入力すると、デコード処理に成功する。 FIG. In the example shown below 22B, the read image (leftmost image) is an image of a code printed in black on a white background, so if it is input to a neural network trained with a code printed in white on a black background, the decoding process fails. After that, a black-and-white reversed image is generated and input to a neural network that has learned a white-on-black code, and the decoding process succeeds.
FIG.22Cは、ユーザによる設定に基づいて、白黒反転処理を実行するか否かを決定する方式である。上側に示すケースは、読取画像が白地に黒印字のコードを撮像した画像であると設定されている場合である。この場合、白黒反転処理モジュールが白黒反転処理を実行することなく、そのまま白地に黒印字のコードで学習したニューラルネットワークに入力する。一方、下側に示すケースは、読取画像が黒地に白印字のコードを撮像した画像であると設定されている場合である。この場合、白黒反転処理モジュールが白黒反転処理を実行する。そして、白黒反転処理した画像を白地に黒印字のコードで学習したニューラルネットワークに入力する。 FIG. 22C is a method for determining whether or not to execute black-and-white reversal processing based on user settings. The case shown on the upper side is a case where the read image is set to be an image of a black-printed code on a white background. In this case, the black-and-white reversal processing module does not perform the black-and-white reversal processing, but directly inputs to the neural network that has learned the code for black printing on a white background. On the other hand, the case shown on the lower side is a case where the read image is set to be an image of a white-printed code on a black background. In this case, the black-and-white reversal processing module performs the black-and-white reversal processing. Then, the black-and-white reversed image is input to a neural network that has been trained with black-printed code on a white background.
(コントラストとマッチングレベルの関係)
マッチングレベルは、例えばチューニング時のスコアとして使用したり、運用時の印字品質/読み取り性能の管理に使用される。例えば、マッチングレベルは0~100の正の整数値で定義されており、50以上では読み取り率テストを実施した場合に読み取り率100%になるように設計することができる。また、マッチングレベル0は読み取れない場合、マッチングレベル1は読み取れる場合の最低値である。
(Relationship between contrast and matching level)
The matching level is used, for example, as a score during tuning, or for managing print quality/reading performance during operation. For example, the matching level is defined as a positive integer value from 0 to 100, and if it is 50 or higher, it can be designed so that the read rate is 100% when a read rate test is performed. Also, matching
図23は、コントラストとマッチングレベルの関係を示すグラフであり、実線は画像修復部20jにより画像修復された画像(修復画像)のコントラストとマッチングレベルの関係を示し、また、破線は画像修復部20jにより画像修復していない画像(読取画像)のコントラストとマッチングレベルの関係を示している。このグラフから明らかなように、修復画像のマッチングレベルは読取画像のマッチングレベルよりも全体的に高くなっているが、ある一定以上画質が悪化すると、マッチングレベルが急激に低下してしまう。
FIG. 23 is a graph showing the relationship between the contrast and the matching level. The solid line shows the relationship between the contrast of the image (repaired image) restored by the
(マッチングレベルの算出処理)
マッチングレベルはアルゴリズムごとに設定されており、一般的には1コード種につき、1つのアルゴリズムである。しかしながら、本実施形態では、画像修復機能の搭載により、1つのコード種で2つのアルゴリズム(画像修復するアルゴリズムと、画像修復しないアルゴリズム)が実行される。この2つのアルゴリズムのうち、デコード処理が早く成功した方の結果が出力されるため、仮に、2つのアルゴリズムで交互にデコード処理に成功するケースにおいてはマッチングレベルの値が不安定になるおそれがある。また、画像修復を実行することで読み取りやすい画像になるため、従来と類似したマッチングレベルの算出方法ではマッチングレベルが既存のものと比較して高くなりやすい。これらのことに対し、本実施形態では、2つのアルゴリズムのマッチングレベルの重みづけ和をとり、マッチングレベルの値を調整するようにした。以下、具体例について、図24に示すフローチャートに基づいて説明する。
(Matching level calculation process)
The matching level is set for each algorithm, generally one algorithm per code type. However, in this embodiment, two algorithms (an image restoration algorithm and an image restoration algorithm not executed) are executed with one code type by installing the image restoration function. Of these two algorithms, the result of the one whose decoding process succeeds earlier is output, so if the decoding process succeeds alternately with the two algorithms, the value of the matching level may become unstable. . In addition, since the image can be easily read by executing the image restoration, the matching level is likely to be higher than the existing one in the matching level calculation method similar to the conventional one. For these reasons, in the present embodiment, the weighted sum of the matching levels of the two algorithms is calculated, and the value of the matching level is adjusted. A specific example will be described below based on the flowchart shown in FIG.
スタート後のステップSF1では読取画像をデコード処理部210に入力する。ステップSF2では、画像修復することなく、デコード処理部210が第1デコード処理を実行する。ステップSF3では、第1デコード処理によるマッチングレベルA(MLA)を算出する。一方、ステップSF4では、読取画像を画像修復部20jに入力して画像修復処理を実行する。その後、ステップSF5に進み、修復画像に対してデコード処理部210が第2デコード処理を実行する。ステップSF6では、第2デコード処理によるマッチングレベルB(MLB)を算出する。尚、ステップSF2でデコードに成功しなかった場合にはMLA=0となり、またステップSF5でデコードに成功しなかった場合にはMLB=0となる。
In step SF1 after the start, the read image is input to the
ステップSF7では、例えば平均化関数等を用いてMLAとMLBの値を調整する。また、ステップSF2、SF5のどちらでデコードに成功しても、MLAの値に重みを付ける処理を行う。 In step SF7, the values of MLA and MLB are adjusted using, for example, an averaging function. Further, even if the decoding is successful in either step SF2 or SF5, a process of weighting the value of MLA is performed.
(ユーザインターフェースの例)
図25は、表示部6に表示されるユーザインターフェース300の例を示す図である。プロセッサ20は、ユーザインターフェース300を生成し、表示部6に表示させる。ユーザインターフェース300には、カメラ5で現在撮像されている画像(ライブビュー画像)が表示される第1画像表示領域301と、読取画像が表示される第2画像表示領域302と、画像修復部20jにより修復された修復画像が表示される第3表示領域303とが設けられている。これにより、読取画像と修復画像とを比較可能な形態でユーザに提示できる。また、デコード処理が実行される画像、またはデコード処理が実行された後の画像がどのような画像であるかをユーザが把握できる。
(Example of user interface)
FIG. 25 is a diagram showing an example of a
(AIチップ付き撮像素子の例)
図26は、AIチップ付き撮像素子5aを用いた例を示す図であり、各図に示すようにカメラ5の撮像素子5aを構成することができる。FIG.26Aは、撮像素子5aに画像修復を実行するAIチップを設けてパッケージ化した場合を示す図であり、読取画像を画像修復した後に、プロセッサ20に出力する。また、FIG.26Bは、撮像素子5aに、修復用コード領域の抽出と、画像修復とを実行するAIチップを設けてパッケージ化した場合を示す図であり、読取画像の中から修復用コード領域を抽出した後、当該領域に対応する部分画像を画像修復した後に、プロセッサ20に出力する。また、FIG.26Cは、撮像素子5aに、修復用コード領域の抽出を実行するAIチップを設けてパッケージ化した場合を示す図であり、読取画像の中から修復用コード領域を抽出した後、当該領域に対応する部分画像をプロセッサ20に出力する。
(Example of image sensor with AI chip)
FIG. 26 is a diagram showing an example using an AI chip-equipped
また、FIG.26Aに示す例において、撮像素子5aで取得した読取画像をプロセッサ20に出力するとともに、AIチップによって画像修復を実行し、修復画像をプロセッサ20に出力してもよい。FIG.26B,FIG.26Cに示す例についても同様である。
Also, FIG. In the example shown in 26A, the read image acquired by the
(偏光フィルタアタッチメント3)
本実施形態では、図2に示すように、少なくともコードを照明する照明光を発生する光源として複数の発光ダイオードからなる第1照明部4a及び第2照明部4bを備えている。偏光フィルタアタッチメント3は、第2照明部4bを構成する発光ダイオードで発生した光のうち、第1の偏光成分の光を通過させる第1偏光板3aと、第1の偏光成分と略直交する第2の偏光成分の光を通過させる第2偏光板3bとを備えている。第1偏光板3a及び第2偏光板3bは、図2中、斜線を引いた範囲にそれぞれ設けることができ、例えば、第1偏光板3aは、第2照明部4bを覆うように配置され、また、第2偏光板3bは、カメラ5の光学系5bを光の入射側から覆うように配置されている。
(Polarizing filter attachment 3)
In the present embodiment, as shown in FIG. 2, a
したがって、カメラ5は、第1偏光板3aを通過し、ワークWの表面(コード)から反射した光を、第2偏光板3bを介して受光する。これにより、ワークWの正反射成分が除去され、第1偏光板3a及び第2偏光板3bを介さない場合に比べて低コントラストな読取画像をカメラ5が生成する。この低コントラストな読取画像をプロセッサ20が取得する。プロセッサ20は、低コントラストな読取画像をニューラルネットワークに入力することにより、入力前に比べて高コントラストな修復画像に変換し、当該修復画像に対してデコード処理を実行する。
Therefore, the
すなわち、偏光板3a、3bを使用することで、ワークWの正反射成分が除去されるので、正反射成分の影響が軽減された読取画像を取得できる。例えば金属ワークを撮像した場合のように正反射成分が多くなる画像に偏光板3a、3bは適しているものの、光量の低下によって読取画像が暗くなり、コントラストが低下することがある。このような場合に、ニューラルネットワークの推論処理によって高コントラストな修復画像に変換することで、読取性能が向上する。
That is, by using the
上述の実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈してはならない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内のものである。 The above-described embodiments are merely examples in all respects and should not be construed in a restrictive manner. Furthermore, all modifications and changes within the equivalent range of claims are within the scope of the present invention.
以上説明したように、本発明に係る光学的情報読取装置は、例えばワークに付されたコードを読み取る場合に利用することができる。 INDUSTRIAL APPLICABILITY As described above, the optical information reader according to the present invention can be used, for example, to read a code attached to a work.
1 定置式の光学的情報読取装置
1A 手持ち式の光学的情報読取装置
2 ハウジング
2A 手持ち式のハウジング
2B 把持部
5 カメラ
20 プロセッサ
20c フィルタ処理部
20d チューニング実行部
20e 設定部
20f デコード処理部
20g 抽出部
20h 縮小部
20i 拡大部
20j 画像修復部
30 記憶部
30d ニューラルネットワーク記憶部
W ワーク
1 stationary
Claims (17)
コードを撮影し、読取画像を生成するカメラと、
コードの読み取りに不適切な部分を有する複数の不良画像と、当該複数の不良画像にそれぞれ対応する複数の理想画像とのうち、コードを構成するモジュールのピクセル分解能が特定範囲内である前記不良画像及び前記理想画像を機械学習させることにより予め生成されたニューラルネットワークの構造及びパラメータを記憶する記憶部と、
前記カメラにより生成された読取画像の中のコードを構成するモジュールのピクセル分解能が前記特定範囲内となるように拡大または縮小した前記読取画像を、前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、前記記憶部に記憶された構造及びパラメータに従って前記読取画像の修復を試行し、前記修復された読取画像に対してデコード処理を実行するプロセッサとを備える光学的情報読取装置。 An optical information reader that reads a code attached to a work,
a camera that captures the code and produces a read image;
Among a plurality of defective images having portions inappropriate for code reading and a plurality of ideal images respectively corresponding to the plurality of defective images, the defective images in which the pixel resolution of the modules constituting the code is within a specific range. and a storage unit that stores the structure and parameters of a neural network generated in advance by machine learning the ideal image;
The read image generated by the camera and expanded or reduced so that the pixel resolution of the modules constituting the code in the read image is within the specific range is configured with the structure and parameters stored in the storage unit. a processor that attempts to restore the read image according to the structure and parameters stored in the storage unit by inputting the optical information into a neural network stored in the memory, and performs decoding processing on the restored read image. reader.
前記ニューラルネットワークの構造及びパラメータは、コードを構成するモジュールのピクセル数が特定範囲内である前記不良画像及び前記理想画像を機械学習させることにより予め生成されており、
前記プロセッサは、前記カメラにより生成された読取画像の中のコードを構成するモジュールのピクセル数が前記特定範囲内となるように拡大または縮小した前記読取画像を、前記ニューラルネットワークに入力する光学的情報読取装置。 The optical information reader according to claim 1,
The structure and parameters of the neural network are generated in advance by machine learning the defective image and the ideal image in which the number of pixels of the modules constituting the code is within a specific range,
Optical information for inputting the read image generated by the camera to the neural network by enlarging or reducing the number of pixels of the modules constituting the code in the read image generated by the camera to be within the specific range. reader.
前記カメラにより生成された読取画像を前記拡大または縮小する前に、当該読取画像に対して画像処理フィルタを実行するフィルタ処理部を更に備える光学的情報読取装置。 The optical information reader according to claim 1 or 2,
An optical information reading apparatus further comprising a filter processing unit that performs an image processing filter on the read image generated by the camera before the enlargement or reduction of the read image.
前記光学的情報読取装置の設定時に、拡大率を変えた複数の読取画像または縮小率を変えた複数の読取画像を生成し、生成した複数の読取画像を前記ニューラルネットワークに入力して各読取画像の修復を試行し、修復された各読取画像に対してデコード処理を実行して読取余裕度を求め、求めた読取余裕度が所定よりも高い読取画像の拡大率または縮小率を、運用時に使用する拡大率または縮小率として特定するチューニング実行部を更に備え、
前記プロセッサは、前記光学的情報読取装置の運用時に、前記チューニング実行部が特定した拡大率または縮小率に前記読取画像を拡大または縮小する光学的情報読取装置。 In the optical information reader according to any one of claims 1 to 3,
When the optical information reading device is set, a plurality of read images with different enlargement ratios or a plurality of read images with different reduction ratios are generated, and the generated plurality of read images are input to the neural network to obtain each read image. is attempted to be repaired, decode processing is performed on each repaired read image to obtain the read margin, and the read image enlargement or reduction ratio with which the read margin is higher than the specified value is used during operation. further comprising a tuning executor specifying the scaling factor or scale factor to be used;
The processor enlarges or reduces the read image to the enlargement ratio or reduction ratio specified by the tuning execution unit when the optical information reader is operated.
前記チューニング実行部は、各読取画像の読取余裕度のうち、最も高い読取余裕度の読取画像の拡大率または縮小率を、運用時に使用する拡大率または縮小率として特定する光学的情報読取装置。 In the optical information reader according to claim 4,
The optical information reading device, wherein the tuning executing unit specifies the enlargement ratio or reduction ratio of the read image with the highest read margin among the read margins of the read images as the enlargement ratio or reduction ratio to be used during operation.
前記記憶部は、層の数または画像処理フィルタの数が異なる複数のニューラルネットワークの構造及びパラメータと、コード条件とを関連付けて記憶しており、
前記光学的情報読取装置の設定時に、前記カメラにより生成された読取画像に含まれるコード条件を設定し、設定したコード条件に関連付けられたニューラルネットワークの構造及びパラメータを前記記憶部から読み出して運用時に使用するニューラルネットワークとして特定するチューニング実行部を更に備え、
前記プロセッサは、前記光学的情報読取装置の運用時に、前記チューニング実行部が特定したニューラルネットワークで前記読取画像の修復を試行する光学的情報読取装置。 In the optical information reader according to any one of claims 1 to 3,
The storage unit associates and stores structures and parameters of a plurality of neural networks having different numbers of layers or different numbers of image processing filters with code conditions,
Code conditions included in the read image generated by the camera are set when the optical information reading device is set, and the structure and parameters of the neural network associated with the set code conditions are read from the storage unit and used during operation. further comprising a tuning executor identifying the neural network to be used;
The optical information reading device, wherein the processor attempts restoration of the read image using the neural network specified by the tuning execution unit when the optical information reading device is operated.
前記チューニング実行部は、前記カメラにより生成された読取画像に含まれるコード条件を設定し、設定したコード条件であるモジュールのピクセル数を取得し、取得したピクセル数が前記特定範囲内である場合には、前記プロセッサによる前記拡大または縮小を非実行にする光学的情報読取装置。 In the optical information reader according to any one of claims 4 to 6,
The tuning execution unit sets code conditions included in the read image generated by the camera, acquires the number of pixels of the module that is the set code conditions, and if the acquired number of pixels is within the specific range, is an optical information reader that disables said enlargement or reduction by said processor.
前記記憶部は、前記プロセッサによる前記拡大率が異なる複数のパラメータセットまたは前記プロセッサによる前記縮小率が異なる複数のパラメータセットを記憶するように構成され、
前記プロセッサは、前記記憶部に記憶された複数のパラメータセットの中から任意の一のパラメータセットを適用してデコード処理を実行する光学的情報読取装置。 In the optical information reader according to claim 4,
The storage unit is configured to store a plurality of parameter sets with different enlargement ratios by the processor or a plurality of parameter sets with different reduction ratios by the processor,
The optical information reading device, wherein the processor applies an arbitrary one parameter set from a plurality of parameter sets stored in the storage unit to perform decoding processing.
前記プロセッサは、拡大または縮小した前記読取画像に対して、コードを特定するための情報に基づいてコードを探索し、探索されたコードを含む領域をコードが存在する可能性が高いコード候補領域として抽出し、抽出したコード候補領域に対応する部分画像を前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、前記記憶部に記憶された構造及びパラメータに従って前記部分画像の修復を試行し、前記修復された部分画像に対してデコード処理を実行する光学的情報読取装置。 The optical information reader according to any one of claims 1 to 6,
The processor searches for a code in the enlarged or reduced read image based on information for identifying the code, and designates an area containing the searched code as a code candidate area in which the code is likely to exist. extracting and inputting a partial image corresponding to the extracted code candidate region to a neural network configured with the structure and parameters stored in the storage unit, thereby extracting the partial image according to the structure and parameters stored in the storage unit; and decoding the restored partial image.
前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに前記カメラにより生成された読取画像を入力し、前記読取画像を修復した修復画像を生成する推論処理を実行する画像修復部と、
前記カメラにより生成された読取画像に対する第1デコード処理を実行する第1デコード処理部と、
前記画像修復部が生成した修復画像に対する第2デコード処理を実行する第2デコード処理部と、をさらに備え、
前記第2デコード処理部は、前記読取画像からコードが存在する可能性が高いコード候補領域を抽出するとともに、前記画像修復部に対し、推論処理を実行するようトリガ信号を送出し、
前記画像修復部は、前記第2デコード処理部から送出されたトリガ信号を受信すると、前記第2デコード処理部が抽出した前記コード候補領域に対応する部分画像を前記ニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行し、
前記第2デコード処理部は、前記修復画像に基づいてコードの各セル位置を示すグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコード処理を実行する光学的情報読取装置。 The optical information reader according to any one of claims 1 to 9,
an image restoration unit that inputs the read image generated by the camera to a neural network configured with the structure and parameters stored in the storage unit, and executes inference processing for generating a restored image obtained by restoring the read image;
a first decoding processing unit that executes a first decoding process on the read image generated by the camera;
a second decoding processing unit that executes a second decoding process on the restored image generated by the image restoration unit;
The second decoding processing unit extracts a code candidate area in which a code is likely to exist from the read image, and sends a trigger signal to the image restoration unit to execute inference processing,
When receiving the trigger signal sent from the second decoding processing unit, the image restoration unit inputs a partial image corresponding to the code candidate region extracted by the second decoding processing unit to the neural network, and restores the partial image to the neural network. Execute an inference process that generates a repaired image that is a repaired image,
The second decoding processing unit determines a grid position indicating each cell position of the code based on the restored image, and executes decoding processing of the restored image based on the determined grid position.
前記画像修復部による推論処理と前記第1デコード処理部による第1デコード処理は並列に実行され、前記第2デコード処理部が第2デコード処理を実行している期間の少なくとも一部は前記画像修復部による推論処理が実行されない休止期間を有する光学的情報読取装置。 In the optical information reader according to claim 10,
The inference processing by the image restoration unit and the first decoding processing by the first decoding processing unit are executed in parallel, and at least part of the period during which the second decoding processing unit is executing the second decoding processing is the image restoration. An optical information reader having a rest period during which inference processing by the unit is not performed.
前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに前記カメラにより生成された読取画像を入力し、前記読取画像を修復した修復画像を生成する推論処理を実行する画像修復部と、
前記カメラにより生成された読取画像に対する第1デコード処理を実行する第1デコード処理部と、
前記画像修復部が生成した修復画像に対する第2デコード処理を実行する第2デコード処理部と、
前記第2デコード処理を実行するか否かを設定する設定部と、をさらに備え、
前記第1デコード処理部は、前記第2デコード処理にかかる時間よりも短い時間で前記第1デコード処理を実行可能であり、
前記設定部は、前記第2デコード処理を実行すると設定されている場合は、前記第2デコード処理の実行に必要な時間よりも長いデコードタイムアウト時間を設定されるとともに、前記第2デコード処理を実行しないと設定されている場合は、前記第2デコード処理の実行に必要な時間よりも短いデコードタイムアウト時間を設定可能に構成されている光学的情報読取装置。 The optical information reader according to any one of claims 1 to 11,
an image restoration unit that inputs the read image generated by the camera to a neural network configured with the structure and parameters stored in the storage unit, and executes inference processing for generating a restored image obtained by restoring the read image;
a first decoding processing unit that executes a first decoding process on the read image generated by the camera;
a second decoding processing unit that performs a second decoding process on the restored image generated by the image restoration unit;
a setting unit that sets whether to execute the second decoding process,
The first decoding processing unit is capable of executing the first decoding processing in a time shorter than the time required for the second decoding processing,
When the setting unit is set to execute the second decoding process, the setting unit sets a decoding timeout period longer than the time required to execute the second decoding process, and executes the second decoding process. An optical information reader configured to be able to set a decoding time-out period shorter than the time required for executing the second decoding process when it is set not to do so.
前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに前記カメラにより生成された読取画像を入力し、前記読取画像を修復した修復画像を生成する推論処理を実行する画像修復部と、
前記カメラにより生成された読取画像に対する第1デコード処理と、前記第1デコード処理と並列に、前記画像修復部が生成した修復画像に対する第2デコード処理を実行するデコード処理部と、
前記第2デコード処理を実行するか否かを設定する設定部と、をさらに備え、
前記デコード処理部は、前記設定部により前記第2デコード処理を実行しないと設定されている場合は、前記第2デコード処理に使われる処理のリソースを前記第1デコード処理に振り分け、前記第2デコード処理を実行すると設定されている場合に比べ、前記第1デコード処理を高速化する光学的情報読取装置。 The optical information reader according to any one of claims 1 to 9,
an image restoration unit that inputs the read image generated by the camera to a neural network configured with the structure and parameters stored in the storage unit, and executes inference processing for generating a restored image obtained by restoring the read image;
a first decoding process on the read image generated by the camera; and a decoding processing unit that, in parallel with the first decoding process, performs a second decoding process on the restored image generated by the image restoration unit;
a setting unit that sets whether to execute the second decoding process,
When the setting unit sets not to execute the second decoding processing, the decoding processing unit allocates processing resources used for the second decoding processing to the first decoding processing, and performs the second decoding processing. An optical information reader that speeds up the first decoding process compared to when the process is set to be executed.
前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに前記カメラにより生成された読取画像を入力し、前記読取画像を修復した修復画像を生成する推論処理を実行する画像修復部と、
前記画像修復部が生成した修復画像に対するデコード処理を実行するデコード処理部と、をさらに備え、
前記デコード処理部は、前記読取画像からコードが存在する可能性が高いコード候補領域を抽出し、
前記画像修復部は、前記デコード処理部が抽出した前記コード候補領域に対応する部分画像を前記ニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行し、
前記デコード処理部は、前記修復画像に基づいてコードの各セル位置を示すグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコードを実行する光学的情報読取装置。 The optical information reader according to any one of claims 1 to 9,
an image restoration unit that inputs the read image generated by the camera to a neural network configured with the structure and parameters stored in the storage unit, and executes inference processing for generating a restored image obtained by restoring the read image;
a decoding processing unit that performs decoding processing on the restored image generated by the image restoration unit;
The decoding processing unit extracts a code candidate area in which a code is likely to exist from the read image,
The image restoration unit inputs a partial image corresponding to the code candidate region extracted by the decoding processing unit to the neural network, and performs an inference process for generating a restored image obtained by restoring the partial image,
The decoding processing unit determines a grid position indicating each cell position of a code based on the restored image, and decodes the restored image based on the determined grid position.
前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに前記カメラにより生成された読取画像を入力し、前記読取画像を修復した修復画像を生成する推論処理を実行する画像修復部と、
前記画像修復部が生成した修復画像に対するデコード処理を実行するデコード処理部と、
前記カメラの撮像条件及び前記デコード処理のデコード条件を変化させて、撮像及びデコード処理を繰り返し、各撮像条件及びデコード条件にて算出されたコードの読み取りのしやすさを示すマッチングレベルに基づいて、最適な撮像条件及びデコード条件を決定するとともに、読取対象のコードの大きさを設定するチューニング処理を実行するチューニング実行部と、を更に備え、
前記デコード処理部は、
前記チューニング処理により設定された読取対象のコードを包含できるサイズで、かつ前記読取画像の中でコードが存在する可能性が高いコード候補領域を抽出し、当該抽出された画像を、予め定められたサイズとなるように縮小又は拡大してから前記ニューラルネットワークに入力し、当該ニューラルネットワークで修復した修復画像をデコードする光学的情報読取装置。 The optical information reader according to any one of claims 1 to 9,
an image restoration unit that inputs the read image generated by the camera to a neural network configured with the structure and parameters stored in the storage unit, and executes inference processing for generating a restored image obtained by restoring the read image;
a decoding processing unit that performs decoding processing on the restored image generated by the image restoration unit;
Repeating the imaging and decoding processes by changing the imaging conditions of the camera and the decoding conditions of the decoding process, and based on the matching level indicating the readability of the code calculated under each imaging condition and decoding condition, a tuning execution unit that determines optimum imaging conditions and decoding conditions and executes tuning processing for setting the size of a code to be read;
The decoding processing unit
A code candidate area having a size capable of containing the code to be read set by the tuning process and having a high possibility that the code exists in the read image is extracted, and the extracted image is subjected to a predetermined An optical information reading device that reduces or enlarges the size of the image, inputs it to the neural network, and decodes the restored image that has been restored by the neural network.
少なくともコードを照明する照明光を発生する複数の光源と、
前記光源で発生した光のうち、第1の偏光成分の光を通過させる第1偏光板と、
前記第1の偏光成分と略直交する第2の偏光成分の光を通過させる第2偏光板と、をさらに備え、
前記カメラは、前記第1偏光板を通過し、コードから反射した光を前記第2偏光板を介して受光し、前記ワークの正反射成分を除去することにより、前記第1偏光板及び前記第2偏光板を介さない場合に比べて低コントラストな読取画像を生成し、
前記プロセッサは、前記低コントラストな読取画像を前記ニューラルネットワークに入力することにより、入力前に比べて高コントラストな修復画像に変換し、当該修復画像に対してデコード処理を実行する光学情報読取装置。 The optical information reader according to any one of claims 1 to 9,
a plurality of light sources that generate illumination light that illuminates at least the code;
a first polarizing plate for passing light of a first polarization component out of the light generated by the light source;
a second polarizing plate that passes light of a second polarization component substantially orthogonal to the first polarization component,
The camera receives light that has passed through the first polarizing plate and is reflected from the code via the second polarizing plate, and removes specular reflection components of the work, thereby obtaining the first polarizing plate and the second polarizing plate. Generating a low-contrast read image compared to the case where two polarizing plates are not interposed,
The optical information reading device, wherein the processor inputs the low-contrast read image to the neural network to convert it into a restored image with a higher contrast than before the input, and executes decoding processing on the restored image.
前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに前記カメラにより生成された読取画像を入力し、前記読取画像を修復した修復画像を生成する推論処理を実行する画像修復部と、
前記画像修復部が生成した修復画像に対するデコード処理を実行するデコード処理部と、
前記カメラの撮像条件を変化させて、撮像及びデコード処理を繰り返し、各撮像条件にて算出されたコードの読み取りのしやすさを示すマッチングレベルに基づいて、前記撮像条件及び読取対象のコードのコード条件を複数設定可能なチューニング実行部と、を更に備え、
前記記憶部は、前記チューニング実行部により設定された第1の撮像条件及びコード条件と第2の撮像条件及びコード条件とを含む複数の撮像条件及びコード条件を記憶し、
前記デコード処理部は、前記記憶部に記憶されている複数の読取条件の内、前記第1の撮像条件及びコード条件で生成された読取画像を前記ニューラルネットワークに入力して修復画像を生成し、当該修復画像のデコード処理に失敗した場合は前記第2の撮像条件及びコード条件で生成された読取画像を前記ニューラルネットワークに入力して修復画像を生成し、当該修復画像のデコードを実行する光学情報読取装置。 The optical information reader according to any one of claims 1 to 9,
an image restoration unit that inputs the read image generated by the camera to a neural network configured with the structure and parameters stored in the storage unit, and executes inference processing for generating a restored image obtained by restoring the read image;
a decoding processing unit that performs decoding processing on the restored image generated by the image restoration unit;
The imaging conditions of the camera are changed to repeat imaging and decoding processing, and the imaging conditions and the code of the code to be read are calculated based on the matching level indicating the readability of the code calculated under each imaging condition. a tuning execution unit capable of setting a plurality of conditions,
The storage unit stores a plurality of imaging conditions and code conditions including a first imaging condition and code condition and a second imaging condition and code condition set by the tuning execution unit,
The decoding processing unit inputs to the neural network a read image generated under the first imaging condition and the code condition among the plurality of reading conditions stored in the storage unit to generate a restored image, optical information for generating a restored image by inputting the read image generated under the second imaging condition and the code condition into the neural network when decoding of the restored image fails, and executing decoding of the restored image; reader.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021005658 | 2021-01-18 | ||
JP2021005658 | 2021-01-18 |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2022111040A true JP2022111040A (en) | 2022-07-29 |
Family
ID=82570210
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021164234A Pending JP2022111040A (en) | 2021-01-18 | 2021-10-05 | Optical information reader |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2022111040A (en) |
Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0792090A (en) * | 1993-09-27 | 1995-04-07 | Suzuki Motor Corp | Fluorescence antibody judging means |
JP2003281010A (en) * | 2002-03-22 | 2003-10-03 | Aimek Co Ltd | Portable terminal equipment |
JP2009110070A (en) * | 2007-10-26 | 2009-05-21 | Canon Inc | Image processing apparatus, image processing method, and computer program |
JP2012018494A (en) * | 2010-07-07 | 2012-01-26 | Keyence Corp | Bar code symbol reader, bar code symbol reading method, and computer program |
JP2012064178A (en) * | 2010-09-17 | 2012-03-29 | Keyence Corp | Optical information reader |
JP2014157519A (en) * | 2013-02-18 | 2014-08-28 | Keyence Corp | Optical code reading system and reading control method of optical code |
JP2015060531A (en) * | 2013-09-20 | 2015-03-30 | 株式会社デンソーウェーブ | Information code reader |
JP2015230715A (en) * | 2014-06-06 | 2015-12-21 | 株式会社デンソーアイティーラボラトリ | Feature quantity computing device, feature quantity computing method, and feature quantity computing program |
JP2016033787A (en) * | 2014-07-31 | 2016-03-10 | 株式会社キーエンス | Optical information reader |
JP2018136858A (en) * | 2017-02-23 | 2018-08-30 | 株式会社キーエンス | Optical information reader |
JP2018136854A (en) * | 2017-02-23 | 2018-08-30 | 株式会社キーエンス | Optical information reader |
JP2019035626A (en) * | 2017-08-10 | 2019-03-07 | 株式会社ブリヂストン | Tire image recognition method and tire image recognition apparatus |
JP2019071018A (en) * | 2017-10-11 | 2019-05-09 | 株式会社キーエンス | Optical information reader and optical information reading method |
WO2019207041A1 (en) * | 2018-04-26 | 2019-10-31 | F. Hoffmann-La Roche Ag | Method of and system for tracking an animal in a population of animals |
JP2020046751A (en) * | 2018-09-14 | 2020-03-26 | 富士ゼロックス株式会社 | Image processing device and program |
JP6683666B2 (en) * | 2017-10-04 | 2020-04-22 | ファナック株式会社 | Identification code reader and machine learning device |
JP6789460B1 (en) * | 2020-05-14 | 2020-11-25 | ポリプラスチックス株式会社 | Fracture surface analysis device, trained model generator, fracture surface analysis method, fracture surface analysis program, and trained model |
-
2021
- 2021-10-05 JP JP2021164234A patent/JP2022111040A/en active Pending
Patent Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0792090A (en) * | 1993-09-27 | 1995-04-07 | Suzuki Motor Corp | Fluorescence antibody judging means |
JP2003281010A (en) * | 2002-03-22 | 2003-10-03 | Aimek Co Ltd | Portable terminal equipment |
JP2009110070A (en) * | 2007-10-26 | 2009-05-21 | Canon Inc | Image processing apparatus, image processing method, and computer program |
JP2012018494A (en) * | 2010-07-07 | 2012-01-26 | Keyence Corp | Bar code symbol reader, bar code symbol reading method, and computer program |
JP2012064178A (en) * | 2010-09-17 | 2012-03-29 | Keyence Corp | Optical information reader |
JP2014157519A (en) * | 2013-02-18 | 2014-08-28 | Keyence Corp | Optical code reading system and reading control method of optical code |
JP2015060531A (en) * | 2013-09-20 | 2015-03-30 | 株式会社デンソーウェーブ | Information code reader |
JP2015230715A (en) * | 2014-06-06 | 2015-12-21 | 株式会社デンソーアイティーラボラトリ | Feature quantity computing device, feature quantity computing method, and feature quantity computing program |
JP2016033787A (en) * | 2014-07-31 | 2016-03-10 | 株式会社キーエンス | Optical information reader |
JP2018136858A (en) * | 2017-02-23 | 2018-08-30 | 株式会社キーエンス | Optical information reader |
JP2018136854A (en) * | 2017-02-23 | 2018-08-30 | 株式会社キーエンス | Optical information reader |
JP2019035626A (en) * | 2017-08-10 | 2019-03-07 | 株式会社ブリヂストン | Tire image recognition method and tire image recognition apparatus |
JP6683666B2 (en) * | 2017-10-04 | 2020-04-22 | ファナック株式会社 | Identification code reader and machine learning device |
JP2019071018A (en) * | 2017-10-11 | 2019-05-09 | 株式会社キーエンス | Optical information reader and optical information reading method |
WO2019207041A1 (en) * | 2018-04-26 | 2019-10-31 | F. Hoffmann-La Roche Ag | Method of and system for tracking an animal in a population of animals |
JP2020046751A (en) * | 2018-09-14 | 2020-03-26 | 富士ゼロックス株式会社 | Image processing device and program |
JP6789460B1 (en) * | 2020-05-14 | 2020-11-25 | ポリプラスチックス株式会社 | Fracture surface analysis device, trained model generator, fracture surface analysis method, fracture surface analysis program, and trained model |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2022111038A (en) | Optical information reader | |
EP3968211B1 (en) | Local tone mapping for symbol reading | |
CA2288758C (en) | Optical scanner and image reader for reading images and decoding optical information including one and two dimensional symbologies at variable depth of field | |
US8950673B2 (en) | Imaging system for reading target with multiple symbols | |
US11694048B2 (en) | Optical information reading device | |
US9147095B2 (en) | Optical code scanner optimized for reading 2D optical codes | |
EP3862921B1 (en) | Unsupervised anchor handling for machine vision system | |
JP7451844B2 (en) | optical reader | |
JP7289703B2 (en) | handheld optical information reader | |
US11854163B2 (en) | Optical information reading device | |
JP2022111040A (en) | Optical information reader | |
JP2022111039A (en) | Optical information reader | |
JP2022135893A (en) | Optical information reader | |
US9104935B1 (en) | Mark reader configured to prioritize images | |
JP2023079346A (en) | Optical information reading device | |
JP2023079345A (en) | Optical information reading device | |
JP2022134482A (en) | Optical information reader | |
JP7430553B2 (en) | optical reader | |
EP1916557B1 (en) | Optical scanner and image reader for reading images and decoding optical information including one and two dimensional symbologies at variable depth of field | |
JP2021047541A (en) | Optical information reading device | |
US20250308275A1 (en) | Method to Use Edge Computing to Detect Non-Payload Encoding Visual Features for Optical Character Recognition | |
KR20230064213A (en) | Apparatus and method for recognizing a barcode | |
CA2577235A1 (en) | Optical scanner and image reader for reading images and decoding optical information including one and two dimensional symbologies at variable depth of field |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20240912 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20250630 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20250805 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20250930 |