Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7795320B2 - Optical information reader - Google Patents
[go: Go Back, main page]

JP7795320B2 - Optical information reader - Google Patents

Optical information reader

Info

Publication number
JP7795320B2
JP7795320B2 JP2021164233A JP2021164233A JP7795320B2 JP 7795320 B2 JP7795320 B2 JP 7795320B2 JP 2021164233 A JP2021164233 A JP 2021164233A JP 2021164233 A JP2021164233 A JP 2021164233A JP 7795320 B2 JP7795320 B2 JP 7795320B2
Authority
JP
Japan
Prior art keywords
code
image
optical information
neural network
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2021164233A
Other languages
Japanese (ja)
Other versions
JP2022111039A (en
Inventor
晃平 上里
郁生 山田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Keyence Corp
Original Assignee
Keyence Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Keyence Corp filed Critical Keyence Corp
Publication of JP2022111039A publication Critical patent/JP2022111039A/en
Application granted granted Critical
Publication of JP7795320B2 publication Critical patent/JP7795320B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Character Input (AREA)
  • Image Processing (AREA)

Description

本発明は、情報を光学的に読み取る光学的情報読取装置に関する。 The present invention relates to an optical information reading device that optically reads information.

近年、たとえば物品の流通経路を製造段階から消費段階あるいは廃棄段階まで追跡可能にする、いわゆるトレーサビリティが重要視されてきており、このトレーサビリティを目的としたコードリーダが普及してきている。また、トレーサビリティ以外にもコードリーダは様々な分野で利用されている。 In recent years, there has been growing emphasis on traceability, which allows goods to be tracked along their distribution route, from the manufacturing stage to the consumption or disposal stage, and code readers designed for this purpose are becoming increasingly popular. Furthermore, code readers are also used in a variety of fields other than traceability.

一般的に、コードリーダは、ワークに付されたバーコードや二次元コード等のコードをカメラによって撮影し、得られた画像に含まれるコードを画像処理によって切り出して二値化し、デコード処理して情報を読み取ることができるように構成されており、情報を光学的に読み取る装置であることから光学的情報読取装置とも呼ばれている。 Generally, code readers are configured to use a camera to capture a barcode, two-dimensional code, or other code attached to a workpiece, then extract and binarize the code contained in the resulting image using image processing, and decode it to read the information. Because they are devices that read information optically, they are also called optical information readers.

この種の光学的情報読取装置としては、例えば特許文献1に開示されているように、ロボットの視覚センサにより取得したコードの画像と、理想的なコードの画像との関係を示すモデル構造を学習する機械学習装置を備えたものが知られている。特許文献1には、運用時に視覚センサにより取得したコードの画像に、機械学習装置による学習結果を適用することで、読み取りに適した画像に修復することが記載されている。 One known example of this type of optical information reading device is one equipped with a machine learning device that learns a model structure that shows the relationship between a code image acquired by a robot's visual sensor and an ideal code image, as disclosed in Patent Document 1. Patent Document 1 describes how the results of learning by the machine learning device are applied to code images acquired by the visual sensor during operation, thereby restoring the image to one suitable for reading.

特許第6683666号公報Patent No. 6683666

ところで、機械学習装置のニューラルネットワークによる画像処理の演算量は、一般的にニューラルネットワークに入力する画像のサイズに依存するので、入力する画像のサイズが大きければ大きいほどニューラルネットワークによる演算量が増大する。演算量が増大するということはプロセッサの演算負荷が重くなり、ひいては処理速度の低下を招く。 By the way, the amount of calculation required for image processing by a neural network in a machine learning device generally depends on the size of the image input to the neural network, so the larger the size of the input image, the greater the amount of calculation required by the neural network. This increased calculation load puts a heavier load on the processor, ultimately resulting in a decrease in processing speed.

一方、光学的情報読取装置で取得される画像の全体にコードが存在しているケースは皆無といってよく、通常の運用時には画像の一部の領域にのみコードが存在しており、その領域のみニューラルネットワークによる修復が行えれば、読み取り精度を高めることができると考えられる。 On the other hand, there are virtually no cases where a code is present throughout the entire image captured by an optical information reading device. During normal operation, the code is present only in a small area of the image, and if only that area can be restored using a neural network, it is thought that reading accuracy can be improved.

本発明は、かかる点に鑑みてなされたものであり、その目的とするところは、読み取りに必要な情報が失われないようにしながら、ニューラルセットワークに入力する画像のサイズを小さくし、処理速度の高速化と、読み取りの高精度化とを両立することにある。 The present invention was made in light of these issues, and its purpose is to reduce the size of the image input to the neural network while preventing the loss of information necessary for reading, thereby achieving both faster processing speeds and higher reading accuracy.

上記目的を達成するために、本開示の一態様では、ワークに付されたコードを読み取る光学的情報読取装置を前提とすることができる。光学的情報読取装置は、コードを撮影し、読取画像を生成するカメラと、コードの読み取りに不適切な部分を有する複数の不良画像と、当該複数の不良画像にそれぞれ対応する複数の理想画像とを機械学習させることにより予め生成されたニューラルネットワークの構造及びパラメータを記憶する記憶部と、前記カメラにより生成された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出し、抽出したコード候補領域に対応する部分画像を前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、前記記憶部に記憶された構造及びパラメータに従って前記部分画像の修復を試行し、前記修復された部分画像に対してデコード処理を実行するプロセッサとを備えるものである。 To achieve the above objective, one aspect of the present disclosure can be based on an optical information reading device that reads a code attached to a workpiece. The optical information reading device includes a camera that photographs the code and generates a read image; a memory unit that stores the structure and parameters of a neural network that has been generated in advance by machine learning multiple defective images that have portions unsuitable for reading the code and multiple ideal images that correspond to the multiple defective images; and a processor that extracts code candidate areas that are likely to contain a code from the read image generated by the camera, inputs partial images corresponding to the extracted code candidate areas into a neural network configured with the structure and parameters stored in the memory unit, attempts to repair the partial image in accordance with the structure and parameters stored in the memory, and performs a decoding process on the repaired partial image.

この構成によれば、光学的情報読取装置の運用時に、カメラにより生成された読取画像の中からコード候補領域が抽出されると、そのコード候補領域に対応する部分画像がニューラルネットワークに入力されて部分画像の修復が試行される。上述したように読取画像の全体にコードが存在しているケースは殆ど無いので、コード候補領域に対応する部分画像のサイズは、読取画像のサイズよりも小さくなる。これにより、ニューラルネットワークに入力する画像のサイズが小さくなるので、プロセッサの演算負荷が軽くなり、ひいては処理速度の高速化が実現される。また、部分画像は、コードが存在する可能性が高い領域に対応しているので、読み取りに必要な情報、即ちコードの全体を含んだ画像とすることが可能である。このコードの全体を含んだ画像をニューラルネットワークに入力するので、読み取り精度の低下は抑制される。 With this configuration, when the optical information reading device is in operation, if a code candidate area is extracted from the scanned image generated by the camera, the partial image corresponding to that code candidate area is input into the neural network, and an attempt is made to repair the partial image. As mentioned above, since it is rare for a code to be present in the entire scanned image, the size of the partial image corresponding to the code candidate area is smaller than the size of the scanned image. This reduces the size of the image input to the neural network, reducing the computational load on the processor and ultimately achieving faster processing speeds. Furthermore, because the partial image corresponds to an area where a code is likely to be present, it is possible to create an image that includes the information necessary for reading, i.e., the entire code. Because an image including this entire code is input into the neural network, a decrease in reading accuracy is suppressed.

本開示の他の態様では、前記プロセッサが、前記カメラにより生成された読取画像に対して、コードを特定するための情報に基づいてコードを探索し、探索されたコードを含む領域を前記コード候補領域として抽出するものである。 In another aspect of the present disclosure, the processor searches for a code in the scanned image generated by the camera based on information for identifying the code, and extracts an area containing the searched code as the code candidate area.

この構成によれば、ユーザがコード候補領域を抽出するための操作を行わなくても、光学的情報読取装置が自動的にコード候補領域を抽出するので、ユーザの負担を軽減できる。 With this configuration, the optical information reader automatically extracts code candidate areas without the user having to perform any operations to extract the code candidate areas, thereby reducing the burden on the user.

本開示の他の態様では、光学的情報読取装置は、前記カメラの撮影視野範囲内へ向けて環境光とは異なる色の可視光を照射して目印を形成するための光照射部を備えている。前記プロセッサは、前記カメラにより生成された読取画像の中から、前記光照射部により形成された目印に対応する部分を特定し、当該特定された部分を前記コード候補領域として抽出することができる。 In another aspect of the present disclosure, the optical information reading device includes a light irradiation unit that forms a mark by irradiating visible light of a color different from ambient light within the field of view of the camera. The processor can identify a portion of the scanned image generated by the camera that corresponds to the mark formed by the light irradiation unit and extract the identified portion as the code candidate region.

この構成によれば、カメラの撮影視野範囲内に可視光によって目印が形成される。例えば、運用時にユーザが把持するための把持部を有する手持ち式のハウジングを備えている光学的情報読取装置では、目印をコードに合わせる操作をユーザが行うことで、コードが確実に含まれる範囲をカメラで撮影できる。したがって、カメラにより生成された読取画像のうち、目印に対応する部分にはコードが存在する可能性が高い。この目印に対応する部分をコード候補領域として抽出することで、抽出された領域にコードが含まれる可能性がより一層高まり、ひいてはデコード処理の成功率を高めることができる。 With this configuration, a marker is formed using visible light within the camera's field of view. For example, in an optical information reader equipped with a handheld housing with a handle for the user to hold during operation, the user can align the marker with the code, allowing the camera to capture an area that reliably contains the code. Therefore, in the scanned image generated by the camera, there is a high probability that the code is present in the portion corresponding to the marker. By extracting the portion corresponding to this marker as a code candidate area, the likelihood that the extracted area contains a code is further increased, thereby improving the success rate of the decoding process.

本開示の他の態様では、前記プロセッサが、前記カメラにより生成された読取画像の中心部分を特定し、当該中心部分を前記コード候補領域として抽出するものである。例えば、運用時にユーザが把持するための把持部を有する手持ち式のハウジングを備えている光学的情報読取装置では、ユーザがカメラの撮影視野範囲の中心にコードが位置するように光学的情報読取装置を移動させるケースが多いと考えられる。したがって、読取画像の中心部分をコード候補領域として抽出することで、抽出された領域にコードが含まれる可能性がより一層高まり、ひいてはデコード処理の成功率を高めることができる。 In another aspect of the present disclosure, the processor identifies the center of the scanned image generated by the camera and extracts that center as the code candidate area. For example, in an optical information reader equipped with a handheld housing with a handle for a user to hold during operation, it is thought that the user will often move the optical information reader so that the code is positioned in the center of the camera's field of view. Therefore, by extracting the center of the scanned image as the code candidate area, the likelihood that the extracted area will contain a code is further increased, thereby improving the success rate of the decoding process.

本開示の他の態様では、前記プロセッサが、前記カメラにより生成された読取画像の中から、ユーザによる所定の部分の指定を受け付けるように構成され、当該指定された部分を前記コード候補領域として抽出するものである。 In another aspect of the present disclosure, the processor is configured to accept a user's designation of a specific portion of the scanned image generated by the camera, and extract the designated portion as the code candidate area.

すなわち、読取画像の中にはコード以外も含まれており、コードとの判別がつきにくい場合があるが、本構成のようにユーザによる部分の指定を受け付けることができれば、ユーザが読取画像の中のコードを指定することで、コードを確実に特定することができる。 In other words, the scanned image may contain things other than codes, making it difficult to distinguish them from codes. However, if the user can specify a part of the image as in this configuration, the user can specify the code in the scanned image and reliably identify the code.

本開示の他の態様では、前記光学的情報読取装置の設定時に各種条件が前記デコード処理に適した条件となるように当該各種条件を設定するチューニング実行部を光学的情報読取装置が更に備えている。前記チューニング実行部は、前記カメラにより生成された読取画像に含まれるコードのサイズを取得することができる。前記プロセッサは、前記チューニング実行部で取得したコードのサイズに基づいて前記部分画像の前記ニューラルネットワークへの入力サイズを決定することができる。 In another aspect of the present disclosure, the optical information reading device further includes a tuning execution unit that sets various conditions during configuration of the optical information reading device so that the conditions are suitable for the decoding process. The tuning execution unit can acquire the size of the code included in the scanned image generated by the camera. The processor can determine the input size of the partial image to the neural network based on the code size acquired by the tuning execution unit.

これにより、コードのサイズに適した入力サイズにすることができるので、入力サイズが無用に大きくて処理に時間がかかるといったことや、入力サイズが小さすぎてコードの一部が欠けてデコード処理に失敗するといったことが起こりにくくなる。 This allows the input size to be appropriate for the code size, reducing the chance of the input size being unnecessarily large and taking a long time to process, or the input size being too small and resulting in parts of the code being missing, causing the decoding process to fail.

本開示の他の態様では、前記チューニング実行部が、前記光学的情報読取装置の設定時に、デコード処理の対象とするコードを前記カメラで撮影して生成した画像に基づいてコードのサイズを取得するものである。この構成によれば、ニューラルネットワークへの入力サイズを、デコード処理の対象とするコードに合わせた入力サイズにすることができる。 In another aspect of the present disclosure, the tuning execution unit, when setting up the optical information reading device, acquires the size of the code to be decoded based on an image generated by capturing an image of the code with the camera. With this configuration, the input size to the neural network can be adjusted to match the input size of the code to be decoded.

本開示の他の態様では、前記プロセッサが、前記部分画像の前記ニューラルネットワークへの入力サイズを、前記チューニング実行部で取得したコードのサイズよりも所定量だけ大きくするものである。 In another aspect of the present disclosure, the processor increases the input size of the partial image to the neural network by a predetermined amount greater than the size of the code obtained by the tuning execution unit.

すなわち、部分画像をニューラルネットワークへ入力することで演算負荷を軽くすることができる反面、例えばコードが回転していたり、コードの位置が精密に検出できなかった場合には、部分画像中のコードの一部が欠けてしまい、デコード処理に失敗する可能性もある。本構成では、ニューラルネットワークへの入力サイズがチューニング実行部で取得したコードのサイズと同じではなく、コードのサイズよりも所定量だけ大きいので、部分画像中でコードの一部が欠けるのを抑制できる。尚、コードのサイズよりも所定量だけ大きくしていることで、ニューラルネットワークへの入力サイズに上限を持たせることができ、よって、演算負荷が重くならないようにすることができる。「所定量」とは、例えばニューラルネットワークへ入力される部分画像の横(または縦)の長さが、チューニング実行部で取得したコードの横(または縦)の長さの1.5倍以上、または2.0倍以上、または3.0倍以上である。 In other words, while inputting a partial image into a neural network can reduce the computational load, if the code is rotated or the code position cannot be detected precisely, there is a risk that part of the code in the partial image will be missing, resulting in a failed decoding process. In this configuration, the input size to the neural network is not the same as the size of the code obtained by the tuning execution unit, but is larger by a predetermined amount, preventing part of the code from being missing from the partial image. Furthermore, by making the input size larger by a predetermined amount than the code size, an upper limit can be placed on the input size to the neural network, thereby preventing the computational load from becoming too heavy. The "predetermined amount" means, for example, that the horizontal (or vertical) length of the partial image input to the neural network is at least 1.5 times, 2.0 times, or 3.0 times the horizontal (or vertical) length of the code obtained by the tuning execution unit.

本開示の他の態様では、前記プロセッサは、前記チューニング実行部で取得したコードを構成する1つのモジュールのピクセル数と当該コードの縦または横方向に並ぶモジュール数とに基づいて前記部分画像の前記ニューラルネットワークへの入力サイズを決定することができる。 In another aspect of the present disclosure, the processor can determine the input size of the partial image to the neural network based on the number of pixels in one module that makes up the code obtained by the tuning execution unit and the number of modules arranged vertically or horizontally in the code.

本開示の他の態様では、ニューラルネットワークに読取画像を入力し、読取画像を修復した修復画像を生成する推論処理を実行する画像修復部と、カメラにより生成された読取画像に対する第1デコード処理を実行する第1デコード処理部と、画像修復部が生成した修復画像に対する第2デコード処理を実行する第2デコード処理部とをさらに備えている。第2デコード処理部は、読取画像からコード候補領域を抽出するとともに、画像修復部に対し、推論処理を実行するようトリガ信号を送出する。画像修復部は、第2デコード処理部から送出されたトリガ信号を受信すると、コード候補領域に対応する部分画像をニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行する。第2デコード処理部は、修復画像に基づいてコードの各セル位置を示すグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコードを実行することができる。つまり、推論処理されていない通常の読取画像のデコードを第1デコード処理部が実行し、また、推論処理による修復画像の生成を画像修復部が実行し、また、推論処理により修復された修復画像のデコードを第2デコード処理部が実行することで、それぞれに適した処理回路を構築して処理速度の高速化を図ることができる。加えて、画像修復部は、コード候補領域に対応する部分画像を修復すればよいので、処理速度の更なる高速化が可能になる。 In another aspect of the present disclosure, the system further includes an image restoration unit that inputs a scanned image to a neural network and performs an inference process to generate a restored image by restoring the scanned image; a first decoding processing unit that performs a first decoding process on the scanned image generated by the camera; and a second decoding processing unit that performs a second decoding process on the restored image generated by the image restoration unit. The second decoding processing unit extracts a code candidate area from the scanned image and sends a trigger signal to the image restoration unit to execute the inference process. Upon receiving the trigger signal from the second decoding processing unit, the image restoration unit inputs a partial image corresponding to the code candidate area to the neural network and executes an inference process to generate a restored image by restoring the partial image. The second decoding processing unit can determine grid positions indicating the positions of each cell of the code based on the restored image and decode the restored image based on the determined grid positions. In other words, the first decoding processing unit decodes the normal scanned image that has not been subjected to inference processing, the image restoration unit generates a restored image through inference processing, and the second decoding processing unit decodes the restored image restored through inference processing. This allows for the construction of processing circuits suited to each process, thereby increasing processing speed. In addition, the image restoration unit only needs to restore the partial image corresponding to the code candidate area, making it possible to further increase processing speed.

本開示の他の態様では、画像修復部による推論処理と、第1デコード処理部による第1デコード処理を並列に実行することで、処理速度の高速化を図ることができる。また、第2デコード処理部が第2デコード処理を実行している期間の少なくとも一部は、画像修復部による推論処理が実行されない休止期間を有しているので、画像修復部の負荷低減や、発熱を抑制できる。この場合、第2デコード処理部は、複数のコアで構成されていてもよい。 In another aspect of the present disclosure, the inference processing by the image restoration unit and the first decoding processing by the first decoding processing unit are performed in parallel, thereby increasing the processing speed. Furthermore, at least a portion of the period during which the second decoding processing unit is performing the second decoding processing includes a pause period during which the inference processing by the image restoration unit is not performed, thereby reducing the load on the image restoration unit and suppressing heat generation. In this case, the second decoding processing unit may be configured with multiple cores.

本開示の他の態様では、第1デコード処理部は、第2デコード処理にかかる時間よりも短い時間で第1デコード処理を実行できる。また、設定部により、第2デコード処理を実行するか否か、即ち、修復画像のデコード処理を実行するか否かを切り替えることができる。第2デコード処理は、修復画像のデコード処理を実行するため、通常の読取画像のデコード処理を実行する第1デコード処理に比べて処理にかかる時間が長い。これを前提としたとき、第2デコード処理を実行すると設定されている場合は、第2デコード処理の実行に必要な時間よりも長いデコードタイムアウト時間(デコード制限時間)を設定することができる。一方、第2デコード処理を実行しないと設定されている場合は、第2デコード処理の実行に必要な時間よりも短いデコードタイムアウト時間を設定することができるので、修復画像に対するデコードがデコードタイムアウト時間を超過すると、速やかに次に撮像された画像のデコード処理に移行できる。 In another aspect of the present disclosure, the first decoding processing unit can execute the first decoding process in a shorter time than the time required for the second decoding process. Furthermore, the setting unit can switch whether or not to execute the second decoding process, i.e., whether or not to execute decoding of the restored image. The second decoding process, which executes decoding of the restored image, takes longer than the first decoding process, which executes decoding of a normal scanned image. Given this premise, if the second decoding process is set to be executed, a decoding timeout period (decoding time limit) longer than the time required to execute the second decoding process can be set. On the other hand, if the second decoding process is set not to be executed, a decoding timeout period shorter than the time required to execute the second decoding process can be set. Therefore, if the decoding of the restored image exceeds the decoding timeout period, the process can quickly move on to decoding of the next captured image.

本開示の他の態様に係るデコード処理部は、カメラにより生成された読取画像に対する第1デコード処理と並列に、修復画像に対する第2デコード処理を実行できるので、読取画像と修復画像とが混在していても、処理速度を高速化できる。このデコード処理部は、設定部により第2デコード処理を実行しないと設定されている場合は、第2デコード処理に使われる処理のリソースを第1デコード処理に振り分けることができる。処理のリソースとは、例えばメモリの使用領域や、マルチコアCPUを構成しているコア等であり、第2デコード処理に使われる処理のリソースとしてメモリ領域やコアが予め設定されている場合に、第2デコード処理を実行しないと設定されると、そのメモリ領域やコアを第1デコード処理に使うことができるので、第1デコード処理をより一層高速化できる。 A decoding processing unit according to another aspect of the present disclosure can perform a second decoding process on a restored image in parallel with a first decoding process on a scanned image generated by a camera, thereby increasing the processing speed even when scanned images and restored images are mixed. When the setting unit is configured not to perform the second decoding process, this decoding processing unit can allocate processing resources used for the second decoding process to the first decoding process. Processing resources include, for example, memory usage areas and cores that make up a multi-core CPU. When a memory area or core is pre-set as a processing resource used for the second decoding process, when the setting is made not to perform the second decoding process, that memory area or core can be used for the first decoding process, thereby further increasing the speed of the first decoding process.

本開示の他の態様に係るデコード処理部は、読取画像からコードが存在する可能性が高いコード候補領域を抽出する。画像修復部は、コード候補領域に対応する部分画像をニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する。デコード処理部は、画像修復部が生成した修復画像に基づいてグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコードを実行する。すなわち、修復画像の生成には時間がかかる場合が多いので、修復画像の生成前に、例えばコードらしさを示す特徴量に基づいてコード候補領域を抽出しておくことで、修復画像の生成に要する時間を短縮できる。また、グリッド位置の決定は修復後の画像に基づいて高精度に実行できるので、読取性能が向上する。 A decoding processing unit according to another aspect of the present disclosure extracts code candidate areas from a scanned image that are likely to contain a code. The image restoration unit inputs a partial image corresponding to the code candidate area into a neural network and generates a restored image by restoring the partial image. The decoding processing unit determines grid positions based on the restored image generated by the image restoration unit, and decodes the restored image based on the determined grid positions. In other words, since generating a restored image often takes time, the time required to generate the restored image can be shortened by extracting code candidate areas based on, for example, feature amounts that indicate code-likeness before generating the restored image. Furthermore, since grid positions can be determined with high accuracy based on the restored image, reading performance is improved.

本開示の他の態様では、最適な撮像条件及びデコード条件を決定するとともに、読取対象のコードの大きさを設定するチューニング処理を実行する。デコード処理部は、チューニング処理で設定されたコードの大きさに基づき、読取画像の中からコード候補領域を含む抽出画像のサイズを決定できる。その抽出画像を予め定められたサイズの画像に拡大・縮小してニューラルネットワークに入力することで、ニューラルネットワークに入力されるコード画像のPPCを所定の範囲内に収めることができ、ニューラルネットワークによる画像修復効果を安定的に引き出すことができる。また、読取対象のコードサイズは様々であることが考えられるが、最終的にニューラルネットワークに入力されるコードのサイズを固定できるので、処理の高速性とデコードのし易さのバランスを一定以上に保つことができる。 In another aspect of the present disclosure, a tuning process is performed to determine optimal 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 an extracted image containing a code candidate area from the scanned image based on the code size set in the tuning process. By enlarging or reducing the extracted image to a predetermined size and inputting it into the neural network, the PPC of the code image input to the neural network can be kept within a predetermined range, allowing for a stable image restoration effect by the neural network. Furthermore, although the code size to be read can vary, the size of the code ultimately input to the neural network can be fixed, thereby maintaining a constant balance between high processing speed and ease of decoding.

本開示の他の態様に係るカメラは、第1偏光板を通過し、コードから反射した光を第2偏光板を介して受光し、第1偏光板及び第2偏光板を介さない場合に比べて低コントラストな読取画像を生成する。偏光板を使用することで、ワークの正反射成分が除去されるので、正反射成分の影響が軽減された読取画像を取得できる。例えば金属ワークを撮像した場合のように正反射成分が多くなる画像に偏光板は適しているものの、光量の低下によって読取画像が暗くなり、コントラストが低下することがある。このような場合に、ニューラルネットワークの推論処理によって高コントラストな修復画像に変換することで、読取性能が向上する。 A camera according to another aspect of the present disclosure receives light that passes through a first polarizer and is reflected from the code via a second polarizer, generating a read image with lower contrast than when the light is not transmitted through the first and second polarizers. By using a polarizer, the specular reflection component of the workpiece is removed, resulting in a read image with reduced influence from the specular reflection component. While polarizers are suitable for images with a high specular reflection component, such as when capturing an image of a metal workpiece, reduced light intensity can cause the read image to become dark and reduce contrast. In such cases, reading performance can be improved by converting the image into a high-contrast restored image using neural network inference processing.

本開示の他の態様では、チューニング実行部により、第1の撮像条件及びコード条件と、第2の撮像条件及びコード条件とを含む複数の撮像条件及びコード条件を設定することができる。デコード処理部は、第1の撮像条件及びコード条件で生成された読取画像をニューラルネットワークに入力して修復画像を生成し、当該修復画像のデコード処理に失敗した場合は、第1の撮像条件及びコード条件とは異なる第2の撮像条件及びコード条件で生成された読取画像をニューラルネットワークに入力して修復画像を生成し、当該修復画像のデコードを実行することができる。 In another aspect of the present disclosure, the tuning execution unit can set multiple imaging conditions and code conditions, including first imaging conditions and code conditions and second imaging conditions and code conditions. The decoding processing unit inputs a read image generated under the first imaging conditions and code conditions into a neural network to generate a repaired image, and if decoding of the repaired image fails, inputs a read image generated under second imaging conditions and code conditions different from the first imaging conditions and code conditions into the neural network to generate a repaired image, and then decodes the repaired image.

以上説明したように、カメラにより生成された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出し、抽出したコード候補領域に対応する部分画像をニューラルネットワークに入力して部分画像の修復を試行し、修復された部分画像に対してデコード処理を実行するので、処理速度の高速化と、読み取りの高精度化とを両立することができる。 As explained above, code candidate areas where a code is likely to exist are extracted from the scanned image generated by the camera, the partial image corresponding to the extracted code candidate area is input into a neural network to attempt to repair the partial image, and the decoding process is performed on the repaired partial image, thereby achieving both faster processing speed and higher reading accuracy.

定置式の光学的情報読取装置の運用時を説明する図である。FIG. 10 is a diagram illustrating the stationary optical information reader during operation. 定置式の光学的情報読取装置の斜視図である。FIG. 1 is a perspective view of a stationary optical information reading device. 光学的情報読取装置のブロック図である。FIG. 1 is a block diagram of an optical information reader. 手持ち式の光学的情報読取装置の斜視図である。FIG. 1 is a perspective view of a handheld optical information reading device. プロセッサによって構成される各部を説明する図である。FIG. 2 is a diagram illustrating each unit configured by a processor. ニューラルネットワークの概念図である。FIG. 1 is a conceptual diagram of a neural network. ニューラルネットワークの学習時の基本手順の一例を示すフローチャートである。1 is a flowchart showing an example of a basic procedure for learning a neural network. 不良画像と理想画像のペアを示し、(A)は不良画像、(B)は理想画像の例である。1 shows a pair of a defective image and an ideal image, where (A) is an example of the defective image and (B) is an example of the ideal image. 画像変換に用いられる畳み込みニューラルネットワークの概念図である。FIG. 1 is a conceptual diagram of a convolutional neural network used for image conversion. 光学的情報読取装置の設定時に行われるチューニング工程の手順の一例を示すフローチャートである。10 is a flowchart showing an example of the procedure of a tuning process performed when setting up an optical information reader. 縮小率及び拡大率決定前のデコード処理手順の一例を示すフローチャートである。10 is a flowchart illustrating an example of a decoding process procedure before a reduction ratio and an enlargement ratio are determined. 縮小率及び拡大率決定後のデコード処理手順の一例を示すフローチャートである。10 is a flowchart illustrating an example of a decoding process procedure after a reduction ratio and an enlargement ratio are determined. (A)はカメラで生成された読取画像の例を示し、(B)は画像処理フィルタ実行後の画像の例を示す図である。1A shows an example of a scanned image generated by a camera, and FIG. 1B shows an example of an image after an image processing filter is applied. (A)は縮小処理後の画像の例を示し、(B)はコード領域抽出後の画像の例を示す図である。10A shows an example of an image after reduction processing, and FIG. 10B shows an example of an image after code region extraction. ニューラルネットワークによる読取画像の修復例を示す図である。FIG. 10 is a diagram showing an example of restoration of a scanned image using a neural network. その他の実施形態に係るデコード処理手順の一例を示す図である。FIG. 10 is a diagram illustrating an example of a decoding process procedure according to another embodiment. 第1デコード処理部及び第2デコード処理部によるデコード処理のタイムチャートである。10 is a time chart of the decoding process by the first decoding processing unit and the second decoding processing unit. デコード処理部によるデコード処理のタイムチャートである。10 is a time chart of a decoding process by a decoding processing unit. 第1デコード処理及び第2デコード処理の一例を示すフローチャートである。10 is a flowchart illustrating an example of a first decoding process and a second decoding process. 各処理の画像例を示す図である。10A to 10C are diagrams illustrating example images of each process. 複数のニューラルネットワークを用いてコードの白黒反転に対応する場合について説明する図である。10A and 10B are diagrams illustrating a case where a plurality of neural networks are used to deal with black and white inversion of a code. 1つのニューラルネットワークを用いてコードの白黒反転に対応する場合について説明する図である。FIG. 10 is a diagram illustrating a case where one neural network is used to handle black and white inversion of a code. コントラストとマッチングレベルの関係を示すグラフである。10 is a graph showing the relationship between contrast and matching level. マッチングレベルの算出処理の一例を示すフローチャートである。10 is a flowchart illustrating an example of a process for calculating a matching level. 表示部に表示されるユーザインターフェースの例を示す図である。FIG. 4 is a diagram illustrating an example of a user interface displayed on a display unit. AIチップ付き撮像素子を用いた例を示す図である。FIG. 10 is a diagram showing an example in which an imaging element with an AI chip is used.

以下、本発明の実施形態を図面に基づいて詳細に説明する。尚、以下の好ましい実施形態の説明は、本質的に例示に過ぎず、本発明、その適用物或いはその用途を制限することを意図するものではない。 Embodiments of the present invention will now be described in detail with reference to the accompanying drawings. Note that the following description of the preferred embodiment is merely exemplary in nature and is not intended to limit the present 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 schematic diagram illustrating a stationary optical information reading device 1 according to an embodiment of the present invention during operation. In this example, multiple workpieces W are placed on the upper surface of a conveyor belt B and transported in the direction of arrow Y in FIG. 1 . The optical information reading device 1 according to the embodiment is installed above and away from the workpieces W. The optical information reading device 1 is a code reader configured to photograph a code attached to the workpiece W and decode the code contained in the photographed image to read information. In the example shown in FIG. 1 , the optical information reading device 1 is stationary. When this stationary optical information reading device 1 is in operation, it is fixed to a bracket or the like (not shown) to prevent movement. The stationary optical information reading device 1 may also be used while being held by a robot (not shown). Alternatively, the optical information reading device 1 may be configured to read the code on a stationary workpiece W. The stationary optical information reading device 1 is in operation when it is performing the operation of reading the codes of the works W being transported by the transport belt conveyor B in order.

また、各ワークWの外面にはコードが付されている。コードには、バーコード及び二次元コードの両方が含まれる。二次元コードとしては、たとえば、QRコード(登録商標)、マイクロQRコード、データマトリクス(Data matrix;Data code)(登録商標)、ベリコード(Veri code)、アズテックコード(Aztec code)、PDF417、マキシコード(Maxi code)などがある。二次元コードにはスタック型とマトリクス型があるが、本発明はいずれの二次元コードに対しても適用できる。コードは、ワークWに直接印刷あるいは刻印することによって付してもよいし、ラベルに印刷した後にワークWに貼付することによって付してもよく、その手段、方法は問わない。 In addition, a code is attached to the outer surface of each workpiece W. The code includes both barcodes and two-dimensional codes. Examples of two-dimensional codes include QR Code (registered trademark), micro QR Code, Data Matrix (Data Code) (registered trademark) , Veri Code, Aztec Code, PDF417, and Maxi Code. Two-dimensional codes are classified into stack type and matrix type, and the present invention can be applied to any two-dimensional code. The code may be attached by printing or engraving directly on the workpiece W, or by printing on a label and then attaching it to the workpiece W, and the means and method are not important.

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

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

図2に示すように、光学的情報読取装置1は、箱状のハウジング2と、偏光フィルタアタッチメント3と、照明部4と、カメラ5と、表示部6と、電源コネクタ7と、信号線コネクタ8とが設けられている。さらに、ハウジング2には、インジケータ9と、エイマー光照射部(光照射部)10と、操作ボタン11、12とが設けられており、インジケータ9、エイマー光照射部10及び操作ボタン11、12も光学的情報読取装置1の構成要素である。 As shown in Figure 2, the optical information reading device 1 includes a box-shaped housing 2, a polarizing filter attachment 3, an illumination unit 4, a camera 5, a display unit 6, a power connector 7, and a signal line connector 8. Furthermore, the housing 2 includes an indicator 9, an aimer light emitting unit (light emitting unit) 10, and operation buttons 11 and 12; the indicator 9, aimer light emitting unit 10, and operation buttons 11 and 12 are also components of the optical information reading device 1.

ハウジング2は、所定方向に長い形状となっているが、ハウジング2の形状は図示した形状に限られるものではない。ハウジング2の前側の外面には、偏光フィルタアタッチメント3が脱着可能に取り付けられている。このハウジング2の内部に、照明部4、カメラ5、エイマー光照射部10、プロセッサ20、記憶部30、ROM40、RAM41等が収容されている。プロセッサ20、記憶部30、ROM40及びRAM41も光学的情報読取装置1の構成要素である。 The housing 2 is elongated in a specific direction, but the shape of the housing 2 is not limited to the shape shown in the figure. A polarizing filter attachment 3 is detachably attached to the front outer surface of the housing 2. Inside the housing 2, an illumination unit 4, a camera 5, an aimer light irradiation unit 10, a processor 20, a memory unit 30, a ROM 40, a RAM 41, etc. are housed. The processor 20, memory unit 30, ROM 40, and RAM 41 are also components of the optical information reading device 1.

ハウジング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のうち、一方を省略してもよい。 An illumination unit 4 is provided on the front side of the housing 2. The illumination unit 4 illuminates at least the code on the workpiece W by emitting light toward the front of the optical information reading device 1. As shown in FIG. 3, the illumination unit 4 includes a first illumination unit 4a consisting of multiple light-emitting diodes (LEDs), a second illumination unit 4b consisting of multiple light-emitting diodes, and an illumination drive unit 4c consisting of an LED driver or the like that drives the first illumination unit 4a and the second illumination unit 4b. The first illumination unit 4a and the second illumination unit 4b are driven individually by the illumination drive unit 4c, allowing them to be turned on and off separately. The illumination drive unit 4c is connected to the processor 20, which controls the illumination drive unit 4c. Note that one of the first illumination unit 4a and the second illumination unit 4b may be omitted.

図2に示すように、ハウジング2の前側の中央部には、カメラ5が設けられている。カメラ5の光軸方向は、照明部4による光の照射方向と略一致している。カメラ5は、コードを撮影し、読取画像を生成する部分である。図3に示すように、カメラ5は、ワークWに付されていて上記照明部4によって照明されているコードからの反射光を受光する撮像素子5aと、レンズ等を有する光学系5bと、AFモジュール(オートフォーカスモジュール)5cとを備えている。光学系5bには、ワークWのコードが付された部分から反射した光が入射するようになっており、入射した光は撮像素子5aへ向けて出射されて撮像素子5aの撮像面上で結像する。 As shown in Figure 2, a camera 5 is provided in the center of the front side of the housing 2. The optical axis direction of the camera 5 is approximately aligned with the direction of light emitted by the illumination unit 4. The camera 5 is the part that photographs the code and generates a scanned image. As shown in Figure 3, the camera 5 is equipped with an image sensor 5a that receives reflected light from the code attached to the workpiece W and illuminated by the illumination unit 4, an optical system 5b having a lens, etc., and an AF module (autofocus module) 5c. Light reflected from the part of the workpiece W where the code is attached is incident on the optical system 5b, and the incident light is emitted toward the image sensor 5a and forms an image on the imaging surface of the image sensor 5a.

撮像素子5aは、光学系5bを通して得られたコードの画像を電気信号に変換するCCD(charge-coupled device)やCMOS(complementary metal oxide semiconductor)等の受光素子からなるイメージセンサである。撮像素子5aはプロセッサ20に接続されていて、撮像素子5aによって変換された電気信号は、読取画像のデータとしてプロセッサ20に入力される。また、AFモジュール5cは、光学系5bを構成するレンズのうち、合焦用レンズの位置や屈折率を変更することによってピント合わせを行う機構である。AFモジュール5cもプロセッサ20に接続され、プロセッサ20により制御される。 The imaging element 5a is an image sensor consisting of light-receiving elements such as a CCD (charge-coupled device) or CMOS (complementary metal oxide semiconductor) that converts the image of the code obtained through the optical system 5b into an electrical signal. The imaging element 5a is connected to the processor 20, and the electrical signal converted by the imaging element 5a is input to the processor 20 as scanned image data. The AF module 5c is a mechanism that adjusts the focus by changing the position and refractive index of the focusing lens that makes up the optical system 5b. The AF module 5c is also connected to and controlled by the processor 20.

図2に示すように、ハウジング2の側面には表示部6が設けられている。表示部6は、たとえば有機ELディスプレイや液晶ディスプレイ等からなるものである。表示部6は、プロセッサ20に接続され、たとえば撮像部5で撮像されたコード、コードのデコード結果である文字列、読み取り成功率、マッチングレベル等を表示させることができる。読み取り成功率とは、複数回読み取り処理を実行したときの平均読み取り成功率である。マッチングレベルとは、デコードが成功したコードの読み取りのしやすさを示す読取余裕度である。これはデコード時に発生した誤り訂正の数等から求めることができ、たとえば数値で表すことができる。誤り訂正が少なければ少ないほどマッチングレベル(読取余裕度)が高くなり、一方、誤り訂正が多ければ多いほどマッチングレベル(読取余裕度)が低くなる。 As shown in FIG. 2, a display unit 6 is provided on the side of the housing 2. The display unit 6 is, for example, an organic EL display or a liquid crystal display. The display unit 6 is connected to the processor 20 and can display, for example, the code captured by the imaging unit 5, the character string resulting from decoding the code, the read success rate, the matching level, etc. The read success rate is the average read success rate when multiple reading processes are performed. The matching level is the reading margin that indicates the ease of reading a successfully decoded code. This can be determined from the number of error corrections that occur during decoding, and can be expressed, for example, as a numerical value. The fewer error corrections, the higher the matching level (reading margin), and conversely, the more error corrections, the lower the matching level (reading margin).

電源コネクタ7には、光学的情報読取装置1に外部から電源を供給するための電源ケーブル(図示せず)が接続される。また、信号線コネクタ8には、コンピュータ100及びPLC101と通信を行うための信号線100a、101a等が接続される。信号線コネクタ8は、例えばEthernetコネクタ、RS232C等のシリアル通信用コネクタ、USBコネクタ等で構成することができる。 A power cable (not shown) is connected to the power connector 7 to supply power to the optical information reader 1 from an external source. Furthermore, signal lines 100a, 101a, etc. are connected to the signal line connector 8 to communicate with the computer 100 and the PLC 101. The signal line connector 8 can be configured, for example, as an Ethernet connector, a serial communication connector such as RS232C, a USB connector, etc.

ハウジング2には、インジケータ9が設けられている。インジケータ9は、プロセッサ20に接続されていて、たとえば発光ダイオード等の発光体で構成することができる。光学的情報読取装置1の作動状態をインジケータ9の点灯状態によって外部に報知することができる。 The housing 2 is provided with an indicator 9. The indicator 9 is connected to the processor 20 and can be composed of a light-emitting element such as a light-emitting diode. The operating status of the optical information reading device 1 can be notified to the outside by the lighting state of the indicator 9.

ハウジング2の前側には、カメラ5を挟むように一対のエイマー光照射部10が設けられている。図3に示すように、エイマー光照射部10は、発光ダイオード等からなるエイマー10aと、エイマー10aを駆動するエイマー駆動部10bとを備えている。エイマー10aは、光学的情報読取装置1の前方へ向けて光(エイマー光)を照射することによってカメラ5の撮影範囲や視野中心、照明部4の光軸の目安等を示すためのものである。具体的には、エイマー10aは、カメラ5の撮影視野範囲内へ向けて環境光とは異なる色(例えば赤色や緑色等)の可視光を照射し、その可視光が照射された面に肉眼で視認可能な目印を形成する。目印は各種図形や記号、文字等であってもよい。ユーザは、エイマー10aから照射される光を参照して光学的情報読取装置1を設置することもできる。 A pair of aimer light emitting units 10 are provided on the front side of the housing 2, sandwiching the camera 5. As shown in FIG. 3, the aimer light emitting unit 10 includes an aimer 10a, such as a light-emitting diode, and an aimer driver 10b that drives the aimer 10a. The aimer 10a emits light (aimer light) toward the front of the optical information reading device 1 to indicate the camera 5's shooting range, the center of the field of view, and the optical axis of the illumination unit 4. Specifically, the aimer 10a emits visible light of a color different from the ambient light (e.g., red or green) toward the camera 5's shooting field of view, forming a mark visible to the naked eye on the surface illuminated by the visible light. The mark may be various shapes, symbols, letters, etc. The user can also install the optical information reading device 1 by referring to the light emitted from the aimer 10a.

図2に示すように、ハウジング2の側面には、光学的情報読取装置1の設定時等に使用する操作ボタン11、12が設けられている。操作ボタン11、12は、例えばセレクトボタンやエンターボタン等を含んでいる。操作ボタン11、12以外にも、例えばタッチパネル式の操作手段が設けられていてもよい。操作ボタン11、12はプロセッサ20に接続されていて、プロセッサ20は操作ボタン11、12の操作状態を検出可能になっている。操作ボタン11、12の操作により、表示部6に表示された複数の選択肢の中から1つを選択することや、選択した結果を確定することができる。 As shown in FIG. 2, operation buttons 11 and 12 are provided on the side of the housing 2 to be used when setting up the optical information reader 1. The operation buttons 11 and 12 include, for example, a select button and an enter button. In addition to the operation buttons 11 and 12, a touch panel-type operation means may also be provided. The operation buttons 11 and 12 are connected to the processor 20, which is capable of detecting the operation status of the operation buttons 11 and 12. By operating the operation buttons 11 and 12, it is possible to select one option from multiple options displayed on the display unit 6 and to confirm the selection.

(手持ち式の光学的情報読取装置)
上述した例では、光学的情報読取装置1が定置式である場合を示したが、本発明は定置式の光学的情報読取装置1以外にも適用可能である。図4は、手持ち式の光学的情報読取装置1Aを示すものであり、この図に示すような手持ち式の光学的情報読取装置1Aにも本発明を適用することができる。
(Handheld optical information reader)
In the above example, the optical information reader 1 is a stationary type, but the present invention can be applied to devices other than the stationary type optical information reader 1. Fig. 4 shows a handheld type optical information reader 1A, and the present invention can also be applied to a handheld type optical information reader 1A such as that shown in this figure.

手持ち式の光学的情報読取装置1Aのハウジング2Aは、上下方向に長い形状とされている。尚、光学的情報読取装置1Aの使用時の向きは図示した向きに限定されるものではなく、様々な向きで使用可能であるが、説明の便宜上、光学的情報読取装置1Aの上下方向を特定している。 The housing 2A of the handheld optical information reader 1A is elongated in the vertical direction. Note that the orientation of the optical information reader 1A during use is not limited to the orientation shown in the figure, and it can be used in a variety of orientations. However, for the sake of convenience, the vertical direction of the optical information reader 1A is specified.

ハウジング2Aの上側部分には、表示部6Aが設けられている。表示部6Aは、定置式の光学的情報読取装置1の表示部6と同様に構成されている。ハウジング2Aの下側部分は、運用時にユーザが把持するための把持部2Bである。把持部2Bは、一般的な成人が片手で握るようにして持つことが可能な部分であり、形状や大きさは自由に設定できる。この把持部2Bを持つことで、光学的情報読取装置1Aを携帯して移動することができる。つまり、この光学的情報読取装置1Aは、携帯型端末装置であり、例えばハンディターミナルと呼ぶこともできるものである。 A display unit 6A is provided on the upper portion of the housing 2A. The display unit 6A is configured in the same manner as the display unit 6 of the stationary optical information reader 1. The lower portion of the housing 2A is a gripping unit 2B that the user holds during operation. The gripping unit 2B is a part that can be held in one hand by an average adult, and its shape and size can be freely set. By holding this gripping unit 2B, the optical information reader 1A can be carried around. In other words, this optical information reader 1A is a portable terminal device, and can also be called, for example, a handheld terminal.

定置式の光学的情報読取装置1と同様に、手持ち式のハウジング2Aにも、照明部、カメラ、エイマー光照射部、プロセッサ、記憶部、ROM、RAM等(図示せず)が収容されている。照明部の光軸、カメラの光軸、エイマー光照射部の光軸は、ハウジング2Aの上端近傍から斜め上方に向いている。また、手持ち式のハウジング2Aには、ブザー(図示せず)も設けられている。 Like the stationary optical information reader 1, the handheld housing 2A also houses an illumination unit, camera, aimer light emitting unit, processor, memory unit, ROM, RAM, etc. (not shown). The optical axes of the illumination unit, camera, and aimer light emitting unit point diagonally upward from near the top end of the housing 2A. The handheld housing 2A also includes a buzzer (not shown).

把持部2Bやその近傍には、複数の操作ボタン11A及びトリガーキー11Bが設けられている。操作ボタン11Aは、定置式の光学的情報読取装置1の操作ボタン11等と同様である。ユーザが光学読取装置1Aの先端(上端)をワークWに向けてトリガーキー11Bを押下すれば、光学読取装置1Aの先端からエイマー光が照射される。ユーザは、ワークWの表面で反射されるエイマー光を目視しながら光学読取装置1Aの向きを調整し、エイマー光を読取対象のコードに合わせれば、コードの読み取り及びデコード処理が自動的に行われる。読み取りが完了すると、ブザーから完了報知音が発せられる。 Multiple operation buttons 11A and trigger keys 11B are provided on or near the gripper 2B. The operation buttons 11A are similar to the operation buttons 11 on the stationary optical information reading device 1. When the user points the tip (top) of the optical reading device 1A toward the workpiece W and presses the trigger key 11B, an aimer beam is emitted from the tip of the optical reading device 1A. The user adjusts the orientation of the optical reading device 1A while visually observing the aimer beam reflected from the surface of the workpiece W, and aligns the aimer beam with the code to be read. The code is then automatically read and decoded. When reading is complete, a buzzer sounds to notify completion.

手持ち式の光学的情報読取装置1Aの使用例として、物流倉庫内におけるピッキング作業に手持ち式の光学的情報読取装置1Aを用いる例がある。例えば、受注した商品を物流倉庫から発送する場合、商品倉庫内の商品棚から必要な商品がピッキングされる。このピッキング作業は、コードが記載された受注伝票を持ったユーザが、商品棚まで移動した後、受注伝票のコードと、商品又は商品棚に付されたコードとを照合しながら行われる。この場合、受注伝票のコードと、商品又は商品棚に付されたコードとを交互に手持ち式の光学的情報読取装置1Aで読み取る。 One example of the use of the handheld optical information reader 1A is for picking work in a logistics warehouse. For example, when ordered products are to be shipped from the logistics warehouse, the required products are picked from the shelves in the warehouse. This picking work is carried out by a user holding an order slip with a code written on it, who then goes to the product shelf and compares the code on the order slip with the code attached to the product or the product shelf. In this case, the handheld optical information reader 1A alternately reads the code on the order slip and the code attached to the product or the product shelf.

(プロセッサの構成)
以下の説明は、定置式の光学的情報読取装置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 both the stationary optical information reader 1 and the handheld optical information reader 1A, and can be applied to either device 1 or 1A unless otherwise specified. As shown in FIG. 3, the processor 20 includes a CPU core 21, a DSP core 22, and an AI chip 23. The CPU core 21, the DSP core 22, and the AI chip 23 are so-called System-on-a-chip (SoC) and are mounted on a single board. Note that the DSP core 22 and the AI chip 23 do not have to be SoCs, in which case they are not mounted on the same board, but this case is also within the scope of the present invention.

CPUコア21、DSPコア22及びAIチップ23には、高速なRAM41が接続されており、CPUコア21、DSPコア22及びAIチップ23のいずれもRAM41にアクセス可能となっている。また、プロセッサ20には、ROM40が接続されており、CPUコア21、DSPコア22及びAIチップ23のいずれもROM40にアクセス可能となっている。 High-speed RAM 41 is connected to the CPU core 21, DSP core 22, and AI chip 23, and all of the CPU core 21, DSP core 22, and AI chip 23 can access RAM 41. In addition, ROM 40 is connected to the processor 20, and all of the CPU core 21, DSP core 22, and AI chip 23 can access ROM 40.

CPUコア21は、汎用プロセッサであり、例えばAF制御、照明制御、カメラ制御、読取画像に対するデコード処理等を実行する部分である。DSPコア22は、例えば読取画像に対して各種フィルタ処理等を実行する部分である。AIチップ23は、ニューラルネットワークによる読取画像の修復の試行専用の集積回路であり、ニューラルネットワークによる処理に必要な積和演算を超高速に実行することに特化したものである。 The CPU core 21 is a general-purpose processor that performs, for example, AF control, lighting control, camera control, and decoding of scanned images. The DSP core 22 performs, for example, various filter processes on scanned images. The AI chip 23 is an integrated circuit dedicated to attempting to restore scanned images using a neural network, and is specialized for performing ultra-high-speed product-sum operations required for neural network processing.

図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 processor 20 configures an AF control unit 20a, an imaging control unit 20b, a filter processing unit 20c, a tuning execution unit 20d, a decode processing unit 20f, an extraction unit 20g, a reduction unit 20h, an enlargement unit 20i, and an image restoration unit 20j. The AF control unit 20a, the imaging control unit 20b, a filter processing unit 20c, a tuning execution unit 20d, a decode processing unit 20f, an extraction unit 20g, a reduction unit 20h, and an enlargement unit 20i are configured by the arithmetic processing of the CPU core 21 or the DSP core 22. On the other hand, the image restoration unit 20j is configured by the AI chip 23.

(AF制御部の構成)
AF制御部20aは、図3に示すAFモジュール5cを制御するユニットであり、従来から周知のコントラストAFや位相差AFによって光学系5bのピント合わせを行うことができるように構成されている。
(Configuration of AF control unit)
The AF control unit 20a is a unit that controls the AF module 5c shown in FIG. 3, and is configured to be able to focus the optical system 5b by conventionally known contrast AF or phase difference AF.

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

(フィルタ処理部の構成)
フィルタ処理部20cは、読取画像に対して画像処理フィルタを実行する部分である。フィルタ処理部20cは、カメラ5により生成された画像に含まれるノイズを除去するノイズ除去フィルタや、コントラストを補正するコントラスト補正フィルタ、平均化フィルタ等を実行する。フィルタ処理部20cが実行する画像処理フィルタは、ノイズ除去フィルタ、コントラスト補正フィルタ、平均化フィルタに限られるものではなく、他の画像処理フィルタを含んでいてもよい。
(Configuration of the filter processing unit)
The filter processing unit 20c is a part that applies image processing filters to the read image. The filter processing unit 20c applies a noise removal filter that removes noise contained in the image generated by the camera 5, a contrast correction filter that corrects contrast, an averaging filter, etc. The image processing filters applied by the filter processing unit 20c are not limited to a noise removal filter, a contrast correction filter, and an averaging filter, and may include other image processing filters.

フィルタ処理部20cは、後述する画像修復前の読取画像に対して画像処理フィルタを実行するように構成されている。また、フィルタ処理部20cは、後述する拡大、縮小前の読取画像に対して画像処理フィルタを実行するように構成されている。尚、フィルタ処理部20cは、画像修復後の読取画像に対して画像処理フィルタを実行するように構成されていてもよいし、拡大、縮小後の読取画像に対して画像処理フィルタを実行するように構成されていてもよい。 The filter processing unit 20c is configured to apply an image processing filter to the scanned image before image restoration, which will be described later. The filter processing unit 20c is also configured to apply an image processing filter to the scanned image before enlargement or reduction, which will be described later. The filter processing unit 20c may also be configured to apply an image processing filter to the scanned image after image restoration, or to apply an image processing filter to the scanned image after enlargement or reduction.

(チューニング実行部の構成)
図5に示すチューニング実行部20dは、カメラ5の撮像条件及びデコード処理のデコード条件を変化させて、撮像及びデコード処理を繰り返し、各撮像条件及びデコード条件にて算出されたコードの読み取りのしやすさを示すマッチングレベルに基づいて、最適な撮像条件及びデコード条件を決定するとともに、読取対象のコードの大きさを設定するチューニング処理を実行する。具体的には、チューニング実行部20dは、光学的情報読取装置1、1Aの設定時に、カメラ5のゲイン、照明部4の光量及び露光時間等の撮像条件や、フィルタ処理部20cにおける画像処理条件を変更してデコードに適した条件となるように各種条件(チューニングパラメータ)を設定する部分である。フィルタ処理部20cにおける画像処理条件とは、画像処理フィルタの係数(フィルタの強弱)や、複数の画像処理フィルタがある場合に画像処理フィルタの切替、種類の異なる画像処理フィルタの組み合わせ等である。搬送時のワークWに対する外光の影響や、コードが付されている面の色及び材質等によって適切な撮像条件及び画像処理条件は異なる。よって、チューニング実行部20dは、より適切な撮像条件及び画像処理条件を探索して、AF制御部20a、撮像制御部20b、フィルタ処理部20cによる処理を設定する。
(Configuration of tuning execution unit)
The tuning execution unit 20d shown in FIG. 5 repeatedly performs the image capture and decoding processes by changing the imaging conditions of the camera 5 and the decoding conditions of the decoding process. Based on a matching level indicating the ease of code reading calculated under each imaging and decoding condition, the tuning execution unit 20d determines optimal imaging and decoding conditions and sets the size of the code to be read. Specifically, when setting up the optical information reading device 1, 1A, the tuning execution unit 20d sets various conditions (tuning parameters) to achieve optimal decoding conditions by changing imaging conditions such as the gain of the camera 5, the light intensity and exposure time of the illumination unit 4, and the image processing conditions of the filter processing unit 20c. The image processing conditions of the filter processing unit 20c include the coefficients (strength of the image processing filter), switching between image processing filters if multiple image processing filters are used, and combining different types of image processing filters. Appropriate imaging and image processing conditions vary depending on factors such as the effect of external light on the workpiece W during transport and the color and material of the surface on which the code is attached. Therefore, the tuning execution unit 20d searches for more appropriate imaging conditions and image processing conditions, and sets the processing to be performed by the AF control unit 20a, the imaging control unit 20b, and the filter processing unit 20c.

チューニング実行部20dは、カメラ5により生成された読取画像に含まれるコードのサイズを取得可能に構成されている。コードのサイズを取得する場合、始めに、チューニング実行部20dは、コードらしさを示す特徴量に基づいてコードを探索する。次いで、チューニング実行部20dは、探索したコードのPPC、コード種、コードサイズ等を取得する。PPC、コード種、コードサイズ等は、コードパラメータまたはコード条件に含まれるものであり、従って、チューニング実行部20dは、探索したコードのコードパラメータまたはコード条件を取得可能に構成されている。 The tuning execution unit 20d is configured to be able to acquire the size of the code contained in the scanned image generated by the camera 5. When acquiring the code size, the tuning execution unit 20d first searches for the code based on features that indicate its likelihood of being a code. Next, the tuning execution unit 20d acquires the PPC, code type, code size, etc. of the searched code. The PPC, code type, code size, etc. are included in the code parameters or code conditions, and therefore the tuning execution unit 20d is configured to be able to acquire the code parameters or code conditions of the searched code.

二次元コードは、複数の白色のモジュールと黒色のモジュールとがランダムに配列されることによって構成されている。例えば、QRコードのモデル2ではモジュール数は21×21~177×177まである。定置式の光学的情報読取装置1の場合は事前に読み取り対象のコードを読み取ることで、モジュール数やPPCを限定し、コードの大きさ(ピクセルサイズ)をモジュール数×PPCに限定して運用する。 A two-dimensional code is composed of multiple white and black modules arranged randomly. For example, in QR code model 2, the number of modules ranges from 21 x 21 to 177 x 177. In the case of a stationary optical information reader 1, the number of modules and PPC are limited by reading the code to be read in advance, and the code size (pixel size) is limited to the number of modules x PPC.

コードを構成するモジュールのうち、1つのモジュールに着目した時、そのモジュールがいくつのピクセル(画素)で構成されているかを示すコードパラメータがPPCである。チューニング実行部20dは、1つのモジュールを特定した後、1つのモジュールを構成している画素数をカウントすることで、PPCを取得できる。 When focusing on one of the modules that make up a code, the PPC is a code parameter that indicates how many pixels (picture elements) that module is made up of. After identifying a module, the tuning execution unit 20d can obtain the PPC by counting the number of pixels that make up that module.

コード種は、例えばQRコード、データマトリクスコード、ベリコードといったコードの種類のことである。各コードには特徴があるので、チューニング実行部20dは、例えばファインダパターンの有無等によってコード種を判別することが可能である。 The code type refers to the type of code, such as a QR code, data matrix code, or VeriCode. Each code has its own characteristics, so the tuning execution unit 20d can determine the code type, for example, based on the presence or absence of a finder pattern.

また、コードサイズは、コードの縦または横方向に並ぶモジュールの数とPPCとによって算出できる。チューニング実行部20dは、コードの縦または横方向に並ぶモジュールの数を算出するとともに、PPCを算出し、縦または横方向に並ぶモジュールの数とPPCとを積算することによってコードサイズを取得できる。 The code size can also be calculated from the number of modules arranged vertically or horizontally in the code and the PPC. The tuning execution unit 20d calculates the number of modules arranged vertically or horizontally in the code, calculates the PPC, and obtains the code size by multiplying the number of modules arranged vertically or horizontally by the PPC.

(デコード処理部の構成)
デコード処理部20fは、白黒の二値化されたデータをデコードする部分である。デコードには、符号化されたデータの対照関係を示すテーブルを使用することができる。さらに、デコード処理部20fは、デコードした結果が正しいか否かを所定のチェック方式に従ってチェックする。データに誤りが発見された場合にはエラー訂正機能を使用して正しいデータを演算する。エラー訂正機能はコードの種類によって異なる。
(Configuration of the Decode Processing Unit)
The decoding processing unit 20f decodes the black and white binary data. A table showing the correspondence between coded data can be used for decoding. Furthermore, the decoding processing unit 20f checks whether the decoded result is correct according to a predetermined check method. If an error is found in the data, an error correction function is used to calculate the correct data. The error correction function differs depending on the type of code.

この実施形態では、デコード処理部20fは、後述する画像修復後の読取画像に含まれるコードをデコードするが、画像修復前の読取画像に含まれるコードをデコードすることもできる。デコード処理部20fは、コードをデコードして得られたデコード結果を図3に示す記憶部30のデコード結果記憶部30bに書き込むように構成されている。 In this embodiment, the decoding processing unit 20f decodes the code contained in the scanned image after image restoration, which will be described later, but it can also decode the code contained in the scanned image before image restoration. The decoding processing unit 20f is configured to write the decoded result obtained by decoding the code to the decoding result storage unit 30b of the storage unit 30 shown in Figure 3.

(抽出部の構成)
抽出部20gは、カメラ5により生成された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出する部分である。コード候補領域は、コードらしさを示す特徴量に基づいて抽出することができ、この場合、コードらしさを示す特徴量はコードを特定するための情報となる。例えば、抽出部20gは、読取画像を取得し、取得した読取画像に対して、コードらしさを示す特徴量に基づいてコードを探索することができる。具体的には、取得した読取画像の中に、コードらしさを示す特徴量を所定以上持った部分が存在するか否かを探索し、その結果、コードらしさを示す特徴量を持った部分を探索することができれば、その部分を含む領域をコード候補領域として抽出する。コード候補領域には、コード以外の領域が含まれていてもよいが、少なくともコードである可能性が所定以上高い部分を含んでいる。尚、コード候補領域は、あくまでもコードが存在する可能性が高い領域であることから、結果的にコードが含まれない領域の場合もあり得る。
(Configuration of extraction unit)
The extraction unit 20g extracts code candidate areas from the scanned image generated by the camera 5 that are likely to contain a code. The code candidate areas can be extracted based on features that indicate the likelihood of a code. In this case, the features that indicate the likelihood of a code serve as information for identifying a code. For example, the extraction unit 20g can acquire a scanned image and search for a code in the acquired scanned image based on the features that indicate the likelihood of a code. Specifically, the extraction unit 20g searches the acquired scanned image for a portion that has a predetermined or higher level of features that indicate the likelihood of a code. If a portion with a feature that indicates the likelihood of a code is found, the extraction unit 20g extracts the portion as a code candidate area. The code candidate area may include areas other than a code, but it must at least include a portion that is more likely to be a code than a predetermined level. Note that the code candidate area is merely an area that is likely to contain a code, and therefore may not actually contain a code.

抽出部20gは、エイマー光照射部10から照射されたエイマー光の位置情報を、コードを特定するための情報として利用し、コード候補領域を抽出することもできる。この場合、抽出部20gは、読取画像の中から、エイマー光照射部10により形成された目印に対応する部分を特定し、当該特定された部分をコード候補領域として抽出する。すなわち、上述したように、エイマー光はカメラ5の撮影範囲や視野中心を示すためのものであることから、エイマー光によって形成される目印は、予めカメラ5の視野中心と一致させておくことが可能である。特に、手持ち式の光学的情報読取装置1Aの場合、ユーザはエイマー光を読取対象のコードに合わせるので、エイマー光によって形成される目印は、コードと重なっている確率が高い。つまり、エイマー光照射部10により形成された目印に対応する部分をカメラ5の視野中心と一致させておくことで、抽出部20gがカメラ5の視野中心を含む領域を抽出すると、その領域はコードが存在する可能性が高い領域となる。この場合、エイマー光照射部10により形成された目印に対応する部分をカメラ5の視野中心と完全に一致させておかなくてもよく、視野の縦方向または横方向に多少ずれていてもよい。また、コードは所定の大きさを有しているので、抽出部20gが抽出する領域は、カメラ5の視野中心だけではなく、視野中心を含む所定の大きさを持った領域である。 The extraction unit 20g can also extract a code candidate area using position information of the aimer light emitted from the aimer light emitting unit 10 as information for identifying the code. In this case, the extraction unit 20g identifies a portion of the scanned image corresponding to the mark formed by the aimer light emitting unit 10 and extracts the identified portion as the code candidate area. As described above, the aimer light indicates the camera 5's shooting range and field of view center, so the mark formed by the aimer light can be aligned with the camera 5's field of view in advance. In particular, with the handheld optical information reading device 1A, the user aims the aimer light at the code to be read, so there is a high probability that the mark formed by the aimer light will overlap with the code. By aligning the portion corresponding to the mark formed by the aimer light emitting unit 10 with the camera 5's field of view center, the extraction unit 20g extracts an area including the camera 5's field of view, which is an area where a code is likely to exist. In this case, the part corresponding to the mark formed by the aimer light irradiation unit 10 does not have to be perfectly aligned with the center of the field of view of the camera 5; it may be slightly misaligned vertically or horizontally. Also, because the code has a predetermined size, the area extracted by the extraction unit 20g is not just the center of the field of view of the camera 5, but an area of a predetermined size that includes the center of the field of view.

抽出部20gは、読取画像の中心部分を特定し、当該中心部分をコード候補領域として抽出することもできる。例えば、カメラ5の視野中心を、コードを特定するための情報として予め取得しておくことで、このカメラ5の視野中心となる部分を読取画像上で特定することができる。特に、手持ち式の光学的情報読取装置1Aの場合、読取画像上で特定した中心部分は、エイマー光照射部10により形成された目印に対応しているので、その中心部分はコードが存在する可能性が高い領域となる。 The extraction unit 20g can also identify the center of the scanned image and extract that center as a code candidate area. For example, by acquiring the center of the field of view of the camera 5 in advance as information for identifying the code, it is possible to identify the center of the field of view of the camera 5 on the scanned image. In particular, in the case of a handheld optical information reading device 1A, the center identified on the scanned image corresponds to the mark formed by the aimer light irradiation unit 10, and therefore this center is an area where a code is likely to exist.

抽出部20gは、読取画像の中から、ユーザによる所定の部分の指定を受け付けるように構成することができ、当該指定された部分をコード候補領域として抽出することができる。すなわち、ユーザは読取画像上の任意の位置(座標)で任意の大きさの領域指定を行うと、抽出部20gは、その位置の座標及び大きさの情報に基づいて読取画像の中から所定の部分の指定を受け付ける。抽出部20gは、受け付けた部分をコード候補領域として抽出する。例えば、定置式の光学的情報読取装置1の場合、図1に示すように搬送用ベルトコンベアBによって搬送されているワークWを撮影してコードのデコード処理を実行することになるが、搬送用ベルトコンベアBの幅方向中央部にワークWが存在しているとは限らず、端にワークWが存在していることがあり、この場合には、読取画像の中から、搬送用ベルトコンベアBの端に対応する部分を指定することで、コードが存在する可能性が高い領域として的確な抽出が可能になる。その他にも、大きなワークWで、その中央部から離れた端近傍にコードが表示されている場合もあり、この場合には、読取画像の中から、ワークWの端近傍に対応する部分を指定することで、コードが存在する可能性が高い領域として的確な抽出が可能になる。 The extraction unit 20g can be configured to accept a user's designation of a specific portion of the scanned image and extract the designated portion as a code candidate area. That is, when the user designates a region of any size at any position (coordinate) on the scanned image, the extraction unit 20g accepts the designation of the specific portion of the scanned image based on the coordinates and size information of that position. The extraction unit 20g extracts the accepted portion as a code candidate area. For example, in the case of a stationary optical information reading device 1, as shown in FIG. 1, a workpiece W being transported by a conveyor belt B is photographed and a code decoding process is performed. However, the workpiece W is not necessarily located in the center of the width of the conveyor belt B, but may be located at an edge. In this case, by designating a portion of the scanned image corresponding to the edge of the conveyor belt B, it is possible to accurately extract the region as a region likely to contain a code. In addition, there are cases where a code is displayed near the edge of a large workpiece W, away from the center. In such cases, by specifying a part of the scanned image that corresponds to the edge of the workpiece W, it is possible to accurately extract the area where the code is likely to be present.

(記憶部の構成)
図3に示す記憶部30は、例えばSSD(ソリッドステートドライブ)等のような読み書き可能な記憶装置で構成することができるが、以下に示す各記憶部30a、30b、30c、30dは、上記記憶装置ではなく、ROM40に設けられていてもよい。すなわち、本実施形態では、画像データ記憶部30aと、デコード結果記憶部30bと、パラメータセット記憶部30cと、ニューラルネットワーク記憶部30dとがROM40に含まれている形態も対象である。画像データ記憶部30aは、カメラ5で生成された読取画像を記憶する部分である。デコード結果記憶部30bは、デコード処理部20fで実行されたコードのデコード結果を記憶する部分である。パラメータセット記憶部30cは、チューニング実行部20dが実行したチューニングの結果、設定された各種条件やユーザが設定した各種条件を記憶する部分である。ニューラルネットワーク記憶部30dは、後述する学習済みのニューラルネットワークの構造及びパラメータを記憶する部分である。
(Configuration of storage unit)
The storage unit 30 shown in FIG. 3 can be configured as a readable/writable storage device such as an SSD (solid state drive). However, the following storage units 30a, 30b, 30c, and 30d may be provided in a ROM 40 instead of the storage device. That is, this embodiment also covers a configuration in which the image data storage unit 30a, the decoded result storage unit 30b, the parameter set storage unit 30c, and the neural network storage unit 30d are included in the ROM 40. The image data storage unit 30a stores a scanned image generated by the camera 5. The decoded result storage unit 30b stores the decoded result of the code executed by the decoding processing unit 20f. The parameter set storage unit 30c stores the results of tuning executed by the tuning execution unit 20d, various conditions set by the user, and various conditions set by the user. The neural network storage unit 30d stores the structure and parameters of a trained neural network, which will be described later.

(ニューラルネットワークを利用した画像修復)
光学的情報読取装置1、1Aは、カメラ5で取得した読取画像を、ニューラルネットワークを利用して修復する画像修復機能を有している。本実施形態では、光学的情報読取装置1、1Aで機械学習を行うのではなく、既に学習が終わったニューラルネットワークの構造及びパラメータを光学的情報読取装置1、1Aが予め保持しておき、その保持している構造及びパラメータで構成されたニューラルネットワークを利用して画像修復を行うように構成されている点で、従来の光学的情報読取装置とは相違している。
(Image restoration using neural networks)
The optical information reading device 1, 1A has an image restoration function that uses a neural network to restore a read image acquired by the camera 5. In this embodiment, the optical information reading device 1, 1A does not perform machine learning, but rather the optical information reading device 1, 1A stores in advance the structure and parameters of a neural network that has already completed learning, and performs image restoration using a neural network configured with the stored structure and parameters, which is different from conventional optical information reading devices.

ニューラルネットワークは、図6に示すように、入力データ(本例では画像データ)が入力される入力層と、出力データを出力する出力層と、入力層及び出力層の間に設けられる中間層とを有している。中間層は例えば複数設けることができ、これにより、多層構造のニューラルネットワークとすることができる。 As shown in Figure 6, a neural network has an input layer to which input data (image data in this example) is input, an output layer that outputs output data, and an intermediate layer located between the input and output layers. For example, multiple intermediate layers can be provided, thereby creating a neural network with a multi-layer structure.

(ニューラルネットワークの学習)
始めに、図7に示すフローチャートに基づいてニューラルネットワークの学習時の基本手順について説明する。ニューラルネットワークの学習は、光学的情報読取装置1、1A以外の学習用として用意したコンピュータを用いて行うことができるが、学習用以外の汎用コンピュータを用いて行ってもよい。また、ニューラルネットワークの学習方法は従来から周知の方法を用いてもよい。
(Neural network learning)
First, the basic procedure for training a neural network will be described with reference to the flowchart shown in Figure 7. Training of the neural network can be performed using a computer prepared for training purposes other than the optical information reading device 1, 1A, but it can also be performed using a general-purpose computer other than one for training purposes. Furthermore, the neural network training method can be a conventionally known method.

スタート後のステップSA1では予め準備している不良画像のデータを読み込む。不良画像は、コードの読み取りに不適切な部分を有する画像であり、図8の左側に示すような画像を例示することができる。不適切な部分とは、例えば汚れた部分や着色された部分等である。その後、ステップSA2に進み、予め準備している理想画像のデータを読み込む。理想画像は、コードの読み取りに適切な画像であり、図8の右側に示すような画像を例示することができる。不良画像と理想画像とはペアとしておき、このようなペアを複数準備しておく。 After starting, in step SA1, data for a previously prepared defective image is read. A defective image is an image that has parts that are inappropriate for reading a code, and an example of this is an image like the one shown on the left side of Figure 8. Inappropriate parts include, for example, dirty or colored parts. Then, proceeding to step SA2, data for a previously prepared ideal image is read. An ideal image is an image that is appropriate for reading a code, and an example of this is an image like the one shown on the right side of Figure 8. A defective image and an ideal image are paired, and multiple such pairs are prepared.

ステップSA2では、損失関数を計算し、不良画像と理想画像との差分を求める。ステップSA3では、ステップSA2で求めた差分を反映させてニューラルネットワークのパラメータを更新する。 In step SA2, a loss function is calculated to determine the difference between the defective image and the ideal image. In step SA3, the neural network parameters are updated to reflect the difference determined in step SA2.

ステップSA4では機械学習の完了条件を満たすか否かを判定する。機械学習の完了条件とは、ステップSA2で求めた差分に基づいて設定することができ、例えば差分が所定以下であれば、機械学習の完了条件を満たすと判定できる。ステップSA4でYESと判定されて機械学習の完了条件を満たしている場合には機械学習を終了する。一方、ステップSA4でNOと判定されて機械学習の完了条件を満たしていない場合にはステップSA1に戻り、別の不良画像を読み込んだ後、ステップSA2に進んで当該別の不良画像とペアになっている別の理想画像を読み込む。 In step SA4, it is determined whether the machine learning completion conditions are met. The machine learning completion conditions can be set based on the difference determined in step SA2; for example, if the difference is less than a predetermined value, it can be determined that the machine learning completion conditions are met. If step SA4 returns YES, meaning the machine learning completion conditions are met, the machine learning ends. On the other hand, if step SA4 returns NO, meaning the machine learning completion conditions are not met, the process returns to step SA1, where another defective image is read, and then the process proceeds to step SA2, where another ideal image paired with the other defective image is read.

このようにして、複数の不良画像と、当該複数の不良画像にそれぞれ対応する複数の理想画像とを機械学習させることにより、学習済みのニューラルネットワークを予め生成することができる。学習済みのニューラルネットワークの構造及びパラメータを光学的情報読取装置1、1Aが保持しておくことで、光学的情報読取装置1、1A内で学習済みのニューラルネットワークを構築することができる。すなわち、機械学習を行う際には、膨大な数の不良画像と理想画像とをニューラルネットワークに入力することになるので、その際の演算能力としては極めて高いものが要求される。光学的情報読取装置1、1A内でそのような高い演算能力を確保するのは、装置の小型軽量化の要求を満たすことができなくなるおそれがあり、困難である。本例のように、光学的情報読取装置1、1A外で機械学習を行い、その結果得られたニューラルネットワークの構造及びパラメータを光学的情報読取装置1、1Aで保持しておけば、光学的情報読取装置1、1Aの小型軽量化を実現しながら、ニューラルネットワークによる画像修復が可能になる。 In this way, a trained neural network can be generated in advance by performing machine learning on multiple defective images and multiple ideal images corresponding to each of the multiple defective images. By storing the structure and parameters of the trained neural network in the optical information reading device 1, 1A, the trained neural network can be constructed within the optical information reading device 1, 1A. In other words, when performing machine learning, a huge number of defective images and ideal images are input into the neural network, which requires extremely high computing power. Ensuring such high computing power within the optical information reading device 1, 1A is difficult and could result in an inability to meet the demand for a compact and lightweight device. By performing machine learning outside the optical information reading device 1, 1A and storing the resulting neural network structure and parameters within the optical information reading device 1, 1A, as in this example, image restoration using a neural network becomes possible while achieving a compact and lightweight optical information reading device 1, 1A.

図9は、上述のようにして構成された畳み込みニューラルネットワーク(CNN:Convolutional Neural Network)の概念図である。「Convolution」では、入力された画像の特徴の抽出を行う。この層は、画像処理フィルタのような畳み込み演算で構成される。フィルタの重みをカーネルと呼び、カーネルに合わせた特徴量の抽出を行う。畳み込み層は一般的に複数の異なるカーネルを持ち、カーネル数に応じてマップ数(D)が増えていく。カーネルサイズは、例えば3×3、5×5などを取ることができる。 Figure 9 is a conceptual diagram of a convolutional neural network (CNN) configured as described above. "Convolution" extracts features from the input image. This layer is composed of convolution operations similar to image processing filters. The filter weights are called kernels, and feature extraction is performed according to the kernels. Convolution layers generally have multiple different kernels, and the number of maps (D) increases depending on the number of kernels. Kernel sizes can be, for example, 3x3 or 5x5.

「pooling」では、縮小処理を行って各カーネルの反応をまとめる。「Deconvolution」では、逆畳み込みフィルタにより、特徴値から画像を再構成する。「Unpooling」では、拡大処理を行って反応値を先鋭化する。 "Pooling" performs a reduction process to combine the responses of each kernel. "Deconvolution" uses a deconvolution filter to reconstruct an image from feature values. "Unpooling" performs an expansion process to sharpen the response values.

学習済みのニューラルネットワークの構造及びパラメータは、図3に示す記憶部30のニューラルネットワーク記憶部30dに記憶される。ニューラルネットワークの構造とは、入力層と出力層との間に設けられる中間層の数(D)や、画像処理フィルタの数等である。ニューラルネットワークのパラメータは、図7に示すフローチャートのステップSA3で設定されたパラメータである。 The structure and parameters of the trained neural network are stored in the neural network storage unit 30d of the storage unit 30 shown in Figure 3. The neural network structure includes the number of intermediate layers (D) provided between the input layer and output layer, the number of image processing filters, etc. The neural network parameters are the parameters set in step SA3 of the flowchart shown in Figure 7.

また、ニューラルネットワーク記憶部30dには、層の数または画像処理フィルタの数が異なる複数のニューラルネットワークの構造及びパラメータを記憶することが可能になっている。この場合、複数のニューラルネットワークの構造及びパラメータと、コード条件とを関連付けた状態でニューラルネットワーク記憶部30dに記憶することができる。例えば、第1のニューラルネットワークを構成するための当該ニューラルネットワークの構造及びパラメータと、第1のニューラルネットワークに対応する第1のコード条件とを関連付ける。関連付けを行う際、第1のニューラルネットワークの層の数またはフィルタの数は、第1のコード条件、特に第1のPPCによって最適な数を事前に特定しておくことができるものなので、この関係が保たれるように関連付けておく。同様に、第1のニューラルネットワークとは異なる第2のニューラルネットワークの構造及びパラメータと、第1のコード条件とは異なる第2のコード条件とを関連付ける。 The neural network storage unit 30d is also capable of storing the structures and parameters of multiple neural networks with different numbers of layers or image processing filters. In this case, the structures and parameters of multiple neural networks can be stored in the neural network storage unit 30d in an associated state with code conditions. For example, the structure and parameters of a first neural network are associated with the first code conditions corresponding to the first neural network. When associating, the number of layers or filters of the first neural network can be optimally determined in advance using the first code conditions, particularly the first PPC, so the association is made to maintain this relationship. Similarly, the structure and parameters of a second neural network different from the first neural network are associated with second code conditions different from the first code conditions.

複数のニューラルネットワークの構造及びパラメータをニューラルネットワーク記憶部30dに記憶している場合には、光学的情報読取装置1、1Aの設定時に、次のようにチューニング実行部20dが動作する。すなわち、チューニング実行部20dは、カメラ5により生成された読取画像に含まれるコード条件を設定する際、設定したコード条件に関連付けられたニューラルネットワークの構造及びパラメータをニューラルネットワーク記憶部30dから読み出して運用時に使用するニューラルネットワークとして特定する。例えば、チューニング実行部20dが読取画像に含まれるコード条件をして第1のコード条件を設定した場合には、第1のコード条件と関連付けられた第1のニューラルネットワークの構造及びパラメータをニューラルネットワーク記憶部30dから読み出す。そして、第1のニューラルネットワークの構造及びパラメータを光学的情報読取装置1、1Aの運用時に使用するニューラルネットワークとして特定する。これにより、コード条件に最適なニューラルネットワークの構造及びパラメータで読取画像の修復を試行できるので、読み取り精度を高めることができる。 If the neural network structures and parameters of multiple neural networks are stored in the neural network storage unit 30d, the tuning execution unit 20d operates as follows when setting the optical information reading device 1, 1A. That is, when setting the code conditions contained in the read image generated by the camera 5, the tuning execution unit 20d reads the neural network structure and parameters associated with the set code conditions from the neural network storage unit 30d and identifies it as the neural network to be used during operation. For example, if the tuning execution unit 20d sets a first code condition as the code condition contained in the read image, it reads the first neural network structure and parameters associated with the first code condition from the neural network storage unit 30d. Then, it identifies the first neural network structure and parameters as the neural network to be used during operation of the optical information reading device 1, 1A. This allows the read image to be repaired using the neural network structure and parameters that are optimal for the code conditions, thereby improving reading accuracy.

ニューラルネットワークの学習にあたっては、コードを構成するモジュールのピクセル分解能が特定範囲内である不良画像及び理想画像を機械学習させることもできる。モジュールのピクセル分解能は、例えばコードを構成する1つのモジュールのピクセル数(PPC)で表すことができ、PPCが特定範囲内にある不良画像及び理想画像のみでニューラルネットワークの機械学習を行ってもよい。 When training the neural network, it is also possible to train it on defective images and ideal images where the pixel resolution of the modules that make up the code is within a specific range. The pixel resolution of a module can be expressed, for example, as the number of pixels (PPC) in one module that makes up the code, and the neural network can be trained on only defective images and ideal images where the PPC is within a specific range.

上記特定範囲は、読取画像の修復効果の高いピクセル分解能を含み、かつ、読取画像の修復効果が殆ど向上しないピクセル分解能を除外する範囲であり、複数のモジュールで構成されたコードを含む画像の修復を前提として設定することができる。これにより、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させることができる。 The above-mentioned specific range includes pixel resolutions that provide a high level of restoration effect on scanned images, but excludes pixel resolutions that provide little improvement in restoration effect on scanned images. This range can be set assuming the restoration of images containing codes made up of multiple modules. This allows for improved processing speed as a neural network structure specialized for the restoration of images containing codes.

上記ピクセル数の特定範囲としては、例えば4PPC以上6PPC以下とすることができるが、4PPC未満であってもよいし、6PPCよりも多くてもよい。また、例えば特定範囲を4PPC以上6PPC以下に限定して機械学習することで、学習に用いる画像から余分なスケールの変動を排除することができ、学習済みニューラルネットワーク構造の適正化を図ることもできる。 The specific range of pixel counts can be, for example, 4 PPC or more and 6 PPC or less, but it can also be less than 4 PPC or more than 6 PPC. Furthermore, by limiting the specific range to 4 PPC or more and 6 PPC or less and performing machine learning, for example, it is possible to eliminate unnecessary scale variations from the images used for training, and 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 processor 20 of the optical information reading device 1, 1A is provided with an image restoration unit 20j configured with an AI chip 23. The image restoration unit 20j reads out the structure and parameters of a neural network stored in the neural network storage unit 30d of the storage unit 30, and configures a neural network in the optical information reading device 1, 1A using the read neural network structure and parameters. The neural network configured in the optical information reading device 1, 1A is the same as the trained neural network trained according to the procedure shown in the flowchart of Fig. 7.

画像修復部20jは、カメラ5により生成された読取画像をニューラルネットワークに入力することにより、ニューラルネットワーク記憶部30dに記憶されたニューラルネットワークの構造及びパラメータに従って読取画像の修復を試行する。そして、修復された読取画像に対してデコード処理部20fがデコード処理を実行する。 The image restoration unit 20j inputs the scanned image generated by the camera 5 into a neural network, and attempts to restore the scanned image according to the neural network structure and parameters stored in the neural network storage unit 30d. The decoding processing unit 20f then performs a decoding process on the restored scanned image.

フィルタ処理部20cは、カメラ5により生成された読取画像を画像修復部20jがニューラルネットワークに入力する前に、読取画像に対して画像処理フィルタを実行するように構成されている。これにより、ニューラルネットワークによる修復を試行する前に適切な画像処理を実行しておくことができ、その結果、読取画像の修復がより的確なものになる。 The filter processing unit 20c is configured to apply an image processing filter to the scanned image generated by the camera 5 before the image restoration unit 20j inputs the scanned image into the neural network. This allows appropriate image processing to be performed before attempting restoration using the neural network, resulting in more accurate restoration of the scanned image.

デコード処理部20fでデコード処理する全ての読取画像に対して画像修復部20jが画像修復を試行してもよいし、デコード処理部20fでデコード処理する一部の読取画像に対してのみ画像修復部20jが画像修復を試行してもよい。例えば、デコード処理部20fは、修復を試行する前の読取画像に対してデコード処理を実行し、デコードが成功したか否かを判定する。デコードに成功した場合には、修復が不要な読取画像であったということであり、そのまま結果を出力する。一方、デコードに失敗した場合には、画像修復部20jが読取画像の修復を試行し、修復された読取画像に対してデコード処理部20fがデコード処理を実行する。 The image restoration unit 20j may attempt image restoration on all read images decoded by the decoding processing unit 20f, or may attempt image restoration on only some of the read images decoded by the decoding processing unit 20f. For example, the decoding processing unit 20f performs a decoding process on the read image before attempting restoration and determines whether the decoding was successful. If the decoding is successful, it means that the read image does not require restoration, and the result is output as is. On the other hand, if the decoding fails, the image restoration unit 20j attempts to restore the read image, and the decoding processing unit 20f performs a decoding process on the restored read image.

(部分画像の入力)
画像修復部20jがニューラルネットワークに入力する画像は、カメラ5により生成された読取画像の全部であってもよいが、入力する画像のサイズが大きければ大きいほどニューラルネットワークによる演算量が増大し、プロセッサ20の演算負荷が重くなり、ひいては処理速度の低下を招くおそれがある。具体的には、図9に示すようなFCN(Fully Convolutional Network)型のニューラルネットワークでは、構造が等しいと仮定した場合、演算量は入力画像サイズに比例した量となり、入力画像サイズはコードの大きさの二乗に比例するため、演算量もコードの大きさの二乗に比例することになる。
(Partial image input)
The image input by the image restoration unit 20j to the neural network may be the entire scanned image generated by the camera 5, but the larger the size of the input image, the greater the amount of calculation by the neural network, which increases the calculation load on the processor 20 and may ultimately result in a decrease in processing speed. Specifically, in an FCN (Fully Convolutional Network) type neural network as shown in Figure 9, assuming the structure is the same, the amount of calculation is proportional to the input image size, and since the input image size is proportional to the square of the code size, the amount of calculation is also proportional to the square of the code size.

一方、カメラ5により生成された読取画像の全体にコードが存在しているケースは皆無といってよく、通常の運用時には読取画像の一部の領域にのみコードが存在しており、その領域のみニューラルネットワークによる修復を行うことができれば、読み取り精度を高めることができる。 On the other hand, there are virtually no cases where a code is present throughout the entire scanned image generated by camera 5. During normal operation, a code is present only in a small area of the scanned image, and if only that area can be repaired using a neural network, reading accuracy can be improved.

そこで、画像修復部20jがニューラルネットワークに入力する画像は、カメラ5により生成された読取画像の一部、即ちコードを含んだ部分画像とすることができる。具体的には、画像修復部20jは、抽出部20gが抽出したコード候補領域に対応する部分画像を、カメラ5により生成された読取画像から切り出す。画像修復部20jは切り出した部分画像をニューラルネットワークに入力することにより、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータに従って部分画像の修復を試行する。そして、修復された部分画像に対してデコード処理部20fがデコード処理を実行する。 The image that the image restoration unit 20j inputs into the neural network can be a portion of the scanned image generated by the camera 5, i.e., a partial image containing a code. Specifically, the image restoration unit 20j cuts out a partial image corresponding to the code candidate area extracted by the extraction unit 20g from the scanned image generated by the camera 5. By inputting the cut-out partial image into the neural network, the image restoration unit 20j attempts to restore the partial image according to the structure and parameters stored in the neural network storage unit 30d. The decoding processing unit 20f then performs decoding processing on the restored partial image.

上述したように読取画像の全体にコードが存在しているケースは殆ど無いので、コード候補領域に対応する部分画像のサイズは、読取画像のサイズよりも小さくなる。これにより、ニューラルネットワークに入力する画像のサイズが小さくなるので、プロセッサ20の演算負荷が軽くなり、ひいては処理速度の高速化が実現される。また、部分画像は、コードが存在する可能性が高い領域に対応しているので、読み取りに必要な情報、即ちコードの全体を含んだ画像とすることが可能である。このコードの全体を含んだ画像をニューラルネットワークに入力するので、読み取り精度の低下は抑制される。 As mentioned above, it is rare for a code to be present in the entire scanned image, so the size of the partial image corresponding to the code candidate area is smaller than the size of the scanned image. This reduces the size of the image input to the neural network, reducing the computational load on the processor 20 and ultimately achieving faster processing speeds. Furthermore, because the partial image corresponds to an area where a code is likely to be present, it is possible to create an image that contains the information necessary for reading, i.e., the entire code. Because this image containing the entire code is input to the neural network, a decrease in reading accuracy is suppressed.

画像修復部20jは、チューニング実行部20dで取得したコードサイズに基づいて部分画像のニューラルネットワークへの入力サイズを決定することができる。上述したように、チューニング実行部20dはコードサイズを取得することができる。画像修復部20jは、ニューラルネットワークへ入力する部分画像の入力サイズを、チューニング実行部20dで取得したコードサイズよりも所定量だけ大きくする。 The image restoration unit 20j can determine the input size of the partial image to the neural network based on the code size obtained by the tuning execution unit 20d. As described above, the tuning execution unit 20d can obtain the code size. The image restoration unit 20j increases the input size of the partial image to be input to the neural network by a predetermined amount compared to the code size obtained by the tuning execution unit 20d.

すなわち、部分画像をニューラルネットワークへ入力することで演算負荷を軽くすることができる反面、例えばコードが回転していたり、コードの位置が精密に検出できなかった場合には、部分画像中のコードの一部が欠けてしまい、デコード処理に失敗する可能性もある。本実施形態では、ニューラルネットワークへの入力サイズがチューニング実行部20dで取得したコードサイズと同じではなく、コードサイズよりも所定量だけ大きいので、部分画像中でコードの一部が欠けるのを抑制できる。尚、コードサイズよりも所定量だけ大きくしていることで、ニューラルネットワークへの入力サイズに上限を持たせることができ、よって、演算負荷が重くならないようにすることができる。「所定量」とは、例えばニューラルネットワークへ入力される部分画像の横(または縦)の長さが、チューニング実行部20dで取得したコードの横(または縦)の長さの1.5倍以上、または2.0倍以上、または3.0倍以上であってもよい。 In other words, while inputting a partial image into the neural network can reduce the computational load, if, for example, the code is rotated or the code position cannot be detected precisely, part of the code in the partial image may be missing, which could result in a failed decoding process. In this embodiment, the input size to the neural network is not the same as the code size acquired by the tuning execution unit 20d, but is larger than the code size by a predetermined amount, thereby preventing part of the code from being missing from the partial image. Furthermore, by making the input size larger than the code size by a predetermined amount, an upper limit can be placed on the input size to the neural network, thereby preventing the computational load from becoming too heavy. The "predetermined amount" may mean, for example, that the horizontal (or vertical) length of the partial image input to the neural network is 1.5 times or more, 2.0 times or more, or 3.0 times or more the horizontal (or vertical) length of the code acquired by the tuning execution unit 20d.

画像修復部20jがニューラルネットワークへ入力する部分画像の入力サイズを決定する際、チューニング実行部20dで取得したコードを構成する1つのモジュールのピクセル数と当該コードの縦または横方向に並ぶモジュール数とに基づいて決定することができる。 When the image restoration unit 20j determines the input size of the partial image to be input to the neural network, it can do so based on the number of pixels in one module that makes up the code acquired by the tuning execution unit 20d and the number of modules arranged vertically or horizontally in the code.

また、チューニング実行部20dでは上述したようにコード条件を設定することができる。画像修復部20jは、チューニング実行部20dで設定されたコード条件に基づいて、ニューラルネットワークに入力する読取画像のサイズを設定することもできる。例えば、チューニング実行部20dで設定されたコード条件のうち、コードサイズを画像修復部20jが取得すると、取得したコードサイズよりも所定量だけ大きなサイズの部分画像をニューラルネットワークに入力する。コードサイズが大きければニューラルネットワークに入力する部分画像のサイズが大きくなる一方、コードサイズが小さければニューラルネットワークに入力する部分画像のサイズが小さくなる。つまり、ニューラルネットワークに入力する部分画像のサイズをコード条件に応じて変えることができる。 The tuning execution unit 20d can also set the code conditions as described above. The image restoration unit 20j can also set the size of the scanned image to be input to the neural network based on the code conditions set by the tuning execution unit 20d. For example, when the image restoration unit 20j acquires the code size from the code conditions set by the tuning execution unit 20d, it inputs a partial image that is a predetermined amount larger than the acquired code size to the neural network. If the code size is larger, the size of the partial image input to the neural network will be larger, and if the code size is smaller, the size of the partial image input to the neural network will be smaller. In other words, the size of the partial image input to the neural network can be changed depending on the code conditions.

(縮小・拡大機能)
ここで、図9に示すような畳み込みニューラルネットワークにおいてコードの特徴を十分に捉え、デコードに適した画像に修復するためには、一定量のモジュール数をカバーする範囲で特徴量を抽出する必要がある。例えば、ニューラルネットワークから得られる1つの特徴値が6×6モジュールの範囲から抽出される値であるとし、1つのモジュールが20ピクセルで撮影された画像の場合、120×120ピクセルの範囲から集約された特徴値を算出するようにニューラルネットワークを設計しなければならない。つまり、カバーしたいピクセル範囲が広ければ広い程、ニューラルネットワークの階層を深くしなければならず、例えば上述した120×120ピクセルの範囲から特徴値を集約しようとすると、6回の畳み込み層が必要となる。
(Zoom in/out function)
In order to fully capture the features of the code and restore the image to a suitable size for decoding using a convolutional neural network such as that shown in Figure 9, it is necessary to extract features within a range covering a certain number of modules. For example, if one feature value obtained from the neural network is a value extracted from a 6x6 module range, and an image is captured with one module consisting of 20 pixels, the neural network must be designed to calculate a feature value aggregated from a 120x120 pixel range. In other words, the wider the pixel range to be covered, the deeper the neural network hierarchy must be. For example, to aggregate feature values from the above-mentioned 120x120 pixel range, six convolutional layers are required.

しかし、コードは白色のモジュールと黒色のモジュールとがランダムに配列されることによって構成されているため、広範囲でのピクセル値の関係は希薄であり、カバーするピクセル範囲を一定以上に広げても修復効果は殆ど向上しない。このような特徴を、本明細書では狭範囲特徴と呼ぶ。 However, because the code is composed of a random arrangement of white and black modules, the relationship between pixel values over a wide range is weak, and expanding the pixel range covered beyond a certain point hardly improves the restoration effect. In this specification, such features are referred to as narrow-range features.

また、コードに含まれるファインダパターンなど決まったモジュールパターンの配置やコード全体として四角形状であることは広範囲特徴になり得るが、モジュールと背景とを大まかに分離するだけであれば、広範囲特徴を用いることなく、狭範囲特徴のみを用いても十分に修復可能である。尚、広範囲特徴とは、広範囲に渡って決まった形状を持つ特徴と定義することができる。 Furthermore, the arrangement of fixed module patterns, such as finder patterns contained in code, or the rectangular shape of the code as a whole can be considered wide-range features. However, if you only roughly separate the modules from the background, recovery is sufficient using only narrow-range features, without using wide-range features. Wide-range features can be defined as features that have a fixed shape over a wide range.

そこで、図7に示すニューラルネットワークの学習の際、コードのPPCが特定範囲にある画像を用いることができる。これにより、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させることができる反面、PPCが特定範囲外にある読取画像に対する修復効果は低下する懸念がある。尚、ニューラルネットワークの学習の際、コードのPPCが特定範囲外にある画像を用いてもよい。 Therefore, when training the neural network shown in Figure 7, images with code PPCs that fall within a specific range can be used. This can improve processing speed as a neural network structure specialized for repairing images that contain codes, but there is a concern that the repair effect will be reduced for scanned images with PPCs that fall outside the specific range. Note that when training the neural network, images with code PPCs that fall outside the specific range may also be used.

本実施形態の光学的情報読取装置1、1Aでは、読取画像のPPCが特定範囲に入るようにするために、読取画像の縮小・拡大機能を備えている。図5に示すように、プロセッサ20には、縮小部20h及び拡大部20iが構成されている。縮小部20hは、カメラ5により生成された読取画像の中のコードを構成するモジュールのピクセル分解能が上述した特定範囲内となるように縮小した読取画像を生成する部分であり、また、拡大部20iは、カメラ5により生成された読取画像の中のコードを構成するモジュールのピクセル分解能が上述した特定範囲内となるように拡大した読取画像を生成する部分である。 The optical information reading device 1, 1A of this embodiment is equipped with a function for reducing and enlarging the read image so that the PPC of the read image falls within a specific range. As shown in FIG. 5, the processor 20 is configured with a reduction unit 20h and an enlargement unit 20i. The reduction unit 20h is a part that generates a reduced read image so that the pixel resolution of the modules that make up the code in the read image generated by the camera 5 falls within the specific range described above. The enlargement unit 20i is a part that generates an enlarged read image so that the pixel resolution of the modules that make up the code in the read image generated by the camera 5 falls within the specific range described above.

縮小部20h及び拡大部20iは、例えばカメラ5により生成された読取画像におけるコードのPPCが特定範囲(4PPC以上6PPC以下)外にあるか否かを判定し、特定範囲内である場合には、縮小または拡大を非実行にする一方、特定範囲外である場合には、縮小または拡大を実行する。縮小または拡大を実行することで、画像修復部20jがニューラルネットワークへ入力する部分画像におけるコードのPPCが特定範囲内に入る。 The reduction unit 20h and the enlargement unit 20i determine whether the PPC of the code in the scanned image generated by the camera 5, for example, is outside a specific range (4 PPC to 6 PPC). If it is within the specific range, they do not perform reduction or enlargement, but if it is outside the specific range, they perform reduction or enlargement. By performing reduction or enlargement, the PPC of the code in the partial image input to the neural network by the image restoration unit 20j falls within the specific range.

画像修復部20jは、特定範囲内となるように拡大または縮小した読取画像を、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、その構造及びパラメータに従って読取画像の修復を試行する。そして、修復された読取画像に対してデコード処理部20fがデコード処理を実行する。 The image restoration unit 20j inputs the scanned image, enlarged or reduced so that it fits within a specific range, into a neural network configured with the structure and parameters stored in the neural network storage unit 30d, and attempts to restore the scanned image according to the structure and parameters. The decoding processing unit 20f then performs a decoding process on the restored scanned image.

抽出部20gは、拡大部20iにより拡大した読取画像または縮小部20hにより縮小した読取画像に対してコードを探索し、探索されたコードを含む領域をコードが存在する可能性が高いコード候補領域として抽出するように構成してもよい。この場合、画像修復部20jは、抽出部20gが抽出したコード候補領域に対応する部分画像を、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、その構造及びパラメータに従って読取画像の修復を試行する。 The extraction unit 20g may be configured to search for codes in the scanned image enlarged by the enlargement unit 20i or reduced by the reduction unit 20h, and extract the area containing the searched code as a code candidate area where a code is likely to exist. In this case, the image restoration unit 20j inputs the partial image corresponding to the code candidate area extracted by the extraction unit 20g into a neural network configured with the structure and parameters stored in the neural network storage unit 30d, and attempts to restore the scanned image in accordance with the structure and parameters.

光学的情報読取装置1、1Aの設定時には、チューニング実行部20dが、拡大率を変えた複数の読取画像(拡大画像)を生成すること、及び縮小率を変えた複数の読取画像(縮小画像)を生成することができる。チューニング実行部20dは、生成した複数の読取画像(拡大画像または縮小画像)をニューラルネットワークに入力して各読取画像の修復を試行し、修復された各読取画像に対してデコード処理を実行し、コードの読み取りのしやすさを示す読取余裕度を求める。チューニング実行部20dは、求めた読取余裕度が所定よりも高い読取画像の拡大率または縮小率を、運用時に使用する拡大率または縮小率として特定する。チューニング実行部20dが拡大率または縮小率を特定した場合、光学的情報読取装置1、1Aの運用時には、縮小部20h及び拡大部20iは、チューニング実行部20dが特定した拡大率または縮小率で読取画像を拡大または縮小する。 When setting up the optical information reading device 1, 1A, the tuning execution unit 20d can generate multiple read images (enlarged images) with different magnification ratios and multiple read images (reduced images) with different reduction ratios. The tuning execution unit 20d inputs the generated multiple read images (enlarged or reduced images) into a neural network to attempt to repair each read image, and performs a decoding process on each repaired read image to determine the reading margin, which indicates the ease of reading the code. The tuning execution unit 20d identifies the magnification or reduction ratio of the read image for which the determined reading margin is higher than a predetermined value as the magnification or reduction ratio to be used during operation. When the tuning execution unit 20d identifies a magnification or reduction ratio, during operation of the optical information reading device 1, 1A, the reduction unit 20h and the enlargement unit 20i enlarge or reduce the read image at the magnification or reduction ratio identified by the tuning execution unit 20d.

すなわち、例えば特定範囲にある程度の広さがある場合、その特定範囲内であっても拡大率や縮小率を変えると、読取余裕度が変化することが考えられる。チューニング実行部20dが求めた読取余裕度が所定よりも高くなるように、運用時における読取画像の拡大率または縮小率を特定することができるので、処理速度及び読み取り精度が向上する。 In other words, for example, if the specific range is relatively large, changing the magnification or reduction ratio within that specific range may change the reading margin. The magnification or reduction ratio of the scanned image during operation can be specified so that the reading margin determined by the tuning execution unit 20d is higher than the specified value, thereby improving processing speed and reading accuracy.

チューニング実行部20dは、各読取画像の読取余裕度を求めた後、求めた複数の読取余裕度のうち、最も高い読取余裕度の読取画像の拡大率または縮小率を、運用時に使用する拡大率または縮小率として特定することができる。これにより、処理速度及び読み取り精度を更に向上させることができる。 After calculating the reading margin for each scanned image, the tuning execution unit 20d can identify the magnification or reduction ratio of the scanned image with the highest reading margin among the multiple reading margins calculated as the magnification or reduction ratio to be used during operation. This can further improve processing speed and reading accuracy.

また、縮小部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に記憶された複数のパラメータセットの中から任意の一のパラメータセットを適用することができる。 Furthermore, by utilizing the ability of the reduction unit 20h and the enlargement unit 20i to reduce and enlarge the scanned image, the number of parameter sets can be increased. Multiple parameter sets with different reduction ratios by the reduction unit 20h and multiple parameter sets with different enlargement ratios by the enlargement unit 20i can be generated, and these parameter sets can be stored in the parameter set storage unit 30c of the storage unit 30. For example, if multiple reduction ratios can be set by the reduction unit 20h, such as 1/2, 1/4, and 1/8, the parameter set with a reduction ratio of 1/2, a parameter set with a reduction ratio of 1/4, and a parameter set with a reduction ratio of 1/8 can be stored in the parameter set storage unit 30c. Furthermore, if multiple enlargement ratios can be set by the enlargement unit 20i, such as 2x, 4x, and 8x, the parameter set with a magnification ratio of 2x, a parameter set with a magnification ratio of 4x, and a parameter set with a magnification ratio of 8x can be stored in the parameter set storage unit 30c. Any one of the multiple parameter sets stored in the parameter set storage unit 30c can then be applied.

(画像修復フィルタ)
画像修復部20jは、ニューラルネットワークを利用して読取画像の修復を試行する画像修復フィルタを実行する部分であってもよい。画像修復フィルタは、読取画像を、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、ニューラルネットワーク記憶部30dに記憶された構造及びパラメータに従って読取画像の修復を試行するフィルタであり、上述した画像修復と同じ機能を発揮する。
(Image restoration filter)
The image restoration unit 20j may be a part that executes an image restoration filter that attempts to restore the scanned image using a neural network. The image restoration filter is a filter that attempts to restore the scanned image in accordance with the structure and parameters stored in the neural network storage unit 30d by inputting the scanned image to a neural network configured with the structure and parameters stored in the neural network storage unit 30d, and performs the same function as the image restoration described above.

画像修復フィルタを実行可能にする場合、画像修復フィルタを設定するための設定部20e(図5に示す)を設けることができる。設定部20eは、ユーザによる画像修復フィルタの設定を受付可能に構成されている。設定部20eは、例えば光学的情報読取装置1、1Aの設定時に、「画像修復フィルタの適用」と「画像修復フィルタの非適用」との一方をユーザが選択可能なユーザインターフェースを生成して表示部6に表示させ、ユーザによる選択を受け付けるように構成することができる。したがって、画像修復部20jは、設定部20eにより設定された画像修復フィルタを読取画像に適用することで、当該読取画像に対して修復を試行する。 When an image restoration filter is executable, a setting unit 20e (shown in Figure 5) for setting the image restoration filter can be provided. The setting unit 20e is configured to accept the user's setting of the image restoration filter. For example, when setting up the optical information reading device 1, 1A, the setting unit 20e can be configured to generate a user interface that allows the user to select either "apply image restoration filter" or "do not apply image restoration filter," display this on the display unit 6, and accept the user's selection. Therefore, the image restoration unit 20j attempts to restore the scanned image by applying the image restoration filter set by the setting unit 20e to the scanned image.

設定部20eは、チューニング実行部20dに含まれていてもよいし、チューニング実行部20dとは別に構成されていてもよい。設定部20eがチューニング実行部20dに含まれている場合、チューニング時に画像修復フィルタに関するパラメータを設定することが可能になる。画像修復フィルタに関するパラメータとしては、「画像修復フィルタの適用」と「画像修復フィルタの非適用」とを含むことができる。「画像修復フィルタの適用」とは、画像修復フィルタを実行可能に設定することであり、「画像修復フィルタの非適用」とは、画像修復フィルタを設定しないことである。 The setting unit 20e may be included in the tuning execution unit 20d, or may be configured separately from the tuning execution unit 20d. If the setting unit 20e is included in the tuning execution unit 20d, it becomes possible to set parameters related to the image restoration filter during tuning. Parameters related to the image restoration filter can include "apply image restoration filter" and "not apply image restoration filter." "Apply image restoration filter" means setting the image restoration filter to be executable, and "not apply image restoration filter" means not setting the image restoration filter.

画像修復フィルタに関するパラメータは、画像修復フィルタに関する情報でもあり、この場合、画像修復フィルタの設定に関する情報を含むパラメータセットをパラメータセット記憶部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. In this case, a parameter set including information related to the image restoration filter settings can be stored in the parameter set storage unit 30c. The parameters related to the image restoration filter include "apply image restoration filter" and "not apply image restoration filter." Therefore, the parameter sets stored in the parameter set storage unit 30c include a first parameter set that sets the image restoration filter to be executable, and a second parameter set that does not set the image restoration filter. When the optical information reading device 1, 1A is operated, one of the first and second parameter sets is applied. When the first parameter set is applied, the decoding processing unit 20f performs decoding processing on the read image on which image restoration has been performed using the image restoration filter. Meanwhile, when the second parameter set is applied, the decoding processing unit 20f performs decoding processing on the read image on which image restoration has not been performed.

パラメータセット記憶部30cに記憶されるパラメータセットには、カメラ5により生成された読取画像に含まれるコード条件を設定する項目も含まれる。コード条件を設定する項目では、チューニング実行部20dが取得したPPC、コード種、コードサイズ等が設定される。例えば、1つのパラメータセットには、コード条件を設定する項目としてのPPC、コード種、コードサイズと、撮像条件としてのカメラ5のゲイン、照明部4の光量、露光時間と、フィルタ処理部20cが適用する画像処理フィルタの項目としての画像処理フィルタ種類、当該画像処理フィルタのパラメータと、画像修復フィルタの適用項目とを含むことができる。これら各項目は、チューニング実行部20dが設定した値等をそのまま用いてもよいし、ユーザが任意に変更することもできる。 The parameter sets stored in the parameter set storage unit 30c also include items for setting the code conditions included in the scanned image generated by the camera 5. The items for setting the code conditions include the PPC, code type, code size, etc. acquired by the tuning execution unit 20d. For example, one parameter set may include the PPC, code type, and code size as items for setting the code conditions, the gain of the camera 5, the light intensity and exposure time of the illumination unit 4 as imaging conditions, and the type of image processing filter, parameters of the image processing filter, and application items of the image restoration filter as items for the image processing filter applied by the filter processing unit 20c. The values set by the tuning execution unit 20d may be used as is for each of these items, or the user may change them as desired.

(チューニング工程の手順の一例)
光学的情報読取装置1、1Aの設定時にチューニング実行部20dによって行われるチューニング工程の手順の一例について、図10に示すフローチャートに基づいて具体的に説明する。図10に示すフローチャートのスタート後のステップSB1では、チューニング実行部20dが照明部4及びカメラ5を制御してカメラ5に読取画像を生成させ、チューニング実行部20dが読取画像を取得する。このとき、デコード処理前に実行される画像処理フィルタの有無や種類、ニューラルネットワークによる画像修復を適用するためのデコード処理パラメータは任意のパラメータに設定されている。次いでステップSB2に進み、取得した読取画像に対してチューニング実行部20dがデコード処理部20fにデコード処理を実行させる。
(An example of the tuning process)
An example of the procedure of the tuning process performed by the tuning execution unit 20d when setting up the optical information reading device 1, 1A will be specifically described with reference to the flowchart shown in Fig. 10. In step SB1 after the start of the flowchart shown in Fig. 10, the tuning execution unit 20d controls the illumination unit 4 and camera 5 to cause the camera 5 to generate a read image, and the tuning execution unit 20d acquires the read image. At this time, the presence and type of an image processing filter to be executed before the decoding process and the decoding process parameters for applying image restoration by a neural network are set to arbitrary parameters. Next, proceeding to step SB2, the tuning execution unit 20d causes the decoding processing unit 20f to execute decoding process on the acquired read image.

デコード処理後、ステップSB3に進み、ステップSB2のデコード処理が成功したか否かをチューニング実行部20dが判定する。ステップSB3でNOと判定されてステップSB2のデコード処理が失敗した場合、即ちコードの読み取りができなかった場合には、ステップSB4に進み、デコード処理パラメータを別のパラメータに変更した後、ステップSB2で再度デコード処理を実行する。全てのデコード処理パラメータでデコード処理を失敗した場合にはこのフローを終了してユーザに報知する。 After the decoding process, the process proceeds to step SB3, where the tuning execution unit 20d determines whether the decoding process of step SB2 was successful. If the determination in step SB3 is NO and the decoding process of step SB2 has failed, i.e., if the code could not be read, the process proceeds to step SB4, where the decoding process parameters are changed to other parameters, and the decoding process is performed again in step SB2. If the decoding process has failed with all decoding process parameters, this flow ends and the user is notified.

一方、ステップSB3でYESと判定されてステップSB2のデコード処理が成功した場合には、ステップSB5に進み、チューニング実行部20dがコードパラメータ(PPC、コード種、コードサイズ等)を決定する。チューニング実行部20dがコードパラメータを決定すると、コードパラメータと関連付けられてニューラルネットワーク記憶部30dに記憶されているニューラルネットワークの構造及びパラメータも決定される(ステップSB6)。ステップSB6では、ニューラルネットワーク記憶部30dから読み出した構造及びパラメータでニューラルネットワークを構成する。 On the other hand, if step SB3 returns YES and the decoding process in step SB2 is successful, the process proceeds to step SB5, where the tuning execution unit 20d determines code parameters (PPC, code type, code size, etc.). Once the tuning execution unit 20d determines the code parameters, it also determines the structure and parameters of the neural network stored in the neural network storage unit 30d in association with the code parameters (step SB6). In step SB6, a neural network is constructed using the structure and parameters read from the neural network storage unit 30d.

ステップSB7では、画像修復部20jが、ステップSB6で構成されたニューラルネットワークに読取画像を入力することにより、読取画像の修復を試行し、前記修復された読取画像に対してデコード処理部20fがデコード処理を実行する。その後、ステップSB8に進み、チューニング実行部20dがステップSB7のデコード処理結果に基づいて読取余裕度を評価し、一旦記憶しておく。 In step SB7, the image restoration unit 20j attempts to restore the read image by inputting the read image into the neural network configured in step SB6, and the decoding processing unit 20f performs decoding processing on the restored read image. Then, proceeding to step SB8, the tuning execution unit 20d evaluates the reading margin based on the results of the decoding processing in step SB7 and temporarily stores the evaluation.

ステップSB9では、全てのデコード処理パラメータでデコード処理の実行が完了したか否かを判定する。ステップSB9でNOと判定されて、全てのデコード処理パラメータでデコード処理の実行が完了していない場合にはステップSB10に進み、デコード処理パラメータを別のパラメータに変更した後、ステップSB7に進む。 In step SB9, it is determined whether the decoding process has been completed for all decoding process parameters. If the determination in step SB9 is NO, meaning that the decoding process has not been completed for all decoding process parameters, proceed to step SB10, change the decoding process parameter to another parameter, and then proceed to step SB7.

一方、ステップSB9でYESと判定されて全てのデコード処理パラメータでデコード処理の実行が完了するとステップSB11に進む。ステップSB11では、チューニング実行部20dが、全てのデコード処理パラメータの中から読取余裕度が最も高いデコード処理パラメータを選択し、その選択したデコード処理パラメータを運用時に適用するパラメータとして決定する。尚、チューニング工程では、撮像条件等も適切な条件に設定される。 On the other hand, if step SB9 returns YES and the decoding process is completed for all decoding process parameters, the process proceeds to step SB11. In step SB11, the tuning execution unit 20d selects the decoding process parameter with the highest reading margin from among all the decoding process parameters, and determines the selected decoding process parameter as the parameter to be applied during operation. Note that during the tuning process, imaging conditions, etc. are also set to appropriate conditions.

(縮小率及び拡大率決定前のデコード処理手順)
次に、縮小率及び拡大率決定前のデコード処理手順の一例について、図11に示すフローチャートに基づいて具体的に説明する。図11に示すフローチャートで特定される処理は、図10に示すフローチャートのステップSB2で実行することができる。
(Decoding procedure before determining reduction and enlargement ratios)
Next, an example of a decoding process procedure before determining the reduction ratio and enlargement ratio will be specifically described with reference to the flowchart shown in Fig. 11. The process specified in the flowchart shown in Fig. 11 can be executed in step SB2 of the flowchart shown in Fig. 10.

図11に示すフローチャートのスタート後のステップSC1では、チューニング実行部20dが、複数の画像処理フィルタの中から任意の画像処理フィルタを選択する。この画像処理フィルタは、フィルタ処理部20cで実行されるフィルタである。その後、ステップSC2では、ステップSC1で選択した画像処理フィルタを読取画像に対してフィルタ処理部20cが実行する。 In step SC1 after the start of the flowchart shown in Figure 11, the tuning execution unit 20d selects an arbitrary image processing filter from among multiple image processing filters. This image processing filter is the filter executed by the filter processing unit 20c. Then, in step SC2, the filter processing unit 20c executes the image processing filter selected in step SC1 on the scanned image.

次いで、ステップSC3に進み、画像ピラミッドを作成する。画像ピラミッドは、元の読取画像、元の読取画像を1/2に縮小した画像、元の読取画像を1/4に縮小した画像、元の読取画像を1/8に縮小した画像、…で構成されている。読取画像の縮小は、縮小部20hで実行される。また、画像ピラミッドは、元の読取画像、元の読取画像を2倍に拡大した画像、元の読取画像を4倍に拡大した画像、元の読取画像を8倍に拡大した画像、…で構成することもできる。読取画像の拡大は、拡大部20iで実行される。尚、縮小した画像と、拡大した画像とのうち、一方を省略してもよい。 Next, proceed to step SC3 and create an image pyramid. The image pyramid is composed of the original scanned image, an image obtained by reducing the original scanned image by half, an image obtained by reducing the original scanned image by a quarter, an image obtained by reducing the original scanned image by an eighth, and so on. The reduction of the scanned image is performed by the reduction unit 20h. The image pyramid can also be composed of the original scanned image, an image obtained by enlarging the original scanned image by two times, an image obtained by enlarging the original scanned image by four times, an image obtained by enlarging the original scanned image by eight times, and so on. The enlargement of the scanned image is performed by the enlargement unit 20i. Note that either the reduced image or the enlarged image may be omitted.

画像ピラミッドを作成した後、ステップSC4に進み、画像ピラミッドを構成する複数の読取画像の中から任意の読取画像を選択する。この選択された画像の中には、縮小及び拡大されていない元の読取画像が含まれる場合もある。ステップSC5では、抽出部20gが、ステップSC4で選択した読取画像の中からコードが存在する可能性が高いコード候補領域を抽出する。その後、ステップSC6に進み、画像修復部20jが、ステップSC5で抽出されたコード候補領域に対応する部分画像をニューラルネットワークに入力して読取画像の修復を試行する。ニューラルネットワークに入力する部分画像のサイズは、上述したコード条件によって決定する。 After creating the image pyramid, the process proceeds to step SC4, where an arbitrary scanned image is selected from the multiple scanned images that make up the image pyramid. The selected images may include the original scanned image that has not been reduced or enlarged. In step SC5, the extraction unit 20g extracts code candidate areas that are likely to contain a code from the scanned images selected in step SC4. The process then proceeds to step SC6, where the image restoration unit 20j inputs the partial image corresponding to the code candidate area extracted in step SC5 into a neural network and attempts to restore the scanned image. The size of the partial image input to the neural network is determined by the code conditions described above.

読取画像の修復後、ステップSC7に進み、コードの輪郭やコードを構成しているモジュールの位置決め処理を実行する。位置決め処理後、ステップSC8に進み、コードを構成している各モジュールが白であるか、黒であるかを判別する。白黒の判別後、ステップSC9に進み、修復された読取画像に対してデコード処理部20fがデコード処理を実行する。デコード処理では、例えばモジュールの0-1マトリックスから文字列を復元する手法を採用することができる。 After the scanned image is restored, the process proceeds to step SC7, where a positioning process is performed on the outline of the code and the modules that make up the code. After the positioning process, the process proceeds to step SC8, where it is determined whether each module that makes up the code is white or black. After determining whether it is black or white, the process proceeds to step SC9, where the decoding processing unit 20f performs a decoding process on the restored scanned image. The decoding process can use a method, for example, to restore a character string from the 0-1 matrix of the modules.

その後、ステップSC10に進み、ステップSC9のデコード処理が成功したか否かをチューニング実行部20dが判定する。ステップSC10でNOと判定されてステップSC9のデコード処理が失敗した場合には、ステップSC11に進み、画像ピラミッドを構成している全ての読取画像が選択されたか否かを判定する。ステップSC11でNOと判定されて画像ピラミッドを構成している全ての読取画像が選択されていない場合にはステップSC4に進み、画像ピラミッドを構成している別の縮小された読取画像または別の拡大された読取画像を選択し、ステップSC5に進む。 Then, the process proceeds to step SC10, where the tuning execution unit 20d determines whether the decoding process of step SC9 was successful. If the determination in step SC10 is NO and the decoding process of step SC9 failed, the process proceeds to step SC11, where it determines whether all of the scanned images that make up the image pyramid have been selected. If the determination in step SC11 is NO and all of the scanned images that make up the image pyramid have not been selected, the process proceeds to step SC4, where another reduced scanned image or another enlarged scanned image that makes up the image pyramid is selected, and the process proceeds to step SC5.

一方、ステップSC11でYESと判定されて画像ピラミッドを構成している全ての読取画像が選択された場合にはこのフローを終了し、デコードが成功した条件を記憶しておく。 On the other hand, if step SC11 returns YES and all scanned images that make up the image pyramid have been selected, this flow ends and the conditions for successful decoding are stored.

(縮小率及び拡大率決定後のデコード処理手順)
次に、縮小率及び拡大率決定後のデコード処理手順の一例について、図12に示すフローチャートに基づいて具体的に説明する。図12に示すフローチャートで特定される処理は、図10に示すフローチャートのステップSB7及び光学的情報読取装置1、1Aの運用時に実行することができる。
(Decoding procedure after determining reduction and enlargement ratios)
Next, an example of a decoding process procedure after determining the reduction ratio and enlargement ratio will be specifically described with reference to the flowchart shown in Fig. 12. The process specified in the flowchart shown in Fig. 12 can be executed in step SB7 of the flowchart shown in Fig. 10 and when the optical information reader 1, 1A is in operation.

図12に示すフローチャートのスタート後のステップSD1では、図11に示すフローチャートのステップSC1で選択した画像処理フィルタを読取画像に対してフィルタ処理部20cが実行する。このとき、図13の上側に示すような読取画像に対してフィルタ処理部20cが平均化フィルタを実行した場合には、図13の下側に示すような画像処理フィルタ実行後の画像が得られる。 In step SD1 after the start of the flowchart shown in FIG. 12, the filter processing unit 20c applies the image processing filter selected in step SC1 of the flowchart shown in FIG. 11 to the read image. At this time, if the filter processing unit 20c applies an averaging filter to the read image shown in the upper part of FIG. 13, the image obtained after application of the image processing filter will be as shown in the lower part of FIG. 13.

その後、ステップSD2に進み、必要に応じて読取画像の縮小・拡大処理を実行する。具体的には、画像処理フィルタ実行後の読取画像におけるコードのPPCが特定範囲内である場合には、縮小または拡大を非実行にする一方、特定範囲外である場合には、縮小または拡大を実行し、PPCが特定範囲内に入るようにする。図14の上側に、縮小処理後の読取画像の例を示している。 Then, proceed to step SD2, where the scanned image is reduced or enlarged as necessary. Specifically, if the PPC of the code in the scanned image after the image processing filter is applied is within a specific range, reduction or enlargement is not performed; if it is outside the specific range, reduction or enlargement is performed so that the PPC falls within the specific range. An example of the scanned image after reduction processing is shown at the top of Figure 14.

次いで、ステップSD3では、抽出部20gが、ステップSD2で縮小または拡大された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出する。図14の下側に、コード候補領域抽出画像の例を示している。尚、ステップSD2で縮小または拡大されていない場合には、ステップSD3で元の読取画像に対して抽出処理が実行されることになる。 Next, in step SD3, the extraction unit 20g extracts code candidate areas that are likely to contain a code from the scanned image reduced or enlarged in step SD2. An example of an extracted code candidate area image is shown in the lower part of Figure 14. Note that if the scanned image was not reduced or enlarged in step SD2, the extraction process will be performed on the original scanned image in step SD3.

その後、ステップSD4に進み、画像修復部20jが、ステップSD3で抽出されたコード候補領域に対応する部分画像をニューラルネットワークに入力して読取画像の修復を試行する。図15に修復前の読取画像と修復後の読取画像の例を示している。読取画像の修復後、ステップSD5~SD7を経てこのフローが終了する。ステップSD5~SD7は、図11に示すフローチャートのステップSC7~SC9と同じである。 Then, the process proceeds to step SD4, where the image restoration unit 20j inputs the partial image corresponding to the code candidate area extracted in step SD3 into a neural network and attempts to restore the scanned image. Figure 15 shows examples of the scanned image before and after restoration. After the scanned image is restored, steps SD5 to SD7 are performed, and the flow ends. Steps SD5 to SD7 are the same as steps SC7 to SC9 in the flowchart shown in Figure 11.

(実施形態の作用効果)
以上説明したように、この実施形態によれば、光学的情報読取装置1、1Aの運用時に、カメラ5により生成された読取画像をニューラルネットワークに入力すると、読取画像の修復が試行されるので、コードの読み取りに適した画像となるように修復された修復試行後の読取画像が得られる。この修復試行後の読取画像に対してデコード処理が実行されるので、読み取り精度が高まる。
(Effects of the embodiment)
As described above, according to this embodiment, when the optical information reading device 1, 1A is in operation, if the read image generated by the camera 5 is input to the neural network, an attempt is made to repair the read image, and a read image after repair attempt is obtained that has been repaired to an image suitable for reading the code. A decoding process is performed on this read image after repair attempt, thereby improving reading accuracy.

修復に利用されるニューラルネットワークは、複数の不良画像と複数の理想画像とを予め機械学習させることによって得られた構造及びパラメータによって構成されたものであることから、光学的情報読取装置1、1Aでは学習処理を行うことなく、ニューラルネットワークによる推論処理のみ行えばよく、これにより、プロセッサ20の演算負荷が軽くなる。その結果、手持ち式の光学的情報読取装置1Aの小型軽量化が可能になるとともに、定置式の光学的情報読取装置1の処理速度を高速化できる。 The neural network used for repair is constructed with a structure and parameters obtained by prior machine learning of multiple defective images and multiple ideal images. Therefore, the optical information reading device 1, 1A does not need to perform learning processing; only inference processing using the neural network is required, thereby reducing the computational load on the processor 20. As a result, the handheld optical information reading device 1A can be made smaller and lighter, and the processing speed of the stationary optical information reading device 1 can be increased.

また、光学的情報読取装置1、1Aの運用時に、読取画像の中からコード候補領域が抽出されると、そのコード候補領域に対応する部分画像がニューラルネットワークに入力されて部分画像の修復が試行される。これにより、ニューラルネットワークに入力する画像のサイズが小さくなるので、プロセッサ20の演算負荷が軽くなり、ひいては処理速度の高速化が実現される。また、部分画像は、コードが存在する可能性が高い領域に対応しているので、読み取りに必要な情報、即ちコードの全体を含んだ画像とすることが可能である。このコードの全体を含んだ画像をニューラルネットワークに入力するので、読み取り精度の低下は抑制される。 Furthermore, when the optical information reading device 1, 1A is in operation, if a code candidate area is extracted from the read image, the partial image corresponding to that code candidate area is input into the neural network, and an attempt is made to repair the partial image. This reduces the size of the image input into the neural network, reducing the computational load on the processor 20 and ultimately achieving faster processing speeds. Furthermore, because the partial image corresponds to an area where a code is likely to exist, it is possible to create an image that includes the information necessary for reading, i.e., the entire code. Because an image including this entire code is input into the neural network, a decrease in reading accuracy is suppressed.

さらに、ニューラルネットワークの構造及びパラメータを生成する際に、コードを構成するモジュールのピクセル分解能が特定範囲内である不良画像及び理想画像を機械学習させるようにしているので、コードを含む画像の修復に特化したニューラルネットワーク構造として処理速度を向上させることができる。そして、読取画像の中のコードを構成するモジュールのピクセル分解能が特定範囲外にある場合には、特定範囲内となるように読取画像を拡大または縮小してからニューラルネットワークに入力するので、幅広いピクセル分解能のコードを含む画像の修復が可能になる。 Furthermore, when generating the neural network structure and parameters, the system uses machine learning to learn defective and ideal images in which the pixel resolution of the modules that make up the code is within a specific range, thereby improving processing speed as a neural network structure specialized for repairing images that contain codes. Furthermore, if the pixel resolution of the modules that make up the code in the scanned image is outside the specific range, the scanned image is enlarged or reduced so that it falls within the specific range before being input into the neural network, making it possible to repair images that contain codes with a wide range of pixel resolution.

(その他の実施形態)
図16は、その他の実施形態に係る光学的情報読取装置1の運用時における処理の手順の一例を説明する図である。この実施形態では、プロセッサ20により、前記画像修復部20jの他に、前処理部200と、後処理部201と、第1デコード処理部202と、第2デコード処理部203とが構成されている。前処理部200は、上記フィルタ処理部20cと同様に、カメラ5により生成された読取画像に対してノイズ除去フィルタ、コントラスト補正フィルタ、平均化フィルタ等を実行する部分である。
(Other embodiments)
16 is a diagram illustrating an example of a processing procedure during operation of an optical information reading device 1 according to another embodiment. In this embodiment, in addition to the image restoration unit 20j, the processor 20 includes a pre-processing unit 200, a post-processing unit 201, a first decoding unit 202, and a second decoding unit 203. The pre-processing unit 200, like the filtering unit 20c, is a unit that applies a noise reduction filter, a contrast correction filter, an averaging filter, etc. to the read image generated by the camera 5.

第1デコード処理部202は、カメラ5により生成された読取画像に対するデコード処理を実行する部分であり、この第1デコード処理部202によるデコード処理を第1デコード処理ともいう。プロセッサ20が複数のコア(N個のコア)を有している場合、そのうちのコア0~コアiによって第1デコード処理部202が構成される。1つのコアで第1デコード処理部202が構成されていてもよい。 The first decoding processing unit 202 is a unit that performs decoding processing on the scanned image generated by the camera 5, and the decoding processing performed by this first decoding processing unit 202 is also referred to as the first decoding processing. If the processor 20 has multiple cores (N cores), the first decoding processing unit 202 is made up of cores 0 to i. The first decoding processing unit 202 may also be made up of a single core.

また、第2デコード処理部203は、画像修復部20jが生成した修復画像に対するデコード処理を実行する部分であり、この第2デコード処理部203によるデコード処理を第2デコード処理ともいう。プロセッサ20がN個のコアを有している場合、そのうちのコアi+1~コアN-1によって第2デコード処理部203が構成される。1つのコアで第2デコード処理部203が構成されていてもよい。 The second decoding processing unit 203 is a unit that performs decoding processing on the restored image generated by the image restoration unit 20j, and the decoding processing by this second decoding processing unit 203 is also referred to as the second decoding processing. If the processor 20 has N cores, the second decoding processing unit 203 is made up of cores i+1 to N-1. The second decoding processing unit 203 may also be made up of a single core.

図17にも示すように、コア0~コアiによって第1デコード処理部202が構成されている場合、コア0~コアiの各々がカメラ5により生成された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出した後、コードの輪郭やコードを構成しているモジュールの位置決め処理を実行し、その後、コードを構成している各モジュールが白であるか、黒であるかを判別し、デコード処理を実行する。処理結果は後処理部201に出力される。 As also shown in Figure 17, when the first decoding processing unit 202 is made up of cores 0 to i, each of cores 0 to i extracts code candidate areas where a code is likely to exist from the scanned image generated by camera 5, then performs positioning processing for the code outline and the modules that make up the code, and then determines whether each module that makes up the code is white or black and performs decoding processing. The processing results are output to the post-processing unit 201.

一方、図17に示すように、コアi+1~コアN-1によって第2デコード処理部203が構成されている場合、コアi+1~コアN-1の各々が、読取画像からコードが存在する可能性が高いコード候補領域を修復用コード領域として抽出するとともに、画像修復部20jに対し、推論処理を実行するようトリガ信号を送出する。この図17では、2つのコアによって1つのタスクを実行するように記載しているが、任意の1つ以上のコアによって1つのタスクを実行すればよい。 On the other hand, as shown in Figure 17, when the second decoding processing unit 203 is made up of cores i+1 to N-1, each of cores i+1 to N-1 extracts code candidate areas from the scanned image that are likely to contain code as repair code areas, and sends a trigger signal to the image repair unit 20j to execute inference processing. While Figure 17 shows one task being executed by two cores, one task may be executed by any one or more cores.

具体的には、第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 cores N-2 and N-1 constituting the second decoding processing unit 203 extract a repair code candidate area, they output a trigger signal (Trigger 1) to the image restoration unit 20j, causing the image restoration unit 20j to execute inference processing. Upon receiving the trigger signal (Trigger 1) sent from cores N-2 and N-1, image restoration unit 20j inputs the partial image corresponding to the repair code candidate area extracted by cores N-2 and N-1 into a neural network and executes inference processing to generate a repaired image by repairing the partial image (Image Restoration 1). The repaired image generated by Image Restoration 1 is sent to cores N-2 and N-1. Based on the repaired image generated by Image Restoration 1, cores N-2 and N-1 determine grid positions indicating the position of each cell of the code and execute decoding processing for the repaired image based on the determined grid positions.

一方、第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で生成した修復画像に基づいてコードの各セル位置を示すグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコード処理を実行する。 Meanwhile, when cores i+1 and i+2 constituting the second decoding processing unit 203 extract a repair code candidate area, they output a trigger signal (Trigger 2) to the image restoration unit 20j, causing the image restoration unit 20j to execute inference processing. Upon receiving the trigger signal (Trigger 2) sent from cores i+1 and i+2, image restoration unit 20j inputs the partial image corresponding to the repair code candidate area extracted by cores i+1 and i+2 into a neural network and executes inference processing to generate a repaired image by repairing the partial image (Image Restoration 2). The repaired image generated by Image Restoration 2 is sent to cores i+1 and i+2. Based on the repaired image generated by Image Restoration 2, cores i+1 and i+2 determine grid positions indicating the position of each cell of the code and execute decoding processing for the repaired image based on the determined grid positions.

以下、同様にして、コア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が実行される。 In the same manner, image restoration 3 is executed in response to a trigger signal (trigger 3) sent from cores N-2 and N-1, image restoration 4 is executed in response to a trigger signal (trigger 4) sent from cores i+1 and i+2, image restoration 5 is executed in response to a trigger signal (trigger 5) sent from cores N-2 and N-1, image restoration 6 is executed in response to a trigger signal (trigger 6) sent from cores i+1 and i+2, and image restoration 7 is executed in response to a trigger signal (trigger 7) sent from cores N-2 and N-1.

このタイムチャートに示すように、画像修復部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 image restoration unit 20j and the first decoding processing by the first decoding processing unit 202 are executed in parallel. For example, while the first decoding processing unit 202 continues to perform code region extraction, grid positioning, and decoding processing, the inference processing by the image restoration unit 20j is executed one or more times. Also, while the first decoding processing unit 202 continues to perform code region extraction, grid positioning, and decoding processing, the second decoding processing unit 203 extracts a repair code region, outputs a trigger signal, positions a grid, and executes second decoding processing. In this way, the image restoration unit 20j only needs to specialize in repairing the partial image corresponding to the repair code candidate region, thereby increasing the inference processing speed.

第2デコード処理部が第2デコード処理を実行している期間の少なくとも一部は、画像修復部20jによる推論処理が実行されない休止期間を有している。すなわち、図17に示すように、画像修復部20jの画像修復1の終了後、第2デコード処理部203が第2デコード処理を開始するのであるが、画像修復部20jが次の画像修復2を開始するまでの間に、所定の期間が設けられており、この所定の期間は、画像修復部20jが画像修復を行わない休止期間とされている。この休止期間は画像修復部20jが推論処理を行わない期間であり、休止期間を設けることにより、画像修復部20jの負荷を低減して、AIチップ23の発熱を抑制できる。なお、グリッド位置決めの処理時間は、処理対象の修復画像によって長い場合や短い場合が存在する。図17では各コアの処理が交互に実行される例を記載しているが、グリッド位置決めの処理時間によっては、各コアの処理は必ずしも交互に実行されない。すなわち、処理が空いているコアから順にトリガ発出や、グリッド位置決めを実行してもよい。 At least a portion of the time during which the second decoding processing unit 20j is performing the second decoding process includes a pause during which the image restoration unit 20j does not perform inference processing. That is, as shown in FIG. 17, after the image restoration unit 20j completes image restoration 1, the second decoding processing unit 203 begins the second decoding process. However, a predetermined period is provided before the image restoration unit 20j begins image restoration 2. This predetermined period is designated as a pause during which the image restoration unit 20j does not perform image restoration. This pause is a period during which the image restoration unit 20j does not perform inference processing. By providing this pause, the load on the image restoration unit 20j is reduced, and heat generation by the AI chip 23 can be suppressed. Note that the processing time for grid positioning may be long or short depending on the image to be restored. While FIG. 17 illustrates an example in which the processing of each core is performed alternately, depending on the processing time for grid positioning, the processing of each core does not necessarily occur alternately. That is, trigger issuance and grid positioning may be performed in order starting with the core with the least processing time.

上述したように、設定部20eは、「画像修復フィルタの適用」と「画像修復フィルタの非適用」との一方をユーザが選択可能に構成されている。画像修復フィルタを適用するということは、画像修復を行うということであり、また、画像修復フィルタを非適用にするということは、画像修復を行わないということなので、設定部20eは、第2デコード処理部203が第2デコード処理を実行するか否かを設定する部分にも相当する。この設定はユーザによって実行されるので、設定部20eはユーザによる操作を受け付けることができるように構成されている。画像修復フィルタの適用、非適用という設定形態に限定されるものではなく、例えば推論処理(修復処理)の適用、非適用、AIによる処理の適用、非適用といった設定形態であってもよい。ユーザによる操作は、例えばユーザインターフェース画面に表示したボタン等の操作を挙げることができる。 As described above, the setting unit 20e is configured to allow the user to select either "applying an image restoration filter" or "not applying an image restoration filter." Applying an image restoration filter means performing image restoration, and not applying an image restoration filter means not performing image restoration. Therefore, the setting unit 20e also corresponds to the part that sets whether or not the second decoding processing unit 203 will perform the second decoding process. This setting is performed by the user, and therefore the setting unit 20e is configured to be able to accept user operations. The setting is not limited to applying or not applying an image restoration filter, and may be, for example, applying or not applying inference processing (restoration processing), or applying or not applying AI processing. User operations may include, for example, operating buttons displayed on a user interface screen.

光学的情報読取装置1では、露光時間やゲインなどの撮像条件、画像処理フィルタなどの設定をあらかじめ決定するチューニング処理行ってから運用される。例えばワークWがラベルのような場合では、コードが鮮明に印字されているので、チューニング処理により適切な条件設定がなされれば、高い読み取り率を実現できる。しかし、金属や樹脂などのワークWにおいては、チューニング処理時の最適な条件が設定されるものの、微弱な外乱光による読取画像の変化などが原因で読み取りにくい状態になったり、そもそも光学設計とアルゴリズム設計上、超低コントラストで読み取れないケースが発生してしまうことがある。 The optical information reading device 1 is operated after a tuning process is performed to determine in advance the settings of imaging conditions such as exposure time and gain, as well as image processing filters. For example, if the workpiece W is a label, the code is printed clearly, so if the appropriate conditions are set through the tuning process, a high reading rate can be achieved. However, for workpieces W made of metal or resin, even if the optimal conditions are set during the tuning process, reading may be difficult due to changes in the read image caused by weak ambient light, or the optical design and algorithm design may make it impossible to read at extremely low contrast.

本例の画像修復部20jが実行する画像修復アルゴリズムを、画像修復しないでデコード処理する場合と並列に実施することで、従来の読み取り性能を維持しながら金属や樹脂などのワークWに対しての読み取り性能を向上させ、読み取り安定性を高めることができる。また、従来の光学設計とアルゴリズムでは読めないワークWに対しても、画像修復アルゴリズムを適用することにより読み取りが可能になる。 By performing the image restoration algorithm executed by the image restoration unit 20j in this example in parallel with the decoding process without image restoration, it is possible to improve the reading performance for workpieces W made of metal, resin, etc. while maintaining conventional reading performance, thereby increasing reading stability. Furthermore, by applying the image restoration algorithm, it becomes possible to read workpieces W that cannot be read using conventional optical designs and algorithms.

具体例を示すと、ある工場で箱に付されたシール上に印字されたコードを読み取る工程で、光学的情報読取装置1の設置条件に制約がなく、最適な設置が可能な場合においては、従来の読み取り性能でも安定した運用が可能であることから、画像修復フィルタを非適用にしてタクトを優先することができる。 To give a specific example, in a process at a factory where codes printed on stickers attached to boxes are read, if there are no restrictions on the installation conditions of the optical information reading device 1 and optimal installation is possible, stable operation is possible even with conventional reading performance, so the image restoration filter can be disabled and takt time can be prioritized.

また、ある工場において、金属にはっきりと印字されたコードを読み取る工程があり、読み取り設定時のチューニング処理においては最適な条件が決定されるものの、実際に運用してみると、金属表面の傷、読み取り位置・角度のばらつき、周囲環境の明るさ変化などで読み取りが不安定になるケースがある。このようなケースでは、画像修復フィルタを適用して、画質改善することで、上記のような条件のばらつきに強くなり、読み取り性能が向上する。 In addition, one factory has a process for reading codes that are clearly printed on metal. Although optimal conditions are determined during the tuning process when setting up the reading, in actual operation, reading can become unstable due to scratches on the metal surface, variations in the reading position and angle, and changes in the brightness of the surrounding environment. In such cases, applying an image restoration filter to improve image quality makes the system more resistant to variations in conditions such as those mentioned above, improving reading performance.

また、一部のワークでは、従来のアルゴリズムでの読み取りが不可能であるが、そのようなケースでは画像修復フィルタを適用することで、読み取りができるようになるケースがある。例えば、コードの損傷が著しかったり、コントラストが明確でない場合でも、画像修復フィルタを適用することによって、コントラストや傷を修復し、読み取りが可能になる。 In addition, some workpieces cannot be read using conventional algorithms, but in such cases, applying an image restoration filter can make them readable. For example, even if the code is severely damaged or the contrast is unclear, applying an image restoration filter can restore the contrast and scratches, making it possible to read the code.

画像修復フィルタを適用した場合に実行される第2デコード処理は、修復画像に対してデコード処理を実行するため、通常の読取画像のデコード処理を実行する第1デコード処理に比べて処理にかかる時間が長い場合が多い。したがって、第1デコード処理部202は、第2デコード処理部203による第2デコード処理にかかる時間よりも短い時間で第1デコード処理を実行可能である。本例では、このことを前提とし、デコード処理の制限時間である、デコードタイムアウト時間を設定部20eが変更可能になっている。 The second decoding process performed when an image restoration filter is applied performs decoding on a restored image, and therefore often takes longer than the first decoding process, which performs decoding on a normal scanned image. Therefore, the first decoding processing unit 202 can perform the first decoding process in a shorter time than the time required for the second decoding process by the second decoding processing unit 203. Based on this premise, in this example, the setting unit 20e can change the decoding timeout time, which is the time limit for the decoding process.

具体的には、設定部20eは、第2デコード処理を実行すると設定されている場合は、第2デコード処理の実行に必要な時間よりも長いデコードタイムアウト時間を設定可能に構成されるとともに、第2デコード処理を実行しないと設定されている場合は、第2デコード処理の実行に必要な時間よりも短いデコードタイムアウト時間を設定可能に構成されている。これにより、運用時には、第2デコード処理を実行する場合、一般的な第2デコード処理の実行に必要な時間よりも長いデコードタイムアウト時間を設定することができるので、修復画像に対するデコード処理を確実に実行できる。一方、第2デコード処理を実行しないと設定されている場合は、一般に第2デコード処理よりも短い時間でデコード処理が可能な第1デコード処理のみを実行することになるので、第1デコード処理に対応した短いデコードタイムアウト時間を設定できる。このようにデコードタイムアウト時間を変更することで、第1デコード処理及び第2デコード処理のそれぞれに対応したデコードタイムアウト時間にすることができる。 Specifically, the setting unit 20e is configured to be able to set a decode timeout time longer than the time required to execute the second decoding process when the second decoding process is set to be executed, and to be able to set a decode timeout time shorter than the time required to execute the second decoding process when the second decoding process is set not to be executed. As a result, during operation, when the second decoding process is executed, a decode timeout time longer than the time required to execute a typical second decoding process can be set, ensuring reliable decoding of the restored image. On the other hand, when the second decoding process is set not to be executed, only the first decoding process, which generally can be decoded in a shorter time than the second decoding process, is executed, so a short decode timeout time corresponding to the first decoding process can be set. By changing the decode timeout time in this way, decode timeout times corresponding to both the first decoding process and the second decoding process can be set.

また、図17では、第1デコード処理部202と第2デコード処理部203とを別にしているが、図18に示すように、第1デコード処理部202と第2デコード処理部203とをまとめてデコード処理部210としてもよい。デコード処理部210は、カメラ5により生成された読取画像に対する第1デコード処理と並列に、修復画像に対する第2デコード処理を実行する。このようにデコード処理を実行する部分は、ハードウエア上で任意に分けることもできるし、統合することもできる。以下、デコード処理を実行する部分を1つに統合した例で説明するが、これに限らず、複数に分けた場合にも同様に適用できる。 In addition, while the first decoding processing unit 202 and the second decoding processing unit 203 are separate in Figure 17, as shown in Figure 18, the first decoding processing unit 202 and the second decoding processing unit 203 may be combined into a decoding processing unit 210. The decoding processing unit 210 performs a second decoding processing on the restored image in parallel with the first decoding processing on the scanned image generated by the camera 5. In this way, the parts that perform the decoding processing can be arbitrarily divided or integrated on the hardware. Below, an example in which the parts that perform the decoding processing are integrated into one will be explained, but this is not limiting and the same applies to cases in which the parts are divided into multiple parts.

デコード処理部210は、設定部20eにより第2デコード処理を実行しないと設定されている場合には、第2デコード処理に使われる処理のリソースを第1デコード処理に振り分け、第2デコード処理を実行すると設定されている場合に比べ、第1デコード処理を高速化するように構成されている。処理のリソースとは、例えばメモリの使用領域や、マルチコアCPUを構成しているコア等である。具体的には、第2デコード処理を実行しないと設定されている場合には、第2デコード処理を実行すると設定されている場合に比べて、第1デコード処理を受け持つコアの数を多くする。また、第2デコード処理を実行しないと設定されている場合には、第2デコード処理を実行すると設定されている場合に比べて、第1デコード処理で使用するメモリの領域を拡大する。コアの数を多くすることと、メモリの領域を拡大することとは、併用してもよいし、いずれか一方のみ実行してもよい。これにより、マルチコアCPUの性能を最大限に引き出して第1デコード処理を高速化できる。 When the setting unit 20e has set the second decoding process not to be performed, the decoding processing unit 210 is configured to allocate processing resources used for the second decoding process to the first decoding process, thereby speeding up the first decoding process compared to when the second decoding process is set to be performed. Processing resources include, for example, memory usage areas and cores constituting a multi-core CPU. Specifically, when the setting unit 20e has set the second decoding process not to be performed, the number of cores responsible for the first decoding process is increased compared to when the setting unit 20e has set the second decoding process to be performed. Furthermore, when the setting unit 20e has set the second decoding process not to be performed, the memory area used for the first decoding process is expanded compared to when the setting unit 20e has set the second decoding process to be performed. Increasing the number of cores and expanding the memory area may be used together, or either one may be performed alone. This maximizes the performance of the multi-core CPU and speeds up the first decoding process.

デコード処理部210は、画像修復に先立ち、読取画像からコードが存在する可能性が高いコード候補領域を抽出する。すなわち、ニューラルネットワークを用いた画像修復時に当該ニューラルネットワークに入力する画像が大きいと演算時間が長時間化してしまうという問題がある。また、処理の高速化の観点からは、デコードの試行回数もできるだけ少なくしたい。これらのことに対し、本例では、コード候補領域を多少時間がかかっても確実に抽出可能にするために、ラインサーチベースではなく、ヒートマップベースのサーチ手法を採用している。例えば、デコード処理部210は、コードの特徴量を定量化し、特徴量の大きさを各画素値に割り当てたヒートマップを生成し、当該ヒートマップ上で、コードが存在する可能性が高いコード候補領域を抽出する。具体例としては、ヒートマップにおいて相対的に熱く(特徴量が大きく)示されている領域で2次元コードの特徴部分(例:ファインダパターン等)を取得する方法がある。特徴部分が複数取得された場合には、優先づけをして抽出し、RAM41や記憶部30等に記憶させておくことができる。 Prior to image restoration, the decoding processing unit 210 extracts code candidate regions from the scanned image that are likely to contain a code. Specifically, when using a neural network for image restoration, if the image input to the neural network is large, the computation time increases. Furthermore, from the perspective of speeding up processing, it is desirable to minimize the number of decoding attempts. In response to these issues, this example employs a heat map-based search method rather than a line search-based method to ensure reliable extraction of code candidate regions, even if it takes some time. For example, the decoding processing unit 210 quantifies the features of the code, generates a heat map in which the magnitude of the feature is assigned to each pixel value, and extracts code candidate regions from the heat map that are likely to contain a code. A specific example is a method of extracting feature portions (e.g., finder patterns) of a 2D code from areas that appear relatively hot (large feature amounts) in the heat map. If multiple feature portions are acquired, they can be prioritized and extracted, and stored in RAM 41, storage unit 30, etc.

デコード処理部210がコード候補領域を抽出した後、抽出したコード候補領域に対応する部分画像を画像修復部20jに出力する。画像修復部20jは、デコード処理部210が抽出したコード候補領域に対応する部分画像をニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行する。これにより、演算時間を短縮できる。 After the decoding processing unit 210 extracts the code candidate region, it outputs the partial image corresponding to the extracted code candidate region to the image restoration unit 20j. The image restoration unit 20j inputs the partial image corresponding to the code candidate region extracted by the decoding processing unit 210 into a neural network and performs inference processing to generate a restored image by restoring the partial image. This reduces the calculation time.

また、デコード処理部210は、上述したチューニング処理により設定された読取対象のコードを包含できるサイズで、かつ読取画像の中でコードが存在する可能性が高いコード候補領域を抽出し、当該抽出された画像を、予め定められたサイズとなるように縮小又は拡大してからニューラルネットワークに入力し、当該ニューラルネットワークで修復した修復画像をデコードするように構成されていてもよい。抽出された画像を予め定められたサイズの画像に拡大・縮小してニューラルネットワークに入力することで、ニューラルネットワークに入力されるコード画像のPPCを所定の範囲内に収めることができ、ニューラルネットワークによる画像修復効果を安定的に引き出すことができる。また、読取対象のコードサイズは様々であることが考えられるが、最終的にニューラルネットワークに入力されるコードのサイズを固定できるので、処理の高速性とデコードのし易さのバランスを一定以上に保つことができる。 The decoding processing unit 210 may also be configured to extract a code candidate area from the scanned image that is large enough to contain the code to be read, as determined by the tuning process described above, and that is likely to contain the code. The extracted image is then reduced or enlarged to a predetermined size before being input to the neural network, and the repaired image repaired by the neural network is decoded. By enlarging or reducing the extracted image to 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, ensuring a stable image repair effect by the neural network. Although the code size to be read may vary, the size of the code ultimately input to the neural network can be fixed, thereby maintaining a consistent balance between high processing speed and ease of decoding.

以下、第1デコード処理及び第2デコード処理のフローチャートについて、図19に基づいて詳細に説明する。スタート後のステップSE1では、プロセッサ20がカメラ5に読取画像を生成させ、読取画像を取得する。ステップSE1で取得された読取画像は、デコード処理部210に入力される。ステップSE2では、ステップSE1で取得された読取画像に対して画像修復を施すことなく、第1デコード処理を実行する。第1デコード処理が成功すれば、ステップSE4に進んで終了処理、即ちデコード結果の出力処理を実行する。ステップSE2で第1デコード処理が失敗すれば、ステップSE2に戻り、第1デコード処理を再度実行する。所定のデコードタイムアウト時間が経過すると、当該読取画像に対する第1デコード処理を中止する。 The flowcharts for the first decoding process and the second decoding process will be explained in detail below with reference to Figure 19. In step SE1 after starting, the processor 20 causes the camera 5 to generate a scanned image and acquires the scanned image. The scanned image acquired in step SE1 is input to the decoding processing unit 210. In step SE2, the first decoding process is executed on the scanned image acquired in step SE1 without performing image restoration. If the first decoding process is successful, the process proceeds to step SE4, where termination processing, i.e., output processing of the decoded result, is executed. If the first decoding process fails in step SE2, the process returns to step SE2, and the first decoding process is executed again. When a predetermined decoding timeout period has elapsed, the first decoding process for the scanned image is stopped.

一方、ステップSE1からステップSE5に進むルートでは、デコード処理部210が読取画像から修復用コード領域を抽出する。具体的には、チューニング処理により設定された読取対象のコードを包含できるサイズで、かつ読取画像の中でコードが存在する可能性が高いコード候補領域を抽出する。このとき、修復用コード領域が複数抽出された場合には、候補領域R1、R2、…として一時的に保存しておく。抽出された修復用コード領域の一例を図20に示す。その後、ステップSE6に進み、kの値を1にしておく。 On the other hand, in the route proceeding from step SE1 to step SE5, the decoding processing unit 210 extracts a repair code area from the read image. Specifically, it extracts a code candidate area that is large enough to contain the code to be read, as set by the tuning process, and that is likely to contain the code within the read image. If multiple repair code areas are extracted at this time, they are temporarily saved as candidate areas R1, R2, .... An example of an extracted repair code area is shown in Figure 20. Then, it proceeds to step SE6, and the value of k is set to 1.

ステップSE7では、候補領域Rkに対応する部分画像に対してリサイズ処理を実行する。リサイズ処理は、ステップSE5で抽出された修復用コード領域に対応する部分画像を、予め定められたサイズとなるように縮小又は拡大する処理である。このリサイズ処理により、後述するニューラルネットワークに入力する画像の大きさを予め所定の大きさにしておくことができる。図20に示す例では、ニューラルネットワークに入力する部分画像の大きさが256ピクセル×256ピクセルである場合について示しているが、部分画像の大きさはこれに限られるものではなく、処理速度等を勘案して任意の大きさにリサイズすることができる。 In step SE7, a resizing process is performed on the partial image corresponding to candidate region Rk. The resizing process reduces or enlarges the partial image corresponding to the repair code region extracted in step SE5 to a predetermined size. This resizing process allows the size of the image input to the neural network, described below, to be set to a predetermined size in advance. In the example shown in Figure 20, the size of the partial image input to the neural network is 256 pixels x 256 pixels, but the size of the partial image is not limited to this and can be resized to any size taking into account processing speed, etc.

ステップSE8では、白黒反転設定が「両方」になっているか否かを判定する。すなわち、画像修復は、数学的には写像を行っているだけであり、白から黒、黒から白、黒から黒、白から白の写像を単一のニューラルネットワークで実現することは難易度が高い場合がある。そのため、白地に黒印字された画像となるようにプロパティに基づいて白黒反転処理を実行する。ニューラルネットワークの学習のさせ方によっては、黒地に白印字された画像であってもよい。白黒反転処理の一例を図20に示す。白黒反転処理の詳細については後述する。 In step SE8, it is determined whether the black and white inversion setting is set to "both." In other words, image restoration is simply a mapping in mathematical terms, and it can be difficult to achieve white-to-black, black-to-white, black-to-black, and white-to-white mappings using a single neural network. For this reason, black and white inversion processing is performed based on the properties so that the image is printed black on a white background. Depending on how the neural network is trained, the image may also be printed white on a black background. An example of black and white inversion processing is shown in Figure 20. Details of black and white inversion 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 step SE8 returns YES and the black-and-white inversion setting is set to "both," the process proceeds to step SE9, where the resized image is input to the image restoration unit 20j and image restoration is performed. Then, the process proceeds to step SE10, where the decode processing unit 210 performs a second decoding process on the restored image. If the second decoding process is successful in step SE10, the process proceeds to step SE4 and executes termination processing. If the second decoding process fails in step SE10, the process proceeds to step SE11, where the resized image is subjected to black-and-white inversion processing. Then, in step SE11, the image after the black-and-white inversion processing is input to the image restoration unit 20j and image restoration is performed (see FIG. 20). Next, the process proceeds to step SE13, where the decode processing unit 210 performs a second decoding process on the restored image. If the second decoding process is successful in step SE13, the process proceeds to step SE4 and executes termination processing. If the second decoding process fails in step SE13, the process proceeds to step SE14. In step SE14, it is determined whether any candidate areas extracted in step SE5 remain, and if no candidate areas remain, the process proceeds to step SE4 to execute termination processing.

一方、ステップ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 step SE8 returns NO and the black-and-white inversion setting is not set to "Both," the process proceeds to step SE15, where it is determined whether the black-and-white inversion setting is set to "OFF." If step SE15 returns NO and the black-and-white inversion setting is not set to "OFF," the process proceeds to step SE16, where the resized image is inverted. Then, in step SE17, the image after the black-and-white inversion processing is input to the image restoration unit 20j, where image restoration is performed. Next, the process proceeds to step SE18, where the decoding processing unit 210 performs a second decoding process on the restored image. If the second decoding process is successful in step SE18, the process proceeds to step SE4, where termination processing is performed. If the second decoding process fails in step SE18, the process proceeds to step SE14. In step SE14, it is determined whether or not there are still candidate areas, and if there are no candidate areas, the process proceeds to step SE4, where termination processing is performed.

ステップSE14で候補領域がまだあると判定された場合には、ステップSE19に進み、kの値に1を加えてステップSE7に進む。ステップSE7では、前回のフローからkの値が1つ増えているので、次の候補領域Rkに対応する部分画像に対して同様にリサイズ処理を実行する。ステップSE8以降は上述したとおりである。つまり、第1デコード処理または第2デコード処理の一方でデコードが成功すれば、成功した時点でデコード結果を出力して他の候補領域に対するデコード処理は行わず、次のワークWを撮像した読取画像を取得し、同様な処理を実行する。 If it is determined in step SE14 that there are more candidate areas, proceed to step SE19, increment the value of k by 1, and proceed to step SE7. In step SE7, since the value of k has increased by 1 since the previous flow, a similar resizing process is performed on the partial image corresponding to the next candidate area Rk. Steps SE8 and beyond are as described above. In other words, if decoding is successful in either the first decoding process or the second decoding process, the decoded result is output at that point, and decoding processes are not performed on other candidate areas; instead, a scanned image of the next work W is obtained and similar processing is performed.

図20に示す後処理部201は、リサイズ処理後に画像修復していない部分画像と、リサイズ処理後に画像修復部20jが画像修復した部分画像とを合成する処理を実行する。すなわち、ニューラルネットワークを用いた画像修復では、修復前のコードが人間の目視で確認できるのに、画像修復がうまくいかないことや、画像修復するとセルが丸くなることが起こり得る。これらのことに対して、画像修復していない部分画像と、画像修復した部分画像とを適切な割合で重ね合わせると、その後のデコード処理が容易になる場合がある。画像修復していない部分画像と、画像修復した部分画像とを重ね合わせる割合は、所定の固定値であってもよいし、固定値以外であってもよく、例えば画像修復部20jによるの修復の安定度に基づいて、読み取り時に動的に、あるいは事前評価(チューニング)で最適化して決定してもよい。例えば事前評価において、その割合をユーザがスケールバー等で調整可能にし、合成後の画像をユーザに提示しながら調整が行えるようにしてもよい。 The post-processing unit 201 shown in FIG. 20 performs a process of combining a partial image that has not been restored after resizing with a partial image that has been restored by the image restoration unit 20j after resizing. In other words, when image restoration using a neural network is performed, even if the code before restoration is visible to the human eye, image restoration may not be successful, or the cells may become round after image restoration. To address these issues, overlapping the partial image that has not been restored with the partial image that has been restored at an appropriate ratio may facilitate subsequent decoding. The overlap ratio between the partial image that has not been restored and the partial image that has been restored may be a predetermined fixed value or may be a non-fixed value. For example, the overlap ratio may be dynamically determined during reading or optimized through pre-evaluation (tuning) based on the stability of restoration by the image restoration unit 20j. For example, in pre-evaluation, the ratio may be adjustable by the user using a scale bar or the like, allowing the user to adjust the ratio while the combined image is presented to the user.

(バンク切り替え機能)
本実施形態では、例えばカメラ5の撮像条件を構成するパラメータ及びデコード処理部210における処理条件等を構成するパラメータがセットになったパラメータセットを上記パラメータセット記憶部30cに記憶することができるように構成されている。パラメータセットは、バンクと呼ぶことができる。バンクは複数設けられており、それぞれに異なるパラメータが記憶されている。例えば、パラメータセット記憶部30cには、チューニング実行部20dにより設定された第1の撮像条件及びコード条件と、第2の撮像条件及びコード条件とを含む複数の撮像条件及びコード条件とがそれぞれ別のパラメータセットとして記憶されている。
(Bank switching function)
In this embodiment, the parameter set storage unit 30c is configured to store parameter sets, each of which includes, for example, parameters constituting the imaging conditions of the camera 5 and parameters constituting the processing conditions in the decoding processing unit 210. The parameter sets can be called banks. A plurality of banks are provided, each storing different parameters. For example, the parameter set storage unit 30c stores a plurality of imaging conditions and code conditions, including first imaging conditions and code conditions set by the tuning execution unit 20d and second imaging conditions and code conditions, as separate parameter sets.

この光学的情報読取装置1では、パラメータセット記憶部35cに記憶されている複数のパラメータセットのうち、第1の撮像条件及びコード条件を含む一のパラメータセットから、第2の撮像条件及びコード条件を含む他のパラメータセットへ切り替えることや、その反対の切り替えができるように構成されている。パラメータセットの切替は、プロセッサ20が行うことや、ユーザが行うこともできるし、PLC101等の外部制御装置からの切替信号によって行うように構成することもできる。パラメータセットの切替をユーザが行う場合には、例えばユーザインターフェースに組み込まれているパラメータセット切替部を操作すればよい。パラメータセット切替部を「有効」にすることで、そのバンクのパラメータセットが光学的情報読取装置1の運用時に使用され、また、パラメータセット切替部を「無効」にすることで、そのバンクのパラメータセットが光学的情報読取装置1の運用時に使用されないようになる。つまり、パラメータセット切替部は、一のパラメータセットから他のパラメータセットに切り替えるためのものである。 This optical information reading device 1 is configured to enable switching from one parameter set including first imaging conditions and code conditions to another parameter set including second imaging conditions and code conditions, or vice versa, among the multiple parameter sets stored in the parameter set storage unit 35c. Parameter set switching can be performed by the processor 20, the user, or by a switching signal from an external control device such as the PLC 101. When switching parameter sets, the user simply operates a parameter set switching unit incorporated in the user interface, for example. By enabling the parameter set switching unit, the parameter set of that bank is used when the optical information reading device 1 is in operation, and by disabling the parameter set switching unit, the parameter set of that bank is not used when the optical information reading device 1 is in operation. In other words, the parameter set switching unit is used to switch from one parameter set to another.

本例のデコード処理部210は、一のパラメータセットを使用して運用している時に、修復画像に対する第2デコード処理に失敗すると、他のパラメータセットに切り替えてから、別の条件で撮像された読取画像に対して画像修復、第2デコード処理を実行する。例えば、デコード処理部210が第2デコード処理に失敗したことを検出すると、現在しているパラメータセット以外のパラメータセットに切り替えた後、画像修復、第2デコード処理を実行し、このパラメータセットでも第2デコード処理に失敗したことを検出すると、これまで使用していない他のパラメータセットに切り替えた後、画像修復、第2デコード処理を実行する。パラメータセットを切り替えると、カメラ5の撮像条件だけなく、読取対象のコードサイズも変更される場合があり、この場合にはコードが存在する可能性が高いコード候補領域を抽出する際のサイズも変わることになる。その結果、ニューラルネットワークに入力する画像の縮小率又は拡大率も変わり、画像修復の結果も変わることになる。 In this example, when the decoding processing unit 210 is operating using one parameter set and fails the second decoding process on the restored image, it switches to another parameter set and then performs image restoration and second decoding on a read image captured under different conditions. For example, when the decoding processing unit 210 detects that the second decoding process has failed, it switches to a parameter set other than the current parameter set and then performs image restoration and second decoding. If it detects that the second decoding process has also failed with this parameter set, it switches to a parameter set that has not been used before and then performs image restoration and second decoding. Switching parameter sets may change not only the imaging conditions of the camera 5 but also the code size to be read. In this case, the size used to extract code candidate areas where a code is likely to exist also changes. As a result, the reduction or enlargement ratio of the image input to the neural network also changes, and the results of image restoration also change.

(白黒反転対応)
次に、図21及び図22に基づいてコードの白黒反転対応について説明する。図21は、2つのニューラルネットワーク、即ち、白地に黒印字のコードで学習したニューラルネットワークと、黒地に白印字のコードで学習したニューラルネットワークとを用いてコードの白黒反転に対応する場合について説明する図である。FIG.21Aは、読取画像(左端の画像)を、白地に黒印字のコードで学習したニューラルネットワークと、黒地に白印字のコードで学習したニューラルネットワークとにそれぞれ入力し、各ニューラルネットワークからデコード結果を出力させる方式を示しており、この方式を並行実施方式と呼ぶ。読取画像は、白地に黒印字のコードを撮像した画像なので、白地に黒印字のコードで学習したニューラルネットワークによる修復画像ではデコード処理に成功するが、黒地に白印字のコードで学習したニューラルネットワークによる修復画像ではデコード処理に失敗する。
(Black and white inversion supported)
Next, we will explain how to deal with black-and-white inversion of codes with reference to Figures 21 and 22. Figure 21 is a diagram illustrating how to deal with black-and-white inversion of codes using 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. Figure 21A shows a method in which a scanned image (the image at the left end) is input to 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, and the decoded results are output from each neural network. This method is called a parallel execution method. Since the scanned image is an image of a code printed in black on a white background, decoding is successful when the neural network trained with the code printed in black on a white background repairs the image, but decoding is unsuccessful when the neural network trained with the code printed in white on a black background repairs the image.

FIG.21Bは、読取画像(左端の画像)を、まず、黒地に白印字のコードで学習したニューラルネットワークのみに入力し、修復画像のデコード処理を試みる。デコード処理に失敗した場合のみ、読取画像を、白地に黒印字のコードで学習したニューラルネットワークに入力して修復画像を生成する。この方式は、失敗後に別ネットワークを使用する方式である。 FIG. 21B shows that the scanned image (the image on the far left) is first input only to a neural network trained on a code printed in white on a black background, and an attempt is made to decode the restored image. Only if the decoding process fails is the scanned image input to a neural network trained on a code printed in black on a white background to generate a restored image. This method uses a different network after a failure.

FIG.21Cは、ユーザによる設定に基づいて、読取画像を入力するニューラルネットワークを選択する方式である。左側に示すケースは、読取画像が白地に黒印字のコードを撮像した画像であると設定されている場合である。この場合、ネットワーク選択モジュールが白地に黒印字のコードで学習したニューラルネットワークを選択する。そして、読取画像(左端の画像)を白地に黒印字のコードで学習したニューラルネットワークに入力する。一方、右側に示すケースは、読取画像が黒地に白印字のコードを撮像した画像であると設定されている場合である。この場合、ネットワーク選択モジュールが黒地に白印字のコードで学習したニューラルネットワークを選択する。そして、読取画像(左端の画像)を黒地に白印字のコードで学習したニューラルネットワークに入力する。 FIG. 21C shows a method for selecting a neural network to input a scanned image based on user settings. The case shown on the left is when the scanned image is set to be an image of a code printed in black on a white background. In this case, the network selection module selects a neural network trained with a code printed in black on a white background. The scanned image (the image at the left) is then input to the neural network trained with a code printed in black on a white background. On the other hand, the case shown on the right is when the scanned image is set to be an image of a code printed in white on a black background. In this case, the network selection module selects a neural network trained with a code printed in white on a black background. The scanned image (the image at the left) is then input to the neural network trained with a code printed in white on a black background.

図22は、1つのニューラルネットワークのみを用いてコードの白黒反転に対応する場合について説明する図である。FIG.22Aでは、読取画像(左端の画像)を白黒反転処理することにより、白黒反転画像を生成する場合について示している。白黒反転処理しない画像と、白黒反転処理した画像とをそれぞれ白地に黒印字のコードで学習したニューラルネットワークに入力する。読取画像は、黒地に白印字のコードを撮像した画像なので、白地に黒印字のコードで学習したニューラルネットワークによる修復画像ではデコード処理に失敗するが、白黒反転処理した後の画像を使用することで、デコード処理に成功する。 Figure 22 is a diagram illustrating how to handle black-and-white inversion of a code using only one neural network. FIG. 22A shows how a black-and-white inverted image is generated by inverting the scanned image (the image on the left). An image without black-and-white inversion and an image with black-and-white inversion are each input to a neural network trained with a code printed in black on a white background. Because the scanned image is an image of a code printed in white on a black background, decoding fails when using a restored image generated by a neural network trained with a code printed in black on a white background. However, decoding is successful when using the image after black-and-white inversion.

FIG.22Bの上に示す例では、読取画像(左端の画像)が黒地に白印字されたコードの画像であるため、白地に黒印字のコードで学習したニューラルネットワークに入力すると、デコード処理に失敗する。その後、白黒反転処理した画像を生成して白地に黒印字のコードで学習したニューラルネットワークに入力すると、デコード処理に成功する。 In the example shown at the top of FIG. 22B, the scanned image (the image on the left) is an image of a code printed in white on a black background, so when it is input into a neural network trained with a code printed in black on a white background, the decoding process fails. If an image with inverted black and white is then generated and input into a neural network trained with a code printed in black on a white background, the decoding process is successful.

FIG.22Bの下に示す例では、読取画像(左端の画像)が白地に黒印字されたコードの画像であるため、黒地に白印字のコードで学習したニューラルネットワークに入力すると、デコード処理に失敗する。その後、白黒反転処理した画像を生成して黒地に白印字のコードで学習したニューラルネットワークに入力すると、デコード処理に成功する。 In the example shown at the bottom of FIG. 22B, the scanned image (the image on the left) is an image of a code printed in black on a white background, so when it is input into a neural network trained with a code printed in white on a black background, the decoding process fails. If an image with inverted black and white is then generated and input into a neural network trained with a code printed in white on a black background, the decoding process is successful.

FIG.22Cは、ユーザによる設定に基づいて、白黒反転処理を実行するか否かを決定する方式である。上側に示すケースは、読取画像が白地に黒印字のコードを撮像した画像であると設定されている場合である。この場合、白黒反転処理モジュールが白黒反転処理を実行することなく、そのまま白地に黒印字のコードで学習したニューラルネットワークに入力する。一方、下側に示すケースは、読取画像が黒地に白印字のコードを撮像した画像であると設定されている場合である。この場合、白黒反転処理モジュールが白黒反転処理を実行する。そして、白黒反転処理した画像を白地に黒印字のコードで学習したニューラルネットワークに入力する。 FIG. 22C shows a method for determining whether to perform black-and-white inversion processing based on user settings. The case shown at the top is when the scanned image is set to be an image of a code printed in black on a white background. In this case, the black-and-white inversion processing module does not perform black-and-white inversion processing, but instead inputs the image directly into a neural network trained with a code printed in black on a white background. On the other hand, the case shown at the bottom is when the scanned image is set to be an image of a code printed in white on a black background. In this case, the black-and-white inversion processing module performs black-and-white inversion processing. The inverted image is then input into a neural network trained with a code printed in black 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 to manage print quality/reading performance during operation. For example, the matching level is defined as a positive integer value between 0 and 100, and a level of 50 or higher can be designed to achieve a 100% read rate when a read rate test is conducted. Also, a matching level of 0 means that the code cannot be read, and a matching level of 1 is the lowest value when the code can be read.

図23は、コントラストとマッチングレベルの関係を示すグラフであり、実線は画像修復部20jにより画像修復された画像(修復画像)のコントラストとマッチングレベルの関係を示し、また、破線は画像修復部20jにより画像修復していない画像(読取画像)のコントラストとマッチングレベルの関係を示している。このグラフから明らかなように、修復画像のマッチングレベルは読取画像のマッチングレベルよりも全体的に高くなっているが、ある一定以上画質が悪化すると、マッチングレベルが急激に低下してしまう。 Figure 23 is a graph showing the relationship between contrast and matching level, with the solid line showing the relationship between contrast and matching level of an image (restored image) that has been restored by the image restoration unit 20j, and the dashed line showing the relationship between contrast and matching level of an image (read image) that has not been restored by the image restoration unit 20j. As is clear from this graph, the matching level of the restored image is generally higher than the matching level of the read image, but once the image quality deteriorates beyond a certain level, the matching level drops sharply.

(マッチングレベルの算出処理)
マッチングレベルはアルゴリズムごとに設定されており、一般的には1コード種につき、1つのアルゴリズムである。しかしながら、本実施形態では、画像修復機能の搭載により、1つのコード種で2つのアルゴリズム(画像修復するアルゴリズムと、画像修復しないアルゴリズム)が実行される。この2つのアルゴリズムのうち、デコード処理が早く成功した方の結果が出力されるため、仮に、2つのアルゴリズムで交互にデコード処理に成功するケースにおいてはマッチングレベルの値が不安定になるおそれがある。また、画像修復を実行することで読み取りやすい画像になるため、従来と類似したマッチングレベルの算出方法ではマッチングレベルが既存のものと比較して高くなりやすい。これらのことに対し、本実施形態では、2つのアルゴリズムのマッチングレベルの重みづけ和をとり、マッチングレベルの値を調整するようにした。以下、具体例について、図24に示すフローチャートに基づいて説明する。
(Matching level calculation process)
A matching level is set for each algorithm, and typically one algorithm is used for each code type. However, in this embodiment, an image restoration function is implemented, and two algorithms (one with image restoration and one without image restoration) are executed for each code type. The result of the algorithm that first successfully decodes the code is output. Therefore, if the two algorithms alternately succeed in decoding, the matching level value may become unstable. Furthermore, because image restoration results in an image that is easier to read, conventional methods of calculating the matching level tend to result in a higher matching level than existing methods. In response to these issues, this embodiment calculates a weighted sum of the matching levels of the two algorithms and adjusts the matching level value. A specific example will now be described based on the flowchart shown in FIG. 24.

スタート後のステップSF1では読取画像をデコード処理部210に入力する。ステップSF2では、画像修復することなく、デコード処理部210が第1デコード処理を実行する。ステップSF3では、第1デコード処理によるマッチングレベルA(MLA)を算出する。一方、ステップSF4では、読取画像を画像修復部20jに入力して画像修復処理を実行する。その後、ステップSF5に進み、修復画像に対してデコード処理部210が第2デコード処理を実行する。ステップSF6では、第2デコード処理によるマッチングレベルB(MLB)を算出する。尚、ステップSF2でデコードに成功しなかった場合にはMLA=0となり、またステップSF5でデコードに成功しなかった場合にはMLB=0となる。 After starting, in step SF1, the read image is input to the decoding processing unit 210. In step SF2, the decoding processing unit 210 performs the first decoding process without image restoration. In step SF3, the matching level A (MLA) from the first decoding process is calculated. Meanwhile, in step SF4, the read image is input to the image restoration unit 20j and image restoration process is performed. Then, proceeding to step SF5, the decoding processing unit 210 performs the second decoding process on the restored image. In step SF6, the matching level B (MLB) from the second decoding process is calculated. Note that if decoding is not successful in step SF2, MLA = 0, and if decoding is not successful in step SF5, MLB = 0.

ステップSF7では、例えば平均化関数等を用いてMLAとMLBの値を調整する。また、ステップSF2、SF5のどちらでデコードに成功しても、MLAの値に重みを付ける処理を行う。 In step SF7, the MLA and MLB values are adjusted using, for example, an averaging function. Furthermore, regardless of whether decoding is successful in step SF2 or SF5, a process is performed to weight the MLA value.

(ユーザインターフェースの例)
図25は、表示部6に表示されるユーザインターフェース300の例を示す図である。プロセッサ20は、ユーザインターフェース300を生成し、表示部6に表示させる。ユーザインターフェース300には、カメラ5で現在撮像されている画像(ライブビュー画像)が表示される第1画像表示領域301と、読取画像が表示される第2画像表示領域302と、画像修復部20jにより修復された修復画像が表示される第3表示領域303とが設けられている。これにより、読取画像と修復画像とを比較可能な形態でユーザに提示できる。また、デコード処理が実行される画像、またはデコード処理が実行された後の画像がどのような画像であるかをユーザが把握できる。
(Example of user interface)
25 is a diagram showing an example of a user interface 300 displayed on the display unit 6. The processor 20 generates the user interface 300 and displays it on the display unit 6. The user interface 300 includes a first image display area 301 in which an image currently captured by the camera 5 (a live view image) is displayed, a second image display area 302 in which a read image is displayed, and a third display area 303 in which a restored image restored by the image restoration unit 20j is displayed. This allows the read image and the restored image to be presented to the user in a form that allows them to compare them. Furthermore, the user can understand what the image to be decoded or what the image will look like after the decoding process has been performed.

(AIチップ付き撮像素子の例)
図26は、AIチップ付き撮像素子5aを用いた例を示す図であり、各図に示すようにカメラ5の撮像素子5aを構成することができる。FIG.26Aは、撮像素子5aに画像修復を実行するAIチップを設けてパッケージ化した場合を示す図であり、読取画像を画像修復した後に、プロセッサ20に出力する。また、FIG.26Bは、撮像素子5aに、修復用コード領域の抽出と、画像修復とを実行するAIチップを設けてパッケージ化した場合を示す図であり、読取画像の中から修復用コード領域を抽出した後、当該領域に対応する部分画像を画像修復した後に、プロセッサ20に出力する。また、FIG.26Cは、撮像素子5aに、修復用コード領域の抽出を実行するAIチップを設けてパッケージ化した場合を示す図であり、読取画像の中から修復用コード領域を抽出した後、当該領域に対応する部分画像をプロセッサ20に出力する。
(Example of an image sensor with an AI chip)
26A and 26B are diagrams showing examples using an imaging element 5a with an AI chip, and the imaging element 5a of the camera 5 can be configured as shown in each diagram. FIG. 26A shows a packaged imaging element 5a equipped with an AI chip that performs image restoration, whereby the scanned image is restored and then output to the processor 20. FIG. 26B shows a packaged imaging element 5a equipped with an AI chip that extracts a repair code area and performs image restoration, whereby the scanned image is extracted, a partial image corresponding to that area is restored, and then output to the processor 20. FIG. 26C shows a packaged imaging element 5a equipped with an AI chip that extracts a repair code area, whereby the scanned image is extracted, a partial image corresponding to that area is restored, and then output to the processor 20.

また、FIG.26Aに示す例において、撮像素子5aで取得した読取画像をプロセッサ20に出力するとともに、AIチップによって画像修復を実行し、修復画像をプロセッサ20に出力してもよい。FIG.26B,FIG.26Cに示す例についても同様である。 In the example shown in FIG. 26A, the scanned image acquired by the image sensor 5a may be output to the processor 20, and the image restoration may be performed by an AI chip, and the restored image may be output to the processor 20. The same applies to the examples shown in FIG. 26B and FIG. 26C.

(偏光フィルタアタッチメント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 this embodiment, as shown in Fig. 2, a first illumination unit 4a and a second illumination unit 4b are provided, each consisting of a plurality of light-emitting diodes as a light source that generates illumination light for illuminating at least the code. The polarizing filter attachment 3 includes a first polarizing plate 3a that transmits light of a first polarization component of the light generated by the light-emitting diodes that constitute the second illumination unit 4b, and a second polarizing plate 3b that transmits light of a second polarization component that is substantially perpendicular to the first polarization component. The first polarizing plate 3a and the second polarizing plate 3b can be provided in the shaded areas in Fig. 2. For example, the first polarizing plate 3a is arranged to cover the second illumination unit 4b, and the second polarizing plate 3b is arranged to cover the optical system 5b of the camera 5 from the light incident side.

したがって、カメラ5は、第1偏光板3aを通過し、ワークWの表面(コード)から反射した光を、第2偏光板3bを介して受光する。これにより、ワークWの正反射成分が除去され、第1偏光板3a及び第2偏光板3bを介さない場合に比べて低コントラストな読取画像をカメラ5が生成する。この低コントラストな読取画像をプロセッサ20が取得する。プロセッサ20は、低コントラストな読取画像をニューラルネットワークに入力することにより、入力前に比べて高コントラストな修復画像に変換し、当該修復画像に対してデコード処理を実行する。 The camera 5 therefore receives light that passes through the first polarizer 3a and is reflected from the surface (code) of the workpiece W via the second polarizer 3b. This removes the specular reflection component of the workpiece W, and the camera 5 generates a read image with lower contrast than when the light does not pass through the first polarizer 3a and second polarizer 3b. This low-contrast read image is acquired by the processor 20. The processor 20 inputs the low-contrast read image into a neural network, converting it into a restored image with higher contrast than before input, and performs a decoding process on the restored image.

すなわち、偏光板3a、3bを使用することで、ワークWの正反射成分が除去されるので、正反射成分の影響が軽減された読取画像を取得できる。例えば金属ワークを撮像した場合のように正反射成分が多くなる画像に偏光板3a、3bは適しているものの、光量の低下によって読取画像が暗くなり、コントラストが低下することがある。このような場合に、ニューラルネットワークの推論処理によって高コントラストな修復画像に変換することで、読取性能が向上する。 In other words, by using polarizing plates 3a and 3b, the specular reflection component of the workpiece W is removed, allowing for a read image with reduced influence from the specular reflection component to be obtained. For example, polarizing plates 3a and 3b are suitable for images with a high specular reflection component, such as when capturing an image of a metal workpiece. However, reduced light intensity can cause the read image to become dark and reduce contrast. In such cases, reading performance can be improved by converting the image into a high-contrast restored image using neural network inference processing.

上述の実施形態はあらゆる点で単なる例示に過ぎず、限定的に解釈してはならない。さらに、特許請求の範囲の均等範囲に属する変形や変更は、全て本発明の範囲内のものである。 The above-described embodiments are merely illustrative in all respects and should not be interpreted as limiting. Furthermore, all modifications and variations that fall within the scope of the claims are within the scope of the present invention.

以上説明したように、本発明に係る光学的情報読取装置は、例えばワークに付されたコードを読み取る場合に利用することができる。 As described above, the optical information reading device of the present invention can be used, for example, to read codes attached to workpieces.

1 定置式の光学的情報読取装置
1A 手持ち式の光学的情報読取装置
2 ハウジング
2A 手持ち式のハウジング
2B 把持部
5 カメラ
20 プロセッサ
20c フィルタ処理部
20d チューニング実行部
20e 設定部
20f デコード処理部
20g 抽出部
20h 縮小部
20i 拡大部
20j 画像修復部
30 記憶部
30d ニューラルネットワーク記憶部
W ワーク
1 Stationary optical information reader 1A Handheld optical information reader 2 Housing 2A Handheld housing 2B Grip unit 5 Camera 20 Processor 20c Filter processing unit 20d Tuning execution unit 20e Setting unit 20f Decode processing unit 20g Extraction unit 20h Reduction unit 20i Enlargement unit 20j Image restoration unit 30 Memory unit 30d Neural network memory unit W Work

Claims (16)

ワークに付されたコードを読み取る光学的情報読取装置であって、
コードを撮影し、読取画像を生成するカメラと、
コードの読み取りに不適切な部分を有する複数の不良画像と、当該複数の不良画像にそれぞれ対応する複数の理想画像とを機械学習させることにより予め生成されたニューラルネットワークの構造及びパラメータを記憶する記憶部と、
前記カメラにより生成された読取画像の中からコードが存在する可能性が高いコード候補領域を抽出し、抽出したコード候補領域に対応する部分画像を前記記憶部に記憶された構造及びパラメータで構成されたニューラルネットワークに入力することにより、前記記憶部に記憶された構造及びパラメータに従って前記部分画像の修復を試行するとともに前記読取画像に対する第1デコード処理と、前記修復された部分画像に対する第2デコード処理を実行するプロセッサとを備える光学的情報読取装置。
An optical information reading device that reads a code attached to a workpiece,
a camera that photographs the code and generates a scanned image;
a storage unit that stores the structure and parameters of a neural network that has been generated in advance by machine learning a plurality of defective images having portions that are inappropriate for reading a code and a plurality of ideal images that respectively correspond to the plurality of defective images;
an optical information reading device comprising: a processor that extracts a code candidate area in which a code is likely to exist from the read image generated by the camera; and inputs a partial image corresponding to the extracted code candidate area into a neural network configured with the structure and parameters stored in the storage unit, thereby attempting to repair the partial image in accordance with the structure and parameters stored in the storage unit; and that executes a first decoding process on the read image and a second decoding process on the repaired partial image.
請求項1に記載の光学的情報読取装置において、
前記プロセッサは、前記カメラにより生成された読取画像に対して、コードを特定するための情報に基づいてコードを探索し、探索されたコードを含む領域を前記コード候補領域として抽出する光学的情報読取装置。
2. The optical information reading device according to claim 1,
The processor searches for a code in the scanned image generated by the camera based on information for identifying the code, and extracts an area containing the code as the code candidate area.
請求項1または2に記載の光学的情報読取装置において、
前記カメラの撮影視野範囲内へ向けて環境光とは異なる色の可視光を照射して目印を形成するための光照射部を備え、
前記プロセッサは、前記カメラにより生成された読取画像の中から、前記光照射部により形成された目印に対応する部分を特定し、当該特定された部分を前記コード候補領域として抽出する光学的情報読取装置。
3. The optical information reading device according to claim 1,
a light irradiation unit for irradiating a visible light of a color different from ambient light into a photographing field of view of the camera to form a mark;
The processor identifies a portion of the scanned image generated by the camera that corresponds to a mark formed by the light irradiation unit, and extracts the identified portion as the code candidate area.
請求項3に記載の光学的情報読取装置において、
前記プロセッサは、前記カメラにより生成された読取画像の中心部分を特定し、当該中心部分を前記コード候補領域として抽出する光学的情報読取装置。
4. The optical information reading device according to claim 3,
The processor identifies a central portion of the scanned image generated by the camera and extracts the central portion as the code candidate area.
請求項1から4のいずれか1つに記載の光学的情報読取装置において、
前記プロセッサは、前記カメラにより生成された読取画像の中から、ユーザによる所定の部分の指定を受け付けるように構成され、当該指定された部分を前記コード候補領域として抽出する光学的情報読取装置。
5. The optical information reading device according to claim 1,
The processor is configured to accept a user's designation of a specific portion from within the scanned image generated by the camera, and extract the designated portion as the code candidate area.
請求項1から5のいずれか1つに記載の光学的情報読取装置において、
前記プロセッサは、前記光学的情報読取装置の設定時に各種条件が前記第1デコード処理に適した条件となるように当該各種条件を設定するとともに、前記カメラにより生成された読取画像に含まれるコードのサイズを取得し、取得したコードのサイズに基づいて前記部分画像の前記ニューラルネットワークへの入力サイズを決定する光学的情報読取装置。
6. The optical information reading device according to claim 1,
The processor sets various conditions when setting up the optical information reading device so that the various conditions are suitable for the first decoding process , and also acquires the size of the code contained in the read image generated by the camera , and determines the input size of the partial image to the neural network based on the acquired code size.
請求項6に記載の光学的情報読取装置において、
前記プロセッサは、前記光学的情報読取装置の設定時に、デコード処理の対象とするコードを前記カメラで撮影して生成した画像に基づいてコードのサイズを取得する光学的情報読取装置。
7. The optical information reading device according to claim 6,
An optical information reading device in which the processor , when setting up the optical information reading device, obtains the size of the code based on an image generated by photographing the code to be decoded with the camera.
請求項6または7に記載の光学的情報読取装置において、
前記プロセッサは、前記部分画像の前記ニューラルネットワークへの入力サイズを、前記読取画像に含まれるコードのサイズよりも所定量だけ大きくする光学的情報読取装置。
8. The optical information reading device according to claim 6 or 7,
The processor increases the input size of the partial image to the neural network by a predetermined amount greater than the size of the code included in the read image .
請求項6から8のいずれか1つに記載の光学的情報読取装置において、
前記プロセッサは、前記読取画像に含まれるコードを構成する1つのモジュールのピクセル数と当該コードの縦または横方向に並ぶモジュール数とに基づいて前記部分画像の前記ニューラルネットワークへの入力サイズを決定する光学的情報読取装置。
9. The optical information reading device according to claim 6,
An optical information reading device in which the processor determines the input size of the partial image to the neural network based on the number of pixels in one module that makes up the code contained in the read image and the number of modules arranged vertically or horizontally in the code.
請求項1から9のいずれか1つに記載の光学的情報読取装置において、
前記部分画像を修復した修復画像を生成する推論処理と前記第1デコード処理とが前記プロセッサにより並列に実行され、前記プロセッサ前記第2デコード処理を実行している期間の少なくとも一部は前記推論処理が実行されない休止期間を有する光学的情報読取装置。
10. The optical information reading device according to claim 1,
An optical information reading device in which an inference process for generating a restored image by repairing the partial image and the first decoding process are executed in parallel by the processor, and at least a portion of the period during which the processor is executing the second decoding process has a pause period during which the inference process is not executed.
請求項1から9のいずれか1つに記載の光学的情報読取装置において、
前記プロセッサは、前記第2デコード処理を実行するか否かの設定を受け付け、該設定に応じて前記第2デコード処理を実行するか否かを切り替える光学的情報読取装置。
10. The optical information reading device according to claim 1,
The processor receives a setting as to whether or not to execute the second decoding process, and switches between executing and not executing the second decoding process in accordance with the setting .
請求項1から9のいずれか1つに記載の光学的情報読取装置において、
プロセッサ、前記コード候補領域に対応する部分画像を前記ニューラルネットワークに入力し、当該部分画像を修復した修復画像を生成する推論処理を実行するとともに、前記修復画像に基づいてコードの各セル位置を示すグリッド位置を決定し、決定したグリッド位置に基づいて当該修復画像のデコードを実行する光学的情報読取装置。
10. The optical information reading device according to claim 1,
The processor inputs a partial image corresponding to the code candidate area into the neural network, performs inference processing to generate a restored image by restoring the partial image, determines grid positions indicating the positions of each cell of the code based on the restored image, and decodes the restored image based on the determined grid positions.
請求項1から9のいずれか1つに記載の光学的情報読取装置において、
前記プロセッサは、前記カメラの撮像条件、並びに、前記第1デコード処理及び前記第2デコード処理のデコード条件を変化させて、撮像及びデコード処理を繰り返し、各撮像条件及びデコード条件にて算出されたコードの読み取りのしやすさを示すマッチングレベルに基づいて、最適な撮像条件及びデコード条件を決定するとともに、読取対象のコードの大きさを設定するチューニング処理を実行、前記チューニング処理により設定された読取対象のコードを包含できるサイズで、かつ前記読取画像の中でコードが存在する可能性が高いコード候補領域を抽出し、当該抽出されたコード候補領域に対応する部分画像を、予め定められたサイズとなるように縮小又は拡大してから前記ニューラルネットワークに入力し、当該ニューラルネットワークで修復した修復画像に対して前記第2デコード処理を実行する光学的情報読取装置。
10. The optical information reading device according to claim 1,
The processor repeats the imaging and decoding processes by changing the imaging conditions of the camera and the decoding conditions of the first decoding process and the second decoding process, determines optimal imaging conditions and decoding conditions based on a matching level indicating the ease of reading the code calculated under each imaging condition and decoding condition, and performs a tuning process to set the size of the code to be read, extracts a code candidate area within the read image that is large enough to contain the code to be read set by the tuning process and that is likely to contain the code, reduces or enlarges the partial image corresponding to the extracted code candidate area to a predetermined size and then inputs it to the neural network, and performs the second decoding process on the repaired image repaired by the neural network.
請求項1から9のいずれか1つに記載の光学的情報読取装置において、
少なくともコードを照明する照明光を発生する複数の光源と、
前記光源で発生した光のうち、第1の偏光成分の光を通過させる第1偏光板と、
前記第1の偏光成分と略直交する第2の偏光成分の光を通過させる第2偏光板と、をさらに備え、
前記カメラは、前記第1偏光板を通過し、コードから反射した光を前記第2偏光板を介して受光し、前記ワークの正反射成分を除去することにより、前記第1偏光板及び前記第2偏光板を介さない場合に比べて低コントラストな読取画像を生成し、
前記プロセッサは、前記低コントラストな読取画像を前記ニューラルネットワークに入力することにより、入力前に比べて高コントラストな修復画像に変換し、当該修復画像に対して前記第2デコード処理を実行する光学情報読取装置。
10. The optical information reading device according to claim 1,
a plurality of light sources that generate illumination light for illuminating at least the code;
a first polarizing plate that transmits light of a first polarization component out of the light generated by the light source;
a second polarizing plate that transmits light of a second polarized component that is substantially orthogonal to the first polarized component;
The camera receives light that passes through the first polarizing plate and is reflected from the code via the second polarizing plate, and removes the regular reflection component of the work, thereby generating a read image with lower contrast than when the first polarizing plate and the second polarizing plate are not used,
The processor inputs the low-contrast read image into the neural network, converts it into a restored image with higher contrast than before input, and performs the second decoding process on the restored image.
請求項1から9のいずれか1つに記載の光学的情報読取装置において、
前記プロセッサは、前記カメラの撮像条件を変化させて、撮像及びデコード処理を繰り返し、各撮像条件にて算出されたコードの読み取りのしやすさを示すマッチングレベルに基づいて、前記撮像条件及び読取対象のコードのコード条件を複数設定可能であり
前記記憶部は、前記プロセッサにより設定された第1の撮像条件及びコード条件と第2の撮像条件及びコード条件とを含む複数の撮像条件及びコード条件を記憶し、前記記憶部に記憶されている複数の読取条件の内、前記第1の撮像条件及びコード条件で生成された読取画像を前記ニューラルネットワークに入力して第1の修復画像を生成し、当該第1の修復画像に対する前記第2デコード処理失敗した場合は前記第2の撮像条件及びコード条件で生成された読取画像を前記ニューラルネットワークに入力して第2の修復画像を生成し、当該第2の修復画像に対して前記第2デコード処理を実行する光学情報読取装置。
10. The optical information reading device according to claim 1,
the processor is capable of changing the imaging conditions of the camera, repeating imaging and decoding processes, and setting a plurality of imaging conditions and code conditions for the code to be read based on a matching level that indicates the ease of reading the code calculated under each imaging condition;
The memory unit stores a plurality of imaging conditions and code conditions including first imaging conditions and code conditions and second imaging conditions and code conditions set by the processor , and an optical information reading device inputs a read image generated under the first imaging conditions and code conditions of the plurality of reading conditions stored in the memory unit to the neural network to generate a first restored image, and if the second decoding process on the first restored image fails, inputs a read image generated under the second imaging conditions and code conditions to the neural network to generate a second restored image, and performs the second decoding process on the second restored image.
請求項1から15のいずれか1つに記載の光学情報読取装置において、16. The optical information reader according to claim 1,
前記プロセッサは、前記第1デコード処理または前記第2デコード処理のいずれか一方でデコードが成功した時点で、該デコードの結果を出力する光学情報読取装置。The optical information reader is configured such that, when decoding is successful in either the first decoding process or the second decoding process, the processor outputs the result of the decoding.
JP2021164233A 2021-01-18 2021-10-05 Optical information reader Active JP7795320B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2021005656 2021-01-18
JP2021005656 2021-01-18

Publications (2)

Publication Number Publication Date
JP2022111039A JP2022111039A (en) 2022-07-29
JP7795320B2 true JP7795320B2 (en) 2026-01-07

Family

ID=82570217

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021164233A Active JP7795320B2 (en) 2021-01-18 2021-10-05 Optical information reader

Country Status (1)

Country Link
JP (1) JP7795320B2 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009110070A (en) 2007-10-26 2009-05-21 Canon Inc Image processing apparatus, image processing method, and computer program
JP2010176619A (en) 2009-02-02 2010-08-12 Casio Computer Co Ltd Symbol reader and program
JP2012064170A (en) 2010-09-17 2012-03-29 Keyence Corp Optical information reading improvement support device
JP2016033787A (en) 2014-07-31 2016-03-10 株式会社キーエンス Optical information reader
JP2018136854A (en) 2017-02-23 2018-08-30 株式会社キーエンス Optical information reader
JP2019101555A (en) 2017-11-29 2019-06-24 株式会社キーエンス Optical reading device
JP6683666B2 (en) 2017-10-04 2020-04-22 ファナック株式会社 Identification code reader and machine learning device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003281010A (en) * 2002-03-22 2003-10-03 Aimek Co Ltd Portable terminal equipment
JP4058529B2 (en) * 2003-09-08 2008-03-12 株式会社デンソーウェーブ Optical information reader
JP5169052B2 (en) * 2007-07-25 2013-03-27 大日本印刷株式会社 Information reading system and program
JP2012064178A (en) * 2010-09-17 2012-03-29 Keyence Corp Optical information reader
JP6338836B2 (en) * 2013-09-20 2018-06-06 株式会社デンソーウェーブ Information code reader
JP2019071018A (en) * 2017-10-11 2019-05-09 株式会社キーエンス Optical information reader and optical information reading method
JP7251079B2 (en) * 2018-09-14 2023-04-04 富士フイルムビジネスイノベーション株式会社 Image processing device and program
JP7402088B2 (en) * 2020-03-19 2023-12-20 株式会社キーエンス optical reader

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009110070A (en) 2007-10-26 2009-05-21 Canon Inc Image processing apparatus, image processing method, and computer program
JP2010176619A (en) 2009-02-02 2010-08-12 Casio Computer Co Ltd Symbol reader and program
JP2012064170A (en) 2010-09-17 2012-03-29 Keyence Corp Optical information reading improvement support device
JP2016033787A (en) 2014-07-31 2016-03-10 株式会社キーエンス Optical information reader
JP2018136854A (en) 2017-02-23 2018-08-30 株式会社キーエンス Optical information reader
JP6683666B2 (en) 2017-10-04 2020-04-22 ファナック株式会社 Identification code reader and machine learning device
JP2019101555A (en) 2017-11-29 2019-06-24 株式会社キーエンス Optical reading device

Also Published As

Publication number Publication date
JP2022111039A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
JP7761442B2 (en) Optical information reader
US12039400B2 (en) Optical information reading device
JP4442624B2 (en) Optical information reader
US8542930B1 (en) Mark reader configured to prioritize images
US12439154B2 (en) Systems, methods, and apparatuses for focus selection using image disparity
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
CN114787648A (en) System and method for transparent object segmentation using polarization cues
JP2020170366A (en) Handheld optical information reader
US11854163B2 (en) Optical information reading device
JP7600449B2 (en) Optical Reader
JP2018136854A (en) Optical information reader
JP7795320B2 (en) Optical information reader
JP7813116B2 (en) Optical information reader
CN116046791B (en) Method and device for detecting defect of adhesive dispensing
JP2015191531A (en) Method for determining spatial position of two-dimensional code and apparatus therefor
JP7733529B2 (en) Optical information reader
JP7824055B2 (en) Optical information reader
JP7824056B2 (en) Optical information reader
JP2025089584A (en) Optical information reader
CN118628786A (en) Image processing device and image processing method
JP2018136855A (en) Optical information reader and optical information reading method
JP7706348B2 (en) Setting device for optical information reading device, optical information reading system, and optical information reading method
US12387452B2 (en) Automatic illumination switching for a scanning device using reflections
JP2007299123A (en) Setting device and setting method for two-dimensional code reader

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20251209

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20251219

R150 Certificate of patent or registration of utility model

Ref document number: 7795320

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150