JP2020148586A - Image processing apparatus, inspection device, image processing method, and program - Google Patents

Image processing apparatus, inspection device, image processing method, and program Download PDF

Info

Publication number
JP2020148586A
JP2020148586A JP2019045710A JP2019045710A JP2020148586A JP 2020148586 A JP2020148586 A JP 2020148586A JP 2019045710 A JP2019045710 A JP 2019045710A JP 2019045710 A JP2019045710 A JP 2019045710A JP 2020148586 A JP2020148586 A JP 2020148586A
Authority
JP
Japan
Prior art keywords
frame
contour candidate
extraction target
region
partial region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2019045710A
Other languages
Japanese (ja)
Inventor
昌樹 木村
Masaki Kimura
昌樹 木村
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2019045710A priority Critical patent/JP2020148586A/en
Publication of JP2020148586A publication Critical patent/JP2020148586A/en
Pending legal-status Critical Current

Links

Images

Abstract

To make it possible, in appearance inspection through image processing, to accurately and simply extract an area where an inspection object is captured.SOLUTION: There is provided an inspection device 1 comprising: a recognition unit 110 that, in order to extract an extraction object area corresponding to an inspection object from an input image, recognizes a first partial area inside the extraction object area and a first frame outside the extraction object area for surrounding the extraction object area; a contour candidate specification unit 120 that, based on the first partial area and the first frame, specifies a contour candidate for the extraction object area so as to include the first partial area and not to include the first frame; an update unit 140 that, based on the contour candidate, creates a second partial area inside the contour candidate and a second frame outside the contour candidate for surrounding the contour candidate; an area specification unit 150 that, based on the second partial area and the second frame, specifies the extraction object area so as to include the second partial area and not to include the second frame; and an appearance inspection unit 160 that performs appearance inspection with reference to the specified extraction object area in the input image.SELECTED DRAWING: Figure 2

Description

本発明は、画像処理装置、検査装置、画像処理方法、及びプログラムに関する。 The present invention relates to an image processing apparatus, an inspection apparatus, an image processing method, and a program.

外観検査とは、工業的に量産される物品の表面に付着した異物や汚れ、傷、バリ、欠け、変形などの欠陥を確認し、物品の良否を判定する検査のことをいう。従来、外観検査は、人が目視で行うことが一般的であったが、近年では、検査対象物の撮像画像に対する画像処理により外観検査を実現することが提案されている。具体的には、検査対象物の撮像画像に対して検査対象物の写っている検査対象領域を指定し、その検査対象領域に対して形状認識等の画像処理を施すことで外観検査が実現される。検査領域の指定は簡便であることが好ましい。画像に対して特定の領域を指定し、その領域に対して画像処理を施す技術の一例としては、特許文献1に開示の技術が挙げられる。特許文献1には、画像中の被写体の領域とその近傍を大まかに指示し被写体認識処理を施すことによって簡便に被写体領域を得る方法が開示されている。 The visual inspection is an inspection for determining the quality of an article by confirming defects such as foreign matter, dirt, scratches, burrs, chips, and deformation adhering to the surface of an article mass-produced industrially. Conventionally, the visual inspection is generally performed visually by a person, but in recent years, it has been proposed to realize the visual inspection by image processing the captured image of the inspection object. Specifically, the appearance inspection is realized by designating the inspection target area in which the inspection target is reflected in the captured image of the inspection target and performing image processing such as shape recognition on the inspection target area. To. It is preferable that the inspection area is specified easily. As an example of a technique for designating a specific area for an image and performing image processing on the area, the technique disclosed in Patent Document 1 can be mentioned. Patent Document 1 discloses a method of easily obtaining a subject area by roughly instructing a region of a subject in an image and its vicinity and performing subject recognition processing.

特開平7−322054号公報Japanese Unexamined Patent Publication No. 7-322504

大量生産される物品の外観検査を画像処理により行う場合、物品の撮像画像の各々に対して検査対象領域その都度指定することは現実的では無く、予め設定した一つのおおまかな指示にしたがって各撮像画像から検査対象領域を抽出することが一般的である。しかし、検査対象物の周辺の画像の様相は撮像画像毎に同じとは限らず、大まかな指示にしたがって検査対象領域を抽出することで欠陥の誤認識を誘発する虞がある。 When visual inspection of mass-produced articles is performed by image processing, it is not realistic to specify the inspection target area for each of the captured images of the articles, and each imaging is performed according to one preset rough instruction. It is common to extract the inspection target area from the image. However, the appearance of the image around the inspection target is not always the same for each captured image, and extracting the inspection target region according to a rough instruction may induce erroneous recognition of defects.

以上の課題を解決するために、本発明に係る画像処理装置は、入力画像のうち画像を抽出する抽出対象領域を特定する画像処理装置であって、前記抽出対象領域内の第1部分領域と、前記抽出対象領域外であって前記抽出対象領域を囲む第1枠を認識する認識部と、前記第1部分領域及び前記第1枠に基づいて、前記第1部分領域を含み且つ前記第1枠を含まないように前記抽出対象領域の輪郭候補を特定する輪郭候補特定部と、前記輪郭候補に基づいて、前記輪郭候補内の第2部分領域と、前記輪郭候補外であって前記輪郭候補を囲む第2枠を生成する更新部と、前記第2部分領域及び前記第2枠に基づいて、前記第2部分領域を含み且つ前記第2枠を含まないように前記抽出対象領域を特定する領域特定部と、を有することを特徴とする。 In order to solve the above problems, the image processing apparatus according to the present invention is an image processing apparatus that specifies an extraction target region for extracting an image from an input image, and is a first partial region within the extraction target region. A recognition unit that recognizes a first frame that is outside the extraction target area and surrounds the extraction target area, and the first partial region and the first partial region based on the first partial region and the first frame. A contour candidate specifying unit that specifies a contour candidate of the extraction target area so as not to include a frame, a second partial region within the contour candidate based on the contour candidate, and the contour candidate outside the contour candidate. Based on the update unit that generates the second frame surrounding the second frame, the second partial area, and the second frame, the extraction target area is specified so as to include the second partial area and not include the second frame. It is characterized by having a region specifying portion.

また、以上の課題を解決するために、本発明に係る検査装置は、入力画像のうち検査対象物に対応する抽出対象領域を抽出するために前記抽出対象領域内の第1部分領域と、前記抽出対象領域外であって前記抽出対象領域を囲む第1枠を認識する認識部と、前記第1部分領域及び前記第1枠に基づいて、前記第1部分領域を含み且つ前記第1枠を含まないように前記抽出対象領域の輪郭候補を特定する輪郭候補特定部と、前記輪郭候補に基づいて、前記輪郭候補内の第2部分領域と、前記輪郭候補外であって前記輪郭候補を囲む第2枠を生成する更新部と、前記第2部分領域及び前記第2枠に基づいて、前記第2部分領域を含み且つ前記第2枠を含まないように前記抽出対象領域を特定する領域特定部と、入力画像のうち前記領域特定部により特定済みの前記抽出対象領域の画像を参照して前記検査対象物の外観検査を行う外観検査部と、を備えることを特徴とする。 Further, in order to solve the above problems, the inspection apparatus according to the present invention includes a first partial region in the extraction target region and the extraction target region in order to extract an extraction target region corresponding to the inspection target in the input image. A recognition unit that recognizes a first frame that is outside the extraction target area and surrounds the extraction target area, and the first frame that includes the first partial area based on the first partial area and the first frame. A contour candidate specifying unit that specifies a contour candidate of the extraction target region so as not to include the contour candidate, a second partial region within the contour candidate based on the contour candidate, and a contour candidate that is outside the contour candidate and surrounds the contour candidate. An area specification that specifies the extraction target area so as to include the second partial area and not include the second frame based on the update unit that generates the second frame, the second partial area, and the second frame. It is characterized by including a unit and an appearance inspection unit that performs an appearance inspection of the inspection object by referring to an image of the extraction target region already specified by the region identification unit in the input image.

また、以上の課題を解決するために、本発明に係る画像処理方法は、入力画像のうち画像を抽出する抽出対象領域を特定する画像処理方法であって、前記抽出対象領域内の第1部分領域と、前記抽出対象領域外であって前記抽出対象領域を囲む第1枠を認識し、前記第1部分領域及び前記第1枠に基づいて、前記第1部分領域を含み且つ前記第1枠を含まないように前記抽出対象領域の輪郭候補を特定し、前記輪郭候補に基づいて、前記輪郭候補内の第2部分領域と、前記輪郭候補外であって前記輪郭候補を囲む第2枠を生成し、前記第2部分領域及び前記第2枠に基づいて、前記第2部分領域を含み且つ前記第2枠を含まないように前記抽出対象領域を特定する、ことを特徴とする。 Further, in order to solve the above problems, the image processing method according to the present invention is an image processing method for specifying an extraction target area for extracting an image from an input image, and is a first portion in the extraction target area. Recognizing the region and the first frame outside the extraction target area and surrounding the extraction target area, and including the first partial region and the first frame based on the first partial region and the first frame. The contour candidate of the extraction target area is specified so as not to include, and based on the contour candidate, a second partial region within the contour candidate and a second frame outside the contour candidate and surrounding the contour candidate are formed. It is characterized in that the extraction target region is specified so as to include the second partial region and not to include the second frame based on the second partial region and the second frame.

また、以上の課題を解決するために、本発明に係るプログラムは、コンピューターを、入力画像のうち画像の抽出対象となる抽出対象領域を特定するために前記抽出対象領域内の第1部分領域と、前記抽出対象領域外であって前記抽出対象領域を囲む第1枠を認識する認識部と、前記第1部分領域及び前記第1枠に基づいて、前記第1部分領域を含み且つ前記第1枠を含まないように前記抽出対象領域の輪郭候補を特定する輪郭候補特定部と、前記輪郭候補に基づいて、前記輪郭候補内の第2部分領域と、前記輪郭候補外であって前記輪郭候補を囲む第2枠を生成する更新部と、前記第2部分領域及び前記第2枠に基づいて、前記第2部分領域を含み且つ前記第2枠を含まないように前記抽出対象領域を特定する領域特定部と、して機能させることを特徴とする。 Further, in order to solve the above problems, the program according to the present invention uses a computer as a first partial region in the extraction target region in order to specify an extraction target region of the input image to be extracted. A recognition unit that recognizes a first frame that is outside the extraction target area and surrounds the extraction target area, and the first partial region and the first partial region based on the first partial region and the first frame. A contour candidate specifying unit that specifies a contour candidate of the extraction target area so as not to include a frame, a second partial region within the contour candidate based on the contour candidate, and the contour candidate outside the contour candidate. Based on the update unit that generates the second frame surrounding the second frame, the second partial area, and the second frame, the extraction target area is specified so as to include the second partial area and not include the second frame. It is characterized in that it functions as an area identification unit.

本発明の一実施形態に係る検査装置1のハードウェア構成の一例を示すブロック図である。It is a block diagram which shows an example of the hardware structure of the inspection apparatus 1 which concerns on one Embodiment of this invention. 同検査装置1の機能を説明するための機能ブロック図である。It is a functional block diagram for demonstrating the function of the inspection apparatus 1. watershed法を説明するための図である。It is a figure for demonstrating the watershed method. watershed法を説明するための図である。It is a figure for demonstrating the watershed method. watershed法を説明するための図である。It is a figure for demonstrating the watershed method. 検査装置1において実行される画像処理方法の流れを示すフローチャートである。It is a flowchart which shows the flow of the image processing method executed in inspection apparatus 1. 抽出対象領域を含む画像の一例を示す図である。It is a figure which shows an example of the image including the extraction target area. 検査装置1の利用者により指定される第1部分領域及び第1枠の一例を示す図である。It is a figure which shows an example of the 1st partial area and 1st frame designated by the user of inspection apparatus 1. 輪郭候補特定処理SA110にて特定される輪郭候補の一例を示す図である。It is a figure which shows an example of the contour candidate specified by the contour candidate identification processing SA110. 更新処理SA120にて生成される第2部分領域及び第2枠の一例を示す図である。It is a figure which shows an example of the 2nd partial area and 2nd frame generated by the update process SA120. 本実施形態の効果を説明するための図である。It is a figure for demonstrating the effect of this embodiment. 本実施形態の効果を説明するための図である。It is a figure for demonstrating the effect of this embodiment. 本実施形態の効果を説明するための図である。It is a figure for demonstrating the effect of this embodiment. 変形例(3)を説明するための図である。It is a figure for demonstrating the modification (3). 変形例(3)を説明するための図である。It is a figure for demonstrating the modification (3). 変形例(3)を説明するための図である。It is a figure for demonstrating the modification (3). 変形例(3)を説明するための図である。It is a figure for demonstrating the modification (3).

以下、図面を参照して実施の形態を説明する。ただし、各図において、各部の寸法及び縮尺は、実際のものと適宜に異ならせてある。また、以下に述べる実施の形態は、技術的に好ましい種々の限定が付されているが、実施の形態はこれらの形態に限られるものではない。 Hereinafter, embodiments will be described with reference to the drawings. However, in each figure, the dimensions and scale of each part are appropriately different from the actual ones. Further, although the embodiments described below are subject to various technically preferable limitations, the embodiments are not limited to these embodiments.

A.実施形態
図1は、本発明の一実施形態による検査装置1のハードウェア構成例を示すブロック図である。検査装置1は、工業的に量産される物品の外観検査を行うための装置である。図1に示すように検査装置1は、処理装置10と、撮像装置20と、表示装置30と、入力装置40と、記憶装置50と、これら構成要素間のデータ授受を仲介するバス60と、を含む。
A. The first embodiment is a block diagram showing a hardware configuration example of the inspection device 1 according to the embodiment of the present invention. The inspection device 1 is a device for inspecting the appearance of industrially mass-produced articles. As shown in FIG. 1, the inspection device 1 includes a processing device 10, an imaging device 20, a display device 30, an input device 40, a storage device 50, a bus 60 that mediates data transfer between these components, and a bus 60. including.

処理装置10は、検査装置1の全体を制御するプロセッサーであり、例えば単数又は複数のチップで構成されるコンピューターである。処理装置10は、例えば、周辺装置とのインタフェース、演算装置及びレジスター等を含む中央処理装置(CPU:Central Processing Unit)で構成される。処理装置10は、記憶装置50に記憶されている制御プログラム510を実行することで、検査装置1の制御中枢として機能する。制御プログラム510にしたがって処理装置10が実行する処理の詳細については後に明らかにする。 The processing device 10 is a processor that controls the entire inspection device 1, and is, for example, a computer composed of a single or a plurality of chips. The processing device 10 is composed of, for example, a central processing unit (CPU) including an interface with peripheral devices, an arithmetic unit, a register, and the like. The processing device 10 functions as a control center of the inspection device 1 by executing the control program 510 stored in the storage device 50. The details of the processing executed by the processing apparatus 10 according to the control program 510 will be clarified later.

撮像装置20は、例えばCCD(Charge Coupled Device)イメージセンサーである。撮像装置20は、外観検査の検査対象物の画像を撮像するためのものである。以下では、検査対象物の画像を検査対象物画像と呼ぶ。撮像装置20は、検査対象物を撮像し、検査対象物画像を表す検査対象物画像データをバス60を介して処理装置10に与える。 The image pickup device 20 is, for example, a CCD (Charge Coupled Device) image sensor. The image pickup apparatus 20 is for capturing an image of an inspection object for visual inspection. Hereinafter, the image of the inspection object is referred to as an inspection object image. The image pickup apparatus 20 takes an image of the inspection object and gives the inspection object image data representing the inspection object image to the processing device 10 via the bus 60.

表示装置30は、例えば液晶ディスプレイである。表示装置30は、処理装置10による制御の下で各種画像を表示する。 The display device 30 is, for example, a liquid crystal display. The display device 30 displays various images under the control of the processing device 10.

入力装置40は、マウスなどのポインティングデバイスとキーボードとを含む。入力装置40は、検査装置1の利用者に各種入力操作を行わせるためのものである。入力装置40に対して利用者がキー操作等の何らかの入力操作を行うと、入力装置40は、利用者の操作内容を表す操作内容データをバス60を介して処理装置10に与える。これにより、利用者の操作内容が処理装置10に伝達される。 The input device 40 includes a pointing device such as a mouse and a keyboard. The input device 40 is for causing the user of the inspection device 1 to perform various input operations. When the user performs some input operation such as a key operation on the input device 40, the input device 40 gives operation content data representing the operation content of the user to the processing device 10 via the bus 60. As a result, the operation content of the user is transmitted to the processing device 10.

図1では詳細な図示を省略したが、記憶装置50は揮発性記憶部と不揮発性記憶部とを含む。揮発性記憶部とは、電力が供給されないと、記憶している情報を保持できない記憶装置のことをいい、不揮発性記憶部とは、電力が供給されなくても、記憶している情報を保持できる記憶装置のことをいう。揮発性記憶部の一例としてはRAM(Random Access Memory)が挙げられる。揮発性記憶部は、制御プログラム510を実行する際のワークエリアとして処理装置10によって利用される。不揮発性記憶部の一例としてはハードディスクが挙げられる。不揮発性記憶部には、制御プログラム510が予め記憶されている。 Although detailed illustration is omitted in FIG. 1, the storage device 50 includes a volatile storage unit and a non-volatile storage unit. A volatile storage unit is a storage device that cannot retain stored information unless electric power is supplied, and a non-volatile storage unit retains stored information even if electric power is not supplied. A storage device that can be used. An example of a volatile storage unit is a RAM (Random Access Memory). The volatile storage unit is used by the processing device 10 as a work area when executing the control program 510. A hard disk is an example of a non-volatile storage unit. The control program 510 is stored in advance in the non-volatile storage unit.

処理装置10は、例えば検査装置1の図示せぬ電源投入を契機として制御プログラム510を記憶装置50から読み出し、その実行を開始する。図2は、処理装置10が制御プログラム510にしたがって実現する機能ブロックの一例を示す図である。図2に示すように、制御プログラム510にしたがって作動している処理装置10は、表示制御部100、認識部110、輪郭候補特定部120、無効化部130、更新部140、領域特定部150、及び外観検査部160、として機能する。これら各部の機能は以下の通りである。 The processing device 10 reads the control program 510 from the storage device 50, for example, when the power of the inspection device 1 is turned on (not shown), and starts executing the control program 510. FIG. 2 is a diagram showing an example of a functional block realized by the processing device 10 according to the control program 510. As shown in FIG. 2, the processing device 10 operating according to the control program 510 includes a display control unit 100, a recognition unit 110, a contour candidate identification unit 120, an invalidation unit 130, an update unit 140, and an area identification unit 150. And function as a visual inspection unit 160. The functions of each of these parts are as follows.

表示制御部100は、各種画像を表示装置30に表示させる。表示制御部100が表示装置30に表示させる画像の一例としては、検査対象物画像、後述する輪郭候補特定部120により特定される輪郭候補の画像が挙げられる。表示装置30に表示される検査対象物画像を視認した利用者は、検査対象物の写っている検査対象領域内の第1部分領域と、検査対象領域外であって検査対象領域を囲む第1枠とを、マウスクリック等の入力装置40に対する操作により指定する。利用者による第1部分領域の指定態様の一例としては、第1部分領域として指定する領域の輪郭を描くようにマウスドラッグを行う態様が挙げられる。第1枠についても同様にマウスドラッグにより指定すればよい。表示制御部100は、第1部分領域の指定が行われると、当該指定された第1部分領域を利用者の判り易い態様で表示装置30に表示させる。また、表示制御部100は、第1枠の指定が行われると、当該指定された第1枠を利用者の判り易い態様で表示装置30に表示させる。第1部分領域及び第1枠素の表示態様としては、各々の指定前とは異なる表示色で表示する態様、或いは、第1部分領域と第1枠とを互いに異なる点滅パターンで点滅させる態様等が挙げられる。 The display control unit 100 causes the display device 30 to display various images. Examples of the image displayed on the display device 30 by the display control unit 100 include an image of an inspection object and an image of a contour candidate specified by the contour candidate specifying unit 120 described later. The user who visually recognizes the inspection target image displayed on the display device 30 has a first partial area in the inspection target area in which the inspection target is reflected and a first portion outside the inspection target area that surrounds the inspection target area. The frame is designated by an operation on the input device 40 such as a mouse click. As an example of the mode in which the user designates the first subregion, there is a mode in which the mouse drag is performed so as to draw the outline of the region designated as the first subregion. Similarly, the first frame may be specified by dragging the mouse. When the first partial area is designated, the display control unit 100 causes the display device 30 to display the designated first partial area in a manner that is easy for the user to understand. Further, when the first frame is designated, the display control unit 100 causes the display device 30 to display the designated first frame in a manner that is easy for the user to understand. As the display mode of the first partial area and the first frame element, a mode of displaying in a display color different from that before each designation, a mode of blinking the first partial area and the first frame in different blinking patterns, and the like. Can be mentioned.

認識部110は、利用者によって指定される第1部分領域と、同じく利用者に指定される第1枠と、を認識する。マウスドラッグにより第1部分領域の指定が行われる場合、認識部110は、マウスドラッグの過程で入力装置40から出力されるデータの表す閉じた軌跡の内側を領域を第1部分領域として認識する。マウスドラッグにより第1枠の指定が行われる場合も同様に、認識部110は、マウスドラッグの過程で入力装置40から出力されるデータの表す閉じた軌跡を第1枠を認識する。詳細については後述するが、検査対象領域は、領域特定部150による抽出対象となるため、以下では検査対象領域のことを抽出対象領域と呼ぶ場合がある。 The recognition unit 110 recognizes the first subregion designated by the user and the first frame also designated by the user. When the first partial region is designated by dragging the mouse, the recognition unit 110 recognizes the region inside the closed locus represented by the data output from the input device 40 in the process of dragging the mouse as the first partial region. Similarly, when the first frame is designated by dragging the mouse, the recognition unit 110 recognizes the first frame as the closed locus represented by the data output from the input device 40 in the process of dragging the mouse. Although the details will be described later, since the inspection target area is the extraction target by the area identification unit 150, the inspection target area may be referred to as the extraction target area below.

輪郭候補特定部120は、認識部110により認識済みの第1部分領域及び認識部110により認識済みの第1枠に基づいて、当該第1部分領域を含み且つ当該第1枠を含まないように抽出対象領域の輪郭候補を特定する。より詳細に説明すると、輪郭候補特定部120は、抽出対象領域の抽出対象の画像を2値化し、水平走査方向に並んだ画素の行毎、及び垂直走査方向に並んだ画素の列毎に、watershed法の処理を施して輪郭候補を特定する。 The contour candidate identification unit 120 includes the first partial area and does not include the first frame based on the first partial region recognized by the recognition unit 110 and the first frame recognized by the recognition unit 110. Identify contour candidates for the extraction target area. More specifically, the contour candidate identification unit 120 binarizes the image to be extracted in the extraction target area, and for each row of pixels arranged in the horizontal scanning direction and for each column of pixels arranged in the vertical scanning direction. The contour candidate is specified by performing the processing of the horizontal method.

図3から図5はwatershed法を説明するための図である。例えば、ある列に属する画素の輝度がその列に沿って図3のように変化していたとする。例えば、検査対象物が金属光沢を有する物品であり、検査対象物画像における背景の色が黒であるとする。この場合、検査対象物画像では、図3に示す例と同様に、検査対象物に対応する領域の画素の輝度は高くなり、背景の領域に属する画素の輝度は低くなる。検査対象物画像において検査対象物の写っている部分に第1部分領域が指定されており、且つ当該検査対象物の周囲の背景部分に当該検査対象物を囲むように第1枠が指定されている場合、第1部分領域に属する画素の輝度は高くなり、第1枠に属する画素の輝度は低くなる。watershed法では、輝度を水位に見立て、図4に示すように、輝度の低い画素については一定量ずつ輝度を引き上げ、輝度の高い画素については一定量ずつ輝度を引き下げる。そして、図5に示すように両者の輝度が一致した箇所が、輝度の低い画素の属する領域と輝度の高い画素の属する領域の境界、すなわち、第1部分領域を含み、且つ第1枠を含まない抽出対象領域の輪郭候補として特定される。 3 to 5 are diagrams for explaining the watershed method. For example, suppose that the brightness of the pixels belonging to a certain row changes along the row as shown in FIG. For example, it is assumed that the inspection object is an article having a metallic luster and the background color in the inspection object image is black. In this case, in the inspection target image, the brightness of the pixels in the region corresponding to the inspection target is high and the brightness of the pixels belonging to the background region is low, as in the example shown in FIG. In the inspection object image, the first partial region is designated in the part where the inspection object is reflected, and the first frame is designated so as to surround the inspection object in the background portion around the inspection object. If so, the brightness of the pixels belonging to the first partial region becomes high, and the brightness of the pixels belonging to the first frame becomes low. In the watershed method, the brightness is regarded as the water level, and as shown in FIG. 4, the brightness is increased by a certain amount for the pixels with low brightness, and the brightness is decreased by a certain amount for the pixels with high brightness. Then, as shown in FIG. 5, the portion where the brightness of both coincides includes the boundary between the region to which the pixel having low brightness belongs and the region to which the pixel having high brightness belongs, that is, the first partial region and includes the first frame. Not specified as a contour candidate for the extraction target area.

輪郭候補特定部120により特定済みの輪郭候補は、表示制御部100によって表示装置30に表示される。表示装置30に表示された輪郭候補内に検査対象物以外の被写体が含まれている場合など、特定された輪郭候補に利用者が不満を感じる場合には、利用者は、第1部分領域と第1枠の少なくとも一方を無効化する操作を入力装置40に対して行うことができる。第1部分領域及び第1枠を無効化する操作の具体例としては、マウスでクリックしつつXキー等の所定のキーを押下する操作が挙げられる。 The contour candidates identified by the contour candidate specifying unit 120 are displayed on the display device 30 by the display control unit 100. When the user is dissatisfied with the specified contour candidate, such as when the contour candidate displayed on the display device 30 includes a subject other than the inspection target, the user sets the first partial area. An operation of invalidating at least one of the first frames can be performed on the input device 40. Specific examples of the operation of invalidating the first partial area and the first frame include an operation of pressing a predetermined key such as the X key while clicking with the mouse.

無効化部130は、認識部110により認識された第1部分領域と第1枠の少なくとも一方の指定を、入力装置40から与えられる操作内容データにしたがって無効化する。利用者は、第1部分領域又は第1枠を指定し直すことで、所望の輪郭候補を輪郭候補特定部120に特定させることができる。 The invalidation unit 130 invalidates the designation of at least one of the first partial area and the first frame recognized by the recognition unit 110 according to the operation content data given from the input device 40. The user can make the contour candidate specifying unit 120 specify a desired contour candidate by redesignating the first partial region or the first frame.

更新部140は、輪郭候補特定部120により特定済みの輪郭候補に基づいて、輪郭候補内の第2部分領域と、輪郭候補外であって輪郭候補を囲む第2枠を生成する。より詳細に説明すると、更新部140は、輪郭候補特定部120により特定済みの輪郭候補を予め定められた縮小率で収縮させて得られる輪郭により囲まれる領域を第2部分領域として生成し、輪郭候補特定部120の特定した輪郭候補を予め定められた拡大率で膨張させて第2枠を生成する。なお、第2部分領域を生成する際の縮小率及び第2枠を生成する際の拡大率については、検査対象物の大きさに関する製造バラツキに応じて定めておけばよい。 The update unit 140 generates a second partial region within the contour candidate and a second frame outside the contour candidate and surrounding the contour candidate based on the contour candidate identified by the contour candidate specifying unit 120. More specifically, the updating unit 140 generates a region surrounded by the contour obtained by contracting the contour candidate identified by the contour candidate specifying unit 120 at a predetermined reduction rate as the second partial region, and the contour The specified contour candidate of the candidate identification unit 120 is expanded at a predetermined enlargement ratio to generate a second frame. The reduction ratio when the second partial region is generated and the enlargement ratio when the second frame is generated may be determined according to the manufacturing variation regarding the size of the inspection object.

領域特定部150は、更新部140の生成する第2部分領域及び第2枠に基づいて、第2部分領域を含み且つ第2枠を含まないように抽出対象領域を特定する。より詳細に説明すると、領域特定部150は、第2部分領域を含み、且つ第2枠を含まないように、前述のwatershed法により抽出対象領域の輪郭を特定する。そして、領域特定部150は、上記の要領で特定した抽出対象領域が検査対象物画像に占める位置、大きさ、及び形状を表すデータを、検査対象物画像から検査対象領域を抽出するためのマスク情報として記憶装置50に書き込む。 The area specifying unit 150 specifies the extraction target area so as to include the second partial area and not to include the second frame based on the second partial area and the second frame generated by the updating unit 140. More specifically, the region specifying unit 150 specifies the outline of the extraction target region by the above-mentioned watershed method so as to include the second partial region and not to include the second frame. Then, the area specifying unit 150 is a mask for extracting the inspection target area from the inspection target image by using the data representing the position, size, and shape of the extraction target area specified in the above procedure in the inspection target image. It is written in the storage device 50 as information.

外観検査部160は、記憶装置50に記憶されているマスク情報を参照して検査対象物画像における検査対象領域を特定し、当該検査対象領域に対して外観検査のための画像処理を施す。この外観検査のアルゴリズムについては、既存のアルゴリズムを適宜用いるようにすればよい。 The appearance inspection unit 160 identifies an inspection target area in the inspection target image with reference to the mask information stored in the storage device 50, and performs image processing for the appearance inspection on the inspection target area. As for this visual inspection algorithm, an existing algorithm may be used as appropriate.

本実施形態の検査装置1では、処理装置10は、制御プログラム510にしたがって、図6のフローチャートに示す画像処理方法を実行する。この画像処理方法は、図6に示すように、認識処理SA100と、輪郭候補特定処理SA110と、更新処理SA120と、領域特定処理SA130と、を含む。以下、検査対象領域の抽出元となる画像が、図7に示すように、検査対象物である物品Aと検査対象物ではないものの、物品Aと同様に金属光沢を有する物品B及び物品Cの写っている背景が黒の画像G01であり、画像G01に対して利用者が、図8に示すように、物品Aの形状を正確に辿るのではなく、第1部分領域R01及び第1枠W01の各々をマウスドラッグにより大まかに指定する場合を例にとって、各処理の処理内容を説明する。 In the inspection device 1 of the present embodiment, the processing device 10 executes the image processing method shown in the flowchart of FIG. 6 according to the control program 510. As shown in FIG. 6, this image processing method includes a recognition process SA100, a contour candidate identification process SA110, an update process SA120, and an area identification process SA130. Hereinafter, as shown in FIG. 7, the images from which the inspection target area is extracted are the article A which is the inspection target and the articles B and C which are not the inspection targets but have a metallic luster like the article A. The image G01 in which the background is black is the image G01, and the user does not accurately follow the shape of the article A with respect to the image G01, but the first partial region R01 and the first frame W01. The processing contents of each processing will be described by taking as an example the case where each of the above is roughly specified by dragging the mouse.

認識処理SA100では、処理装置10は、認識部110として機能し、利用者によって指定される第1部分領域と、利用者に指定される第1枠と、を認識する。本動作例の認識処理SA100では、図8に示す第1部分領域R01及び第1枠W01が、入力装置40から与えられる操作内容データに基づいて認識される。 In the recognition process SA100, the processing device 10 functions as the recognition unit 110 and recognizes the first subregion designated by the user and the first frame designated by the user. In the recognition process SA100 of this operation example, the first partial region R01 and the first frame W01 shown in FIG. 8 are recognized based on the operation content data given from the input device 40.

輪郭候補特定処理SA110では、処理装置10は、輪郭候補特定部120として機能し、認識処理SA100にて認識済みの第1部分領域及び認識部110の認識する第1枠に基づいて、当該第1部分領域を含み且つ当該第1枠を含まないように抽出対象領域の輪郭候補を特定する。図7に示す画像G01に前述のwatershed法の処理を施すと、輝度の低い領域と輝度の高い領域の輪郭として、物品Aの輪郭と、物品Bの輪郭と、物品Cの輪郭が特定される。これら3つの輪郭のうち、第1部分領域R01を含み。且つ第1枠W01を含まないのは、物品Aの輪郭のみである。したがって、輪郭候補特定処理SA110では、図9に示すように、物品Aの輪郭と略同じ輪郭候補Z01が特定される。 In the contour candidate identification process SA110, the processing device 10 functions as the contour candidate identification unit 120, and the first portion region recognized by the recognition process SA100 and the first frame recognized by the recognition unit 110 are used. The contour candidates of the extraction target area are specified so as to include the partial area and not include the first frame. When the above-mentioned watershed method is applied to the image G01 shown in FIG. 7, the contour of the article A, the contour of the article B, and the contour of the article C are specified as the contours of the low-luminance region and the high-luminance region. .. Of these three contours, the first partial region R01 is included. Moreover, only the outline of the article A does not include the first frame W01. Therefore, in the contour candidate identification process SA110, as shown in FIG. 9, the contour candidate Z01 which is substantially the same as the contour of the article A is specified.

更新処理SA120では、処理装置10は、更新部140として機能し、輪郭候補特定処理SA110にて特定済みの輪郭候補に基づいて、輪郭候補内の第2部分領域と、輪郭候補外であって輪郭候補を囲む第2枠を生成する。本動作例では、輪郭候補特定処理SA110にて、図9に示すように輪郭候補Z01が特定されている。更新処理SA120では、図10に示すように、輪郭候補Z01を収縮させて得られる輪郭を有する第2部分領域R02と、輪郭候補Z01を膨張させて得られる第2枠W02とが生成される。 In the update processing SA120, the processing device 10 functions as an update unit 140, and based on the contour candidate identified by the contour candidate identification processing SA110, the second partial region in the contour candidate and the contour outside the contour candidate and outside the contour candidate. Generate a second frame that surrounds the candidate. In this operation example, the contour candidate Z01 is specified by the contour candidate identification process SA110 as shown in FIG. In the update process SA120, as shown in FIG. 10, a second partial region R02 having a contour obtained by contracting the contour candidate Z01 and a second frame W02 obtained by expanding the contour candidate Z01 are generated.

領域特定処理SA130では、処理装置10は、領域特定部150として機能し、更新処理SA120にて生成済の第2部分領域及び第2枠に基づいて、第2部分領域を含み且つ第2枠を含まないように抽出対象領域を特定する。本動作例では、更新処理SA120にて、図10に示すように第2部分領域R02と第2枠W02とが生成されている。このため、領域特定処理SA130では、前掲図9に示す輪郭候補Z01と同様に、部材Aの輪郭と略同じ輪郭を有する抽出対象領域が特定される。 In the area specifying process SA130, the processing device 10 functions as the area specifying unit 150, and includes the second partial area and includes the second frame based on the second partial area and the second frame generated by the update process SA120. Specify the extraction target area so that it is not included. In this operation example, the second partial region R02 and the second frame W02 are generated in the update process SA120 as shown in FIG. Therefore, in the area identification process SA130, an extraction target area having substantially the same contour as the contour of the member A is specified as in the contour candidate Z01 shown in FIG. 9 above.

以降、物品Aについての外観検査では、検査装置1は、検査対象物画像が入力される毎に、記憶装置50に記憶されたマスク情報にしたがって検査対象領域を抽出し、外観検査が行われる。 After that, in the visual inspection of the article A, the inspection device 1 extracts the inspection target area according to the mask information stored in the storage device 50 every time the inspection target image is input, and the visual inspection is performed.

以上に説明した動作例において領域特定処理SA130にて特定される抽出対象領域の輪郭は、輪郭候補特定処理SA110にて特定される輪郭候補と略同じであるため、更新処理SA120及び領域特定処理SA130は不要な処理であるかのように見える。本実施形態において更新処理SA120及び領域特定処理SA130を設けた理由は次の通りである。 Since the contour of the extraction target area specified by the area identification process SA130 in the operation example described above is substantially the same as the contour candidate specified by the contour candidate identification process SA110, the update process SA120 and the area identification process SA130 Seems to be unnecessary processing. The reason why the update process SA120 and the area identification process SA130 are provided in this embodiment is as follows.

抽出対象領域の抽出元となる画像が図11に示す画像G02であったとする。図11に示す画像G02には図7の画像G01と同様に物品A、物品Bおよび物品Cが写っているが、物品Bが物品Aに近接して写っている点が画像G01と異なる。画像G02に対して、利用者が、図11に示すように第1部分領域R01と第1枠W01とを大まかに指定すると、図12に示すように物品Bの輪郭を含む輪郭候補Z01´が輪郭候補特定処理SA110にて特定される場合がある。更新処理SA120及び領域特定処理SA130を行わないとすると、図12に示す輪郭候補Z01´を抽出対象領域の輪郭とすることとなり、物品Bの輪郭を含む分だけ、背景の相違等に起因する欠陥の誤検知が発生し易くなる。これに対して、輪郭候補特定処理SA110に後続して更新処理SA120及び領域特定処理SA130を行うようにすると、図13に示す第2部分領域R02´及び第2枠W02´が更新処理SA120にて生成され、領域特定処理SA130では、上記動作例と同様に物品Aの輪郭と略同じ輪郭を有する抽出対象領域が特定される。つまり、更新処理SA120及び領域特定処理SA130は、物品の位置が若干ズレて撮像されている等、抽出対象領域の抽出元となる画像にバラツキがある状況下で、利用者が第1部分領域及び第1枠を大まかに指定しても、抽出対象領域を精度良く抽出できるようにするために設けられている。これが、更新処理SA120及び領域特定処理SA130を設けた理由である。 It is assumed that the image that is the extraction source of the extraction target area is the image G02 shown in FIG. The image G02 shown in FIG. 11 shows the article A, the article B, and the article C as in the image G01 of FIG. 7, but differs from the image G01 in that the article B is shown close to the article A. When the user roughly specifies the first partial region R01 and the first frame W01 with respect to the image G02 as shown in FIG. 11, the contour candidate Z01 ′ including the contour of the article B is generated as shown in FIG. It may be specified by the contour candidate identification process SA110. If the update process SA120 and the area identification process SA130 are not performed, the contour candidate Z01'shown in FIG. 12 will be the contour of the extraction target region, and the defect due to the difference in background or the like will be included as much as the contour of the article B is included. False positives are more likely to occur. On the other hand, when the update process SA120 and the area identification process SA130 are performed after the contour candidate identification process SA110, the second partial area R02'and the second frame W02'shown in FIG. 13 are in the update process SA120. In the generated area identification process SA130, an extraction target area having substantially the same contour as the contour of the article A is specified as in the above operation example. That is, in the update processing SA120 and the area identification processing SA130, the user can use the first partial area and the area identification process SA130 in a situation where the image of the extraction source of the extraction target area varies, such as when the position of the article is slightly deviated. Even if the first frame is roughly specified, it is provided so that the extraction target area can be extracted with high accuracy. This is the reason why the update process SA120 and the area identification process SA130 are provided.

以上説明したように検査装置1は、認識部110と、輪郭候補特定部120と、更新部140と、領域特定部150と、を有する。認識部110は、利用者によって指定される抽出対象領域内の第1部分領域と、利用者に指定される抽出対象領域外であって抽出対象領域を囲む第1枠を認識する。輪郭候補特定部120は、第1部分領域及び第1枠に基づいて、第1部分領域を含み且つ第1枠を含まないように抽出対象領域の輪郭候補を特定する。更新部140は、輪郭候補に基づいて、輪郭候補内の第2部分領域と、輪郭候補外であって輪郭候補を囲む第2枠を生成する。そして、領域特定部150は、第2部分領域及び第2枠に基づいて、第2部分領域を含み且つ第2枠を含まないように抽出対象領域を特定する。このため、利用者が第1部分領域及び第1枠を大まかに指定したとしても、検査対象物の輪郭と略同じ輪郭を有する抽出対象領域を精度よく抽出することが可能になり、抽出対象領域に余分な背景が含まれていることに起因する欠陥の誤検出の発生を防ぐことができる。 As described above, the inspection device 1 has a recognition unit 110, a contour candidate identification unit 120, an update unit 140, and an area identification unit 150. The recognition unit 110 recognizes the first partial area in the extraction target area designated by the user and the first frame outside the extraction target area designated by the user and surrounding the extraction target area. The contour candidate specifying unit 120 specifies the contour candidate of the extraction target region based on the first partial region and the first frame so as to include the first partial region and not include the first frame. Based on the contour candidate, the update unit 140 generates a second partial region within the contour candidate and a second frame outside the contour candidate and surrounding the contour candidate. Then, the region specifying unit 150 specifies the extraction target region based on the second partial region and the second frame so as to include the second partial region and not to include the second frame. Therefore, even if the user roughly specifies the first subregion and the first frame, it is possible to accurately extract the extraction target region having substantially the same contour as the contour of the inspection target, and the extraction target region. It is possible to prevent the occurrence of false detection of defects due to the inclusion of extra background in.

また、検査装置1は、検査対象物画像、輪郭候補特定部120により特定された輪郭候補、利用者により指定された第1部分領域及び第1枠、を表示装置30に表示させる表示制御部100を有する。このため、検査装置1の利用者は、表示装置30に表示される検査対象物画像を目視確認しつつ、第1部分領域及び第1枠を指定することができる。また、利用者は、自身の指定した第1部分領域及び第1枠に応じて特定された輪郭候補を目視確認することができる。 Further, the inspection device 1 causes the display device 30 to display the image of the inspection object, the contour candidate specified by the contour candidate identification unit 120, the first partial region and the first frame designated by the user, and the display control unit 100. Has. Therefore, the user of the inspection device 1 can specify the first partial area and the first frame while visually checking the image of the inspection object displayed on the display device 30. In addition, the user can visually confirm the contour candidates specified according to the first subregion and the first frame designated by the user.

また、検査装置1は、認識部110により認識済みの第1部分領域及び第1枠の少なくとも一方の指定を無効化する無効化部130をさらに有する。このため、利用者は、輪郭候補特定部120により特定された輪郭候補に不満がある場合には、所望の輪郭候補が得られるまで、第1部分領域と第1枠の少なくとも一方の無効化及び再指定、輪郭候補特定部120による輪郭候補の特定、を繰り返すことができる。 Further, the inspection device 1 further includes an invalidation unit 130 that invalidates the designation of at least one of the first partial region and the first frame recognized by the recognition unit 110. Therefore, when the user is dissatisfied with the contour candidate specified by the contour candidate specifying unit 120, at least one of the first partial region and the first frame is invalidated until a desired contour candidate is obtained. Redesignation and identification of contour candidates by the contour candidate identification unit 120 can be repeated.

B.その他の実施形態
上記実施形態に以下の変形を適宜組み合わせてもよい。
B. Other Embodiments The following modifications may be appropriately combined with the above embodiments.

(1)上記実施形態の検査装置1は、処理装置10の他に、撮像装置20、表示装置30、入力装置40、及び記憶装置50を含んでいた。しかし、撮像装置20、表示装置30、入力装置40、及び記憶装置50のうちの一又は複数、或いは全ては、LAN(Local Area Network)又はインターネットなどの電気通信回線を介して検査装置1に接続されてもよい。 (1) The inspection device 1 of the above embodiment includes an image pickup device 20, a display device 30, an input device 40, and a storage device 50 in addition to the processing device 10. However, one or more of the image pickup device 20, the display device 30, the input device 40, and the storage device 50, or all of them are connected to the inspection device 1 via a telecommunication line such as a LAN (Local Area Network) or the Internet. May be done.

(2)上記実施形態における表示制御部100、認識部110、輪郭候補特定部120、無効化部130、更新部140、領域特定部150、及び外観検査部160の各部は、ソフトウェアである制御プログラム510にしたがってコンピューターが実現するソフトウェアモジュールであった。しかし、表示制御部100、認識部110、輪郭候補特定部120、無効化部130、更新部140、領域特定部150、及び外観検査部160の各部をASICなどのハードウェアで実現し、これらハードウェアを組み合わせて検査装置1を構成してもよい。 (2) Each part of the display control unit 100, the recognition unit 110, the contour candidate identification unit 120, the invalidation unit 130, the update unit 140, the area identification unit 150, and the appearance inspection unit 160 in the above embodiment is a control program that is software. It was a software module realized by a computer according to 510. However, each part of the display control unit 100, the recognition unit 110, the contour candidate identification unit 120, the invalidation unit 130, the update unit 140, the area identification unit 150, and the appearance inspection unit 160 is realized by hardware such as ASIC, and these hardwares are realized. The inspection device 1 may be configured by combining hardware.

(3)上記実施形態の更新部140は、輪郭候補特定部120により特定済みの輪郭候補を収縮させて第2部分領域を生成したが、認識部110により認識される第1部分領域、すなわち利用者の指定する第1部分領域を含むように第2部分領域を生成してもよい。その理由は次の通りである。 (3) The update unit 140 of the above embodiment shrinks the contour candidate identified by the contour candidate identification unit 120 to generate the second partial region, but the first partial region recognized by the recognition unit 110, that is, the use The second subregion may be generated so as to include the first subregion specified by the person. The reason is as follows.

例えば、図14における物品Aが検査対象物であり、図14にて斜め線のハッチングで示す部分が検査において特に注目すべき箇所であったとする。このような場合、前掲図10に示すように輪郭候補Z01を収縮させて第2部分領域R02を生成すると、図14に示すように、検査において注目すべき箇所の一部が第2部分領域R02からはみ出すことが起こり得る。このように、検査において着目すべき箇所の一部が第2部分領域R02からはみ出していると、検査において注目すべき箇所の一部を含まない抽出対象領域が特定される可能性がある。 For example, it is assumed that the article A in FIG. 14 is an object to be inspected, and the portion indicated by the hatching of the diagonal line in FIG. 14 is a particularly noteworthy part in the inspection. In such a case, when the contour candidate Z01 is contracted to generate the second partial region R02 as shown in FIG. 10 above, as shown in FIG. 14, a part of the portion notable in the inspection is the second partial region R02. It can happen that it sticks out. As described above, when a part of the portion to be noted in the inspection protrudes from the second partial region R02, there is a possibility that the extraction target region not including a part of the portion to be noted in the inspection is specified.

これに対して、図15に示すように、検査において注目すべき箇所を全て含むように利用者に第1部分領域R01´を指定させ、図16に示す第2部分領域R02´´のように当該第1部分領域R01´を含む第2部分領域を更新部140に生成させるようにすれば、抽出対象領域には当該着目すべき箇所が全て含まれることになり、当該箇所の検査漏れを確実に回避することが可能になる。なお、利用者の指定する第1部分領域を含む第2部分領域の生成態様としては、図17に示すように、利用者の指定する第1部分領域R01´と、輪郭候補Z01を収縮させて得られる第2部分領域R02とを重ね合わせて得られる領域を第2部分領域R02´´とする態様が考えられる。 On the other hand, as shown in FIG. 15, the user is made to specify the first subregion R01 ′ so as to include all the points of interest in the inspection, and the second subregion R02 ″ is shown in FIG. If the update unit 140 is made to generate the second partial region including the first partial region R01', the extraction target region includes all the points of interest, and the inspection omission of the relevant portion is ensured. It becomes possible to avoid it. As a mode of generating the second partial region including the first partial region designated by the user, as shown in FIG. 17, the first partial region R01'designated by the user and the contour candidate Z01 are contracted. It is conceivable that the region obtained by superimposing the obtained second partial region R02 is referred to as the second partial region R02 ″.

(4)上記実施形態では、表示装置30に表示される検査対象物画像に対する操作により第1部分領域及び第1枠を利用者に指定させた。しかし、検査対象物画像を印刷済みの記録用紙に対して、第1部分領域を示す目印及び第1枠を示す目印を各々異なる表記態様で利用者に追記させ、これら目印の追記された記録用紙をスキャナーで読み込み、読み込んだ画像に対する画像処理によって上記各目印に基づいて第1部分領域及び第1枠を認識部110に検出させてもよい。この態様においては、検査対象物画像、抽出対象領域、第1部分領域及び第1枠の表示装置30への表示は必須ではないから、表示制御部100は省略可能である。また、利用者の指定する第1部分領域の無効化及び第1枠の無効化も必須ではないから、無効化部130も省略可能である。 (4) In the above embodiment, the user is made to specify the first partial area and the first frame by operating the inspection object image displayed on the display device 30. However, on the recording paper on which the image of the inspection object is printed, the user is made to add a mark indicating the first partial area and a mark indicating the first frame in different notation modes, and the recording paper on which these marks are added is added. May be read by a scanner, and the recognition unit 110 may detect the first partial region and the first frame based on each of the above marks by image processing on the read image. In this embodiment, the display of the inspection target image, the extraction target region, the first partial region, and the first frame on the display device 30 is not essential, so that the display control unit 100 can be omitted. Further, since the invalidation of the first partial area and the invalidation of the first frame designated by the user are not essential, the invalidation unit 130 can also be omitted.

(5)上記実施形態の検査装置1は検査対象領域の抽出と外観検査とを実行したが、検査対象領域の抽出と外観検査の各々を別箇の装置に実行させてもよい。具体的には、認識部110、輪郭候補特定部120、更新部140、及び領域特定部150を組み合わせて構成した画像処理装置に、外観検査部160として機能する他の装置を接続して検査装置1を構成してもよい。また、上記画像処理装置を単体で製造又は販売してもよい。上記画像処理装置は、外観検査における検査対象領域の抽出だけでなく、顔認証のための顔領域の抽出など、他の用途にも利用可能だからである。 (5) Although the inspection device 1 of the above embodiment executes the extraction of the inspection target area and the visual inspection, each of the extraction of the inspection target area and the visual inspection may be executed by another device. Specifically, an inspection device in which another device functioning as an appearance inspection unit 160 is connected to an image processing device configured by combining a recognition unit 110, a contour candidate identification unit 120, an update unit 140, and an area identification unit 150. 1 may be configured. Further, the image processing apparatus may be manufactured or sold as a single unit. This is because the image processing device can be used not only for extracting the inspection target area in the visual inspection but also for other purposes such as extracting the face area for face recognition.

(6)上記実施形態では、図6に示す画像処理方法の各処理を処理装置10に実行させた。しかし、図6における4つの処理の各々を異なる装置に実行させてもよい。要は、入力画像のうち画像を抽出する抽出対象領域を特定する画像処理方法であって、以下の認識処理と、輪郭候補特定処理と、更新処理と、領域特定処理とを含む画像処理方法であればよい、認識処理では、利用者によって指定される抽出対象領域内の第1部分領域と、利用者に指定される抽出対象領域外であって抽出対象領域を囲む第1枠を認識する。輪郭特定処理では、第1部分領域及び前記第1枠に基づいて、第1部分領域を含み且つ第1枠を含まないように抽出対象領域の輪郭候補を特定する。更新処理では、輪郭候補に基づいて、輪郭候補内の第2部分領域と、輪郭候補外であって輪郭候補を囲む第2枠を生成する。そして、領域特定処理では、第2部分領域及び第2枠に基づいて、第2部分領域を含み且つ第2枠を含まないように抽出対象領域を特定する。 (6) In the above embodiment, each process of the image processing method shown in FIG. 6 is executed by the processing device 10. However, each of the four processes in FIG. 6 may be performed by a different device. In short, it is an image processing method that specifies an extraction target area for extracting an image from the input image, and is an image processing method that includes the following recognition processing, contour candidate identification processing, update processing, and area identification processing. In the recognition process, the first sub-region within the extraction target area designated by the user and the first frame outside the extraction target area designated by the user and surrounding the extraction target area are recognized. In the contour specifying process, the contour candidates of the extraction target region are specified based on the first partial region and the first frame so as to include the first partial region and not include the first frame. In the update process, a second subregion within the contour candidate and a second frame outside the contour candidate and surrounding the contour candidate are generated based on the contour candidate. Then, in the area identification process, the extraction target area is specified based on the second partial area and the second frame so as to include the second partial area and not include the second frame.

(7)上記実施形態では、処理装置10を、認識部110と、輪郭候補特定部120と、更新部140と、領域特定部150と、して機能させる制御プログラム510が記憶装置50に予め記憶されていた。しかし、一般的なコンピューターを、認識部110と、輪郭候補特定部120と、更新部140と、領域特定部150と、して機能させるプログラムを単体で製造し、配布してもよい。このプログラムにしたがって一般的なコンピューターを作動させることで、当該コンピューターを上記画像処理装置として機能させることが可能になるからである。なお、上記プログラムの具体的な配布方法としては、フラッシュROM(Read Only Memory)などのコンピューター読み取り可能な記録媒体に上記プログラムを書き込んで配布する態様や、インターネットなどの電気通信回線経由のダウンロードにより配布する態様が考えられる。 (7) In the above embodiment, the control program 510 that causes the processing device 10 to function as the recognition unit 110, the contour candidate identification unit 120, the update unit 140, and the area identification unit 150 is stored in the storage device 50 in advance. It had been. However, a program that causes a general computer to function as a recognition unit 110, a contour candidate identification unit 120, an update unit 140, and an area identification unit 150 may be manufactured and distributed as a single unit. This is because by operating a general computer according to this program, the computer can function as the image processing device. As a specific distribution method of the above program, the above program is written and distributed on a computer-readable recording medium such as a flash ROM (Read Only Memory), or is distributed by downloading via a telecommunication line such as the Internet. The mode of doing so is conceivable.

(8)上記実施形態では、第1部分領域および第1枠を利用者が指定していたが、検査装置1が検査対象物画像を認識して、その検査対象物画像に基づいて検査装置1が自動的に第1部分領域および第1枠を指定するようにしてもよい。また、利用者の代わりに検査ロボット等が第1部分領域および第1枠を指定するようにしてもよい。
本開示は上記の実施形態に限らず、本開示の主旨を逸脱しない範囲で広く適用が可能である。
(8) In the above embodiment, the user has designated the first partial region and the first frame, but the inspection device 1 recognizes the inspection object image, and the inspection device 1 is based on the inspection object image. May automatically specify the first subregion and the first frame. Further, the inspection robot or the like may specify the first subregion and the first frame instead of the user.
The present disclosure is not limited to the above-described embodiment, and can be widely applied without departing from the gist of the present disclosure.

1…検査装置、10…処理装置、100…表示制御部、110…認識部、120…輪郭候補特定部、130…無効化部、140…更新部、150…領域特定部、160…外観検査部、20…撮像装置、30…表示装置、40…入力装置、50…記憶装置、510…制御プログラム、60…バス。 1 ... Inspection device, 10 ... Processing device, 100 ... Display control unit, 110 ... Recognition unit, 120 ... Contour candidate identification unit, 130 ... Invalidation unit, 140 ... Update unit, 150 ... Area identification unit, 160 ... Appearance inspection unit , 20 ... Imaging device, 30 ... Display device, 40 ... Input device, 50 ... Storage device, 510 ... Control program, 60 ... Bus.

Claims (8)

入力画像のうち画像を抽出する抽出対象領域を特定する画像処理装置であって、
前記抽出対象領域内の第1部分領域と、前記抽出対象領域外であって前記抽出対象領域を囲む第1枠を認識する認識部と、
前記第1部分領域及び前記第1枠に基づいて、前記第1部分領域を含み且つ前記第1枠を含まないように前記抽出対象領域の輪郭候補を特定する輪郭候補特定部と、
前記輪郭候補に基づいて、前記輪郭候補内の第2部分領域と、前記輪郭候補外であって前記輪郭候補を囲む第2枠を生成する更新部と、
前記第2部分領域及び前記第2枠に基づいて、前記第2部分領域を含み且つ前記第2枠を含まないように前記抽出対象領域を特定する領域特定部と、
を備える画像処理装置。
An image processing device that specifies an extraction target area for extracting an image from an input image.
A first partial region within the extraction target region, a recognition unit outside the extraction target region and recognizing a first frame surrounding the extraction target region, and a recognition unit.
A contour candidate specifying unit that specifies contour candidates of the extraction target region so as to include the first partial region and not include the first frame based on the first partial region and the first frame.
Based on the contour candidate, a second partial region in the contour candidate, an update unit outside the contour candidate and generating a second frame surrounding the contour candidate, and
A region specifying portion that specifies the extraction target region so as to include the second partial region and not include the second frame based on the second partial region and the second frame.
An image processing device comprising.
前記画像、前記第1部分領域、前記第1枠、及び前記輪郭候補特定部により特定済みの前記輪郭候補、を表示装置に表示させる表示制御部を有する、ことを特徴とする請求項1に記載の画像処理装置。 The first aspect of claim 1, wherein the display control unit has a display control unit for displaying the image, the first partial region, the first frame, and the contour candidate identified by the contour candidate specifying unit on a display device. Image processing equipment. 前記第1領域と前記第1枠の少なくとも一方を無効化する無効化部をさらに有することを特徴とする請求項2に記載の画像処理装置。 The image processing apparatus according to claim 2, further comprising an invalidation unit that invalidates at least one of the first region and the first frame. 前記更新部は、前記輪郭候補特定部により特定済の輪郭候補を収縮させて前記第2部分領域を生成し、前記輪郭候補特定部により特定済の輪郭候補を膨張させて前記第2枠を生成することを特徴とする請求項1から3うちの何れか1項に記載の画像処理装置。 The update unit contracts the contour candidate identified by the contour candidate specifying unit to generate the second partial region, and expands the contour candidate identified by the contour candidate specifying unit to generate the second frame. The image processing apparatus according to any one of claims 1 to 3, wherein the image processing apparatus is used. 前記更新部は、前記第1部分領域を含むように前記第2部分領域を生成することを特徴とする請求項1から3のうちの何れか1項に記載の画像処理装置。 The image processing apparatus according to any one of claims 1 to 3, wherein the updating unit generates the second partial region so as to include the first partial region. 入力画像のうち検査対象物に対応する抽出対象領域を抽出するために前記抽出対象領域内の第1部分領域と、前記抽出対象領域外であって前記抽出対象領域を囲む第1枠を認識する認識部と、
前記第1部分領域及び前記第1枠に基づいて、前記第1部分領域を含み且つ前記第1枠を含まないように前記抽出対象領域の輪郭候補を特定する輪郭候補特定部と、
前記輪郭候補に基づいて、前記輪郭候補内の第2部分領域と、前記輪郭候補外であって前記輪郭候補を囲む第2枠を生成する更新部と、
前記第2部分領域及び前記第2枠に基づいて、前記第2部分領域を含み且つ前記第2枠を含まないように前記抽出対象領域を特定する領域特定部と、
入力画像のうち前記領域特定部により特定済みの前記抽出対象領域の画像を参照して前記検査対象物の外観検査を行う外観検査部と、
を備える検査装置。
In order to extract the extraction target area corresponding to the inspection target object in the input image, the first partial area in the extraction target area and the first frame outside the extraction target area and surrounding the extraction target area are recognized. Recognition part and
A contour candidate specifying unit that specifies contour candidates of the extraction target region so as to include the first partial region and not include the first frame based on the first partial region and the first frame.
Based on the contour candidate, a second partial region in the contour candidate, an update unit outside the contour candidate and generating a second frame surrounding the contour candidate, and
A region specifying portion that specifies the extraction target region so as to include the second partial region and not include the second frame based on the second partial region and the second frame.
Of the input images, an appearance inspection unit that inspects the appearance of the inspection object by referring to the image of the extraction target area identified by the area identification unit, and
Inspection device equipped with.
入力画像のうち画像を抽出する抽出対象領域を特定する画像処理方法であって、前記抽出対象領域内の第1部分領域と、前記抽出対象領域外であって前記抽出対象領域を囲む第1枠を認識し、前記第1部分領域及び前記第1枠に基づいて、前記第1部分領域を含み且つ前記第1枠を含まないように前記抽出対象領域の輪郭候補を特定し、前記輪郭候補に基づいて、前記輪郭候補内の第2部分領域と、前記輪郭候補外であって前記輪郭候補を囲む第2枠を生成し、前記第2部分領域及び前記第2枠に基づいて、前記第2部分領域を含み且つ前記第2枠を含まないように前記抽出対象領域を特定する、画像処理方法。 An image processing method for specifying an extraction target area for extracting an image from an input image, which is a first partial area within the extraction target area and a first frame outside the extraction target area and surrounding the extraction target area. Is recognized, and based on the first partial region and the first frame, contour candidates of the extraction target region are specified so as to include the first partial region and not include the first frame, and the contour candidates are selected as the contour candidates. Based on this, a second partial region within the contour candidate and a second frame outside the contour candidate that surrounds the contour candidate are generated, and based on the second partial region and the second frame, the second frame is generated. An image processing method for specifying the extraction target area so as to include a partial area and not include the second frame. コンピューターを、
入力画像のうち画像の抽出対象となる抽出対象領域を特定するために前記抽出対象領域内の第1部分領域と、前記抽出対象領域外であって前記抽出対象領域を囲む第1枠を認識する認識部と、
前記第1部分領域及び前記第1枠に基づいて、前記第1部分領域を含み且つ前記第1枠を含まないように前記抽出対象領域の輪郭候補を特定する輪郭候補特定部と、
前記輪郭候補に基づいて、前記輪郭候補内の第2部分領域と、前記輪郭候補外であって前記輪郭候補を囲む第2枠を生成する更新部と、
前記第2部分領域及び前記第2枠に基づいて、前記第2部分領域を含み且つ前記第2枠を含まないように前記抽出対象領域を特定する領域特定部と、
して機能させる、プログラム。
Computer,
In order to specify the extraction target area of the input image to be extracted, the first partial area in the extraction target area and the first frame outside the extraction target area and surrounding the extraction target area are recognized. Recognition part and
A contour candidate specifying unit that specifies contour candidates of the extraction target region so as to include the first partial region and not include the first frame based on the first partial region and the first frame.
Based on the contour candidate, a second partial region in the contour candidate, an update unit outside the contour candidate and generating a second frame surrounding the contour candidate, and
A region specifying portion that specifies the extraction target region so as to include the second partial region and not include the second frame based on the second partial region and the second frame.
A program that works.
JP2019045710A 2019-03-13 2019-03-13 Image processing apparatus, inspection device, image processing method, and program Pending JP2020148586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019045710A JP2020148586A (en) 2019-03-13 2019-03-13 Image processing apparatus, inspection device, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019045710A JP2020148586A (en) 2019-03-13 2019-03-13 Image processing apparatus, inspection device, image processing method, and program

Publications (1)

Publication Number Publication Date
JP2020148586A true JP2020148586A (en) 2020-09-17

Family

ID=72429623

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019045710A Pending JP2020148586A (en) 2019-03-13 2019-03-13 Image processing apparatus, inspection device, image processing method, and program

Country Status (1)

Country Link
JP (1) JP2020148586A (en)

Similar Documents

Publication Publication Date Title
KR100785594B1 (en) Image process apparatus
JP4001162B2 (en) Image processing method, image processing program and storage medium therefor, and image processing apparatus
JP6317725B2 (en) System and method for determining clutter in acquired images
JP7118277B2 (en) Inspection device, inspection method and program
JP7214432B2 (en) Image processing method, image processing program, recording medium, image processing apparatus, production system, article manufacturing method
JPWO2009057619A1 (en) House change judgment method, house change judgment program, house change judgment image generation method, and house change judgment image
US20200074666A1 (en) Method of operating measurement device, measurement device, and recording medium
JP5791475B2 (en) Image processing apparatus, image processing method, and image processing program
JP2010082245A (en) Hair information measuring method
TW201447811A (en) Method for partitioning area, and inspection device
JP5772675B2 (en) Gray image edge extraction method, edge extraction device, and gray image edge extraction program
JP2002140713A (en) Image processing method and image processor
JP2020148586A (en) Image processing apparatus, inspection device, image processing method, and program
JP2007026423A (en) Image processor and image processing method
JP2011058806A (en) Image processor and program
JP2000092319A (en) Device and method for deciding scratch part on image and storage medium
CN111524171B (en) Image processing method and device and electronic equipment
TWI450572B (en) Computing system and method for scanning a boundary of an image of an object
JP5385048B2 (en) Image processing apparatus and program
JP5519202B2 (en) Image processing apparatus and program
JP4351090B2 (en) Image processing apparatus and image processing method
JP2008269131A (en) Image processor and image processing program
JP2007104296A (en) Method, apparatus, and program for measuring resolution
JP2002140695A (en) Inspection method and its device
JP5745128B2 (en) Image processing device