JP7090899B2 - Image processing equipment and image processing programs that use encoded illumination patterns - Google Patents

Image processing equipment and image processing programs that use encoded illumination patterns Download PDF

Info

Publication number
JP7090899B2
JP7090899B2 JP2018169165A JP2018169165A JP7090899B2 JP 7090899 B2 JP7090899 B2 JP 7090899B2 JP 2018169165 A JP2018169165 A JP 2018169165A JP 2018169165 A JP2018169165 A JP 2018169165A JP 7090899 B2 JP7090899 B2 JP 7090899B2
Authority
JP
Japan
Prior art keywords
image
pattern
illumination
image processing
illumination pattern
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
JP2018169165A
Other languages
Japanese (ja)
Other versions
JP2020042527A (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.)
Hokkaido Research Organization
Original Assignee
Hokkaido Research Organization
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 Hokkaido Research Organization filed Critical Hokkaido Research Organization
Priority to JP2018169165A priority Critical patent/JP7090899B2/en
Publication of JP2020042527A publication Critical patent/JP2020042527A/en
Application granted granted Critical
Publication of JP7090899B2 publication Critical patent/JP7090899B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、分光分析分野や三次元計測分野において用いられる、視差のある複数の画像を処理するのに好適な画像処理装置および画像処理プログラムに関するものである。 The present invention relates to an image processing apparatus and an image processing program suitable for processing a plurality of images having parallax, which are used in the fields of spectroscopic analysis and three-dimensional measurement.

従来、分光分析分野や三次元計測分野においては、分析対象または計測対象となる被写体について、視差のある画像(分光画像を含む)を複数取得し、各画像間において対応する画素の位置合わせを行うことにより、マルチスペクトルデータや三次元形状データを取得するようになっている。 Conventionally, in the field of spectroscopic analysis and the field of three-dimensional measurement, a plurality of images (including spectroscopic images) having a parallax are acquired for an analysis target or a subject to be measured, and the corresponding pixels are aligned between the images. As a result, multi-spectral data and three-dimensional shape data are acquired.

例えば、特開2016-138789号公報には、波長の異なる複数の分光画像を光学モジュールから同期して取得し、各分光画像をマッチング処理して得られたマルチスペクトルデータを解析することにより、検査対象物に混入した異物等を検査する分光イメージングシステムが提案されている(特許文献1)。 For example, Japanese Patent Application Laid-Open No. 2016-138789 describes inspection by synchronously acquiring a plurality of spectral images having different wavelengths from an optical module and analyzing the multispectral data obtained by matching each spectral image. A spectroscopic imaging system for inspecting foreign matter and the like mixed in an object has been proposed (Patent Document 1).

特開2016-138789号公報Japanese Unexamined Patent Publication No. 2016-138789

しかしながら、特許文献1においても用いられており、従来より上記位置合わせの方法として知られるステレオマッチング法等においては、被写体の表面に際立った模様がない場合には、撮像した複数の画像間において対応する画素を見つけることができないという問題がある。 However, in the stereo matching method, which is also used in Patent Document 1 and has been conventionally known as the above-mentioned alignment method, when there is no conspicuous pattern on the surface of the subject, it corresponds between a plurality of captured images. There is a problem that it is not possible to find the pixel to be used.

このような問題を解決するために、模様のない被写体に対しては、ドットパターン等を投影することによって、対応する画素を探索する技術も提案されている。しかしながら、従来のドットパターン等には、全く照明されない部分が存在するため、分光画像を撮像する場合には、スペクトルデータを取得できない部分が発生してしまうという問題がある。 In order to solve such a problem, a technique of searching for a corresponding pixel by projecting a dot pattern or the like on a subject without a pattern has also been proposed. However, since there is a portion that is not illuminated at all in the conventional dot pattern or the like, there is a problem that a portion in which spectral data cannot be acquired occurs when a spectroscopic image is captured.

本発明は、このような問題点を解決するためになされたものであって、視差のある複数の画像内に撮像した被写体が無模様であっても、各画像間において対応する画素を位置合わせするとともに、分光画像におけるスペクトルデータを漏れなく取得することができる画像処理装置および画像処理プログラムを提供することを目的としている。 The present invention has been made to solve such a problem, and even if the subject captured in a plurality of images having a difference in image is unpatterned, the corresponding pixels are aligned between the images. At the same time, it is an object of the present invention to provide an image processing apparatus and an image processing program capable of acquiring spectral data in a spectral image without omission.

本発明に係る画像処理装置は、視差のある複数の画像内に撮像した被写体が無模様であっても、各画像間において対応する画素を位置合わせするとともに、分光画像におけるスペクトルデータを漏れなく取得するという課題を解決するために、被写体に投影するための照明パターンを投影装置に送信するとともに、前記照明パターンが投影された被写体について同時に撮像された複数の画像を一または複数の撮像装置から取得し、前記照明パターンに基づいて各画像における各画素の位置合わせ処理を実行する画像処理装置であって、前記照明パターンは、同一輝度値の画素群からなるブロックを複数有してなる照明領域を全面に有しているとともに、前記各ブロックの輝度値が0(黒)以外のランダムな値に設定されている。 The image processing apparatus according to the present invention aligns the corresponding pixels between the images and acquires the spectral data in the spectral image without omission even if the subject captured in the plurality of images having the difference in image is unpatterned. In order to solve the problem of An image processing device that executes alignment processing of each pixel in each image based on the illumination pattern, wherein the illumination pattern includes an illumination region having a plurality of blocks composed of pixel groups having the same brightness value. The brightness value of each block is set to a random value other than 0 (black) while having the entire surface.

また、本発明の一態様として、各ブロックに設定するランダムな輝度値の枯渇を防止するとともに、照明パターンを明確化して認識ミスを抑制するという課題を解決するために、前記照明パターンは、所定形状の前記照明領域を複数配置してなり、これら各照明領域を構成する各ブロックの輝度値は、同一パターンの照明領域が存在しないようにランダムな値に設定されていてもよい。 Further, as one aspect of the present invention, in order to prevent the exhaustion of random luminance values set in each block and to solve the problem of clarifying the illumination pattern and suppressing recognition errors, the illumination pattern is predetermined. A plurality of the illuminated areas of the shape are arranged, and the brightness value of each block constituting each of these illuminated areas may be set to a random value so that the illuminated areas of the same pattern do not exist.

さらに、本発明の一態様として、各画像のマッチング処理を効率化および高速化するという課題を解決するために、前記照明パターンは、前記照明領域である、複数の縦格子線と、複数の横格子線と、前記縦格子線および前記横格子線によって囲まれた矩形状の複数のグリッドとから構成されており、少なくとも前記縦格子線および前記横格子線を構成する各ブロックの輝度値が、同一パターンの前記縦格子線および同一パターンの前記横格子線が存在しないようにランダムな値に設定されていてもよい。 Further, as one aspect of the present invention, in order to solve the problem of improving the efficiency and speed of the matching process of each image, the illumination pattern has a plurality of vertical grid lines and a plurality of horizontal grid lines, which are the illumination regions. It is composed of a grid line and a plurality of rectangular grids surrounded by the vertical grid line and the horizontal grid line, and at least the brightness value of each block constituting the vertical grid line and the horizontal grid line is set. It may be set to a random value so that the vertical grid line of the same pattern and the horizontal grid line of the same pattern do not exist.

また、本発明の一態様として、縦格子線および横格子線を抽出し、光切断法としてのデータを取得するという課題を解決するために、前記縦格子線および前記横格子線を構成する各ブロックの輝度値の範囲と、前記グリッドを構成する各ブロックの輝度値の範囲は、所定の閾値より小さい範囲と大きい範囲の一方と他方に設定されており、前記撮像装置によって撮像された各画像に対して前記閾値による二値化処理を実行してもよい。 Further, as one aspect of the present invention, in order to solve the problem of extracting vertical grid lines and horizontal grid lines and acquiring data as an optical cutting method, the vertical grid lines and the horizontal grid lines are configured. The range of the brightness value of the blocks and the range of the brightness value of each block constituting the grid are set to one and the other of a range smaller than a predetermined threshold value and a range larger than a predetermined threshold value, and each image captured by the image pickup apparatus. The binarization process based on the threshold value may be executed on the subject.

さらに、本発明の一態様として、低輝度でSN比(Signal-Noise ratio)が小さい画像であっても、高精度に位置合わせするという課題を解決するために、前記撮像装置によって撮像された各画像に対して微分処理を実行した後、前記照明領域ごとに微分値のスケールを合わせるための正規化処理を実行してもよい。 Further, as one aspect of the present invention, even if the image has a low brightness and a small SN ratio (Signal-Noise ratio), in order to solve the problem of positioning with high accuracy, each image imaged by the image pickup device is performed. After performing the differential processing on the image, the normalization processing for adjusting the scale of the differential value may be executed for each of the illumination regions.

また、本発明の一態様として、食品等に混入する異物を検査するための従来の食品異物検査装置と同等の検査速度で様々な形状の被写体を検査でき、異物を高精度かつ高速度に自動検査するという課題を解決するために、前記撮像装置は、複数の分光画像を同時に撮像する多眼式分光イメージングカメラであり、前記画像処理装置は、前記分光画像における各画素を位置合わせ処理して得られるマルチスペクトルデータを解析することにより、前記被写体に混入する異物を検出してもよい。 Further, as one aspect of the present invention, it is possible to inspect subjects of various shapes at the same inspection speed as a conventional food foreign matter inspection device for inspecting foreign matter mixed in food or the like, and the foreign matter is automatically inspected with high accuracy and high speed. In order to solve the problem of inspection, the image pickup device is a multi-lens spectroscopic imaging camera that simultaneously captures a plurality of spectroscopic images, and the image processing device aligns and processes each pixel in the spectroscopic image. By analyzing the obtained multispectral data, foreign matter mixed in the subject may be detected.

さらに、本発明の一態様として、正確なマルチスペクトルデータや三次元形状データを確実に取得するという課題を解決するために、前記位置合わせ処理に失敗した照明領域が存在する場合、下記(a),(b)のうち、少なくともいずれか一方の処理を実行する画像処理装置であってもよい。
(a)前記位置合わせ処理が成功した他の照明領域またはマッチング度合が最大の照明領域に基づいて補間して位置合わせする補間処理。
(b)前記照明パターンとは異なる照明パターンを投影装置に送信するとともに、前記異なる照明パターンが投影された被写体について同時に取得された複数の画像を一または複数の撮像装置から取得し、前記異なる照明パターンに基づいて各画像における各画素の位置合わせ処理を再び行うリトライ処理。
Further, as one aspect of the present invention, in order to solve the problem of reliably acquiring accurate multispectral data and three-dimensional shape data, when there is an illumination region in which the alignment process has failed, the following (a) , (B) may be an image processing apparatus that executes at least one of the processes.
(A) Interpolation processing for interpolating and aligning based on another lighting area where the alignment processing is successful or the lighting area having the maximum matching degree.
(B) An illumination pattern different from the illumination pattern is transmitted to the projection device, and a plurality of images simultaneously acquired for the subject on which the different illumination pattern is projected are acquired from one or a plurality of image pickup devices, and the different illuminations are obtained. Retry processing that re-aligns each pixel in each image based on the pattern.

本発明に係る画像処理プログラムは、視差のある複数の画像内に撮像した被写体が無模様であっても、各画像間において対応する画素を位置合わせするとともに、分光画像におけるスペクトルデータを漏れなく取得するという課題を解決するために、被写体に投影するための照明パターンを投影装置に送信するステップと、前記照明パターンが投影された被写体について同時に撮像された複数の画像を一または複数の撮像装置から取得するステップと、前記照明パターンに基づいて各画像における各画素の位置合わせ処理を実行するステップと、をコンピュータに実行させる画像処理プログラムであって、前記照明パターンは、同一輝度値の画素群からなるブロックを複数有してなる照明領域を全面に有しているとともに、前記各ブロックの輝度値が0(黒)以外のランダムな値に設定されている。 The image processing program according to the present invention aligns the corresponding pixels between the images and acquires the spectral data in the spectral image without omission even if the subject captured in the plurality of images having the difference in image is unpatterned. In order to solve the problem of An image processing program that causes a computer to execute a step of acquiring and a step of executing an alignment process of each pixel in each image based on the illumination pattern. The illumination pattern is from a group of pixels having the same brightness value. It has an illumination area having a plurality of blocks, and the brightness value of each block is set to a random value other than 0 (black).

本発明によれば、視差のある複数の画像内に撮像した被写体が無模様であっても、各画像間において対応する画素を位置合わせするとともに、分光画像におけるスペクトルデータを漏れなく取得することができる。 According to the present invention, even if the subject captured in a plurality of images with parallax has no pattern, the corresponding pixels can be aligned between the images and the spectral data in the spectroscopic image can be acquired without omission. can.

本発明に係る画像処理装置および画像処理プログラムの一実施形態を示すブロック図である。It is a block diagram which shows one Embodiment of the image processing apparatus and the image processing program which concerns on this invention. 本実施形態の照明パターンを示す全体図およびその一部の拡大図である。It is the whole view which shows the lighting pattern of this embodiment, and is the enlarged view of a part thereof. 本実施形態の照明領域とブロックとの関係を示す拡大図である。It is an enlarged view which shows the relationship between the illumination area and a block of this embodiment. 本実施形態において、グリッドのマッチング処理を示す図である。It is a figure which shows the matching process of the grid in this embodiment. 本実施形態において、縦格子線および横格子線のみが唯一となるように設定された照明パターンの一例を示す図である。In this embodiment, it is a figure which shows an example of the illumination pattern which was set so that only a vertical grid line and a horizontal grid line are unique. 本実施形態において、縦格子線および横格子線を設けず、各グリッドが唯一となるように設定された照明パターンの一例を示す図である。In this embodiment, it is a figure which shows an example of the illumination pattern in which the vertical grid line and the horizontal grid line are not provided, and each grid is set to be unique. 本実施形態において、低輝度の照明パターンを微分処理した例を示す図である。It is a figure which shows the example which differential-processed the low-luminance illumination pattern in this embodiment. 本実施形態において、(a)照明パターン全体のうち、一部の照明領域(グリッド)の位置合わせ処理に失敗した場合、(b)ある照明領域(グリッド)の一部が欠落して位置合わせ処理に失敗した場合を示す図である。In the present embodiment, when (a) the alignment process of a part of the illumination area (grid) in the entire illumination pattern fails, (b) a part of a certain illumination area (grid) is missing and the alignment process is performed. It is a figure which shows the case which failed. 本実施形態の画像処理装置および画像処理プログラムによって実行される処理を示すフローチャートである。It is a flowchart which shows the process executed by the image processing apparatus and the image processing program of this embodiment. 本実施例1において、位置合わせ性能を評価する際に行った各照明領域のマッチング動作を示す図である。It is a figure which shows the matching operation of each illumination area performed at the time of evaluating the alignment performance in this Example 1. FIG. 本実施例1において、(a)微分処理および正規化処理を実行しない場合、および(b)各処理を実行した場合における、位置合わせ性能の評価結果を示すグラフである。In the first embodiment, it is a graph which shows the evaluation result of the alignment performance in the case where (a) the differentiation process and the normalization process are not executed, and (b) each process is executed.

以下、本発明に係る画像処理装置および画像処理プログラムの一実施形態について図面を用いて説明する。 Hereinafter, an embodiment of the image processing apparatus and the image processing program according to the present invention will be described with reference to the drawings.

本実施形態の画像処理装置1は、図1に示すように、被写体に投影するための照明パターンを投影装置2に送信するとともに、当該照明パターンが投影された被写体について同時に撮像された複数の画像を撮像装置3から取得し、照明パターンに基づいて各画像における各画素の位置合わせ処理を実行するためのものである。以下、各構成について説明する。なお、本発明において、画像とは、一般的なカラー画像やグレースケール画像のみならず、分光画像を含む概念である。 As shown in FIG. 1, the image processing device 1 of the present embodiment transmits a lighting pattern for projecting to a subject to the projection device 2, and simultaneously captures a plurality of images of the subject on which the lighting pattern is projected. Is for executing the alignment processing of each pixel in each image based on the illumination pattern. Hereinafter, each configuration will be described. In the present invention, the image is a concept including not only a general color image and a gray scale image but also a spectral image.

投影装置2は、符号化された照明パターンを被写体に投影するためのものである。具体的には、投影装置2は、DLP(Digital Light Processing)プロジェクタ、液晶プロジェクタ、LCOS(Liquid Crystal On Silicon)プロジェクタ等によって構成されている。そして、投影装置2は、画像処理装置1から照明パターンが送られてくると、当該照明パターンを被写体に向けて投影するようになっている。 The projection device 2 is for projecting a coded illumination pattern onto a subject. Specifically, the projection device 2 is composed of a DLP (Digital Light Processing) projector, a liquid crystal projector, an LCOS (Liquid Crystal On Silicon) projector, and the like. Then, when the illumination pattern is sent from the image processing apparatus 1, the projection device 2 projects the illumination pattern toward the subject.

撮像装置3は、照明パターンが投影された被写体を撮像するものである。具体的には、撮像装置3は、複数の分光画像を同時に撮像する多眼式分光イメージングカメラや、単一の画像を撮像する単眼式カメラ等によって構成されている。そして、撮像装置3が多眼式分光イメージングカメラの場合、一の撮像装置3によって同時に撮像された複数の分光画像が画像処理装置1へ送信される。また、撮像装置3が単眼式カメラの場合、複数の撮像装置3によって同時に撮像された複数の画像が画像処理装置1へ送信される。いずれの場合も、視差のある複数の画像がスナップショット方式で同時に取得される。 The image pickup apparatus 3 captures a subject on which an illumination pattern is projected. Specifically, the image pickup apparatus 3 is composed of a multi-eye spectroscopic imaging camera that simultaneously captures a plurality of spectroscopic images, a monocular camera that captures a single image, and the like. When the image pickup device 3 is a multi-eye spectroscopic imaging camera, a plurality of spectroscopic images simultaneously captured by one image pickup device 3 are transmitted to the image processing device 1. When the image pickup device 3 is a monocular camera, a plurality of images simultaneously captured by the plurality of image pickup devices 3 are transmitted to the image processing device 1. In either case, a plurality of images with parallax are simultaneously acquired by the snapshot method.

画像処理装置1は、パーソナルコンピュータ等のコンピュータによって構成されており、図1に示すように、主として、本実施形態の画像処理プログラム1aや各種データを記憶する記憶手段4と、各種の演算処理を実行し後述する各構成部として機能する演算処理手段5とを有している。以下、各構成手段について詳細に説明する。 The image processing device 1 is composed of a computer such as a personal computer, and as shown in FIG. 1, mainly performs the image processing program 1a of the present embodiment, the storage means 4 for storing various data, and various arithmetic processes. It has an arithmetic processing means 5 that is executed and functions as each component described later. Hereinafter, each configuration means will be described in detail.

記憶手段4は、ハードディスク、ROM(Read Only Memory)、RAM(Random Access Memory)等で構成されており、各種データを記憶するとともに、演算処理手段5が各種の演算処理を実行する際のワーキングエリアとして機能するものである。本実施形態において、記憶手段4は、図1に示すように、プログラム記憶部41と、照明パターン記憶部42と、画像記憶部43とを有している。 The storage means 4 is composed of a hard disk, a ROM (Read Only Memory), a RAM (Random Access Memory), etc., and is a working area for storing various data and for the arithmetic processing means 5 to execute various arithmetic processes. It functions as. In the present embodiment, as shown in FIG. 1, the storage means 4 has a program storage unit 41, a lighting pattern storage unit 42, and an image storage unit 43.

プログラム記憶部41には、本実施形態の画像処理プログラム1aがインストールされている。そして、演算処理手段5が、画像処理プログラム1aを実行することにより、画像処理装置1としてのコンピュータを後述する各構成部として機能させるようになっている。 The image processing program 1a of the present embodiment is installed in the program storage unit 41. Then, the arithmetic processing means 5 executes the image processing program 1a to make the computer as the image processing device 1 function as each component described later.

照明パターン記憶部42は、被写体に投影するための照明パターンを記憶する領域である。本実施形態において、照明パターンは、図2に示すように、複数の縦格子線と、複数の横格子線と、これら縦格子線および横格子線によって囲まれた矩形状の複数のグリッドとから構成されている。 The illumination pattern storage unit 42 is an area for storing an illumination pattern for projecting onto a subject. In the present embodiment, as shown in FIG. 2, the illumination pattern is composed of a plurality of vertical grid lines, a plurality of horizontal grid lines, and a plurality of rectangular grids surrounded by these vertical grid lines and horizontal grid lines. It is configured.

また、本実施形態において、縦格子線、横格子線およびグリッドのそれぞれは、図3に示すように、同一輝度値の画素群からなるブロックを複数有してなる照明領域であり、この照明領域を照明パターンの全面に有している。そして、縦格子線、横格子線およびグリッドのそれぞれを構成する各ブロックの輝度値が、同一パターンの縦格子線、同一パターンの横格子線および同一パターンのグリッドが存在しないように、0(黒)以外のランダムな値に設定されている。例えば、0から255までの256段階のグレースケールの場合、1~255のうちいずれかの値によってランダムに符号化される。 Further, in the present embodiment, each of the vertical grid line, the horizontal grid line, and the grid is a lighting area having a plurality of blocks composed of pixel groups having the same luminance value, as shown in FIG. 3, and this lighting area. Has on the entire surface of the lighting pattern. Then, the luminance value of each block constituting each of the vertical grid line, the horizontal grid line, and the grid is 0 (black) so that the vertical grid line of the same pattern, the horizontal grid line of the same pattern, and the grid of the same pattern do not exist. ) Is set to a random value. For example, in the case of a gray scale of 256 steps from 0 to 255, it is randomly encoded by any value from 1 to 255.

以上のように符号化された照明パターンによれば、被写体の表面に所定の模様が投影されるため、視差のある複数の画像間において対応する画素の位置合わせ処理を行うことが可能となる。また、投影装置2が照明パターンの全面で被写体を照射し、照明として機能するため、光が当たらない部分が存在しない。このため、分光イメージングカメラ等で撮像した場合、スペクトルデータが漏れなく取得される。 According to the illumination pattern encoded as described above, since a predetermined pattern is projected on the surface of the subject, it is possible to perform the alignment processing of the corresponding pixels between a plurality of images having parallax. Further, since the projection device 2 illuminates the subject on the entire surface of the illumination pattern and functions as illumination, there is no portion that is not exposed to light. Therefore, when an image is taken with a spectroscopic imaging camera or the like, the spectral data is acquired without omission.

さらに、照明領域が同一輝度値の画素群からなるブロックによって構成されているため、各ブロックに設定するランダムな輝度値が枯渇することがない。また、画素単位で輝度値を設定する場合と比較して、照明パターンが明確となり、認識に失敗してしまうことが抑制される。 Further, since the illumination area is composed of blocks composed of pixels having the same luminance value, the random luminance values set in each block are not exhausted. Further, as compared with the case where the brightness value is set for each pixel, the illumination pattern becomes clear and the recognition failure is suppressed.

また、本実施形態の照明パターンによれば、縦格子線、横格子線およびグリッドの相対位置関係が既知となる。このため、例えば、図4(a)に示すように、グリッドA,Bのそれぞれについてマッチングする場合、グリッドAがマッチングできると、当該グリッドAとの相対位置関係に基づいて、グリッドBの対応グリッドを特定する。そして、図4(b)に示すように、対応グリッドの周囲に存在するグリッドのみが、グリッドBの探索範囲として限定されるため、各画像のマッチング処理が効率化および高速化する。 Further, according to the illumination pattern of the present embodiment, the relative positional relationship between the vertical grid line, the horizontal grid line, and the grid becomes known. Therefore, for example, as shown in FIG. 4A, when the grids A and B are matched, if the grid A can be matched, the corresponding grid of the grid B is based on the relative positional relationship with the grid A. To identify. Then, as shown in FIG. 4B, only the grid existing around the corresponding grid is limited as the search range of the grid B, so that the matching process of each image is made more efficient and faster.

ただし、照明パターンは上述した構成に限定されるものではなく、照明領域を全面に有しており、各ブロックの輝度値が0(黒)以外のランダムな値に設定されている限り、適宜変更することができる。例えば、上述したマッチング処理の効率化および高速化の観点からは、格子線同士またはグリッド同士の相対位置関係が既知であればよい。このため、少なくとも縦格子線および横格子線を構成する各ブロックの輝度値が、同一パターンの縦格子線および同一パターンの横格子線が存在しないようにランダムな値に設定してもよい。この場合、各グリッドは同一パターンであっても、縦格子線および横格子線を構成する4本の線分によって唯一に定義できるためである。例えば、図5に示すように、グリッドXは、当該グリッドXを取り囲む四方の線分(横1,横2,縦1,縦2)によって定義することができる。 However, the illumination pattern is not limited to the above-mentioned configuration, and is appropriately changed as long as it has an illumination area on the entire surface and the brightness value of each block is set to a random value other than 0 (black). can do. For example, from the viewpoint of improving the efficiency and speed of the matching process described above, it is sufficient that the relative positional relationship between the grid lines or the grids is known. Therefore, at least the luminance value of each block constituting the vertical grid line and the horizontal grid line may be set to a random value so that the vertical grid line of the same pattern and the horizontal grid line of the same pattern do not exist. In this case, even if each grid has the same pattern, it can be uniquely defined by the four line segments constituting the vertical grid line and the horizontal grid line. For example, as shown in FIG. 5, the grid X can be defined by four line segments (horizontal 1, horizontal 2, vertical 1, vertical 2) surrounding the grid X.

あるいは、図6に示すように、縦格子線および横格子線を設けず、複数のグリッドを隙間なく配置し、各グリッドを構成する各ブロックの輝度値が、同一パターンのグリッドが存在しないようにランダムな値に設定してもよい。この構成によっても、グリッド同士の相対位置関係が既知となるためである。 Alternatively, as shown in FIG. 6, vertical grid lines and horizontal grid lines are not provided, and a plurality of grids are arranged without gaps so that the luminance values of the blocks constituting each grid do not have the same pattern. It may be set to a random value. This is because the relative positional relationship between the grids becomes known even with this configuration.

また、本実施形態では、撮像素子として、水平方向および垂直方向にフォトダイオードを並べたCCD(Charge Coupled Device)やCMOS(Complementary Metal Oxide Semiconductor)を備えた撮像装置3の使用を想定している。このため、縦方向または横方向の直線のみからなる照明パターンとすることで、幾何学的な歪みの発生を抑制するとともに、マッチング処理を簡素化・高速化している。しかしながら、幾何学的な歪みの影響を無視しうるのであれば、照明パターンは、格子状のパターンに限定されるものではなく、斜線や曲線等を含む所定形状の照明領域を複数配置してなり、これら各照明領域を構成する各ブロックの輝度値が、同一パターンの照明領域が存在しないようにランダムな値に設定されていればよい。 Further, in the present embodiment, it is assumed that the image pickup device 3 provided with a CCD (Charge Coupled Device) or CMOS (Complementary Metal Oxide Semiconductor) in which photodiodes are arranged in the horizontal direction and the vertical direction is used as the image pickup element. For this reason, by using an illumination pattern consisting of only vertical or horizontal straight lines, the occurrence of geometric distortion is suppressed, and the matching process is simplified and speeded up. However, if the influence of geometric distortion can be ignored, the illumination pattern is not limited to the grid pattern, and a plurality of illumination regions having a predetermined shape including diagonal lines, curves, etc. are arranged. , The brightness value of each block constituting each of these illumination areas may be set to a random value so that the illumination areas of the same pattern do not exist.

さらに、ハイスペックなコンピュータ等によって、上述したマッチング処理の高速化を担保しうるのであれば、照明パターンを複数の照明領域に分割することなく、照明パターン全面にランダムな輝度値のブロックを隙間なく配置したものでもよい。すなわち、本発明に係る照明パターンは、少なくとも同一輝度値の画素群からなるブロックを複数有してなる照明領域を全面に有しているとともに、各ブロックの輝度値が0(黒)以外のランダムな値に設定されていればよい。 Further, if it is possible to guarantee the speeding up of the matching process described above by a high-spec computer or the like, the lighting pattern is not divided into a plurality of lighting areas, and blocks of random brightness values are formed without gaps on the entire surface of the lighting pattern. It may be arranged. That is, the illumination pattern according to the present invention has an illumination region having a plurality of blocks consisting of at least a group of pixels having the same luminance value on the entire surface, and the luminance value of each block is random other than 0 (black). It suffices if it is set to a value.

なお、本実施形態において、縦格子線および横格子線を構成する各ブロックの輝度値の範囲と、グリッドを構成する各ブロックの輝度値の範囲は、所定の閾値より小さい範囲と大きい範囲の一方と他方に設定されている。このため、本実施形態の照明パターンが撮像された画像に対し、前記閾値による二値化処理を実行すると、縦格子線および横格子線が抽出されるため、光切断法としてのデータを取得することが可能となる。 In the present embodiment, the range of the luminance value of each block constituting the vertical grid line and the horizontal grid line and the range of the luminance value of each block constituting the grid are one of a range smaller than a predetermined threshold value and a range larger than the predetermined threshold value. And the other. Therefore, when the binarization process based on the threshold value is executed on the image in which the illumination pattern of the present embodiment is captured, the vertical grid lines and the horizontal grid lines are extracted, so that the data as the optical cutting method is acquired. It becomes possible.

また、本実施形態において、照明パターン記憶部42には、後述するリトライ処理を実行するために、模様の異なる複数種類の照明パターンが記憶されている。 Further, in the present embodiment, the illumination pattern storage unit 42 stores a plurality of types of illumination patterns having different patterns in order to execute the retry process described later.

画像記憶部43は、撮像装置3によって撮像された画像を記憶する領域である。本実施形態において、画像記憶部43は、後述する画像取得部によって同時に取得された複数の画像を1つの画像セットとして保存するようになっている。 The image storage unit 43 is an area for storing an image captured by the image pickup device 3. In the present embodiment, the image storage unit 43 stores a plurality of images simultaneously acquired by the image acquisition unit described later as one image set.

演算処理手段5は、CPU(Central Processing Unit)等によって構成されており、プログラム記憶部41にインストールされた画像処理プログラム1aを実行することにより、図1に示すように、照明パターン送信部51と、画像取得部52と、微分処理部53と、正規化処理部54と、二値化処理部55と、位置合わせ処理部56と、補間処理部57と、異物検出処理部58として機能するようになっている。以下、各構成部についてより詳細に説明する。 The arithmetic processing means 5 is composed of a CPU (Central Processing Unit) or the like, and by executing the image processing program 1a installed in the program storage unit 41, the illumination pattern transmission unit 51 and the illumination pattern transmission unit 51 are executed, as shown in FIG. , Image acquisition unit 52, differentiation processing unit 53, normalization processing unit 54, binarization processing unit 55, alignment processing unit 56, interpolation processing unit 57, and foreign matter detection processing unit 58. It has become. Hereinafter, each component will be described in more detail.

照明パターン送信部51は、照明パターンを投影装置2へ送信するものである。本実施形態において、照明パターン送信部51は、照明パターン記憶部42に保存されている照明パターンを読み出し、当該照明パターンを投影装置2へ送信するようになっている。なお、本実施形態では、一度作成した照明パターンを全ての撮影に対して使い回すことが可能である。このため、画像を撮影するたびに、新たな照明パターンを作成して送信する必要がない。 The illumination pattern transmission unit 51 transmits the illumination pattern to the projection device 2. In the present embodiment, the illumination pattern transmission unit 51 reads out the illumination pattern stored in the illumination pattern storage unit 42 and transmits the illumination pattern to the projection device 2. In this embodiment, the lighting pattern once created can be reused for all shooting. Therefore, it is not necessary to create and transmit a new lighting pattern every time an image is taken.

画像取得部52は、撮像装置3から画像を取得するものである。本実施形態において、画像取得部52は、被写体が撮像装置3の画角内に入っているタイミングで、一または複数の撮像装置3に対し、複数の画像をスナップショット方式で同時に撮像させる。そして、それらの撮像装置3から複数の画像を取得し、画像記憶部43に保存するようになっている。 The image acquisition unit 52 acquires an image from the image pickup device 3. In the present embodiment, the image acquisition unit 52 causes one or a plurality of image pickup devices 3 to simultaneously capture a plurality of images by a snapshot method at a timing when the subject is within the angle of view of the image pickup device 3. Then, a plurality of images are acquired from those image pickup devices 3 and stored in the image storage unit 43.

微分処理部53は、画像に対して微分処理を実行するものである。本実施形態において、微分処理部53は、Sobelフィルタ等の微分フィルタを用いた微分処理機能を有している。そして、微分処理部53は、撮像された画像に輝度値が小さい部分がある場合、縦方向および横方向の両方向に微分処理し、照明パターンを強調するようになっている。 The differential processing unit 53 executes differential processing on the image. In the present embodiment, the differential processing unit 53 has a differential processing function using a differential filter such as a Sobel filter. Then, when the captured image has a portion having a small luminance value, the differential processing unit 53 performs differential processing in both the vertical direction and the horizontal direction to emphasize the illumination pattern.

正規化処理部54は、微分処理された画像に対して、照明領域ごとに微分値のスケールを合わせるための正規化処理を実行するものである。本実施形態において、正規化処理部54は、マッチング処理する単位である照明領域(縦格子線、横格子線およびグリッド)ごとに、各画素の微分値の最大値と最小値を特定し、これら最大値および最小値に基づいて、複数の縦格子線、複数の横格子線および複数のグリッドの間で微分値のスケールを合わせるようになっている。 The normalization processing unit 54 executes normalization processing for adjusting the scale of the differential value for each illumination region on the differentiated image. In the present embodiment, the normalization processing unit 54 specifies the maximum value and the minimum value of the differential value of each pixel for each illumination region (vertical grid line, horizontal grid line, and grid) which is a unit for matching processing, and these are specified. Based on the maximum and minimum values, the scale of the derivative value is adjusted between a plurality of vertical grid lines, a plurality of horizontal grid lines, and a plurality of grids.

例えば、図7に示すように、原パターンに対する輝度値が25%である低輝度の照明パターンは視認しにくくなるが、微分処理および正規化処理を実行することにより、照明パターンが強調されて見やすくなる。以上のように、本実施形態では、低輝度な画像に対しては、微分処理を実行した後、照明領域ごとに微分値のスケールを合わせるための正規化処理を実行するようになっている。これにより、低輝度でSN比が小さい画像であっても、高精度に位置合わせすることが可能となる。 For example, as shown in FIG. 7, a low-luminance illumination pattern having a luminance value of 25% with respect to the original pattern is difficult to see, but by executing differential processing and normalization processing, the illumination pattern is emphasized and is easy to see. Become. As described above, in the present embodiment, after the differential processing is executed for the low-luminance image, the normalization processing for adjusting the scale of the differential value is executed for each illumination region. This makes it possible to align even an image with low brightness and a small SN ratio with high accuracy.

二値化処理部55は、撮像装置3によって撮像された各画像に対して、所定の閾値よる二値化処理を実行するものである。本実施形態の照明パターンは、縦格子線および横格子線を構成する各ブロックの輝度値の範囲と、グリッドを構成する各ブロックの輝度値の範囲とが、所定の閾値より小さい範囲と大きい範囲の一方と他方に設定されている。このため、二値化処理部55が前記閾値による二値化処理を実行すると、縦格子線および横格子線が抽出され、光切断法としてのデータが取得される。 The binarization processing unit 55 executes binarization processing according to a predetermined threshold value for each image captured by the image pickup apparatus 3. In the illumination pattern of the present embodiment, the range of the luminance value of each block constituting the vertical grid line and the horizontal grid line and the range of the luminance value of each block constituting the grid are a range smaller than a predetermined threshold value and a range larger than the predetermined threshold value. It is set to one and the other. Therefore, when the binarization processing unit 55 executes the binarization processing according to the threshold value, the vertical grid lines and the horizontal grid lines are extracted, and the data as the optical cutting method is acquired.

位置合わせ処理部56は、照明パターンに基づいて各画像における各画素の位置合わせ処理を実行するものである。本実施形態において、位置合わせ処理部56は、ステレオマッチング法等のアルゴリズムを用いて、視差のある複数の画像において対応する画素を探索し、その画素間のズレを補正することにより、位置合わせするようになっている。これにより、分光画像の場合には、正確なマルチスペクトルデータが得られることとなり、三次元計測用の画像であれば、正確な三次元形状データが得られることとなる。 The alignment processing unit 56 executes the alignment processing of each pixel in each image based on the illumination pattern. In the present embodiment, the alignment processing unit 56 searches for corresponding pixels in a plurality of images having parallax by using an algorithm such as a stereo matching method, and aligns the pixels by correcting the deviation between the pixels. It has become like. As a result, in the case of a spectroscopic image, accurate multispectral data can be obtained, and in the case of an image for three-dimensional measurement, accurate three-dimensional shape data can be obtained.

補間処理部57は、位置合わせ処理に失敗した照明領域が存在する場合、補間処理を実行するものである。本実施形態において、補間処理部57は、例えば、図8(a)に示すように、照明パターン全体のうち、一部の照明領域(グリッド(6,G))の位置合わせ処理に失敗した場合、当該照明領域の周囲に存在する他の照明領域(グリッド(5,F)~(5,H),(6,F),(6,H),(7,F)~(7,H))の位置合わせ処理が成功しているか否かを確認する。そして、成功していれば、これらの一意に特定できる各グリッドの位置関係が既知であるため、補間処理部57は、周囲のグリッドに基づいて、グリッド(6,G)の位置を補間する。 The interpolation processing unit 57 executes the interpolation processing when there is a lighting area in which the alignment processing has failed. In the present embodiment, for example, as shown in FIG. 8A, when the interpolation processing unit 57 fails in the alignment processing of a part of the illumination pattern (grid (6, G)) in the entire illumination pattern. , Other lighting areas existing around the lighting area (grid (5, F) to (5, H), (6, F), (6, H), (7, F) to (7, H) ) Check if the alignment process is successful. Then, if successful, since the positional relationship of each of these uniquely identifiable grids is known, the interpolation processing unit 57 interpolates the positions of the grids (6, G) based on the surrounding grids.

また、本実施形態において、補間処理部57は、図8(b)に示すように、ある照明領域(グリッド)の一部が欠落して位置合わせ処理に失敗した場合、各照明領域のランダムパターンは唯一であるため、照明領域の中で一致する部分が存在し、そのマッチング度合が最大の照明領域を特定する。そして、当該照明領域と位置合わせすることにより、各画像間の位置ずれが算出されるため、補間処理部57は、周囲の位置ずれ量に基づいて、欠落部分の位置ずれ量を補間するようになっている。 Further, in the present embodiment, as shown in FIG. 8B, when a part of a certain lighting area (grid) is missing and the alignment processing fails, the interpolation processing unit 57 has a random pattern of each lighting area. Since there is only one, there is a matching part in the illumination area, and the illumination area with the maximum degree of matching is specified. Then, since the positional deviation between the images is calculated by aligning with the illumination area, the interpolation processing unit 57 interpolates the positional deviation amount of the missing portion based on the peripheral positional deviation amount. It has become.

また、本実施形態において、位置合わせ処理に失敗した照明領域が存在する場合であって、補間処理にも失敗した場合、または前記補間処理の代わりに、リトライ処理を実行してもよい。このリトライ処理は、最初に照射した照明パターンとは異なる照明パターンを投影装置2に送信するとともに、当該異なる照明パターンが投影された被写体について同時に撮像された複数の画像を一または複数の撮像装置3から取得し、前記異なる照明パターンに基づいて各画像における各画素の位置合わせ処理を再び行う処理である。 Further, in the present embodiment, when there is a lighting area where the alignment process has failed and the interpolation process also fails, or the retry process may be executed instead of the interpolation process. In this retry process, an illumination pattern different from the initially illuminated illumination pattern is transmitted to the projection device 2, and a plurality of images simultaneously captured for the subject on which the different illumination pattern is projected are captured by one or a plurality of image pickup devices 3. It is a process of re-aligning each pixel in each image based on the different illumination patterns obtained from the above.

すなわち、本実施形態では、位置合わせ処理に失敗した照明領域が存在する場合、下記(a),(b)のうち、少なくともいずれか一方の処理を実行するようになっている。
(a)位置合わせ処理が成功した他の照明領域またはマッチング度合が最大の照明領域に基づいて補間して位置合わせする補間処理。
(b)位置合わせ処理に失敗した照明パターンとは異なる照明パターンを投影装置2に送信するとともに、異なる照明パターンが投影された被写体について同時に取得された複数の画像を一または複数の撮像装置3から取得し、異なる照明パターンに基づいて各画像における各画素の位置合わせ処理を再び行うリトライ処理。
That is, in the present embodiment, when there is a lighting area in which the alignment process has failed, at least one of the following processes (a) and (b) is executed.
(A) Interpolation processing for interpolating and aligning based on another lighting area where the alignment processing is successful or the lighting area having the maximum matching degree.
(B) An illumination pattern different from the illumination pattern for which the alignment process has failed is transmitted to the projection device 2, and a plurality of images simultaneously acquired for a subject on which the different illumination patterns are projected are transmitted from one or a plurality of image pickup devices 3. Retry processing that acquires and realigns each pixel in each image based on different illumination patterns.

異物検出処理部58は、分光画像から得られたマルチスペクトルデータに基づいて、食品等の被写体に混入する人毛等の異物を検出するものである。本実施形態において、異物検出処理部58は、被写体のマルチスペクトルデータについて主成分分析等の解析を実行し、被写体の特徴量と異物の特徴量についての分布を取得する。そして、異物検出処理部58は、被写体の特徴量とは異なる分布を有する特徴量が検出されたとき、被写体に異物が混入していることを検出するようになっている。 The foreign matter detection processing unit 58 detects foreign matter such as human hair mixed in a subject such as food based on the multispectral data obtained from the spectroscopic image. In the present embodiment, the foreign matter detection processing unit 58 executes analysis such as principal component analysis on the multispectral data of the subject, and acquires the distribution of the feature amount of the subject and the feature amount of the foreign matter. When a feature amount having a distribution different from that of the subject is detected, the foreign matter detection processing unit 58 detects that the foreign matter is mixed in the subject.

つぎに、本実施形態の画像処理装置1および画像処理プログラム1aの作用について、図9のフローチャートを参照しつつ説明する。なお、以下の説明では、コンベアによって搬送される被写体の画像(分光画像)を撮像し、当該画像に基づいて被写体に混入している異物を検出する例について説明する。 Next, the operations of the image processing device 1 and the image processing program 1a of the present embodiment will be described with reference to the flowchart of FIG. In the following description, an example of capturing an image (spectral image) of a subject conveyed by a conveyor and detecting foreign matter mixed in the subject based on the image will be described.

本実施形態の画像処理装置1および画像処理プログラム1aを使用するに際しては、まず、事前準備として、予め作成した照明パターンを照明パターン記憶部42に記憶させておく。なお、本実施形態では、リトライ処理を実行できるように、模様の異なる複数種類の照明パターンを照明パターン記憶部42に記憶させておく。 When using the image processing device 1 and the image processing program 1a of the present embodiment, first, as a preliminary preparation, a lighting pattern created in advance is stored in the lighting pattern storage unit 42. In this embodiment, a plurality of types of lighting patterns having different patterns are stored in the lighting pattern storage unit 42 so that the retry process can be executed.

つぎに、照明パターン送信部51が、照明パターンを投影装置2へ送信すると(ステップS1)、当該投影装置2からコンベア上の所定位置に照明パターンが投影される。そして、当該所定位置を被写体が通過するタイミングで、撮像装置3が被写体の画像を同時に複数撮像すると、画像取得部52が各画像を取得する(ステップS2)。 Next, when the illumination pattern transmission unit 51 transmits the illumination pattern to the projection device 2 (step S1), the illumination pattern is projected from the projection device 2 at a predetermined position on the conveyor. Then, when the image pickup apparatus 3 simultaneously captures a plurality of images of the subject at the timing when the subject passes through the predetermined position, the image acquisition unit 52 acquires each image (step S2).

これにより、被写体の表面上に照明パターンが投影された状態の画像が複数得られるため、被写体が無模様であっても、視差のある複数の画像間において対応する画素を位置合わせすることが可能となる。また、照明パターンの全面に設けられた照明領域は、輝度値が0(黒)以外のブロックで構成されているため、被写体の全体が照射される。このため、分光画像を撮像した際には、スペクトルデータが漏れなく取得される。さらに、本実施形態では、スナップショット方式により、一回の撮像で被写体の分光画像が取得されるため、多数の被写体を検査する場合等には、検査速度が高速化される。 As a result, a plurality of images in which the illumination pattern is projected on the surface of the subject can be obtained, so that the corresponding pixels can be aligned between the plurality of images having parallax even if the subject has no pattern. It becomes. Further, since the illumination area provided on the entire surface of the illumination pattern is composed of blocks having a luminance value other than 0 (black), the entire subject is illuminated. Therefore, when the spectroscopic image is taken, the spectral data is acquired without omission. Further, in the present embodiment, since the spectral image of the subject is acquired by one imaging by the snapshot method, the inspection speed is increased when inspecting a large number of subjects.

つづいて、本実施形態では、ステップS2で取得された画像に輝度値が小さい部分がある場合(ステップS3:YES)、各画像に対して微分処理部53が微分処理を実行した後(ステップS4)、正規化処理部54が照明領域ごとに正規化処理を実行し(ステップS5)、微分値のスケールを合わせる。これにより、低輝度でSN比が小さい画像であっても、照明パターンが強調され高精度に位置合わせすることが可能となる。 Subsequently, in the present embodiment, when the image acquired in step S2 has a portion having a small luminance value (step S3: YES), after the differential processing unit 53 executes the differential processing for each image (step S4). ), The normalization processing unit 54 executes the normalization processing for each illumination area (step S5), and adjusts the scale of the differential value. As a result, even if the image has low brightness and a small SN ratio, the illumination pattern is emphasized and it is possible to align the image with high accuracy.

つぎに、ステップS5の実行後、またはステップS2で取得された各画像に輝度値が小さい部分がない場合(ステップS3:NO)、本実施形態では、光切断法としてデータを取得する必要があるか否かを判定する。そして、当該データが必要な場合(ステップS6:YES)、二値化処理部55が、各画像に対して二値化処理を実行する(ステップS7)。これにより、本実施形態の照明パターンからは、縦格子線および横格子線が抽出されるため、仮に、マルチスペクトルデータや三次元形状データの取得に失敗した場合でも、光切断法としてのデータが取得される。 Next, after the execution of step S5 or when there is no portion having a small luminance value in each image acquired in step S2 (step S3: NO), in the present embodiment, it is necessary to acquire data as an optical cutting method. Judge whether or not. Then, when the data is required (step S6: YES), the binarization processing unit 55 executes the binarization processing for each image (step S7). As a result, vertical grid lines and horizontal grid lines are extracted from the illumination pattern of the present embodiment, so even if acquisition of multispectral data or three-dimensional shape data fails, data as an optical cutting method can be obtained. To be acquired.

ステップS7の実行後、または光切断法のデータが不要な場合(ステップS6:NO)、位置合わせ処理部56が、照明パターンに基づいて各画像における各画素の位置合わせ処理を実行する(ステップS8)。これにより、分光画像を撮像した場合には、正確なマルチスペクトルデータが得られる。また、三次元計測用の画像を撮像した場合には、正確な三次元形状データが得られる。 After the execution of step S7, or when the data of the optical cutting method is unnecessary (step S6: NO), the alignment processing unit 56 executes the alignment processing of each pixel in each image based on the illumination pattern (step S8). ). As a result, accurate multispectral data can be obtained when a spectroscopic image is taken. Further, when an image for three-dimensional measurement is captured, accurate three-dimensional shape data can be obtained.

つづいて、本実施形態では、ステップS8の位置合わせ処理に失敗した照明領域が存在する場合(ステップS9:YES)、補間処理部57が補間処理を実行するか、またはリトライ処理を実行する(ステップS10)。補間処理によれば、照明パターン全体のうち、一部の照明領域の位置合わせ処理に失敗した場合でも、補間処理部57が当該照明領域の位置を補間する。また、ある照明領域の一部が欠落して位置合わせ処理に失敗した場合でも、補間処理部57が当該欠落部分の位置ずれ量を補間する。このため、表面に細かな凹凸を有し、位置合わせが困難な被写体であっても、高精度にマッチングする。 Subsequently, in the present embodiment, when there is an illuminated area in which the alignment process in step S8 has failed (step S9: YES), the interpolation processing unit 57 executes the interpolation process or the retry process (step S9: YES). S10). According to the interpolation processing, even if the alignment processing of a part of the lighting area in the entire lighting pattern fails, the interpolation processing unit 57 interpolates the position of the lighting area. Further, even if a part of a certain illumination area is missing and the alignment processing fails, the interpolation processing unit 57 interpolates the amount of misalignment of the missing portion. Therefore, even a subject having fine irregularities on the surface and difficult to align can be matched with high accuracy.

また、リトライ処理によれば、最初に照射した照明パターンとは異なる照明パターンを用いて、上述したステップS1からステップS9までの処理を繰り返す。このため、上記補間処理に失敗した場合等であっても、各画素の位置合わせ処理が成功するまでリトライされ、マルチスペクトルデータや三次元形状データがより確実に取得される。 Further, according to the retry process, the process from step S1 to step S9 described above is repeated using an illumination pattern different from the illumination pattern initially irradiated. Therefore, even if the interpolation processing fails, retries are performed until the alignment processing of each pixel is successful, and multispectral data and three-dimensional shape data are acquired more reliably.

ステップS8の位置合わせ処理に成功すると(ステップS9:NO)、異物検出処理部58が、分光画像から得られたマルチスペクトルデータに基づいて、被写体に混入する異物を検出する(ステップS11)。これにより、従来、食品工場等で既に導入されているX線異物検査装置や金属検出器と同等の検査速度で、様々な形状の被写体を検査することが可能となる。このため、従来、目視により検査されている、人毛、プラスチック片、虫等の異物を高精度かつ高速度に自動検査することが可能となる。 When the alignment process in step S8 is successful (step S9: NO), the foreign matter detection processing unit 58 detects the foreign matter mixed in the subject based on the multispectral data obtained from the spectroscopic image (step S11). This makes it possible to inspect subjects of various shapes at an inspection speed equivalent to that of X-ray foreign matter inspection devices and metal detectors that have already been introduced in food factories and the like. Therefore, it is possible to automatically inspect foreign substances such as human hair, plastic pieces, and insects, which have been visually inspected, with high accuracy and high speed.

以上のような本発明に係る画像処理装置1および画像処理プログラム1aによれば、以下のような効果を奏する。
1.視差のある複数の画像内に撮像した被写体が無模様であっても、各画像間において対応する画素を位置合わせすることができ、分光画像におけるスペクトルデータを漏れなく取得することができる。
2.各ブロックに設定するランダムな輝度値の枯渇を防止することができ、照明パターンを明確化して認識ミスを抑制することができる。
3.各画像のマッチング処理を効率化および高速化することができる。
4.縦格子線および横格子線を抽出し、光切断法としてのデータを取得することができる。
5.低輝度でSN比が小さい画像であっても、高精度に位置合わせすることができる。
6.従来の検査装置と同等の検査速度で様々な形状の被写体を検査でき、異物を高精度かつ高速度に自動検査することができる。
7.正確なマルチスペクトルデータや三次元形状データを確実に取得することができる。
According to the image processing device 1 and the image processing program 1a according to the present invention as described above, the following effects are obtained.
1. 1. Even if the subject captured in a plurality of images with parallax has no pattern, the corresponding pixels can be aligned between the images, and the spectral data in the spectroscopic image can be acquired without omission.
2. 2. It is possible to prevent the exhaustion of random brightness values set in each block, clarify the lighting pattern, and suppress recognition errors.
3. 3. The matching process of each image can be made more efficient and faster.
4. It is possible to extract vertical grid lines and horizontal grid lines and acquire data as an optical cutting method.
5. Even an image with low brightness and a small SN ratio can be aligned with high accuracy.
6. Subjects of various shapes can be inspected at the same inspection speed as conventional inspection equipment, and foreign matter can be automatically inspected with high accuracy and high speed.
7. Accurate multispectral data and 3D shape data can be reliably acquired.

つぎに、本発明に係る画像処理装置1および画像処理プログラム1aの具体的な実施例について説明する。 Next, specific examples of the image processing apparatus 1 and the image processing program 1a according to the present invention will be described.

本実施例1では、本実施形態の画像処理装置1および画像処理プログラム1aによって実行される位置合わせ性能を理論的に評価するシミュレーション実験を行った。 In the first embodiment, a simulation experiment was conducted to theoretically evaluate the alignment performance executed by the image processing device 1 and the image processing program 1a of the present embodiment.

実験条件としては、被写体として、表面に模様が無く、平面形状の被写体を設定した。また、照明パターンとしては、図2に示すように、15本の縦格子線、13本の横格子線、および168個のグリッドから構成され、プロジェクタで出力可能な8ビット階調のパターンを使用した。そして、同一の平均輝度値(1~99%)を有する照明パターンの画像を2枚用意し、各照明パターンを構成する各照明領域毎のパターン(縦格子線、横格子線、グリッドの各パターン)が一致するかどうかを評価した。 As the experimental conditions, a flat subject with no pattern on the surface was set as the subject. As the illumination pattern, as shown in FIG. 2, an 8-bit gradation pattern that is composed of 15 vertical grid lines, 13 horizontal grid lines, and 168 grids and can be output by a projector is used. did. Then, two images of lighting patterns having the same average brightness value (1 to 99%) are prepared, and patterns (vertical grid lines, horizontal grid lines, grid lines) for each lighting area constituting each lighting pattern are prepared. ) Matches.

評価項目としては、平均輝度値をパラメータとして「その照明領域のパターンが完全に一致するか否か」と、そのときの「評価値」を算出した。各照明領域のマッチングには、テンプレートマッチング手法として正規化差分二乗和を使用した。この正規化差分二乗和は、値が最小(0)になる場合のマッチング度合が最も高いため、1から正規化差分二乗和を引いたものを評価値とし、完全にマッチしたときの評価値が最大(1)となるようにした。すなわち、評価値は、一致しない場合は0となり、一致する場合は0より大きく、1以下の値となる。なお、一致しないということは、本来一意である照明領域のパターンが、他の照明領域のパターンと区別がつかなくなっている状態を意味する。 As the evaluation items, "whether or not the patterns of the illumination area completely match" and "evaluation value" at that time were calculated using the average luminance value as a parameter. For matching of each illumination area, the normalized difference squared sum was used as a template matching method. This normalized difference squared sum has the highest degree of matching when the value becomes the minimum (0), so the value obtained by subtracting the normalized difference squared sum from 1 is used as the evaluation value, and the evaluation value when a perfect match is made is used. The maximum is (1). That is, the evaluation values are 0 if they do not match, and are greater than 0 and 1 or less if they match. The fact that they do not match means that the originally unique pattern of the lighting area is indistinguishable from the patterns of other lighting areas.

以上の条件下において、図10に示すように、縦格子線は水平方向にスキャンし、横格子線は垂直方向にスキャンし、グリッドはラスタースキャンして、テンプレートマッチングを行い、各輝度値における評価値を算出した。また、別途、各照明パターンに上述した微分処理および正規化処理を行った場合の評価値を算出した。この結果を図11に示す。なお、図11では、位置合わせできた場合は、その評価値をプロットし、位置合わせできなかった場合は、評価値を0としてプロットした。 Under the above conditions, as shown in FIG. 10, vertical grid lines are scanned horizontally, horizontal grid lines are scanned vertically, grids are raster-scanned, template matching is performed, and evaluation at each luminance value is performed. The value was calculated. Further, separately, the evaluation value when the above-mentioned differentiation processing and normalization processing was performed on each lighting pattern was calculated. The result is shown in FIG. In FIG. 11, when the alignment was possible, the evaluation value was plotted, and when the alignment could not be achieved, the evaluation value was plotted as 0.

図11(a)に示すように、微分処理および正規化処理を実行しない場合でも、輝度値が52~53%程度になったところで評価値が上昇し、位置合わせできることが確認された。なお、照明領域別の評価値を見ると、横格子線が最も位置合わせしやすく、グリッドが最も位置合わせしにくいことがわかる。一方、図11(b)に示すように、微分処理および正規化処理を実行した場合、どの照明領域についても、3%以上の輝度値があれば、ほぼ位置合わせできることが確認された。 As shown in FIG. 11A, it was confirmed that the evaluation value increased when the luminance value reached about 52 to 53% and the alignment could be performed even when the differentiation processing and the normalization processing were not executed. Looking at the evaluation values for each illumination area, it can be seen that the horizontal grid lines are the easiest to align and the grid is the most difficult to align. On the other hand, as shown in FIG. 11B, it was confirmed that when the differentiation process and the normalization process were executed, almost the alignment could be performed in any of the illumination regions if the luminance value was 3% or more.

以上の本実施例1によれば、本発明に係る照明パターンによって、被写体が無模様であっても、複数の画像間において対応する画素を位置合わせできることが示された。また、微分処理および正規化処理を実行することによって位置合わせ性能が向上することが示された。 According to the above-mentioned first embodiment, it is shown that the illumination pattern according to the present invention can align the corresponding pixels among a plurality of images even if the subject has no pattern. It was also shown that the alignment performance is improved by performing the differential processing and the normalization processing.

なお、本発明に係る画像処理装置1および画像処理プログラム1aは、前述した実施形態に限定されるものではなく、適宜変更することができる。 The image processing device 1 and the image processing program 1a according to the present invention are not limited to the above-described embodiments, and can be appropriately modified.

例えば、上述した本実施形態では、撮像した画像が低輝度でSN比が小さい場合、微分処理および正規化処理を実行しているが、常に高輝度の画像を撮像しうる環境下等では、必ずしも実行する必要はない。また、上述した本実施形態では、位置合わせ処理に失敗した場合、補間処理やリトライ処理を実行しているが、必ずしも実行する必要はなく、失敗した被写体については目視によって検査してもよい。 For example, in the above-described embodiment, when the captured image has low brightness and the SN ratio is small, the differential processing and the normalization processing are executed, but in an environment where a high-brightness image can always be captured, it is not always necessary. You don't have to do it. Further, in the above-described embodiment, when the alignment process fails, the interpolation process and the retry process are executed, but it is not always necessary to execute the process, and the failed subject may be visually inspected.

本発明に係る画像処理装置1および画像処理プログラム1aは、分光分析分野や三次元計測分野で利用するのに好適である。例えば、分光分析分野では、マルチスペクトルデータに基づいて食品等に混入する異物を検出するための異物検出装置としての利用可能性がある。また、三次元計測分野では、ロボットハンド等によって把持しようとする対象物の三次元形状を求めるための三次元形状測定装置としての利用可能性がある。 The image processing apparatus 1 and the image processing program 1a according to the present invention are suitable for use in the fields of spectroscopic analysis and three-dimensional measurement. For example, in the field of spectroscopic analysis, it may be used as a foreign matter detecting device for detecting a foreign matter mixed in food or the like based on multispectral data. Further, in the field of three-dimensional measurement, there is a possibility of using it as a three-dimensional shape measuring device for obtaining a three-dimensional shape of an object to be grasped by a robot hand or the like.

1 画像処理装置
1a 画像処理プログラム
2 投影装置
3 撮像装置
4 記憶手段
5 演算処理手段
41 プログラム記憶部
42 照明パターン記憶部
43 画像記憶部
51 照明パターン送信部
52 画像取得部
53 微分処理部
54 正規化処理部
55 二値化処理部
56 位置合わせ処理部
57 補間処理部
58 異物検出処理部
1 Image processing device 1a Image processing program 2 Projection device 3 Image pickup device 4 Storage means 5 Arithmetic processing means 41 Program storage unit 42 Lighting pattern storage unit 43 Image storage unit 51 Lighting pattern transmission unit 52 Image acquisition unit 53 Differentiation processing unit 54 Normalization Processing unit 55 Binarization processing unit 56 Alignment processing unit 57 Interpretation processing unit 58 Foreign matter detection processing unit

Claims (8)

被写体に投影するための照明パターンを投影装置に送信するとともに、前記照明パターンが投影された被写体について同時に撮像された複数の画像を一または複数の撮像装置から取得し、前記照明パターンに基づいて各画像における各画素の位置合わせ処理を実行する画像処理装置であって、
前記照明パターンは、同一輝度値の画素群からなるブロックを複数有してなる照明領域を全面に有しているとともに、前記各ブロックの輝度値が0(黒)以外のランダムな値に設定されている、前記画像処理装置。
A lighting pattern for projecting to a subject is transmitted to a projection device, and a plurality of images simultaneously captured for the subject on which the lighting pattern is projected are acquired from one or a plurality of image pickup devices, and each of them is based on the lighting pattern. An image processing device that executes alignment processing for each pixel in an image.
The illumination pattern has an illumination region having a plurality of blocks composed of pixels having the same luminance value on the entire surface, and the luminance value of each block is set to a random value other than 0 (black). The image processing device.
前記照明パターンは、所定形状の前記照明領域を複数配置してなり、これら各照明領域を構成する各ブロックの輝度値は、同一パターンの照明領域が存在しないようにランダムな値に設定されている、請求項1に記載の画像処理装置。 The illumination pattern is formed by arranging a plurality of the illumination regions having a predetermined shape, and the brightness value of each block constituting each of these illumination regions is set to a random value so that the illumination regions of the same pattern do not exist. , The image processing apparatus according to claim 1. 前記照明パターンは、前記照明領域である、複数の縦格子線と、複数の横格子線と、前記縦格子線および前記横格子線によって囲まれた矩形状の複数のグリッドとから構成されており、
少なくとも前記縦格子線および前記横格子線を構成する各ブロックの輝度値が、同一パターンの前記縦格子線および同一パターンの前記横格子線が存在しないようにランダムな値に設定されている、請求項1または請求項2に記載の画像処理装置。
The illumination pattern is composed of a plurality of vertical grid lines, a plurality of horizontal grid lines, and a plurality of rectangular grids surrounded by the vertical grid lines and the horizontal grid lines, which are the illumination areas. ,
At least the luminance values of the vertical grid lines and the blocks constituting the horizontal grid lines are set to random values so that the vertical grid lines of the same pattern and the horizontal grid lines of the same pattern do not exist. The image processing apparatus according to claim 1 or 2.
前記縦格子線および前記横格子線を構成する各ブロックの輝度値の範囲と、前記グリッドを構成する各ブロックの輝度値の範囲は、所定の閾値より小さい範囲と大きい範囲の一方と他方に設定されており、前記撮像装置によって撮像された各画像に対して前記閾値による二値化処理を実行する、請求項3に記載の画像処理装置。 The range of the luminance value of each block constituting the vertical grid line and the horizontal grid line and the range of the luminance value of each block constituting the grid are set to one of a range smaller than a predetermined threshold value and a range larger than the predetermined threshold value, and the other. The image processing apparatus according to claim 3, wherein each image captured by the image pickup apparatus is subjected to binarization processing according to the threshold value. 前記撮像装置によって撮像された各画像に対して微分処理を実行した後、前記照明領域ごとに微分値のスケールを合わせるための正規化処理を実行する、請求項1から請求項4のいずれかに記載の画像処理装置。 One of claims 1 to 4, wherein a differential process is executed for each image captured by the image pickup device, and then a normalization process for adjusting the scale of the differential value is executed for each illumination region. The image processing device described. 前記撮像装置は、複数の分光画像を同時に撮像する多眼式分光イメージングカメラであり、前記画像処理装置は、前記分光画像における各画素を位置合わせ処理して得られるマルチスペクトルデータを解析することにより、前記被写体に混入する異物を検出する、請求項1から請求項5のいずれかに記載の画像処理装置。 The image pickup device is a multi-eye spectroscopic imaging camera that simultaneously captures a plurality of spectroscopic images, and the image processing device analyzes multispectral data obtained by aligning each pixel in the spectroscopic image. The image processing apparatus according to any one of claims 1 to 5, which detects foreign matter mixed in the subject. 前記位置合わせ処理に失敗した照明領域が存在する場合、下記(a),(b)のうち、少なくともいずれか一方の処理を実行する、請求項1から請求項6のいずれかに記載の画像処理装置;
(a)前記位置合わせ処理が成功した他の照明領域またはマッチング度合が最大の照明領域に基づいて補間して位置合わせする補間処理;
(b)前記照明パターンとは異なる照明パターンを投影装置に送信するとともに、前記異なる照明パターンが投影された被写体について同時に取得された複数の画像を一または複数の撮像装置から取得し、前記異なる照明パターンに基づいて各画像における各画素の位置合わせ処理を再び行うリトライ処理。
The image processing according to any one of claims 1 to 6, wherein at least one of the following processes (a) and (b) is executed when there is an illuminated area in which the alignment process has failed. Device;
(A) Interpolation processing for interpolating and aligning based on another lighting area where the alignment processing is successful or the lighting area having the maximum matching degree;
(B) An illumination pattern different from the illumination pattern is transmitted to the projection device, and a plurality of images simultaneously acquired for the subject on which the different illumination pattern is projected are acquired from one or a plurality of image pickup devices, and the different illuminations are obtained. Retry processing that re-aligns each pixel in each image based on the pattern.
被写体に投影するための照明パターンを投影装置に送信するステップと、
前記照明パターンが投影された被写体について同時に撮像された複数の画像を一または複数の撮像装置から取得するステップと、
前記照明パターンに基づいて各画像における各画素の位置合わせ処理を実行するステップと、
をコンピュータに実行させる画像処理プログラムであって、
前記照明パターンは、同一輝度値の画素群からなるブロックを複数有してなる照明領域を全面に有しているとともに、前記各ブロックの輝度値が0(黒)以外のランダムな値に設定されている、前記画像処理プログラム。
The step of transmitting the illumination pattern for projecting to the subject to the projection device,
A step of acquiring a plurality of images simultaneously captured for a subject on which the illumination pattern is projected from one or a plurality of imaging devices, and a step of acquiring the plurality of images.
A step of executing the alignment process of each pixel in each image based on the illumination pattern, and
Is an image processing program that causes a computer to execute
The illumination pattern has an illumination region having a plurality of blocks composed of pixels having the same luminance value on the entire surface, and the luminance value of each block is set to a random value other than 0 (black). The image processing program.
JP2018169165A 2018-09-10 2018-09-10 Image processing equipment and image processing programs that use encoded illumination patterns Active JP7090899B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018169165A JP7090899B2 (en) 2018-09-10 2018-09-10 Image processing equipment and image processing programs that use encoded illumination patterns

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018169165A JP7090899B2 (en) 2018-09-10 2018-09-10 Image processing equipment and image processing programs that use encoded illumination patterns

Publications (2)

Publication Number Publication Date
JP2020042527A JP2020042527A (en) 2020-03-19
JP7090899B2 true JP7090899B2 (en) 2022-06-27

Family

ID=69798277

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018169165A Active JP7090899B2 (en) 2018-09-10 2018-09-10 Image processing equipment and image processing programs that use encoded illumination patterns

Country Status (1)

Country Link
JP (1) JP7090899B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6229913B1 (en) 1995-06-07 2001-05-08 The Trustees Of Columbia University In The City Of New York Apparatus and methods for determining the three-dimensional shape of an object using active illumination and relative blurring in two-images due to defocus
JP2001194126A (en) 2000-01-14 2001-07-19 Sony Corp Apparatus and method for measuring three-dimensional shape and program providing medium
JP2006214914A (en) 2005-02-04 2006-08-17 Asahi Glass Co Ltd Mirror surface profile measuring method, system, inspection method, and device for measuring mirror face shape
US20140003740A1 (en) 2010-12-15 2014-01-02 Canon Kabushiki Kaisha Block patterns as two-dimensional ruler
JP2016138789A (en) 2015-01-27 2016-08-04 地方独立行政法人北海道立総合研究機構 Spectral imaging system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6229913B1 (en) 1995-06-07 2001-05-08 The Trustees Of Columbia University In The City Of New York Apparatus and methods for determining the three-dimensional shape of an object using active illumination and relative blurring in two-images due to defocus
JP2001194126A (en) 2000-01-14 2001-07-19 Sony Corp Apparatus and method for measuring three-dimensional shape and program providing medium
JP2006214914A (en) 2005-02-04 2006-08-17 Asahi Glass Co Ltd Mirror surface profile measuring method, system, inspection method, and device for measuring mirror face shape
US20140003740A1 (en) 2010-12-15 2014-01-02 Canon Kabushiki Kaisha Block patterns as two-dimensional ruler
JP2016138789A (en) 2015-01-27 2016-08-04 地方独立行政法人北海道立総合研究機構 Spectral imaging system

Also Published As

Publication number Publication date
JP2020042527A (en) 2020-03-19

Similar Documents

Publication Publication Date Title
CN107316047B (en) Image processing apparatus, image processing method, and storage medium
US9835438B2 (en) Distance measuring apparatus and method
KR20140120821A (en) Method of inspecting foreign substance on a board
CN112534474A (en) Depth acquisition device, depth acquisition method, and program
JP5342413B2 (en) Image processing method
CN112513677A (en) Depth acquisition device, depth acquisition method, and program
CN107018407B (en) Information processing device, evaluation chart, evaluation system, and performance evaluation method
CN112634173B (en) Curved screen image correction method and system
KR20180115646A (en) Bead recognition apparatus using vision camera and method thereof
TWI512284B (en) Bubble inspection system for glass
JP6812118B2 (en) Defect detector, defect detection method and program
JP2007155405A (en) Visual inspection method and visual inspection device
JP4244046B2 (en) Image processing method and image processing apparatus
KR102241989B1 (en) Semiconductor inspecting method, semiconductor inspecting apparatus and semiconductor manufacturing method
JP2005165387A (en) Method and device for detecting stripe defective of picture and display device
JP7090899B2 (en) Image processing equipment and image processing programs that use encoded illumination patterns
JP2013024653A (en) Distance measuring apparatus and program
US20140270390A1 (en) Analysis of the digital image of the internal surface of a tyre and processing of false measurement points
JP2011095131A (en) Image processing method
EP2775422A2 (en) Object detection apparatus, program, and integrated circuit
JP6811540B2 (en) Defect detector, defect detection method and program
JP2019120644A (en) Surface inspection device and surface inspection method
JP5754931B2 (en) Image analysis apparatus, image analysis method, and program
CN111536895B (en) Appearance recognition device, appearance recognition system, and appearance recognition method
JP4863050B2 (en) Color unevenness defect inspection method and apparatus

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181126

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210616

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220527

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220608

R150 Certificate of patent or registration of utility model

Ref document number: 7090899

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150