JP7396160B2 - Inspection equipment, inspection program and inspection method - Google Patents
Inspection equipment, inspection program and inspection method Download PDFInfo
- Publication number
- JP7396160B2 JP7396160B2 JP2020056586A JP2020056586A JP7396160B2 JP 7396160 B2 JP7396160 B2 JP 7396160B2 JP 2020056586 A JP2020056586 A JP 2020056586A JP 2020056586 A JP2020056586 A JP 2020056586A JP 7396160 B2 JP7396160 B2 JP 7396160B2
- Authority
- JP
- Japan
- Prior art keywords
- color
- group
- pixels
- ratio
- 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
Links
Images
Landscapes
- Image Analysis (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Description
本発明は、検査装置、検査プログラム及び検査方法に関する。 The present invention relates to an inspection device, an inspection program, and an inspection method.
従来より、特定の物品(例えば、果物、野菜、パン、花等の物品)を出荷する際の外観検査においては、当該物品の外観の色に着目して、合否の判定が行われている。このため、当該物品の外観検査を行う検査装置では、例えば、当該物品を撮影した対象画像を、所定のモデル画像(合格と判定される物品を予め撮影した画像)とマッチングさせることで、合否の判定を行っている。 BACKGROUND ART Conventionally, in appearance inspections when shipping specific products (for example, products such as fruits, vegetables, bread, flowers, etc.), pass/fail judgments have been made by focusing on the color of the product's appearance. For this reason, in an inspection device that performs a visual inspection of the item, for example, by matching a target image taken of the item with a predetermined model image (an image taken in advance of an item that is determined to be acceptable), it is possible to determine whether the item has passed or failed. Judgment is being made.
しかしながら、上記のような物品の場合、外観検査において合格と判定される物品であっても、外観の色は均一ではない。例えば、パンの焼きムラや、花の模様などのように外観の色には一定程度の個体差があり、完全に同じ色が再現されることがないからである。このため、所定のモデル画像とマッチングさせる検査方法では、検査精度に限界がある。加えて、上記のような物品の場合、物品全体の外観を比較しても、局所的な異常が物品の個体差に埋もれ、検出されにくいといった問題もある。 However, in the case of the above-mentioned articles, even if the article is determined to pass the visual inspection, the color of the exterior is not uniform. This is because, for example, there is a certain degree of individual difference in the external color, such as uneven baking of bread or the pattern of a flower, and completely the same color cannot be reproduced. For this reason, there is a limit to the inspection accuracy in the inspection method of matching with a predetermined model image. In addition, in the case of the above-mentioned articles, there is a problem in that even if the appearance of the entire article is compared, local abnormalities are buried in individual differences among the articles and are difficult to detect.
一つの側面では、物品の外観検査において、検査精度の向上を図ることを目的としている。 One aspect of the present invention is to improve inspection accuracy in appearance inspection of articles.
一態様によれば、検査装置は、
検査対象の物品を撮影した対象画像より抽出された、該物品の外接矩形領域を、複数の領域画像に分割する分割部と、
前記複数の領域画像を、前記外接矩形領域の基準位置からの距離に応じて、複数のグループに分類する分類部と、
各グループに分類された領域画像に含まれる画素を、色ごとに集計することで、グループごとに各色の画素数の割合を算出する算出部と、
合格と判定される物品を撮影したモデル画像について予め算出された、各グループの各色の画素数の割合と、前記算出部により算出された各グループの各色の画素数の割合と比較し、前記検査対象の物品の合否を判定する比較部とを有する。
According to one aspect, the inspection device includes:
a dividing unit that divides a circumscribed rectangular area of the item, extracted from a target image obtained by photographing the item to be inspected, into a plurality of area images;
a classification unit that classifies the plurality of area images into a plurality of groups according to a distance from a reference position of the circumscribed rectangular area;
a calculation unit that calculates the ratio of the number of pixels of each color for each group by totaling the pixels included in the area image classified into each group for each color;
The ratio of the number of pixels of each color in each group calculated in advance for a model image taken of an article that is determined to be acceptable is compared with the ratio of the number of pixels of each color in each group calculated by the calculation unit, and the ratio of the number of pixels of each color in each group calculated by the calculation unit is compared. and a comparison section that determines whether the target article passes or fails.
物品の外観検査において、検査精度の向上を図ることができる。 Inspection accuracy can be improved in appearance inspection of articles.
以下、各実施形態について添付の図面を参照しながら説明する。なお、本明細書及び図面において、実質的に同一の機能構成を有する構成要素については、同一の符号を付することにより重複した説明を省略する。 Each embodiment will be described below with reference to the accompanying drawings. Note that, in this specification and the drawings, components having substantially the same functional configuration are designated by the same reference numerals, thereby omitting redundant explanation.
[第1の実施形態]
<検査システムのシステム構成>
はじめに、第1の実施形態に係る検査装置を含む検査システムのシステム構成について説明する。図1は、検査システムのシステム構成の一例を示す図である。
[First embodiment]
<System configuration of inspection system>
First, the system configuration of an inspection system including the inspection apparatus according to the first embodiment will be described. FIG. 1 is a diagram showing an example of the system configuration of an inspection system.
図1に示すように、検査システム100は、撮像装置110と、検査装置120とを有する。撮像装置110と検査装置120とは、有線または無線を介して接続される。
As shown in FIG. 1, the
撮像装置110は、合格と判定される物品を予め撮影したモデル画像を含む画像データを、検査装置120に送信する。また、撮像装置110は、検査対象の物品141、142、143、・・・等を撮影した対象画像を含む画像データを、検査装置120に送信する。なお、第1の実施形態において、検査対象の物品141、142、143、・・・等は、"果物"であり、搬送装置130により、撮像装置110の撮影範囲まで搬送されるものとする。
The
検査装置120は、撮像装置110より送信される画像データを処理する。検査装置120には、生成プログラムと判定プログラムとを含む検査プログラムがインストールされており、当該プログラムが実行されることで、検査装置120は、生成部121、判定部122として機能する。
The
生成部121は、画像データに含まれるモデル画像に基づいて、基準データを生成する。また、生成部121は、生成した基準データを、基準データ格納部123に格納する。
The
判定部122は、画像データに含まれる対象画像に基づいて、検査対象の物品の合否を判定する。なお、判定部122は、検査対象の物品の合否を判定する際、基準データ格納部123に格納された基準データを参照する。
The
<検査装置のハードウェア構成>
次に、検査装置120のハードウェア構成について説明する。図2は、検査装置のハードウェア構成の一例を示す図である。図2に示すように、検査装置120は、CPU(Central Processing Unit)201、ROM(Read Only Memory)202、RAM(Random Access Memory)203を有する。CPU201、ROM202、RAM203は、いわゆるコンピュータを形成する。
<Hardware configuration of inspection device>
Next, the hardware configuration of the
また、検査装置120は、補助記憶装置204、操作装置205、表示装置206、I/F(Interface)装置207、ドライブ装置208を有する。なお、検査装置120の各ハードウェアは、バス209を介して相互に接続されている。
The
CPU201は、補助記憶装置204にインストールされている各種プログラム(例えば、生成プログラムと判定プログラムとを含む検査プログラム等)を実行する演算デバイスである。
The
ROM202は、不揮発性メモリである。ROM202は、補助記憶装置204にインストールされている各種プログラムをCPU201が実行するために必要な各種プログラム、データ等を格納する、主記憶デバイスとして機能する。具体的には、ROM202はBIOS(Basic Input/Output System)やEFI(Extensible Firmware Interface)等のブートプログラム等を格納する。
ROM202 is a nonvolatile memory. The
RAM203は、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)等の揮発性メモリである。RAM203は、補助記憶装置204にインストールされている各種プログラムがCPU201によって実行される際に展開される作業領域を提供する、主記憶デバイスとして機能する。
The
補助記憶装置204は、各種プログラムや、各種プログラムが実行されることで生成されるデータ等を格納する補助記憶デバイスである。例えば、基準データ格納部123は、補助記憶装置204において実現される。
The
操作装置205は、検査装置120の管理者が検査装置120に対して各種指示を入力するための入力デバイスである。表示装置206は、検査装置120の内部状態等を表示する表示デバイスである。I/F装置207は、撮像装置110と接続するための接続デバイスである。
The
ドライブ装置208は、記録媒体210をセットするためのデバイスである。ここでいう記録媒体210には、CD-ROM、フレキシブルディスク、光磁気ディスク等のように情報を光学的、電気的あるいは磁気的に記録する媒体が含まれる。また、記録媒体210には、ROM、フラッシュメモリ等のように情報を電気的に記録する半導体メモリ等が含まれていてもよい。
The
なお、ドライブ装置208は、補助記憶装置204に各種プログラムをインストールする際に用いられてもよい。具体的には、検査装置120の管理者が、配布された記録媒体210をドライブ装置208にセットし、該記録媒体210に記録された各種プログラムをドライブ装置208が読み出すことで、補助記憶装置204に各種プログラムがインストールされてもよい。
Note that the
<検査装置の生成部の機能構成>
次に、検査装置120の生成部121の機能構成について説明する。図3は、検査装置の生成部の機能構成の一例を示す図である。図3に示すように、生成部121は、画像データ取得部301、圧縮部302、RGB値変換部303、領域分割部304、グループ生成部305、色彩割合算出部306、登録部307を有する。
<Functional configuration of the generation section of the inspection device>
Next, the functional configuration of the
画像データ取得部301は、撮像装置110より送信された画像データのうち、モデル画像を取得し、取得したモデル画像より、合格と判定される物品の外接矩形領域を抽出することで、矩形画像を出力する。
The image data acquisition unit 301 acquires a model image from among the image data transmitted from the
圧縮部302は、矩形画像を所定の画素数の部分画像に分割し、各部分画像に含まれる所定数の画素をまとめて1画素とする。このとき、圧縮部302は、各部分画像について、各部分画像に含まれる所定数の画素の画素値を用いて1の画素値(RGB値)を算出する。これにより、圧縮部302は、矩形画像を、各部分画像を1画素とする画像に圧縮し、圧縮済みの矩形画像を生成する。 The compression unit 302 divides the rectangular image into partial images having a predetermined number of pixels, and combines the predetermined number of pixels included in each partial image into one pixel. At this time, the compression unit 302 calculates a pixel value (RGB value) of 1 for each partial image using the pixel values of a predetermined number of pixels included in each partial image. Thereby, the compression unit 302 compresses the rectangular image into an image in which each partial image has one pixel, and generates a compressed rectangular image.
RGB値変換部303は、圧縮済みの矩形画像について、各部分画像の画素値(RGB値)を変換し、色変換済みの矩形画像を生成する。また、RGB値変換部303は、色変換済みの矩形画像を、領域分割部304に通知する。 The RGB value conversion unit 303 converts the pixel values (RGB values) of each partial image of the compressed rectangular image to generate a color-converted rectangular image. Furthermore, the RGB value conversion unit 303 notifies the area division unit 304 of the color-converted rectangular image.
領域分割部304は、色変換済みの矩形画像を複数の領域画像(所定数の部分画像を含む)に領域分割する。また、領域分割部304は、矩形画像を領域分割することで得た複数の領域画像を、グループ生成部305に通知する。
The area dividing unit 304 divides the color-converted rectangular image into a plurality of area images (including a predetermined number of partial images). Further, the area dividing unit 304 notifies the
グループ生成部305は、領域分割部304より通知された複数の領域画像を、矩形画像の基準位置からの距離に応じて、複数のグループに分類する。また、グループ生成部305は、各グループに分類した各領域画像を、色彩割合算出部306に通知する。
The
色彩割合算出部306は、各グループに分類された領域画像に含まれる複数の画素(部分画像)を、色ごとに集計する(グループごとに各色の画素数(部分画像数)を算出する)。これにより、色彩割合算出部306では、各グループの各色の画素数(部分画像数)の割合(色彩割合)を算出する。 The color ratio calculation unit 306 totalizes a plurality of pixels (partial images) included in the area images classified into each group for each color (calculates the number of pixels (number of partial images) of each color for each group). Thereby, the color ratio calculation unit 306 calculates the ratio (color ratio) of the number of pixels (number of partial images) of each color in each group.
登録部307は、各グループの色彩割合を、基準データとして、基準データ格納部123に格納する。
The
<検査装置の生成部の各部の処理の具体例>
次に、検査装置120の生成部121の各部(画像データ取得部301~登録部307の各部)の処理の具体例について説明する。
<Specific example of processing of each part of the generation unit of the inspection device>
Next, a specific example of the processing of each section of the generation section 121 (the image data acquisition section 301 to the registration section 307) of the
(1)画像データ取得部、圧縮部、RGB値変換部の処理の具体例
はじめに、生成部121の画像データ取得部301、圧縮部302、RGB値変換部303の処理の具体例について説明する。図4は、画像データ取得部、圧縮部、RGB値変換部の処理の具体例を示す図である。
(1) Specific example of processing by image data acquisition unit, compression unit, and RGB value conversion unit First, a specific example of processing by the image data acquisition unit 301, compression unit 302, and RGB value conversion unit 303 of the
図4に示すように、画像データ取得部301では、撮像装置110より送信されたモデル画像410を取得し、取得したモデル画像410から、合格と判定される物品411の外接矩形領域を抽出することで、矩形画像420を出力する。
As shown in FIG. 4, the image data acquisition unit 301 acquires a model image 410 transmitted from the
また、図4に示すように、圧縮部302では、矩形画像420を所定数の画素(図4の例は9画素)の部分画像(例えば、部分画像421)に分割し、部分画像に含まれる所定数の画素(図4の例では9画素)をまとめて1画素とする。 Further, as shown in FIG. 4, the compression unit 302 divides the rectangular image 420 into partial images (for example, partial image 421) of a predetermined number of pixels (9 pixels in the example of FIG. 4), and A predetermined number of pixels (nine pixels in the example of FIG. 4) are collectively defined as one pixel.
なお、圧縮部302では、部分画像(例えば、部分画像421)に含まれる所定数の画素(図4の例では9画素)をまとめて1画素とする際、所定数の画素の画素値の平均値を算出する。これにより、圧縮部302では、1つの画素値(図4の例では、R値="210")を有する部分画像422を生成する(以降は、部分画像422が1画素となる)。 Note that when compressing a predetermined number of pixels (9 pixels in the example of FIG. 4) included in a partial image (for example, partial image 421) into one pixel, the compression unit 302 calculates the average pixel value of the predetermined number of pixels. Calculate the value. As a result, the compression unit 302 generates a partial image 422 having one pixel value (in the example of FIG. 4, R value="210") (hereinafter, the partial image 422 will be one pixel).
なお、圧縮部302では、G値、B値についても同様に所定数の画素の画素値の平均値を算出するとともに、矩形画像420に含まれる全ての部分画像について同様の処理を行う。これにより、圧縮部302では、矩形画像420を、各部分画像を1画素とする画像に圧縮し、圧縮済みの矩形画像を生成する。 Note that the compression unit 302 similarly calculates the average value of the pixel values of a predetermined number of pixels for the G value and the B value, and performs similar processing on all partial images included in the rectangular image 420. Thereby, the compression unit 302 compresses the rectangular image 420 into an image in which each partial image has one pixel, and generates a compressed rectangular image.
また、図4に示すように、RGB値変換部303では、圧縮済みの矩形画像について、各部分画像の画素値(RGB値)を変換する。本実施形態では、例えば、0~255の256階調のR値を、11の階調範囲に分け、それぞれの階調範囲に属するR値を、それぞれの階調範囲の代表値に色変換する。図4の例は、
・階調範囲=0~24に属するR値を、代表値=0に色変換すること、
・階調範囲=25~49に属するR値を、代表値=25に色変換すること、
・階調範囲=50~74に属するR値を、代表値=50に色変換すること、
・階調範囲=75~99に属するR値を、代表値=75に色変換すること、
・階調範囲=100~124に属するR値を、代表値=100に色変換すること、
・階調範囲=125~149に属するR値を、代表値=125に色変換すること、
等を示している。これにより、256階調のR値は、11の代表値に色変換されることになる。
Further, as shown in FIG. 4, the RGB value conversion unit 303 converts the pixel values (RGB values) of each partial image for the compressed rectangular image. In this embodiment, for example, the R values of 256 gradations from 0 to 255 are divided into 11 gradation ranges, and the R values belonging to each gradation range are color-converted to the representative value of each gradation range. . The example in Figure 4 is
・Color conversion of R values belonging to the gradation range = 0 to 24 to representative value = 0,
・Color conversion of the R value belonging to the gradation range = 25 to 49 to the representative value = 25,
・Color conversion of the R value belonging to the gradation range = 50 to 74 to a representative value = 50,
・Color conversion of the R value belonging to the gradation range = 75 to 99 to the representative value = 75,
・Color conversion of R values belonging to the gradation range = 100 to 124 to a representative value = 100,
・Color conversion of the R value belonging to the gradation range = 125 to 149 to the representative value = 125,
etc. As a result, the R value of 256 gradations is color-converted into 11 representative values.
同様に、RGB値変換部303は、例えば、0~255の256階調のG値を、11の階調範囲に分け、それぞれの階調範囲に属するG値を、それぞれの階調範囲の代表値に色変換する。これにより、256階調のG値は、11の代表値に色変換されることになる。 Similarly, the RGB value conversion unit 303 divides the G values of 256 gradations from 0 to 255 into 11 gradation ranges, and converts the G values belonging to each gradation range into representative values of each gradation range. Convert color to value. As a result, the 256 gradations of G values are color-converted into 11 representative values.
同様に、RGB値変換部303は、例えば、0~255の256階調のB値を、11の階調範囲に分け、それぞれの階調範囲に属するB値を、それぞれの階調範囲の代表値に色変換する。これにより、256階調のB値は、11の代表値に色変換されることになる。 Similarly, the RGB value conversion unit 303 divides the B values of 256 gradations from 0 to 255 into 11 gradation ranges, and converts the B values belonging to each gradation range into representative values of each gradation range. Convert color to value. As a result, the 256 gradation B values are color-converted into 11 representative values.
なお、RGB値変換部303によれば、256×256×256=16,777,216パターンの色情報が、11×11×11=1,331パターンの色情報に変換されることになる。 Note that, according to the RGB value conversion unit 303, color information of 256×256×256=16,777,216 patterns is converted to color information of 11×11×11=1,331 patterns.
図4において、色変換済みの矩形画像430に含まれる、合格と判定される物品412は、RGB値変換部303により色変換が行われた後の画像を示している。 In FIG. 4, an article 412 that is determined to be acceptable and is included in a color-converted rectangular image 430 shows an image after color conversion has been performed by the RGB value conversion unit 303.
(2)領域分割部の処理の具体例
次に、生成部121の領域分割部304の処理の具体例について説明する。図5は、領域分割部の処理の具体例を示す図である。図5に示すように、領域分割部304では、色変換済みの矩形画像430を取得すると、複数の領域画像に領域分割する。図5の例は、色変換済みの矩形画像430を、縦方向に6分割、横方向に6分割することで、36個の領域画像に領域分割した様子を示している。
(2) Specific example of processing by area dividing unit Next, a specific example of processing by area dividing unit 304 of
また、領域分割部304では、色変換済みの矩形画像430を領域分割することで得られる複数の領域画像(図5の例では、36個の領域画像)を、グループ生成部305に通知する。
Furthermore, the region dividing unit 304 notifies the
(3)グループ生成部の処理の具体例
次に、生成部121のグループ生成部305の処理の具体例について説明する。図6は、グループ生成部の処理の具体例を示す第1の図である。図6に示すように、グループ生成部305では、色変換済みの矩形画像430を領域分割することで得られる複数の領域画像を、複数のグループ(図6の例では、3個のグループ)に分類する。
(3) Specific example of processing by group generation unit Next, a specific example of processing by
図6の例は、グループ生成部305が、色変換済みの矩形画像430の中心位置を基準位置として、基準位置からの距離に応じて、複数の領域画像を3個のグループに分類した様子を示している。
The example in FIG. 6 shows how the
具体的には、グループ生成部305では、色変換済みの矩形画像430の中心位置を囲む領域画像群をグループ1に分類する。図6の例は、矢印601に沿って位置する4個の領域画像群がグループ1に分類された様子を示している。
Specifically, the
続いて、グループ生成部305では、色変換済みの矩形画像430の中心位置を囲む領域画像群であって、グループ1に分類された領域画像群よりも1列外側に位置する領域画像群をグループ2に分類する。図6の例は、矢印602に沿って位置する12個の領域画像群がグループ2に分類された様子を示している。
Next, the
続いて、グループ生成部305では、色変換済みの矩形画像430の中心位置を囲む領域画像群であって、グループ2に分類された領域画像群よりも1列外側に位置する領域画像群をグループ3に分類する。図6の例は、矢印603に沿って位置する20個の領域画像群がグループ3に分類された様子を示している。
Next, the
(4)色彩割合算出部の処理の具体例
次に、生成部121の色彩割合算出部306の処理の具体例について説明する。図7は、色彩割合算出部の処理の具体例を示す図である。
(4) Specific example of processing by color ratio calculation unit Next, a specific example of processing by color ratio calculation unit 306 of
図7に示すように、色彩割合算出部306では、各グループに分類された領域画像(グループ1に分類された4個の領域画像、グループ2に分類された12個の領域画像、グループ3に分類された20個の領域画像)を取得する。
As shown in FIG. 7, the color ratio calculation unit 306 calculates the area images classified into each group (4 area images classified into
続いて、色彩割合算出部306では、各グループに分類された領域画像に含まれる複数の画素(部分画像)を、色ごとに集計することで、グループごとに各色の画素数(部分画像数)の割合(色彩割合)を算出する。 Next, the color ratio calculation unit 306 aggregates the plurality of pixels (partial images) included in the area images classified into each group for each color, thereby calculating the number of pixels of each color (number of partial images) for each group. Calculate the ratio (color ratio).
図7において、円グラフ701は、グループ1に分類された4個の領域画像に含まれる複数の部分画像を色ごとに集計し、各色の画素数(部分画像数)の割合(色彩割合)を示したグラフである。
In FIG. 7, a pie chart 701 aggregates multiple partial images included in the four area images classified into
同様に、円グラフ702は、グループ2に分類された12個の領域画像に含まれる複数の部分画像を色ごとに集計し、各色の画素数(部分画像数)の割合(色彩割合)を示したグラフである。
Similarly, a pie chart 702 aggregates a plurality of partial images included in the 12 area images classified into
同様に、円グラフ703は、グループ3に分類された20個の領域画像に含まれる複数の部分画像を色ごとに集計し、各色の画素数(部分画像数)の割合(色彩割合)を示したグラフである。
Similarly, a pie chart 703 aggregates multiple partial images included in the 20 area images classified into
(5)登録部の処理の具体例
次に、生成部121の登録部307の処理の具体例について説明する。図8は、登録部の処理の具体例を示す図である。
(5) Specific example of processing by registration unit Next, a specific example of processing by the
図8に示すように、登録部307では、合格と判定される複数の物品(合格物品)について、各グループの色彩割合を取得する。図8の例は、合格物品1、2、3、・・・等について、各グループの色彩割合を取得した様子を示したものである。
As shown in FIG. 8, the
図8の例によれば、合格物品1について取得した、各グループの色彩割合は、基準データとして、テーブル801に登録され、基準データ格納部123に格納される。図8に示すように、テーブル801は、情報の項目として、横方向に"色情報1"~"色情報N"が配列され、縦方向に、"グループ1"~"グループ3"が配列される。なお、上述した図4の例によれば、色変換済みの矩形画像に含まれる色情報は、1,331パターンであることから、N=1331となる。
According to the example of FIG. 8, the color ratio of each group obtained for the accepted
また、図8の例によれば、合格物品1のグレード("グレード1")もあわせてテーブル801に登録される。
Further, according to the example of FIG. 8, the grade of the accepted article 1 ("
同様に、図8の例によれば、合格物品2について取得した、各グループの色彩割合は、基準データとして、テーブル802に登録され、基準データ格納部123に格納される。また、図8の例によれば、合格物品2のグレード("グレード2")もあわせてテーブル802に登録される。
Similarly, according to the example of FIG. 8, the color ratio of each group acquired for the accepted
同様に、図8の例によれば、合格物品3について取得した、各グループの色彩割合は、基準データとして、テーブル803に登録され、基準データ格納部123に格納される。また、図8の例によれば、合格物品3のグレード("グレード3")もあわせてテーブル803に登録される。
Similarly, according to the example of FIG. 8, the color ratios of each group acquired for the accepted
<検査装置の判定部の機能構成>
次に、検査装置120の判定部122の機能構成について説明する。図9は、検査装置の判定部の機能構成の一例を示す図である。図9に示すように、判定部122は、画像データ取得部901、圧縮部902、RGB値変換部903(変換部の一例)を有する。また、判定部122は、領域分割部904(分割部の一例)、グループ生成部905(分類部の一例)、色彩割合算出部906(算出部の一例)、比較部907を有する。
<Functional configuration of the determination section of the inspection device>
Next, the functional configuration of the
なお、画像データ取得部901から色彩割合算出部906までの各部の機能は、図3を用いて説明した画像データ取得部301から色彩割合算出部306までの各部の機能と同様であるため、ここでは説明を省略し、比較部907についてのみ説明する。
Note that the functions of each unit from the image data acquisition unit 901 to the color ratio calculation unit 906 are the same as the functions of each unit from the image data acquisition unit 301 to the color ratio calculation unit 306 described using FIG. The explanation will be omitted and only the
比較部907は、色彩割合算出部906より、検査対象の物品について、各グループの色彩割合を取得すると、基準データ格納部123より、基準データ(テーブル801、802、803、・・・等)を読み出す。また、比較部907は、検査対象の物品について取得した各グループの色彩割合と、テーブル801、802、803、・・・等に登録された、各合格物品についての各グループの色彩割合とを比較する。更に、比較部907は、比較結果に基づいて、検査対象の物品の合否を判定するとともに、合格と判定した場合にあっては、検査対象の物品のグレードを判定する。
When the
<検査装置の判定部の各部の処理の具体例>
次に、検査装置120の判定部122の各部(ここでは、比較部907)の処理の具体例について説明する。
<Specific example of processing of each part of the determination unit of the inspection device>
Next, a specific example of the processing of each section (here, the comparison section 907) of the
図10は、比較部の処理の具体例を示す図である。図10に示すように、比較部907は、検査対象の物品について取得した、各グループの色彩割合と、テーブル801に登録された各グループの色彩割合とを比較する。同様に、比較部907は、検査対象の物品について取得した、各グループの色彩割合と、テーブル802に登録された各グループの色彩割合とを比較する。同様に、比較部907は、検査対象の物品について取得した、各グループの色彩割合と、テーブル803に登録された各グループの色彩割合とを比較する。
FIG. 10 is a diagram illustrating a specific example of processing by the comparison unit. As shown in FIG. 10, the
このように、比較部907では、基準データ格納部123に基準データとして格納されたすべてのテーブルとの間で、テーブル単位で比較を行う。また、比較部907では、テーブル単位での比較結果に基づいて、検査対象の物品の合否を判定するとともに、合格と判定した場合にあっては、検査対象の物品のグレードを判定する。
In this manner, the
図11は、比較結果の一例を示す図であり、合格物品1(符号1100)についての各グループの色彩割合と、検査対象の物品(符号1110)についての各グループの色彩割合とを比較した様子を示している。 FIG. 11 is a diagram showing an example of the comparison results, and shows a comparison between the color ratio of each group for passing article 1 (numeral 1100) and the color ratio of each group for the article to be inspected (numeral 1110). It shows.
図11において、円グラフ1101~1103は、合格物品1についての各グループの色彩割合を示している。また、円グラフ1111~1113は、検査対象の物品についての各グループの色彩割合を示している。
In FIG. 11, pie charts 1101 to 1103 indicate the color ratio of each group for the accepted
また、図11において、比較結果1121は、グループ1の色彩割合の比較結果を、比較結果1122は、グループ2の色彩割合の比較結果を、比較結果1123は、グループ3の色彩割合の比較結果を、それぞれ表している。
In addition, in FIG. 11, a comparison result 1121 shows the comparison result of the color ratio of
比較結果1121~1123に示すように、比較部907は、テーブルごとに色彩割合を比較する際、グループごとにわけて色彩割合を比較する。また、比較結果1121~1123に示すように、比較部907は、各グループにおいて色彩割合を比較する際、色ごとにわけて比較を行い、差の絶対値を算出する。更に、比較結果1121~1123に示すように、比較部907は、色ごとに算出した差の絶対値を加算し、グループごとに、差の絶対値の合計を算出する。
As shown in comparison results 1121 to 1123, when comparing the color ratios for each table, the
このように、グループごとにわけたうえで、各色の色彩割合を比較することで、検査対象の物品における局所的な異常が物品の個体差に埋もれるといった事態を回避することができる。この結果、物品全体の外観を色ごとにわけて比較を行う場合よりも、局所的な異常を含む物品と合格物品との差異をより明確にすることができる。 In this way, by dividing the objects into groups and comparing the color ratios of each color, it is possible to avoid a situation where local abnormalities in the object to be inspected are buried in individual differences among the objects. As a result, the difference between an article containing a local abnormality and an acceptable article can be made clearer than when comparing the overall appearance of the article by color.
なお、比較部907では、いずれかのグループにおいて、差の絶対値の合計が大きい場合には(例えば、差の絶対値の合計が所定の閾値以上の場合には)、検査対象の物品が不合格の候補であると判定する。また、比較部907では、いずれのグループについても差の絶対値の合計が小さい場合には(例えば、差の絶対値の合計が所定の閾値未満の場合には)、検査対象の物品が合格であると判定する。
Note that in the
なお、基準データ格納部123に基準データとして格納されたすべてのテーブルとの比較において、検査対象の物品が不合格の候補であると判定した場合、比較部907は、当該検査対象の物品が不合格であると判定する。
Note that when it is determined that the item to be inspected is a candidate for failure in comparison with all the tables stored as standard data in the standard
一方、基準データ格納部123に基準データとして格納されたテーブルのうち、いずれか1つ以上のテーブルとの比較において、検査対象の物品が合格であると判定した場合、比較部907は、検査対象の物品が合格であると判定する。
On the other hand, if it is determined that the item to be inspected is acceptable in comparison with any one or more tables among the tables stored as standard data in the standard
また、検査対象の物品が合格である判定したテーブルが複数ある場合、比較部907では、差の絶対値の合計が最小となるテーブルを特定し(つまり、最も類似するテーブルを特定し)、特定したテーブルに対応付けられたグレードを判定する。これにより、比較部907では、検査対象の物品のグレードを判定する。
In addition, if there are multiple tables that have been determined to pass the inspection target article, the
<基準データ生成処理の流れ>
次に、検査装置120の生成部121による基準データ生成処理の流れについて説明する。図12は、基準データ生成処理の流れを示すフローチャートである。
<Flow of standard data generation process>
Next, the flow of reference data generation processing by the
ステップS1201において、生成部121の画像データ取得部301は、合格と判定される物品をカウントするカウンタnに、"1"を入力する。
In step S1201, the image data acquisition unit 301 of the
ステップS1202において、生成部121の画像データ取得部301は、合格物品nの画像データをモデル画像として取得し、取得したモデル画像より、合格物品nの外接矩形領域を抽出し、矩形画像を出力する。
In step S1202, the image data acquisition unit 301 of the
ステップS1203において、生成部121の圧縮部302は、矩形画像を所定の画素数の部分画像に分割し、各部分画像に含まれる所定数の画素を1画素にまとめることで、矩形画像を、各部分画像を1画素とする画像に圧縮する。
In step S1203, the compression unit 302 of the
ステップS1204において、生成部121のRGB値変換部303は、圧縮済みの矩形画像について、各部分画像の画素値(RGB値)を変換することで、圧縮済みの矩形画像を色変換する。
In step S1204, the RGB value conversion unit 303 of the
ステップS1205において、生成部121の領域分割部304は、色変換済みの矩形画像を複数の領域画像に領域分割する。
In step S1205, the area division unit 304 of the
ステップS1206において、生成部121のグループ生成部305は、領域分割することで得られる各領域画像を、矩形画像の基準位置からの距離に応じて、複数のグループに分類する。
In step S1206, the
ステップS1207において、生成部121の色彩割合算出部306は、複数のグループに分類された各領域画像に含まれる複数の部分画像を、色ごとに集計し、各グループの色彩割合を算出する。
In step S1207, the color ratio calculation unit 306 of the
ステップS1208において、生成部121の登録部307は、各グループの色彩割合をテーブルに登録し、基準データとして、基準データ格納部123に格納する。
In step S1208, the
ステップS1209において、生成部121の画像データ取得部301は、合格と判定されるすべての物品(全ての合格物品)について、各グループの色彩割合をテーブルに登録したか否かを判定する。ステップS1209において、各グループの色彩割合をテーブルに登録していない合格物品があると判定した場合には(ステップS1209においてNoの場合には)、ステップS1210に進む。
In step S1209, the image data acquisition unit 301 of the
ステップS1210において、生成部121の画像データ取得部301は、カウンタnをインクリメントした後、ステップS1202に戻る。
In step S1210, the image data acquisition unit 301 of the
一方、ステップS1209において、全ての合格物品について、各グループの色彩割合をテーブルに登録したと判定した場合には(ステップS1209においてYesの場合には)、基準データ生成処理を終了する。 On the other hand, if it is determined in step S1209 that the color ratios of each group have been registered in the table for all acceptable articles (in the case of YES in step S1209), the reference data generation process is ended.
<判定処理の流れ>
次に、検査装置120の判定部122による判定処理の流れについて説明する。図13は、判定処理の流れを示すフローチャートである。
<Flow of judgment process>
Next, the flow of the determination process by the
ステップS1301において、判定部122の比較部907は、基準データ格納部123より基準データを読み出す。
In step S1301, the
ステップS1302において、判定部122の画像データ取得部901は、検査対象の物品を撮影した対象画像を取得し、取得した対象画像より、検査対象の物品の外接矩形領域を抽出することで、矩形画像を出力する。
In step S1302, the image data acquisition unit 901 of the
ステップS1303において、判定部122の圧縮部902は、矩形画像を所定の画素数の部分画像に分割し、各部分画像に含まれる所定数の画素を1画素にまとめることで、矩形画像を、各部分画像を1画素とする画像に圧縮する。
In step S1303, the compression unit 902 of the
ステップS1304において、判定部122のRGB値変換部903は、圧縮済みの矩形画像について、各部分画像の画素値(RGB値)を変換することで、圧縮済みの矩形画像を色変換する。
In step S1304, the RGB value conversion unit 903 of the
ステップS1305において、判定部122の領域分割部904は、色変換済みの矩形画像を複数の領域画像に領域分割する。
In step S1305, the area division unit 904 of the
ステップS1306において、判定部122のグループ生成部905は、領域分割することで得られる各領域画像を、矩形画像の基準位置からの距離に応じて、複数のグループに分類する。
In step S1306, the group generation unit 905 of the
ステップS1307において、判定部122の色彩割合算出部906は、複数のグループに分類された各領域画像に含まれる複数の部分画像を、色ごとに集計し、各グループの色彩割合を算出する。
In step S1307, the color ratio calculation unit 906 of the
ステップS1308において、判定部122の比較部907は、検査対象の物品についての色彩割合と、基準データに含まれる各テーブルの色彩割合とをグループごと、色ごとに比較し、グループごとに差の絶対値の合計を算出する。
In step S1308, the
ステップS1309において、判定部122の比較部907は、基準データに含まれる各テーブルについて、色彩割合の差の絶対値の合計が大きいグループが含まれているか否かを判定する。ステップS1309において、基準データに含まれるいずれのテーブルについても、色彩割合の差の絶対値の合計が大きいグループが含まれていると判定した場合には(ステップS1309においてYesの場合には)、ステップS1310に進む。
In step S1309, the
ステップS1310において、判定部122の比較部907は、検査対象の物品が不合格であると判定する。
In step S1310, the
一方、ステップS1309において、基準データに含まれるテーブルの中に、色彩割合の差の絶対値の合計が大きいグループが含まれていないテーブルがあると判定した場合には(ステップS1309においてNoの場合には)、ステップS1311に進む。 On the other hand, if it is determined in step S1309 that there is a table that does not include a group with a large sum of the absolute values of differences in color ratios among the tables included in the reference data (in the case of No in step S1309), ), the process advances to step S1311.
ステップS1311において、判定部122の比較部907は、検査対象の物品が合格であると判定する。
In step S1311, the
ステップS1312において、判定部122の比較部907は、色彩割合の差の絶対値の合計が大きいグループが含まれていないテーブルを特定する。また、判定部122の比較部907は、特定したテーブルに対応付けられたグレードを識別することで、検査対象の物品のグレードを判定する。
In step S1312, the
なお、色彩割合の差の絶対値の合計が大きいグループが含まれていないテーブルが複数ある場合、判定部122の比較部907は、各グループの色彩割合の差の絶対値の合計が最も小さいテーブルを特定する。そして、判定部122の比較部907は、特定したテーブルに対応付けられたグレードを識別することで、検査対象の物品のグレードを判定する。
Note that if there are multiple tables that do not include a group in which the sum of the absolute values of the differences in color proportions is large, the
ステップS1313において、判定部122の画像データ取得部901は、判定処理を終了するか否かを判定する。ステップS1313において、判定処理を継続すると判定した場合には(ステップS1313においてNoの場合には)、ステップS1302に戻る。一方、ステップS1313において、判定処理を終了すると判定した場合には(ステップS1313においてYesの場合には)、判定処理を終了する。
In step S1313, the image data acquisition unit 901 of the
以上の説明から明らかなように、第1の実施形態に係る検査装置120は、検査対象の物品を撮影した対象画像より抽出された、該物品の外接矩形領域を、複数の領域画像に領域分割する。また、第1の実施形態に係る検査装置120は、複数の領域画像を、外接矩形領域の基準位置からの距離に応じて、複数のグループに分類する。また、第1の実施形態に係る検査装置120は、各グループに分類された領域画像に含まれる各部分画像を、色ごとに集計することで、グループごとに色彩割合を算出する。更に、第1の実施形態に係る検査装置120は、合格と判定される物品を撮影したモデル画像について予め算出された、各グループの色彩割合と、検査対象の物品について算出された各グループの色彩割合とを比較し、検査対象の物品の合否を判定する。
As is clear from the above description, the
このように、第1の実施形態に係る検査装置120では、検査対象の物品についての色彩割合と、合格物品についての色彩割合とを、グループごとにわけて比較する。これにより、第1の実施形態に係る検査装置120によれば、検査対象の物品における局所的な異常が物品の個体差に埋もれるといった事態を回避することができる。
In this manner, the
この結果、第1の実施形態によれば、物品全体の外観を色ごとにわけて比較を行う場合よりも、局所的な異常を含む物品と合格物品との差異をより明確にすることができる。つまり、第1の実施形態によれば、物品の外観検査において、検査精度の向上を図ることができる。 As a result, according to the first embodiment, the difference between an article containing a local abnormality and an acceptable article can be made clearer than when comparing the appearance of the entire article by color. . That is, according to the first embodiment, it is possible to improve the inspection accuracy in the appearance inspection of articles.
[第2の実施形態]
上記第1の実施形態では、基準データ生成処理及び判定処理の際に、物品の固有の特性について、特に考慮しなかった。しかしながら、物品によっては、外観検査の際に考慮すべき固有の特性が含まれる場合がある。
[Second embodiment]
In the first embodiment described above, the unique characteristics of the article were not particularly considered during the reference data generation process and the determination process. However, some articles may have unique characteristics that should be considered during visual inspection.
例えば、物品が果物の場合、ヘタの部分は、ヘタ以外の部分とは色が大きく異なるとともに、果物ごとに特定の色を有している。一方で、外観検査の際の果物の載置のしかたによっては、果物のヘタの位置は、画像データごとに異なる位置となる。このため、領域画像をグループ分けした場合には、いずれのグループに分類されることもあり得、分類されたグループでは、色彩割合が大きく変動することになる。 For example, when the article is a fruit, the calyx portion is greatly different in color from the portion other than the calyx, and each fruit has a specific color. On the other hand, depending on how the fruit is placed during the visual inspection, the position of the fruit's stem will be different for each image data. Therefore, when region images are divided into groups, they may be classified into any group, and the color ratios will vary greatly in the classified groups.
そこで、第2の実施形態では、領域画像をグループ分けする際、果物のヘタを含む領域画像(特定の色を有する領域画像)については、グループ分けの対象(分類対象)から除外する。以下、第2の実施形態について、上記第1の実施形態との相違点を中心に説明する。 Therefore, in the second embodiment, when dividing area images into groups, area images including fruit halves (area images having a specific color) are excluded from grouping targets (classification targets). The second embodiment will be described below, focusing on the differences from the first embodiment.
<グループ生成部の処理の具体例>
図14は、グループ生成部の処理の具体例を示す第2の図である。なお、図14において、グループ生成部1400は、生成部121が有するグループ生成部であるとして説明するが、判定部122が有するグループ生成部も同様の機能を有しているものとする。
<Specific example of processing by group generation unit>
FIG. 14 is a second diagram showing a specific example of processing by the group generation unit. Note that in FIG. 14, the group generation section 1400 will be described as a group generation section included in the
図14に示すように、グループ生成部1400では、色変換済みの矩形画像1430を複数の領域画像に領域分割し、複数のグループに分類する。 As shown in FIG. 14, the group generation unit 1400 divides the color-converted rectangular image 1430 into a plurality of regional images and classifies them into a plurality of groups.
ここで、図14の例では、色変換済みの矩形画像1430に含まれる複数の領域画像のうち、領域画像1431に、検査対象の果物のヘタの部分が含まれている。この場合、グループ生成部1400では、グループ2に分類する12個の領域画像群から、領域画像1431を除外し、11個の領域画像群をグループ2に分類する。図14において、符号1401は、領域画像1431が、グループ2に分類する領域画像群から除外された様子を示している。
Here, in the example of FIG. 14, among the plurality of area images included in the color-converted rectangular image 1430, area image 1431 includes the calyx of the fruit to be inspected. In this case, the group generation unit 1400 excludes the region image 1431 from the 12 region images classified into
このように、物品の固有の特性を考慮して、領域画像を分類することで、各グループの色彩割合として、適切な色彩割合を算出することができる。この結果、第2の実施形態によれば、物品の外観検査において、更なる検査精度の向上を図ることができる。 In this way, by classifying the region images in consideration of the unique characteristics of the article, it is possible to calculate an appropriate color ratio as the color ratio for each group. As a result, according to the second embodiment, it is possible to further improve the inspection accuracy in the appearance inspection of articles.
[その他の実施形態]
上記第1及び第2の実施形態では、領域画像をグループ分けする際、矩形画像の中心位置を基準位置とした。しかしながら、基準位置は、矩形画像の中心位置に限定されず、例えば、矩形画像の上端位置や下端位置であってもよい。あるいは、矩形画像の左端位置や右端位置であってもよい。
[Other embodiments]
In the first and second embodiments described above, when dividing area images into groups, the center position of the rectangular image is used as the reference position. However, the reference position is not limited to the center position of the rectangular image, and may be, for example, the upper end position or the lower end position of the rectangular image. Alternatively, it may be the left end position or right end position of a rectangular image.
また、上記第1及び第2の実施形態では、圧縮部302、902がそれぞれ、部分画像に含まれる3画素×3画素(9画素)をまとめて1画素とすることで、矩形画像を圧縮する場合について説明したが、圧縮部302、902による圧縮方法はこれに限定されない。 Furthermore, in the first and second embodiments described above, the compression units 302 and 902 respectively compress the rectangular image by combining 3 pixels x 3 pixels (9 pixels) included in the partial image into one pixel. Although the case has been described, the compression method by the compression units 302 and 902 is not limited to this.
また、上記第1及び第2の実施形態では、生成部121、判定部122が、それぞれ、圧縮部302、902を有するものとして説明した。しかしながら、生成部121、判定部122は、圧縮部302、902を有していなくてもよい。この場合、色彩割合算出部306、906では、各色の画素数の割合として、圧縮後の画素数の割合(つまり、部分画像数の割合)に代えて、非圧縮の画素数の割合を、色彩割合として算出することになる。
Furthermore, in the first and second embodiments described above, the
また、上記第1及び第2の実施形態では、RGB値変換部303、903がそれぞれ、25階調を1階調に色変換する場合について説明したが、RGB値変換部303、903による色変換方法はこれに限定されない。 Further, in the first and second embodiments described above, the case where the RGB value conversion units 303 and 903 respectively convert 25 gradations into 1 gradation has been described, but the color conversion by the RGB value conversion units 303 and 903 The method is not limited to this.
また、上記第1及び第2の実施形態では、生成部121、判定部122が、それぞれ、RGB値変換部303、903を有するものとして説明した。しかしながら、生成部121、判定部122は、RGB値変換部303、903を有していなくてもよい。この場合、色彩割合算出部306、906では、各色の画素数の割合として、1,331パターンの各色の画素数の割合に代えて、16,777,216パターンの各色の画素数の割合を、色彩割合として算出することになる。
Furthermore, in the first and second embodiments described above, the
また、上記第1及び第2の実施形態では、領域分割部304、904がそれぞれ、矩形画像を縦方向に6分割、横方向に6分割する場合について説明したが、分割数は、6個に限定されない。 In addition, in the first and second embodiments described above, the case where the area dividing units 304 and 904 respectively divide the rectangular image into six vertically and horizontally into six, but the number of divisions is six. Not limited.
また、上記第1及び第2の実施形態では、比較部907が、グループごとに各色の差の絶対値の合計を算出し、算出した合計値に基づいて比較を行うものとして説明した。しかしながら、比較部907の比較方法はこれに限定されず、例えば、グループごとに各色の差の絶対値の合計を正規化し、正規化した合計値に基づいて比較を行ってもよい。
Furthermore, in the first and second embodiments described above, the
また、上記第1の実施形態では、検査対象の物品=果物の場合について説明したが、検査対象の物品はこれに限定されず、野菜、パン、花等のように、外観の色に基づいて、合否の判定が行われる物品であれば、他の物品であってもよい。 Further, in the first embodiment, the case where the object to be inspected is a fruit has been described, but the object to be inspected is not limited to this, and the object to be inspected is not limited to this, but may be an object to be inspected based on the color of its appearance, such as vegetables, bread, flowers, etc. , any other article may be used as long as it is an article for which a pass/fail determination is to be made.
なお、開示の技術では、以下に記載する付記のような形態が考えられる。
(付記1)
検査対象の物品を撮影した対象画像より抽出された、該物品の外接矩形領域を、複数の領域画像に分割する分割部と、
前記複数の領域画像を、前記外接矩形領域の基準位置からの距離に応じて、複数のグループに分類する分類部と、
各グループに分類された領域画像に含まれる画素を、色ごとに集計することで、グループごとに各色の画素数の割合を算出する算出部と、
合格と判定される物品を撮影したモデル画像について予め算出された、各グループの各色の画素数の割合と、前記算出部により算出された各グループの各色の画素数の割合と比較し、前記検査対象の物品の合否を判定する比較部と
を有する検査装置。
(付記2)
前記比較部は、
グループごとに比較した結果、いずれかのグループにおいて、各色の画素数の割合の差が所定の閾値以上であると判定した場合、前記検査対象の物品が不合格であると判定する、付記1に記載の検査装置。
(付記3)
前記比較部は、
グループごとに比較した結果、全てのグループにおいて、各色の画素数の割合の差が所定の閾値未満であると判定した場合、前記検査対象の物品が合格であると判定する、付記1に記載の検査装置。
(付記4)
前記比較部は、
複数のモデル画像について予め算出された、各グループの各色の画素数の割合に対して、前記検査対象の物品が合格であると判定した場合、各グループの各色の画素数の割合の差が最小となるモデル画像を特定することで、前記検査対象の物品のグレードを判定する、付記3に記載の検査装置。
(付記5)
前記検査対象の物品を撮影した対象画像より抽出された、該物品の外接矩形領域を、所定の画素数ごとの部分画像に分割し、各部分画像に含まれる所定数の画素の画素値をまとめて1の画素値を算出することで、前記物品の外接矩形領域を圧縮する圧縮部を更に有し、
前記算出部は、
前記部分画像を1画素として、前記画素数の割合を算出する、付記1に記載の検査装置。
(付記6)
前記圧縮部により圧縮された物品の外接矩形領域に含まれる各部分画像の画素値を、該画素値が属する階調範囲において予め定められた代表値に変換する変換部を更に有し、
前記算出部は、
前記代表値に変換された色ごとに集計することで、前記各色の画素数の割合を算出する、付記5に記載の検査装置。
(付記7)
前記分類部は、前記領域画像を複数のグループに分類する際、予め定められた色が含まれる領域画像を、分類対象から除外する、付記1に記載の検査装置。
(付記8)
前記外接矩形領域の基準位置には、前記外接矩形領域の中心位置、上端位置、下端位置、左端位置、右端位置のいずれかが含まれる、付記1に記載の検査装置。
(付記9)
検査対象の物品を撮影した対象画像より抽出された、該物品の外接矩形領域を、複数の領域画像に分割し、
前記複数の領域画像を、前記外接矩形領域の基準位置からの距離に応じて、複数のグループに分類し、
各グループに分類された領域画像に含まれる画素を、色ごとに集計することで、グループごとに各色の画素数の割合を算出し、
合格と判定される物品を撮影したモデル画像について予め算出された、各グループの各色の画素数の割合と、前記算出された各グループの各色の画素数の割合と比較し、前記検査対象の物品の合否を判定する、
処理をコンピュータに実行させるための検査プログラム。
(付記10)
検査対象の物品を撮影した対象画像より抽出された、該物品の外接矩形領域を、複数の領域画像に分割し、
前記複数の領域画像を、前記外接矩形領域の基準位置からの距離に応じて、複数のグループに分類し、
各グループに分類された領域画像に含まれる画素を、色ごとに集計することで、グループごとに各色の画素数の割合を算出し、
合格と判定される物品を撮影したモデル画像について予め算出された、各グループの各色の画素数の割合と、前記算出された各グループの各色の画素数の割合と比較し、前記検査対象の物品の合否を判定する、
処理をコンピュータが実行する検査方法。
Note that, in the disclosed technology, forms such as those described below are possible.
(Additional note 1)
a dividing unit that divides a circumscribed rectangular area of the item, extracted from a target image obtained by photographing the item to be inspected, into a plurality of area images;
a classification unit that classifies the plurality of area images into a plurality of groups according to a distance from a reference position of the circumscribed rectangular area;
a calculation unit that calculates the ratio of the number of pixels of each color for each group by totaling the pixels included in the area image classified into each group for each color;
The ratio of the number of pixels of each color in each group calculated in advance for a model image taken of an article that is determined to be acceptable is compared with the ratio of the number of pixels of each color in each group calculated by the calculation unit, and the ratio of the number of pixels of each color in each group calculated by the calculation unit is compared. An inspection device comprising: a comparison section for determining pass/fail of a target article;
(Additional note 2)
The comparison section is
As a result of comparing each group, if it is determined that the difference in the ratio of the number of pixels of each color in any group is greater than or equal to a predetermined threshold value, the item to be inspected is determined to be rejected. Inspection equipment as described.
(Additional note 3)
The comparison section is
As a result of comparing each group, if it is determined that the difference in the ratio of the number of pixels of each color in all groups is less than a predetermined threshold value, the article to be inspected is determined to pass. Inspection equipment.
(Additional note 4)
The comparison section is
If the item to be inspected is determined to pass the ratio of the number of pixels of each color in each group calculated in advance for multiple model images, the difference in the ratio of the number of pixels of each color in each group is the smallest. The inspection device according to
(Appendix 5)
Divide the circumscribed rectangular area of the object, extracted from the target image of the object to be inspected, into partial images each having a predetermined number of pixels, and summarize the pixel values of the predetermined number of pixels included in each partial image. further comprising a compression unit that compresses a circumscribed rectangular area of the article by calculating a pixel value of 1,
The calculation unit is
The inspection device according to
(Appendix 6)
further comprising a conversion unit that converts the pixel value of each partial image included in the circumscribed rectangular area of the article compressed by the compression unit into a predetermined representative value in the gradation range to which the pixel value belongs,
The calculation unit is
The inspection device according to
(Appendix 7)
The inspection device according to
(Appendix 8)
The inspection device according to
(Appendix 9)
dividing a circumscribed rectangular region of the object, extracted from a target image obtained by photographing the object to be inspected, into a plurality of region images;
classifying the plurality of area images into a plurality of groups according to the distance from the reference position of the circumscribed rectangular area;
By aggregating the pixels included in the area images classified into each group for each color, the ratio of the number of pixels of each color is calculated for each group,
The ratio of the number of pixels of each color in each group, calculated in advance for a model image taken of an item that is determined to be acceptable, is compared with the calculated ratio of the number of pixels of each color in each group, and the item to be inspected is determined. Judging pass/fail of
An inspection program that causes a computer to perform processing.
(Appendix 10)
dividing a circumscribed rectangular region of the object, extracted from a target image obtained by photographing the object to be inspected, into a plurality of region images;
classifying the plurality of area images into a plurality of groups according to the distance from the reference position of the circumscribed rectangular area;
By aggregating the pixels included in the area images classified into each group for each color, the ratio of the number of pixels of each color is calculated for each group,
The ratio of the number of pixels of each color in each group, calculated in advance for a model image taken of an item that is determined to be acceptable, is compared with the calculated ratio of the number of pixels of each color in each group, and the item to be inspected is determined. Judging pass/fail of
An inspection method in which processing is performed by a computer.
なお、上記実施形態に挙げた構成等に、その他の要素との組み合わせ等、ここで示した構成に本発明が限定されるものではない。これらの点に関しては、本発明の趣旨を逸脱しない範囲で変更することが可能であり、その応用形態に応じて適切に定めることができる。 Note that the present invention is not limited to the configurations shown here, such as combinations of other elements with the configurations listed in the above embodiments. These points can be modified without departing from the spirit of the present invention, and can be appropriately determined depending on the application thereof.
100 :検査システム
110 :撮像装置
120 :検査装置
121 :生成部
122 :判定部
301 :画像データ取得部
302 :圧縮部
303 :RGB値変換部
304 :領域分割部
305 :グループ生成部
306 :色彩割合算出部
307 :登録部
430 :矩形画像
801~803 :テーブル
901 :画像データ取得部
902 :圧縮部
903 :RGB値変換部
904 :領域分割部
905 :グループ生成部
906 :色彩割合算出部
907 :比較部
1121~1123 :比較結果
1400 :グループ生成部
100: Inspection system 110: Imaging device 120: Inspection device 121: Generation unit 122: Determination unit 301: Image data acquisition unit 302: Compression unit 303: RGB value conversion unit 304: Area division unit 305: Group generation unit 306: Color ratio Calculation unit 307: Registration unit 430: Rectangular image 801-803: Table 901: Image data acquisition unit 902: Compression unit 903: RGB value conversion unit 904: Area division unit 905: Group generation unit 906: Color ratio calculation unit 907: Comparison Parts 1121 to 1123: Comparison results 1400: Group generation part
Claims (8)
前記複数の領域画像を、前記外接矩形領域の基準位置からの距離に応じて、複数のグループに分類する分類部と、
各グループに分類された領域画像に含まれる画素を、色ごとに集計することで、グループごとに各色の画素数の割合を算出する算出部と、
合格と判定される物品を撮影したモデル画像について予め算出された、各グループの各色の画素数の割合と、前記算出部により算出された各グループの各色の画素数の割合と比較し、前記検査対象の物品の合否を判定する比較部と
を有する検査装置。 a dividing unit that divides a circumscribed rectangular area of the item, extracted from a target image obtained by photographing the item to be inspected, into a plurality of area images;
a classification unit that classifies the plurality of area images into a plurality of groups according to a distance from a reference position of the circumscribed rectangular area;
a calculation unit that calculates the ratio of the number of pixels of each color for each group by totaling the pixels included in the area image classified into each group for each color;
The ratio of the number of pixels of each color in each group calculated in advance for a model image taken of an article that is determined to be acceptable is compared with the ratio of the number of pixels of each color in each group calculated by the calculation unit, and the ratio of the number of pixels of each color in each group calculated by the calculation unit is compared. An inspection device comprising: a comparison section for determining pass/fail of a target article;
グループごとに比較した結果、いずれかのグループにおいて、各色の画素数の割合の差が所定の閾値以上であると判定した場合、前記検査対象の物品が不合格であると判定する、請求項1に記載の検査装置。 The comparison section is
As a result of comparing each group, if it is determined that the difference in the ratio of the number of pixels of each color in any group is equal to or greater than a predetermined threshold value, the article to be inspected is determined to be rejected. The inspection device described in .
グループごとに比較した結果、全てのグループにおいて、各色の画素数の割合の差が所定の閾値未満であると判定した場合、前記検査対象の物品が合格であると判定する、請求項1に記載の検査装置。 The comparison section is
According to claim 1, the article to be inspected is determined to pass when it is determined that the difference in the ratio of the number of pixels of each color is less than a predetermined threshold value in all groups as a result of comparison for each group. inspection equipment.
複数のモデル画像について予め算出された、各グループの各色の画素数の割合に対して、前記検査対象の物品が合格であると判定した場合、各グループの各色の画素数の割合の差が最小となるモデル画像を特定することで、前記検査対象の物品のグレードを判定する、請求項3に記載の検査装置。 The comparison section is
If the item to be inspected is determined to pass the ratio of the number of pixels of each color in each group calculated in advance for multiple model images, the difference in the ratio of the number of pixels of each color in each group is the smallest. 4. The inspection device according to claim 3, wherein the grade of the article to be inspected is determined by specifying a model image that becomes .
前記算出部は、
前記部分画像を1画素として、前記画素数の割合を算出する、請求項1に記載の検査装置。 Divide the circumscribed rectangular area of the object, extracted from the target image of the object to be inspected, into partial images each having a predetermined number of pixels, and summarize the pixel values of the predetermined number of pixels included in each partial image. further comprising a compression unit that compresses a circumscribed rectangular area of the article by calculating a pixel value of 1,
The calculation unit is
The inspection device according to claim 1, wherein the ratio of the number of pixels is calculated by setting the partial image as one pixel.
前記算出部は、前記代表値に変換された色ごとに集計することで、前記各色の画素数の割合を算出する、請求項5に記載の検査装置。 further comprising a conversion unit that converts the pixel value of each partial image included in the circumscribed rectangular area of the article compressed by the compression unit into a predetermined representative value in the gradation range to which the pixel value belongs,
The inspection device according to claim 5, wherein the calculation unit calculates the ratio of the number of pixels of each color by totaling the converted values for each color.
前記複数の領域画像を、前記外接矩形領域の基準位置からの距離に応じて、複数のグループに分類し、
各グループに分類された領域画像に含まれる画素を、色ごとに集計することで、グループごとに各色の画素数の割合を算出し、
合格と判定される物品を撮影したモデル画像について予め算出された、各グループの各色の画素数の割合と、前記算出された各グループの各色の画素数の割合と比較し、前記検査対象の物品の合否を判定する、
処理をコンピュータに実行させるための検査プログラム。 dividing a circumscribed rectangular region of the object, extracted from a target image obtained by photographing the object to be inspected, into a plurality of region images;
classifying the plurality of area images into a plurality of groups according to the distance from the reference position of the circumscribed rectangular area;
By aggregating the pixels included in the area images classified into each group for each color, the ratio of the number of pixels of each color is calculated for each group,
The ratio of the number of pixels of each color in each group, calculated in advance for a model image taken of an item that is determined to be acceptable, is compared with the calculated ratio of the number of pixels of each color in each group, and the item to be inspected is determined. Judging pass/fail of
An inspection program that causes a computer to perform processing.
前記複数の領域画像を、前記外接矩形領域の基準位置からの距離に応じて、複数のグループに分類し、
各グループに分類された領域画像に含まれる画素を、色ごとに集計することで、グループごとに各色の画素数の割合を算出し、
合格と判定される物品を撮影したモデル画像について予め算出された、各グループの各色の画素数の割合と、前記算出された各グループの各色の画素数の割合と比較し、前記検査対象の物品の合否を判定する、
処理をコンピュータが実行する検査方法。 dividing a circumscribed rectangular region of the object, extracted from a target image obtained by photographing the object to be inspected, into a plurality of region images;
classifying the plurality of area images into a plurality of groups according to the distance from the reference position of the circumscribed rectangular area;
By aggregating the pixels included in the area images classified into each group for each color, the ratio of the number of pixels of each color is calculated for each group,
The ratio of the number of pixels of each color in each group, calculated in advance for a model image taken of an item that is determined to be acceptable, is compared with the calculated ratio of the number of pixels of each color in each group, and the item to be inspected is determined. Judging pass/fail of
An inspection method in which processing is performed by a computer.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020056586A JP7396160B2 (en) | 2020-03-26 | 2020-03-26 | Inspection equipment, inspection program and inspection method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020056586A JP7396160B2 (en) | 2020-03-26 | 2020-03-26 | Inspection equipment, inspection program and inspection method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2021157452A JP2021157452A (en) | 2021-10-07 |
| JP7396160B2 true JP7396160B2 (en) | 2023-12-12 |
Family
ID=77918473
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2020056586A Active JP7396160B2 (en) | 2020-03-26 | 2020-03-26 | Inspection equipment, inspection program and inspection method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7396160B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115272277A (en) * | 2022-08-15 | 2022-11-01 | 维达护理用品(中国)有限公司 | Online testing method and testing equipment for paper packaging |
| CN118279437B (en) * | 2024-03-21 | 2025-07-22 | 成都乐信圣文科技有限责任公司 | Automatic stramonium pattern coloring method and system |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012242233A (en) | 2011-05-19 | 2012-12-10 | Sumitomo Metal Ind Ltd | Pipe inner surface inspection method and pipe inner surface inspection device |
| JP2014136353A (en) | 2013-01-16 | 2014-07-28 | Nec Fielding Ltd | Printer, abnormality detection device of printer and abnormality detection method for the same |
| JP2014215233A (en) | 2013-04-26 | 2014-11-17 | 橋本電機工業株式会社 | Device for sorting and stacking and method of sorting and stacking veneer |
| JP2019086914A (en) | 2017-11-02 | 2019-06-06 | 株式会社富士通アドバンストエンジニアリング | Article inspection device, article inspection method and article inspection program |
-
2020
- 2020-03-26 JP JP2020056586A patent/JP7396160B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012242233A (en) | 2011-05-19 | 2012-12-10 | Sumitomo Metal Ind Ltd | Pipe inner surface inspection method and pipe inner surface inspection device |
| JP2014136353A (en) | 2013-01-16 | 2014-07-28 | Nec Fielding Ltd | Printer, abnormality detection device of printer and abnormality detection method for the same |
| JP2014215233A (en) | 2013-04-26 | 2014-11-17 | 橋本電機工業株式会社 | Device for sorting and stacking and method of sorting and stacking veneer |
| JP2019086914A (en) | 2017-11-02 | 2019-06-06 | 株式会社富士通アドバンストエンジニアリング | Article inspection device, article inspection method and article inspection program |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2021157452A (en) | 2021-10-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Sun | Inspecting pizza topping percentage and distribution by a computer vision method | |
| US20170069075A1 (en) | Classifier generation apparatus, defective/non-defective determination method, and program | |
| Suttapakti et al. | Potato leaf disease classification based on distinct color and texture feature extraction | |
| JP3740065B2 (en) | Object extraction device and method based on region feature value matching of region-divided video | |
| Dadwal et al. | Color image segmentation for fruit ripeness detection: A review | |
| Zhang et al. | Date maturity and quality evaluation using color distribution analysis and back projection | |
| JP7396160B2 (en) | Inspection equipment, inspection program and inspection method | |
| US8873859B2 (en) | Apparatus and method that determines whether a pattern within the detection window is a subject based on characteristic amounts obtained from within a first region | |
| US9824278B2 (en) | Determining native resolutions of video sequences | |
| CN103106668B (en) | The method and system of image-region is described based on color histogram | |
| WO2019026104A1 (en) | Information processing device, information processing program, and information processing method | |
| CN109271906A (en) | Smoke detecting method based on deep convolutional neural network and device thereof | |
| US20140185956A1 (en) | Device and method of image processing | |
| Dang-Ngoc et al. | Citrus leaf disease detection and classification using hierarchical support vector machine | |
| CN106454302A (en) | Method and device for detecting ripeness of fruits and vegetables | |
| Najeeb et al. | Dates maturity status and classification using image processing | |
| JP7167426B2 (en) | Inspection device, inspection method and inspection program | |
| JPH10124535A (en) | Method for retrieving sample in picture of data base | |
| KR20070122409A (en) | Video content detector | |
| JP7144384B2 (en) | Object detection device, method and program | |
| JP6404794B2 (en) | Image information acquisition method, image evaluation method, image information acquisition device, image evaluation device, and image processing program | |
| Reyes et al. | Image analysis of real-time classification of cherry fruit from colour features | |
| Gelasca et al. | On evaluating video object segmentation quality: A perceptually driven objective metric | |
| JP2013150122A (en) | Image processing device, method, and program | |
| Mousse et al. | Fast moving object detection from overlapping cameras |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20210825 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20221208 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20231023 |
|
| 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: 20231031 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20231113 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7396160 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |