JP7380332B2 - Image processing device, control method and program for the image processing device - Google Patents

Image processing device, control method and program for the image processing device Download PDF

Info

Publication number
JP7380332B2
JP7380332B2 JP2020035235A JP2020035235A JP7380332B2 JP 7380332 B2 JP7380332 B2 JP 7380332B2 JP 2020035235 A JP2020035235 A JP 2020035235A JP 2020035235 A JP2020035235 A JP 2020035235A JP 7380332 B2 JP7380332 B2 JP 7380332B2
Authority
JP
Japan
Prior art keywords
processing
image
item
setting
images
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2020035235A
Other languages
Japanese (ja)
Other versions
JP2021140270A (en
Inventor
健利 松田
博幸 枦山
智大 荒野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP2020035235A priority Critical patent/JP7380332B2/en
Publication of JP2021140270A publication Critical patent/JP2021140270A/en
Application granted granted Critical
Publication of JP7380332B2 publication Critical patent/JP7380332B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本開示は、画像処理装置、画像処理装置の制御方法およびプログラムに関する。 The present disclosure relates to an image processing device, a method of controlling the image processing device, and a program.

FA(Factory Automation)分野において、ワークなどの検査対象物を自動で検査するための技術が普及している。ワークの検査処理は、様々な処理項目の組み合わせによって実現される。各処理項目の実行に用いられるパラメータを容易に設定するためのユーザインターフェイスを提供するアプリケーションが開発されている。 2. Description of the Related Art In the field of FA (Factory Automation), technology for automatically inspecting objects to be inspected such as workpieces has become widespread. Workpiece inspection processing is realized by a combination of various processing items. Applications have been developed that provide user interfaces to easily set parameters used to execute each process item.

例えば、特開2012-123777号公報(特許文献1)には、画像処理フローのうち、パラメータの設定された画像処理アイテムを抽出して表示する情報処理装置が開示されている。情報処理装置は、表示された画像処理アイテムのうちユーザに指定された画像処理アイテムを、パラメータの参照先として設定する。情報処理装置は、画像処理を実行する場合、参照先が設定されている画像処理アイテムについて参照先の画像処理アイテムからパラメータを取得して画像処理を実行する。 For example, Japanese Patent Application Publication No. 2012-123777 (Patent Document 1) discloses an information processing apparatus that extracts and displays image processing items for which parameters are set from an image processing flow. The information processing apparatus sets the image processing item specified by the user among the displayed image processing items as a reference destination for the parameter. When performing image processing, the information processing apparatus acquires parameters from the image processing item to which the reference destination is set, and executes the image processing.

特開2012-123777号公報Japanese Patent Application Publication No. 2012-123777

特許文献1に記載の技術は、別の画像処理アイテムのパラメータを援用できる場合に限り有効である。すなわち、別の画像処理アイテムのパラメータを援用できない場合には、パラメータの設定に手間がかかる。 The technique described in Patent Document 1 is effective only when parameters of another image processing item can be used. That is, if the parameters of another image processing item cannot be used, it takes time and effort to set the parameters.

本開示は、上記の問題に鑑みてなされたものであり、その目的は、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間を削減可能な画像処理装置、画像処理装置の制御方法およびプログラムを提供することである。 The present disclosure has been made in view of the above problems, and the purpose is to provide an image processing device and an image processing device that can reduce the effort of setting parameters used to execute processing items that constitute an image processing flow. The object of the present invention is to provide a control method and program.

本開示の一例によれば、複数の処理項目が実行順序に従って並べられた画像処理フローを実行する画像処理装置は、生成部と設定部とを備える。生成部は、複数の処理項目のうち指定された処理項目の実行に用いられるパラメータの設定指示の入力に応じて、複数の設定用画像に対して画像処理フローの一部または全部を実行することにより、指定された処理項目の前段までの処理項目が実行された複数の処理済画像をそれぞれ生成する。設定部は、複数の処理済画像を用いてパラメータの値を設定する。 According to an example of the present disclosure, an image processing apparatus that executes an image processing flow in which a plurality of processing items are arranged in an execution order includes a generation unit and a setting unit. The generation unit executes part or all of the image processing flow on the plurality of setting images in response to input of an instruction to set parameters used for executing a specified processing item among the plurality of processing items. As a result, a plurality of processed images in which the processing items up to the stage preceding the specified processing item have been executed are respectively generated. The setting unit sets parameter values using a plurality of processed images.

この開示によれば、パラメータの設定指示の入力に応じて、指定された処理項目の前段までの処理項目が実行された複数の処理済画像が自動的に生成される。さらに、生成された複数の処理済画像を用いてパラメータの値が設定される。これにより、複数の処理済画像を収集するための手間が削減される。これにより、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間を削減できる。 According to this disclosure, in response to an input of a parameter setting instruction, a plurality of processed images in which processing items up to a specified processing item are executed are automatically generated. Further, parameter values are set using the plurality of generated processed images. This reduces the effort required to collect multiple processed images. As a result, it is possible to reduce the effort required to set parameters used to execute processing items that constitute an image processing flow.

上述の開示において、設定部は、パラメータが取りうる複数の値の各々について、当該値を用いて、複数の処理済画像に対して指定された処理項目を実行することにより複数の処理結果をそれぞれ取得する。設定部は、複数の処理結果に基づいて複数の値の中から選択された値をパラメータの値として設定する。 In the above disclosure, the setting unit executes a specified processing item on the plurality of processed images using each of the plurality of values that the parameter can take, thereby obtaining the plurality of processing results. get. The setting unit sets a value selected from the plurality of values as the value of the parameter based on the plurality of processing results.

上記の開示によれば、複数の処理結果を参考にしながら、パラメータが取りうる複数の値の中から適切な値が選択される。 According to the above disclosure, an appropriate value is selected from among a plurality of values that the parameter can take, with reference to a plurality of processing results.

上述の開示において、設定部は、複数の処理結果と、複数の設定用画像に対してそれぞれ予め設定された複数の正解値との差分を示す差分情報を生成する。設定部は、複数の値の各々と差分情報との対応関係を表示装置に表示させる。設定部は、複数の値の中から選択指示を受けた値を、パラメータの値として設定する。 In the above disclosure, the setting unit generates difference information indicating the difference between the plurality of processing results and the plurality of correct values set in advance for the plurality of setting images. The setting unit causes the display device to display the correspondence between each of the plurality of values and the difference information. The setting unit sets a value that has been selected from among the plurality of values as a value of the parameter.

上記の開示によれば、ユーザは、表示装置に表示された、複数の値の各々と差分情報との対応関係を見ながら、最適な値を選択できる。 According to the above disclosure, the user can select the optimal value while viewing the correspondence between each of the plurality of values and the difference information displayed on the display device.

上述の開示において、設定部は、複数の処理結果が、複数の設定用画像に対してそれぞれ予め設定された複数の正解値に近づくように、パラメータの値を最適化する。 In the above disclosure, the setting unit optimizes the values of the parameters so that the plurality of processing results approach the plurality of correct values set in advance for the plurality of setting images.

上記の開示によれば、指定された処理項目の処理結果が正解値に近づくように、パラメータの値が自動的に設定される。これにより、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間をさらに削減できる。 According to the above disclosure, the value of the parameter is automatically set so that the processing result of the designated processing item approaches the correct value. This can further reduce the effort required to set parameters used to execute the processing items that make up the image processing flow.

上述の開示において、設定部は、複数の処理結果から得られる特徴量が予め設定された基準値に近づくように、パラメータの値を最適化する。 In the above disclosure, the setting unit optimizes the value of the parameter so that the feature amount obtained from the plurality of processing results approaches a preset reference value.

上記の開示によれば、複数の処理結果から得られる特徴量が基準値に近づくように、パラメータの値が自動的に設定される。これにより、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間をさらに削減できる。 According to the above disclosure, the value of the parameter is automatically set so that the feature amount obtained from a plurality of processing results approaches the reference value. This can further reduce the effort required to set parameters used to execute the processing items that make up the image processing flow.

上述の開示において、複数の設定用画像の各々には対象物が写る。指定された処理項目は、前段の処理項目から出力された画像に写る対象物の属性を判定する項目である。複数の正解値は、複数の設定用画像に写る対象物の属性をそれぞれ示す。 In the above disclosure, each of the plurality of setting images includes an object. The specified processing item is an item for determining the attributes of the object appearing in the image output from the previous processing item. The plurality of correct answer values each indicate the attributes of the object appearing in the plurality of setting images.

例えば、指定された処理項目は、前段の処理項目から出力された画像から演算される特徴量とパラメータの値との比較結果に基づいて、対象物の属性を判定する項目である。 For example, the designated processing item is an item for determining the attributes of the object based on the comparison result between the feature amount calculated from the image output from the previous processing item and the value of the parameter.

上記の開示によれば、対象物の属性を判定する処理項目の実行に用いられるパラメータを容易に設定できる。 According to the above disclosure, it is possible to easily set the parameters used to execute the processing item for determining the attributes of the object.

上述の開示において、指定された処理項目は、複数の処理済画像を用いた機械学習を行なうことにより生成される学習済モデルを用いて対象物の属性を判定する項目である。パラメータは、学習済モデルを定義する。 In the above disclosure, the specified processing item is an item for determining the attributes of an object using a learned model generated by performing machine learning using a plurality of processed images. The parameters define the trained model.

上記の開示によれば、対象物の属性を判定するのに適した学習済モデルを容易に生成することができる。 According to the above disclosure, a trained model suitable for determining the attributes of an object can be easily generated.

上述の開示において、複数の設定用画像の各々には、特徴部分を含む対象物が写る。指定された処理項目は、特徴部分の写るモデル画像を用いて、前段の処理項目から出力された画像に写る特徴部分の位置を検出する項目である。複数の正解値は、複数の設定用画像に写る特徴部分の座標をそれぞれ示す。 In the above disclosure, each of the plurality of setting images depicts an object including a characteristic portion. The specified processing item is an item for detecting the position of the characteristic portion appearing in the image output from the previous processing item using a model image in which the characteristic portion appears. The plurality of correct answer values each indicate the coordinates of the characteristic portion shown in the plurality of setting images.

上記の開示によれば、特徴部分の位置を検出する処理項目の実行に用いられるパラメータを容易に設定できる。 According to the above disclosure, it is possible to easily set parameters used to execute a processing item for detecting the position of a characteristic portion.

上述の開示において、複数の設定用画像の各々にはテキストが写る。指定された処理項目は、前段の処理項目から出力された画像に写るテキストの文字認識を行なう項目である。複数の正解値は、複数の設定用画像に写るテキストをそれぞれ示す。 In the above disclosure, each of the plurality of setting images includes text. The specified processing item is an item that performs character recognition of the text appearing in the image output from the previous processing item. The plurality of correct answer values each indicate the text appearing in the plurality of setting images.

上記の開示によれば、文字認識を行なう処理項目の実行に用いられるパラメータを容易に設定できる。 According to the above disclosure, it is possible to easily set parameters used to execute a processing item for character recognition.

本開示の一例によれば、複数の処理項目が実行順序に従って並べられた画像処理フローを実行する画像処理装置の制御方法は、第1のステップと第2のステップとを備える。第1のステップは、複数の処理項目のうち指定された処理項目の実行に用いられるパラメータの値の設定指示の入力に応じて、複数の設定用画像に対して画像処理フローの一部または全部を実行することにより、指定された処理項目の前段までの処理項目が実行された複数の処理済画像をそれぞれ生成するステップである。第2のステップは、複数の処理済画像を用いてパラメータの値を設定するステップである。 According to an example of the present disclosure, a method for controlling an image processing apparatus that executes an image processing flow in which a plurality of processing items are arranged in an execution order includes a first step and a second step. The first step is to perform part or all of the image processing flow for a plurality of setting images in response to an input instruction for setting the value of a parameter used to execute a specified processing item among a plurality of processing items. This is a step of generating each of a plurality of processed images in which the processing items up to the stage preceding the designated processing item have been executed. The second step is to set parameter values using a plurality of processed images.

本開示の一例によれば、プログラムは、上記の制御方法をコンピュータに実行させる。これらの開示によっても、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間を削減できる。 According to an example of the present disclosure, a program causes a computer to execute the above control method. These disclosures can also reduce the effort required to set parameters used to execute processing items that constitute an image processing flow.

本開示によれば、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間を削減できる。 According to the present disclosure, it is possible to reduce the effort required to set parameters used to execute processing items that constitute an image processing flow.

本実施の形態に係る画像処理装置を含む画像処理システムの全体構成を示す概略図である。1 is a schematic diagram showing the overall configuration of an image processing system including an image processing device according to an embodiment. 画像処理フローを構成する処理項目に用いられるパラメータの設定方法の参考例を示す図である。FIG. 3 is a diagram illustrating a reference example of a method for setting parameters used for processing items that constitute an image processing flow. 画像処理フローを構成する処理項目に用いられるパラメータの設定方法の別の参考例を示す図である。FIG. 7 is a diagram illustrating another reference example of a method for setting parameters used for processing items that constitute an image processing flow. 本実施の形態に係る画像処理装置におけるパラメータの設定方法の一例を示す図である。FIG. 3 is a diagram illustrating an example of a parameter setting method in the image processing apparatus according to the present embodiment. 画像処理装置のハードウェア構成の一例を示す模式図である。FIG. 1 is a schematic diagram showing an example of a hardware configuration of an image processing device. 画像処理装置の機能構成の一例を示す図である。1 is a diagram illustrating an example of a functional configuration of an image processing device. 本実施の形態に係るパラメータ設定処理全体の流れの一例を示すフローチャートである。3 is a flowchart illustrating an example of the overall flow of parameter setting processing according to the present embodiment. 図7に示すステップS2のサブルーチンの処理の流れの一例を示すフローチャートである。8 is a flowchart showing an example of the process flow of the subroutine of step S2 shown in FIG. 7. FIG. 図7に示すステップS3のサブルーチンの処理の流れの一例を示すフローチャートである。8 is a flowchart showing an example of the process flow of the subroutine of step S3 shown in FIG. 7. FIG. 図7に示すステップS3のサブルーチンの処理の流れの別の例を示すフローチャートである。8 is a flowchart showing another example of the process flow of the subroutine of step S3 shown in FIG. 7. 動作例1においてパラメータ設定の対象となる画像処理フローを示す図である。3 is a diagram illustrating an image processing flow for which parameters are set in operation example 1. FIG. 動作例1においてパラメータの設定対象となる処理項目35Aの内容を示す図である。FIG. 7 is a diagram showing the contents of a processing item 35A for which parameters are set in operation example 1; 動作例1において、設定用画像に対する正解値を設定するときの画面を示す図である。FIG. 6 is a diagram showing a screen when setting a correct value for a setting image in operation example 1; 動作例1においてパラメータを設定するときの画面を示す図である。7 is a diagram showing a screen when setting parameters in operation example 1. FIG. 動作例1における処理結果の詳細情報を示すウィンドウの一例を示す図である。7 is a diagram showing an example of a window showing detailed information on processing results in operation example 1. FIG. 動作例2におけるワークWを示す図である。7 is a diagram showing a workpiece W in operation example 2. FIG. 動作例2においてパラメータ設定の対象となる画像処理フローを示す図である。7 is a diagram illustrating an image processing flow for which parameters are set in operation example 2. FIG. 動作例2においてパラメータの設定対象となる処理項目の内容を示す図である。7 is a diagram illustrating the contents of processing items for which parameters are set in operation example 2. FIG. 動作例2において準備される設定用画像の例を示す図である。7 is a diagram illustrating an example of a setting image prepared in operation example 2. FIG. 動作例2において、設定用画像に対する正解値を設定するときの画面を示す図である。FIG. 7 is a diagram showing a screen when setting a correct value for a setting image in operation example 2; 動作例2においてパラメータを設定するときの画面を示す図である。7 is a diagram showing a screen when setting parameters in operation example 2. FIG. 動作例2における処理結果の詳細情報を示すウィンドウの一例を示す図である。7 is a diagram showing an example of a window showing detailed information on processing results in operation example 2. FIG. 図22に示すボタン86の操作に応じて表示されるウィンドウを示す。23 shows a window displayed in response to the operation of button 86 shown in FIG. 22. 動作例3においてパラメータ設定の対象となる画像処理フローを示す図である。FIG. 7 is a diagram showing an image processing flow for which parameters are set in operation example 3; 図24に示す処理項目34Cの処理例を示す図である。25 is a diagram showing a processing example of processing item 34C shown in FIG. 24. FIG. 動作例3において、設定用画像に対する正解値を設定するときの画面を示す図である。FIG. 7 is a diagram showing a screen when setting a correct value for a setting image in operation example 3; 動作例3においてパラメータを設定するときの画面を示す図である。FIG. 7 is a diagram showing a screen when setting parameters in operation example 3; 動作例3における処理結果の詳細情報を示すウィンドウの一例を示す図である。12 is a diagram showing an example of a window showing detailed information on processing results in operation example 3. FIG.

本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。 Embodiments of the present invention will be described in detail with reference to the drawings. Note that the same or corresponding parts in the figures are given the same reference numerals and the description thereof will not be repeated.

§1 適用例
図1~図4を参照して、本発明の適用例について説明する。図1は、本実施の形態に係る画像処理装置を含む画像処理システムの全体構成を示す概略図である。図1に示されるように、画像処理システムSYSは、主要なコンポーネントとして、視覚センサとも称される画像処理装置1と、画像処理装置1に接続されたカメラ3と、画像処理装置1に接続された表示装置6および入力装置7とを含む。
§1 Application Examples Application examples of the present invention will be described with reference to FIGS. 1 to 4. FIG. 1 is a schematic diagram showing the overall configuration of an image processing system including an image processing apparatus according to the present embodiment. As shown in FIG. 1, the image processing system SYS includes, as main components, an image processing device 1 also called a visual sensor, a camera 3 connected to the image processing device 1, and a camera 3 connected to the image processing device 1. The display device 6 includes a display device 6 and an input device 7.

画像処理装置1は、生産ラインに組み込まれ、対象物(以下、「ワークW」ともいう。)上の欠陥や汚れの有無の検査、ワークWの大きさや位置、向きなどの計測、ワークW表面上の文字や図形などの認識といった画像処理を実行する。すなわち、画像処理装置1は、ワークWを撮像することで生成された画像データに対する画像処理を実行する。 The image processing device 1 is incorporated into a production line, and inspects the presence or absence of defects or dirt on a target object (hereinafter also referred to as "work W"), measures the size, position, orientation, etc. of the work W, and performs inspections on the surface of the work W. Performs image processing such as recognition of characters and figures above. That is, the image processing device 1 performs image processing on image data generated by imaging the workpiece W.

撮像装置であるカメラ3は、一例として、レンズなどの光学系に加えて、CCD(Coupled Charged Device)やCMOS(Complementary Metal Oxide Semiconductor)センサといった、複数の画素に区画された撮像素子を含んで構成される。カメラ3による撮像によって取得された画像データ(以下、「カメラ画像」ともいう。)は、画像処理装置1へ伝送される。そして、画像処理装置1は、カメラ3により撮像されたカメラ画像に対して画像処理を行なう。カメラ3によって撮像されるワークWに対して光を照射する照明装置をさらに設けてもよい。 The camera 3, which is an imaging device, includes, for example, an optical system such as a lens, and an imaging element partitioned into a plurality of pixels, such as a CCD (Coupled Charged Device) or a CMOS (Complementary Metal Oxide Semiconductor) sensor. be done. Image data acquired by imaging with the camera 3 (hereinafter also referred to as “camera image”) is transmitted to the image processing device 1. The image processing device 1 then performs image processing on the camera image captured by the camera 3. An illumination device that irradiates light onto the workpiece W imaged by the camera 3 may be further provided.

画像処理装置1は、ワークWおよび画像処理の目的に応じた画像処理フローを作成するためのユーザインターフェイスを提供する。ユーザインターフェイスは、予め定義されている処理項目群のうちから任意の処理項目の選択を受け付ける。ユーザは、処理項目群から複数の処理項目を選択するとともに、選択した複数の処理項目の実行順序を指定することにより、所望の画像処理フローを構築できる。なお、本明細書における処理項目は、特定の用途を有する機能単位であり、「ユニット」とも称される。 The image processing device 1 provides a user interface for creating an image processing flow according to the work W and the purpose of image processing. The user interface accepts selection of any processing item from a predefined group of processing items. The user can construct a desired image processing flow by selecting a plurality of processing items from the processing item group and specifying the execution order of the selected processing items. Note that a processing item in this specification is a functional unit having a specific purpose, and is also referred to as a "unit."

画像処理フローを構成する各処理項目は、対応するパラメータの値に従って実行される。処理項目の実行の結果(処理結果)は、パラメータの値に依存する。そのため、パラメータの値は、所望の処理結果を得られるように適切に設定される必要がある。 Each processing item constituting the image processing flow is executed according to the value of the corresponding parameter. The result of executing a processing item (processing result) depends on the value of the parameter. Therefore, the values of the parameters need to be appropriately set so as to obtain the desired processing results.

通常、パラメータの値の設定は、予め準備しておいた画像を処理項目に入力したときの処理結果を確認することにより実施される。画像処理フローを構成する処理項目には、前段までの処理項目が実行された画像が入力される。そのため、従来、画像処理フローを構成する処理項目の実行に用いられるパラメータの値を設定するために、当該処理項目の前段までの処理項目が実行された画像(以下、「処理済画像」と称する)を別途準備する必要があった。 Normally, parameter values are set by checking the processing results when an image prepared in advance is input into a processing item. Images on which the previous processing items have been executed are input to the processing items that make up the image processing flow. Therefore, conventionally, in order to set the values of parameters used to execute the processing items that make up the image processing flow, it is necessary to set the values of the parameters used to execute the processing items that constitute the image processing flow. ) had to be prepared separately.

図2は、画像処理フローを構成する処理項目に用いられるパラメータの設定方法の参考例を示す図である。図2には、処理項目31~36がこの順に実行される画像処理フロー30において、処理項目33の実行に用いられるパラメータの値を設定する方法が示される。 FIG. 2 is a diagram illustrating a reference example of a method for setting parameters used for processing items that constitute an image processing flow. FIG. 2 shows a method for setting the values of parameters used to execute processing item 33 in image processing flow 30 in which processing items 31 to 36 are executed in this order.

図2に示されるように、画像処理フロー30とは別に、処理項目33の前段までの処理項目31,32と「画像収集」に対応する処理項目41とをこの順に実行する画像収集用フロー40が作成される。処理項目41は、入力された画像を指定されたフォルダに保存する処理を示す。画像収集用フロー40が実行されることにより、入力された画像に対して処理項目31,32を順に実行した結果である画像が指定フォルダに保存される。図2に示す例では、処理項目32の実行によって、画像に写る対象物の向きが一定となるように座標が変換される。 As shown in FIG. 2, apart from the image processing flow 30, an image collection flow 40 executes the processing items 31 and 32 up to the previous stage of the processing item 33 and the processing item 41 corresponding to "image collection" in this order. is created. Processing item 41 indicates processing for saving the input image in a designated folder. By executing the image collection flow 40, images that are the results of sequentially executing the processing items 31 and 32 on the input image are saved in the designated folder. In the example shown in FIG. 2, by executing processing item 32, the coordinates are transformed so that the orientation of the object in the image is constant.

ユーザは、予め準備しておいた複数の設定用画像22に対して画像収集用フロー40を実行させることにより、パラメータの設定対象となる処理項目33の前段までの処理項目31,32が実行された複数の処理済画像25を収集する。そして、ユーザは、複数の処理済画像25の各々を処理項目33に入力したときの処理結果が所望の結果となるように、処理項目33の実行に用いられるパラメータの値を設定する。 By executing the image collection flow 40 on a plurality of setting images 22 prepared in advance, the user can execute the processing items 31 and 32 up to the processing item 33 for which parameters are to be set. A plurality of processed images 25 are collected. Then, the user sets the values of the parameters used to execute the processing item 33 so that the processing result when each of the plurality of processed images 25 is input to the processing item 33 is a desired result.

図2に例示される設定方法を用いる場合、ユーザは、画像処理フロー30とは別に画像収集用フロー40を作成する必要がある。そのため、ユーザの手間がかかる。 When using the setting method illustrated in FIG. 2, the user needs to create an image collection flow 40 separately from the image processing flow 30. Therefore, it takes time and effort on the part of the user.

また、画像処理フロー30における処理項目32の実行に用いられるパラメータの値を変更した場合、あるいは、処理項目32を別の処理項目に変更した場合、同様の変更を画像収集用フロー40にも反映させる必要がある。当該反映を怠った場合、処理項目33に入力される画像の状態とは異なる状態の画像を用いて、処理項目33の実行に用いられるパラメータの値が設定される。その結果、画像処理フロー30の処理性能が低下する。 In addition, when the value of a parameter used to execute the processing item 32 in the image processing flow 30 is changed, or when the processing item 32 is changed to another processing item, the same change is also reflected in the image collection flow 40. It is necessary to do so. If this reflection is neglected, the values of the parameters used to execute the processing item 33 are set using an image in a state different from the state of the image input to the processing item 33. As a result, the processing performance of the image processing flow 30 deteriorates.

さらに、ワークWの品種ごとに画像処理フロー30が作成される場合、当該品種ごとに画像収集用フロー40も作成される。品種A用の画像処理フロー30における処理項目33のパラメータの値の設定は、品種A用の画像収集用フロー40の実行によって得られた処理済画像を用いて実施される必要がある。しかしながら、画像処理フロー30と画像収集用フロー40との組み合わせの間違いが発生し得る。例えば、品種A用の画像処理フロー30における処理項目33のパラメータの値の設定が、品種B用の画像収集用フロー40の実行によって得られた処理済画像を用いて誤って実施され得る。その結果、画像処理フロー30の処理性能が低下する。 Furthermore, when the image processing flow 30 is created for each type of workpiece W, the image collection flow 40 is also created for each type. Setting the value of the parameter of the processing item 33 in the image processing flow 30 for type A needs to be performed using the processed image obtained by executing the image collection flow 40 for type A. However, a mistake may occur in the combination of the image processing flow 30 and the image collection flow 40. For example, the value of the parameter of the processing item 33 in the image processing flow 30 for product type A may be erroneously set using the processed image obtained by executing the image collection flow 40 for product type B. As a result, the processing performance of the image processing flow 30 deteriorates.

図3は、画像処理フローを構成する処理項目に用いられるパラメータの設定方法の別の参考例を示す図である。図3には、処理項目31~36がこの順に実行される画像処理フロー50において、処理項目33の実行に用いられるパラメータの値を設定する方法が示される。 FIG. 3 is a diagram illustrating another reference example of a method for setting parameters used for processing items that constitute an image processing flow. FIG. 3 shows a method for setting values of parameters used to execute processing item 33 in image processing flow 50 in which processing items 31 to 36 are executed in this order.

図3に示されるように、画像処理フロー50において、処理項目32と処理項目33との間に、「画像収集」に対応する処理項目41へ分岐する分岐ポイント51が設けられる。画像処理フロー50では、通常指示を受けたことに応じて、処理項目32の後に処理項目33~36が順に実行され、画像収集指示を受けたことに応じて、処理項目32の後に処理項目41が実行される。 As shown in FIG. 3, in the image processing flow 50, a branch point 51 is provided between the processing item 32 and the processing item 33 to branch to the processing item 41 corresponding to "image collection". In the image processing flow 50, processing items 33 to 36 are executed in order after processing item 32 in response to receiving a normal instruction, and processing item 41 is executed after processing item 32 in response to receiving an image collection instruction. is executed.

ユーザは、処理項目33の実行に用いられるパラメータの値を設定する場合、画像収集指示を画像処理フロー50に入力することにより、予め準備しておいた複数の設定用画像22に対して処理項目31,32がそれぞれ実行された複数の処理済画像25を収集する。そして、ユーザは、複数の処理済画像25の各々を処理項目33に入力したときの処理結果が所望の結果となるように、処理項目33の実行に用いられるパラメータの値を設定する。 When setting the value of a parameter used to execute a processing item 33, the user inputs an image collection instruction into the image processing flow 50 to set the processing item for a plurality of setting images 22 prepared in advance. 31 and 32 collect a plurality of processed images 25, respectively. Then, the user sets the values of the parameters used to execute the processing item 33 so that the processing result when each of the plurality of processed images 25 is input to the processing item 33 is a desired result.

図3に例示される設定方法では、図2に例示される設定方法のように、画像処理フローとは別に画像収集用フローを作成する手間が削減される。さらに、図2に例示される設定方法のように、画像処理フローと画像収集用フローとの組み合わせの間違いに起因する、画像処理フローの性能低下を防止できる。 In the setting method illustrated in FIG. 3, unlike the setting method illustrated in FIG. 2, the effort of creating an image collection flow separately from the image processing flow is reduced. Furthermore, as in the setting method illustrated in FIG. 2, it is possible to prevent performance degradation of the image processing flow due to an incorrect combination of the image processing flow and the image collection flow.

しかしながら、画像処理フロー50を構成するN個(Nは2以上の整数)の処理項目の各々について、パラメータの値を設定したい場合、当該N個の処理項目にそれぞれ対応するN個の分岐ポイント51を画像処理フロー50に設ける必要がある。そのため、画像処理フロー50の設計の難易度が高くなる。その結果、画像処理フロー50の設定の手間がかかる。 However, when it is desired to set parameter values for each of N processing items (N is an integer of 2 or more) constituting the image processing flow 50, N branch points 51 corresponding to each of the N processing items are set. It is necessary to provide this in the image processing flow 50. Therefore, the degree of difficulty in designing the image processing flow 50 increases. As a result, it takes time and effort to set up the image processing flow 50.

さらに、画像処理フロー50における処理項目32の実行に用いられるパラメータの値を変更した場合、あるいは、処理項目32を別の処理項目に変更した場合、再度、複数の処理済画像25を収集する作業と、パラメータの値を設定する作業とを行なう必要がある。その結果、処理項目33の実行に用いられるパラメータの値の設定に手間がかかる。 Furthermore, when the value of the parameter used to execute the processing item 32 in the image processing flow 50 is changed, or when the processing item 32 is changed to another processing item, the task of collecting the plurality of processed images 25 again is performed. and setting the parameter values. As a result, it takes time and effort to set the values of parameters used to execute the processing item 33.

本実施の形態に係る画像処理装置1では、処理項目の実行に用いられるパラメータの設定の手間を削減するために、以下のような設定方法が実行される。 In the image processing apparatus 1 according to the present embodiment, the following setting method is executed in order to reduce the effort of setting parameters used for executing processing items.

図4は、本実施の形態に係る画像処理装置におけるパラメータの設定方法の一例を示す図である。本実施の形態では、画像処理装置1は、画像処理フロー30を構成する処理項目33の実行に用いられるパラメータの設定指示の入力に応じて、予め準備された複数の設定用画像22に対して画像処理フロー30を実行することにより、処理項目33の前段までの処理項目31,32が実行された複数の処理済画像25をそれぞれ生成する。さらに、画像処理装置1は、生成された複数の処理済画像25を用いて、処理項目33の実行に用いられるパラメータの値を設定する。 FIG. 4 is a diagram illustrating an example of a parameter setting method in the image processing apparatus according to the present embodiment. In the present embodiment, the image processing apparatus 1 processes a plurality of setting images 22 prepared in advance in response to an input of an instruction to set parameters used to execute the processing items 33 constituting the image processing flow 30. By executing the image processing flow 30, a plurality of processed images 25 in which the processing items 31 and 32 up to the stage before the processing item 33 have been executed are respectively generated. Furthermore, the image processing device 1 uses the plurality of generated processed images 25 to set values of parameters used to execute the processing items 33.

本実施の形態に係る画像処理装置1によれば、処理項目33の実行に用いられるパラメータの設定指示の入力に応じて、処理項目33の前段までの処理項目31,32が実行された複数の処理済画像25が自動的に生成される。さらに、生成された複数の処理済画像25を用いてパラメータの値が設定される。これにより、複数の処理済画像25を生成するために、図2に例示されるような画像収集用フロー40を作成する必要や、図3に例示されるような、分岐ポイント51を含む画像処理フロー50を作成する必要がない。その結果、複数の処理済画像25を収集するための手間が削減される。 According to the image processing device 1 according to the present embodiment, a plurality of processing items 31 and 32 up to the preceding stages of the processing item 33 are executed in response to an input of an instruction to set parameters used for executing the processing item 33. A processed image 25 is automatically generated. Further, parameter values are set using the plurality of generated processed images 25. This eliminates the need to create an image collection flow 40 as illustrated in FIG. 2 in order to generate a plurality of processed images 25, and image processing including a branch point 51 as illustrated in FIG. There is no need to create the flow 50. As a result, the effort required to collect a plurality of processed images 25 is reduced.

さらに、画像処理フロー30における前段の処理項目32の実行に用いられるパラメータの値を変更した場合、あるいは、処理項目32を別の処理項目に変更した場合であっても、処理項目33の実行に用いられるパラメータの設定指示の入力することにより、複数の処理済画像25が自動的に収集される。そのため、ユーザは、複数の処理済画像25の収集のための作業を別途行なう必要がない。 Furthermore, even if the value of the parameter used to execute the preceding processing item 32 in the image processing flow 30 is changed, or even if the processing item 32 is changed to another processing item, the execution of the processing item 33 may be changed. A plurality of processed images 25 are automatically collected by inputting instructions for setting the parameters to be used. Therefore, the user does not need to perform a separate operation to collect the plurality of processed images 25.

以上のように、本実施の形態によれば、画像処理フロー30を構成する処理項目33の実行に用いられるパラメータの設定の手間を削減できる。 As described above, according to the present embodiment, it is possible to reduce the effort required to set parameters used to execute the processing items 33 that constitute the image processing flow 30.

§2 具体例
<A.画像処理装置のハードウェア構成>
図5は、画像処理装置のハードウェア構成の一例を示す模式図である。図5に示すように、画像処理装置1は、典型的には、汎用的なコンピュータアーキテクチャに従う構造を有しており、予めインストールされたプログラムをプロセッサが実行することで、後述するような各種の処理を実現する。
§2 Specific example <A. Hardware configuration of image processing device>
FIG. 5 is a schematic diagram showing an example of the hardware configuration of the image processing device. As shown in FIG. 5, the image processing device 1 typically has a structure that follows a general-purpose computer architecture, and a processor executes a preinstalled program to perform various types of processing as described below. Achieve processing.

より具体的には、画像処理装置1は、CPU(Central Processing Unit)やMPU(Micro-Processing Unit)などのプロセッサ110と、RAM(Random Access Memory)112と、表示コントローラ114と、システムコントローラ116と、I/O(Input Output)コントローラ118と、ハードディスク120と、カメラインターフェイス122と、入力インターフェイス124と、PLCインターフェイス126と、通信インターフェイス128と、メモリカードインターフェイス130とを含む。これらの各部は、システムコントローラ116を中心として、互いにデータ通信可能に接続される。 More specifically, the image processing device 1 includes a processor 110 such as a CPU (Central Processing Unit) or an MPU (Micro-Processing Unit), a RAM (Random Access Memory) 112, a display controller 114, and a system controller 116. , an I/O (Input Output) controller 118, a hard disk 120, a camera interface 122, an input interface 124, a PLC interface 126, a communication interface 128, and a memory card interface 130. These units are connected to each other so as to be able to communicate data, centering on the system controller 116.

プロセッサ110は、システムコントローラ116との間でプログラム(コード)などを交換して、これらを所定順序で実行することで、目的の演算処理を実現する。 The processor 110 exchanges programs (codes) and the like with the system controller 116 and executes them in a predetermined order, thereby achieving the desired arithmetic processing.

システムコントローラ116は、プロセッサ110、RAM112、表示コントローラ114、およびI/Oコントローラ118とそれぞれバスを介して接続されており、各部との間でデータ交換などを行うとともに、画像処理装置1全体の処理を司る。 The system controller 116 is connected to the processor 110 , RAM 112 , display controller 114 , and I/O controller 118 via buses, and exchanges data with each section, as well as performs overall processing of the image processing device 1 . in charge of

RAM112は、典型的には、DRAM(Dynamic Random Access Memory)などの揮発性の記憶装置であり、ハードディスク120から読み出されたプログラムや、カメラ3によって取得されたカメラ画像(画像データ)、カメラ画像に対する処理結果、およびワークデータなどを保持する。 The RAM 112 is typically a volatile storage device such as DRAM (Dynamic Random Access Memory), and stores programs read from the hard disk 120, camera images (image data) acquired by the camera 3, and camera images. Stores processing results and work data.

表示コントローラ114は、表示装置6と接続されており、システムコントローラ116からの内部コマンドに従って、各種の情報を表示するための信号を表示装置6へ出力する。表示装置6は、一例として、液晶ディスプレイや有機EL(Electro Luminescence)ディスプレイや有機ELなどを含む。 The display controller 114 is connected to the display device 6, and outputs signals for displaying various information to the display device 6 according to internal commands from the system controller 116. The display device 6 includes, for example, a liquid crystal display, an organic EL (Electro Luminescence) display, an organic EL, and the like.

I/Oコントローラ118は、画像処理装置1に接続される記録媒体や外部機器との間のデータ交換を制御する。より具体的には、I/Oコントローラ118は、ハードディスク120と、カメラインターフェイス122と、入力インターフェイス124と、PLCインターフェイス126と、通信インターフェイス128と、メモリカードインターフェイス130と接続される。 The I/O controller 118 controls data exchange with recording media and external devices connected to the image processing apparatus 1 . More specifically, I/O controller 118 is connected to hard disk 120, camera interface 122, input interface 124, PLC interface 126, communication interface 128, and memory card interface 130.

ハードディスク120は、典型的には、不揮発性の磁気記憶装置であり、プロセッサ110で実行される制御プログラム121などが格納される。このハードディスク120にインストールされる制御プログラム121は、メモリカード106などに格納された状態で流通する。さらに、ハードディスク120には、カメラ画像が格納される。なお、ハードディスク120に代えて、フラッシュメモリなどの半導体記憶装置やDVD-RAM(Digital Versatile Disk Random Access Memory)などの光学記憶装置を採用してもよい。 The hard disk 120 is typically a nonvolatile magnetic storage device, and stores the control program 121 executed by the processor 110 and the like. The control program 121 installed on the hard disk 120 is distributed in a state stored in the memory card 106 or the like. Furthermore, the hard disk 120 stores camera images. Note that instead of the hard disk 120, a semiconductor storage device such as a flash memory or an optical storage device such as a DVD-RAM (Digital Versatile Disk Random Access Memory) may be used.

カメラインターフェイス122は、ワークWを撮像することで生成された画像データを受け付ける入力部に相当し、プロセッサ110とカメラ3との間のデータ伝送を仲介する。より具体的には、カメラインターフェイス122は、1つ以上のカメラ3と接続が可能であり、プロセッサ110からカメラインターフェイス122を介してカメラ3に撮像指示が出力される。これにより、カメラ3は、被写体を撮像し、カメラインターフェイス122を介して、生成された画像をプロセッサ110に出力する。 The camera interface 122 corresponds to an input unit that receives image data generated by imaging the workpiece W, and mediates data transmission between the processor 110 and the camera 3. More specifically, the camera interface 122 can be connected to one or more cameras 3, and an imaging instruction is output from the processor 110 to the camera 3 via the camera interface 122. Thereby, the camera 3 images the subject and outputs the generated image to the processor 110 via the camera interface 122.

入力インターフェイス124は、プロセッサ110とキーボード、マウス、タッチパネル、専用コンソールなどの入力装置7との間のデータ伝送を仲介する。すなわち、入力インターフェイス124は、ユーザが入力装置7を操作することで与えられる操作指令を受け付ける。 Input interface 124 mediates data transmission between processor 110 and input device 7 such as a keyboard, mouse, touch panel, dedicated console, etc. That is, the input interface 124 receives an operation command given by the user operating the input device 7.

PLC(Programmable Logic Controller)インターフェイス126は、プロセッサ110と図示しないPLCとの間のデータ伝送を仲介する。より具体的には、PLCインターフェイス126は、PLCによって制御される生産ラインの状態に係る情報やワークWに係る情報などをプロセッサ110へ伝送する。 A PLC (Programmable Logic Controller) interface 126 mediates data transmission between the processor 110 and a PLC (not shown). More specifically, the PLC interface 126 transmits information related to the state of the production line controlled by the PLC, information related to the workpiece W, etc. to the processor 110.

通信インターフェイス128は、プロセッサ110と図示しない他のパーソナルコンピュータやサーバ装置などとの間のデータ伝送を仲介する。通信インターフェイス128は、典型的には、イーサネット(登録商標)やUSB(Universal Serial Bus)などからなる。なお、後述するように、メモリカード106に格納されたプログラムを画像処理装置1にインストールする形態に代えて、通信インターフェイス128を介して、配信サーバなどからダウンロードしたプログラムを画像処理装置1にインストールしてもよい。 Communication interface 128 mediates data transmission between processor 110 and other personal computers, server devices, etc. (not shown). The communication interface 128 typically includes Ethernet (registered trademark), USB (Universal Serial Bus), or the like. Note that, as will be described later, instead of installing the program stored in the memory card 106 on the image processing apparatus 1, a program downloaded from a distribution server or the like may be installed on the image processing apparatus 1 via the communication interface 128. It's okay.

メモリカードインターフェイス130は、プロセッサ110と記録媒体であるメモリカード106との間のデータ伝送を仲介する。すなわち、メモリカード106には、画像処理装置1で実行される制御プログラム121などが格納された状態で流通し、メモリカードインターフェイス130は、このメモリカード106から制御プログラム121を読み出す。また、メモリカードインターフェイス130は、プロセッサ110の内部指令に応答して、カメラ3によって取得されたカメラ画像および/または画像処理装置1における処理結果などをメモリカード106へ書き込む。なお、メモリカード106は、SD(Secure Digital)などの汎用的な半導体記憶デバイスや、フレキシブルディスク(Flexible Disk)などの磁気記録媒体や、CD-ROM(Compact Disk Read Only Memory)などの光学記録媒体等からなる。 Memory card interface 130 mediates data transmission between processor 110 and memory card 106, which is a recording medium. That is, the memory card 106 stores and distributes the control program 121 to be executed by the image processing apparatus 1 , and the memory card interface 130 reads the control program 121 from the memory card 106 . Furthermore, the memory card interface 130 writes the camera image acquired by the camera 3 and/or the processing result in the image processing device 1 to the memory card 106 in response to an internal command from the processor 110 . Note that the memory card 106 may be a general-purpose semiconductor storage device such as an SD (Secure Digital), a magnetic recording medium such as a flexible disk, or an optical recording medium such as a CD-ROM (Compact Disk Read Only Memory). Consists of etc.

上述のような汎用的なコンピュータアーキテクチャに従う構造を有するコンピュータを利用する場合には、本実施の形態に係る機能を提供するためのアプリケーションに加えて、コンピュータの基本的な機能を提供するためのOS(Operating System)がインストールされていてもよい。この場合には、本実施の形態に係るプログラムは、OSの一部として提供されるプログラムモジュールのうち、必要なモジュールを所定の順序および/またはタイミングで呼出して処理を実行するものであってもよい。すなわち、本実施の形態に係るプログラム自体は、上記のようなモジュールを含んでおらず、OSと協働して処理が実行される場合もある。 When using a computer having a structure according to the general-purpose computer architecture as described above, in addition to an application for providing the functions according to this embodiment, an OS for providing the basic functions of the computer is required. (Operating System) may be installed. In this case, the program according to the present embodiment may execute processing by calling necessary modules in a predetermined order and/or timing from among the program modules provided as part of the OS. good. That is, the program itself according to the present embodiment does not include the above-mentioned modules, and may execute processing in cooperation with the OS.

さらに、本実施の形態に係る制御プログラム121は、他のプログラムの一部に組み込まれて提供されるものであってもよい。その場合にも、プログラム自体には、上記のような組み合わせられる他のプログラムに含まれるモジュールを含んでおらず、当該他のプログラムと協働して処理が実行される。すなわち、本実施の形態に係る制御プログラム121としては、このような他のプログラムに組み込まれた形態であってもよい。 Furthermore, the control program 121 according to this embodiment may be provided by being incorporated into a part of another program. Even in that case, the program itself does not include modules included in other programs to be combined as described above, and processing is executed in cooperation with the other programs. That is, the control program 121 according to the present embodiment may be incorporated into such another program.

なお、代替的に、制御プログラム121の実行により提供される機能の一部もしくは全部を専用のハードウェア回路として実装してもよい。 Alternatively, part or all of the functions provided by executing the control program 121 may be implemented as a dedicated hardware circuit.

<B.画像処理装置の機能構成>
図6は、画像処理装置の機能構成の一例を示す図である。図6に示されるように、画像処理装置1は、フロー作成部11とフロー実行部16と記憶部20とを備える。フロー作成部11およびフロー実行部16は、プロセッサ110が制御プログラム121を実行することにより実現される。記憶部20は、ハードディスク120およびRAM112によって実現される。
<B. Functional configuration of image processing device>
FIG. 6 is a diagram illustrating an example of the functional configuration of an image processing device. As shown in FIG. 6, the image processing device 1 includes a flow creation section 11, a flow execution section 16, and a storage section 20. The flow creation unit 11 and the flow execution unit 16 are realized by the processor 110 executing the control program 121. Storage unit 20 is realized by hard disk 120 and RAM 112.

フロー作成部11は、画像処理フローを作成するため画面を表示装置6に提供し、入力装置7への入力に応じて、ユーザ所望の画像処理フローを作成する。典型的には、フロー作成部11は、予め定義されている処理項目群のうちから1以上の処理項目の選択と、選択された1以上の処理項目の実行順序の指定とを受け付け、受け付けた内容に従って画像処理フローを作成する。なお、通常、複数の処理項目から構成される画像処理フローが作成される。そのため、以下では、複数の処理項目から構成される画像処理フローが作成される場合について説明する。 The flow creation unit 11 provides a screen to the display device 6 to create an image processing flow, and creates an image processing flow desired by the user in response to input to the input device 7. Typically, the flow creation unit 11 receives the selection of one or more processing items from a group of predefined processing items and the designation of the execution order of the selected one or more processing items. Create an image processing flow according to the content. Note that an image processing flow consisting of a plurality of processing items is usually created. Therefore, below, a case will be described in which an image processing flow composed of a plurality of processing items is created.

処理項目群には、画像の取り込みに関する処理項目、画像の補正に関する処理項目、画像に写る特徴部分に対する検査または計測に関する処理項目、上記の検査または計測の補助に関する処理項目、処理結果の出力に関する処理項目、処理結果の表示に関する処理項目、画像処理フローの分岐に関する処理項目などが含まれる。 The processing item group includes processing items related to image capture, processing items related to image correction, processing items related to inspection or measurement of characteristic parts in images, processing items related to assisting the above inspections or measurements, and processing related to output of processing results. This includes items, processing items related to display of processing results, processing items related to branching of image processing flow, etc.

画像の補正に関する処理項目には、例えば、幾何学変換、各種のフィルタ処理、複数の画像から1つの画像を生成する画像合成、3D画像化などが含まれる。幾何学変換には、平行移動と回転を行なう位置ずれ修正、縮小、拡大、射影変換、透視変換などが含まれる。画像合成には、例えばハイダイナミックレンジ画像の生成が含まれる。3D画像化は、複数枚の画像を演算することで距離や3D形状に関する情報を映像化する処理であり、多眼ステレオ、照度差ステレオ、デフレクトメトリ処理等を含む。 Processing items related to image correction include, for example, geometric transformation, various types of filter processing, image synthesis for generating one image from a plurality of images, 3D imaging, and the like. Geometric transformations include positional displacement correction, reduction, enlargement, projective transformation, perspective transformation, etc. that perform parallel translation and rotation. Image synthesis includes, for example, generating high dynamic range images. 3D imaging is a process of visualizing information regarding distance and 3D shape by calculating a plurality of images, and includes multi-view stereo, photometric stereo, deflectometry processing, and the like.

検査または計測に関する処理項目には、特徴部分の形状識別や位置の検出、エッジ位置の検出、淡画像やカラー画像に対する閾値処理によって画素にラベルを付与するラベリング、画像認識に基づいて全ての画素に識別した物体を意味するラベルを付与するセマンティックセグメンテーションなどが含まれる。 Processing items related to inspection or measurement include shape identification and position detection of characteristic parts, edge position detection, labeling that assigns labels to pixels using threshold processing for light and color images, and labeling that applies labels to all pixels based on image recognition. This includes semantic segmentation, which assigns a label to the identified object.

フロー作成部11は、例えば、各処理項目に対応するオブジェクトの一覧と、当該一覧の中から選択されたオブジェクトを任意に配置可能な作業領域とを含む画面を表示装置6に提供する。ユーザは、所望の複数の処理項目にそれぞれ対応する複数のオブジェクトを一覧から選択し、作業領域において、所望の実行順序と一致するように、選択した複数のオブジェクトの配置順序を編集する。フロー作成部11は、作業領域に配置された複数のオブジェクトとその配置順序とに従って、画像処理フローを作成する。 The flow creation unit 11 provides the display device 6 with a screen including, for example, a list of objects corresponding to each processing item and a work area in which objects selected from the list can be arbitrarily arranged. The user selects a plurality of objects from the list that respectively correspond to a plurality of desired processing items, and edits the arrangement order of the selected plurality of objects in the work area so as to match the desired execution order. The flow creation unit 11 creates an image processing flow according to a plurality of objects arranged in the work area and their arrangement order.

フロー作成部11は、作成した画像処理フローを構成する複数の処理項目と、当該複数の処理項目の実行順序とを示すフローデータ21を生成し、生成したフローデータ21を記憶部20に保存する。 The flow creation unit 11 generates flow data 21 indicating a plurality of processing items constituting the created image processing flow and the execution order of the plurality of processing items, and stores the generated flow data 21 in the storage unit 20. .

フロー作成部11は、フローデータ21によって示される画像処理フローを構成する複数の処理項目の各々の実行に用いられるパラメータの値を設定するための構成として、管理部12と生成部13と設定部14とを含む。 The flow creation unit 11 includes a management unit 12, a generation unit 13, and a setting unit as a configuration for setting the values of parameters used to execute each of a plurality of processing items that constitute the image processing flow indicated by the flow data 21. 14.

管理部12は、パラメータの値の設定のために用いる複数の設定用画像ファイル(以下、「複数の設定用画像22」と称する。)の各々に対する正解値を管理する。複数の設定用画像22は、過去に取得されたカメラ画像(カメラ3の撮像によって得られる画像)の中から選択されてもよいし、通信インターフェイス128(図5参照)を介して外部のPCなどから取得されてもよい。あるいは、管理部12は、カメラ3に複数の撮像指示を出力し、複数の撮像指示に応じてそれぞれ撮像された複数の画像を複数の設定用画像22として取得してもよい。複数の設定用画像22は、記憶部20に保存される。あるいは、複数の設定用画像22は、外部ストレージ2に保存されてもよい。外部ストレージ2には、メモリカード106(図5参照)、USB(Universal Serial Bus)メモリ、外付けHDD(Hard Disk Drive)、外付けSSD(Solid State Drive)、NAS(Network Attached Storage)などが含まれる。以下では、記憶部20に複数の設定用画像22が保存されているものとして説明する。 The management unit 12 manages correct values for each of a plurality of setting image files (hereinafter referred to as "a plurality of setting images 22") used for setting parameter values. The plurality of setting images 22 may be selected from camera images acquired in the past (images obtained by imaging with the camera 3), or may be selected from an external PC or the like via the communication interface 128 (see FIG. 5). It may be obtained from Alternatively, the management unit 12 may output a plurality of imaging instructions to the camera 3 and obtain a plurality of images respectively captured according to the plurality of imaging instructions as a plurality of setting images 22. The plurality of setting images 22 are stored in the storage unit 20. Alternatively, the plurality of setting images 22 may be stored in the external storage 2. The external storage 2 includes a memory card 106 (see FIG. 5), a USB (Universal Serial Bus) memory, an external HDD (Hard Disk Drive), an external SSD (Solid State Drive), a NAS (Network Attached Storage), etc. It will be done. In the following description, it is assumed that a plurality of setting images 22 are stored in the storage unit 20.

管理部12は、パラメータの設定対象となる処理項目に応じた正解値を管理する。例えば、ワークWの属性(例えば、ワークの種別、ワークの良否など)を判定する処理項目の場合、管理部12は、各設定用画像22に写るワークWの属性を正解値として管理する。ワークWの特徴部分(例えば、印字されたマーク)の位置を計測する処理項目の場合、管理部12は、各設定用画像22に写る特徴部分の位置を正解値として管理する。ワークWに印字されたテキストを文字認識する処理項目の場合、管理部12は、各設定用画像22に写るテキストを正解値として管理する。 The management unit 12 manages correct values corresponding to processing items for which parameters are set. For example, in the case of a processing item that determines the attributes of the workpiece W (for example, the type of workpiece, the quality of the workpiece, etc.), the management unit 12 manages the attributes of the workpiece W shown in each setting image 22 as correct values. In the case of a processing item that measures the position of a characteristic part (for example, a printed mark) of the workpiece W, the management unit 12 manages the position of the characteristic part shown in each setting image 22 as a correct value. In the case of a processing item for character recognition of text printed on the workpiece W, the management unit 12 manages the text appearing in each setting image 22 as a correct value.

管理部12は、入力装置7から正解値を取得すればよい。管理部12は、複数の設定用画像22それぞれの正解値を示す管理データ23を生成し、生成した管理データ23を記憶部20に保存する。 The management unit 12 may acquire the correct value from the input device 7 . The management unit 12 generates management data 23 indicating the correct value of each of the plurality of setting images 22, and stores the generated management data 23 in the storage unit 20.

生成部13は、フローデータ21によって示される画像処理フローを構成する複数の処理項目のうち指定された処理項目の実行に用いられるパラメータの設定指示の入力を受け付ける。生成部13は、パラメータの設定指示の入力に応じて、フローデータ21によって示される画像処理フローを複数の設定用画像22に対して実行することにより、指定された処理項目の前段までの処理項目が実行された複数の処理済画像25をそれぞれ生成する。 The generation unit 13 receives an input of an instruction to set a parameter used to execute a specified processing item among a plurality of processing items that constitute the image processing flow indicated by the flow data 21 . The generation unit 13 executes the image processing flow indicated by the flow data 21 on the plurality of setting images 22 in response to the input of the parameter setting instruction, thereby generating the processing items up to the stage preceding the specified processing item. A plurality of processed images 25 are generated, respectively.

設定部14は、生成部13によって生成された複数の処理済画像25を用いて、指定された処理項目の実行に用いられるパラメータの値を設定する。設定部14は、設定したパラメータの値を示す設定データ24を生成し、生成した設定データ24を記憶部20に保存する。 The setting unit 14 uses the plurality of processed images 25 generated by the generation unit 13 to set values of parameters used to execute the specified processing item. The setting unit 14 generates setting data 24 indicating the values of the set parameters, and stores the generated setting data 24 in the storage unit 20.

フロー実行部16は、フロー作成部11によって作成された画像処理フローを実行する。すなわち、フロー実行部16は、実行指示を受けると、フローデータ21によって示される画像処理フローを構成する複数の処理項目を実行順序に従って順に実行する。フロー実行部16は、設定データ24によって示されるパラメータの値を用いて各処理項目を実行する。 The flow execution unit 16 executes the image processing flow created by the flow creation unit 11. That is, upon receiving an execution instruction, the flow execution unit 16 sequentially executes a plurality of processing items forming the image processing flow indicated by the flow data 21 in accordance with the execution order. The flow execution unit 16 executes each processing item using the parameter values indicated by the setting data 24.

<C.パラメータ設定処理>
図7~図10を参照して、パラメータ設定処理の流れについて説明する。図7は、本実施の形態に係るパラメータ設定処理全体の流れの一例を示すフローチャートである。
<C. Parameter setting process>
The flow of the parameter setting process will be explained with reference to FIGS. 7 to 10. FIG. 7 is a flowchart showing an example of the overall flow of the parameter setting process according to the present embodiment.

まず、プロセッサ110は、入力装置7からパラメータの設定指示を受けたか否かを判定する(ステップS1)。パラメータの設定指示には、パラメータの設定対象となる処理項目の指定が含まれる。パラメータの設定指示を受けていない場合(ステップS1でNO)、処理はステップS1に戻る。 First, the processor 110 determines whether a parameter setting instruction has been received from the input device 7 (step S1). The parameter setting instruction includes designation of the processing item for which the parameter is to be set. If a parameter setting instruction has not been received (NO in step S1), the process returns to step S1.

パラメータの設定指示を受けた場合(ステップS1でYES)、生成部13として動作するプロセッサ110は、複数の設定用画像22に対して画像処理フローを実行し、指定された処理項目の前段までの処理項目が実行された複数の処理済画像25を生成する(ステップS2)。なお、プロセッサ110は、画像処理フローを構成する複数の処理項目の全てを実行順序に従って実行してもよいし、当該複数の処理項目のうちの一部(少なくとも指定された処理項目の前段までの処理項目を含む)を実行してもよい。 When receiving a parameter setting instruction (YES in step S1), the processor 110, which operates as the generation unit 13, executes the image processing flow on the plurality of setting images 22, and processes up to the previous stage of the specified processing item. A plurality of processed images 25 in which the processing items have been executed are generated (step S2). Note that the processor 110 may execute all of the plurality of processing items that make up the image processing flow in accordance with the execution order, or may execute some of the plurality of processing items (at least up to the preceding stage of the specified processing item). (including processing items) may be executed.

次に、設定部14としてプロセッサ110は、複数の処理済画像25を用いて、指定された処理項目の実行に用いられるパラメータの値を設定する(ステップS3)。プロセッサ110は、設定したパラメータの値を示す設定データ24を記憶部20に保存する(ステップS4)。ステップS4が完了すると、指定された処理項目に対するパラメータの設定処理が完了する。 Next, the processor 110 as the setting unit 14 uses the plurality of processed images 25 to set values of parameters used to execute the specified processing item (step S3). The processor 110 stores the setting data 24 indicating the values of the set parameters in the storage unit 20 (step S4). When step S4 is completed, the parameter setting process for the specified processing item is completed.

なお、プロセッサ110は、画像処理フローを構成する複数の処理項目の各々について、ステップS1~S4を実行すればよい。これにより、画像処理フローを構成する複数の処理項目の各々について、パラメータの値が設定される。 Note that the processor 110 may execute steps S1 to S4 for each of the plurality of processing items that constitute the image processing flow. As a result, parameter values are set for each of the plurality of processing items that constitute the image processing flow.

図8は、図7に示すステップS2のサブルーチンの処理の流れの一例を示すフローチャートである。図8に例示されるフローチャートでは、プロセッサ110は、入力装置7への入力に応じて、複数の設定用画像22を選択する(ステップS21)。次に、プロセッサ110は、入力装置7への入力に応じて、複数の設定用画像22の各々に対して正解値を設定する(ステップS22)。 FIG. 8 is a flowchart showing an example of the process flow of the subroutine of step S2 shown in FIG. In the flowchart illustrated in FIG. 8, the processor 110 selects a plurality of setting images 22 in response to input to the input device 7 (step S21). Next, the processor 110 sets a correct value for each of the plurality of setting images 22 in accordance with the input to the input device 7 (step S22).

次に、プロセッサ110は、入力装置7に開始指示が入力されたか否かを判定する(ステップS23)。開始指示が入力されていない場合(ステップS23でNO)、処理はステップS21に戻る。 Next, the processor 110 determines whether a start instruction has been input to the input device 7 (step S23). If the start instruction has not been input (NO in step S23), the process returns to step S21.

開始指示が入力された場合(ステップS23でYES)、プロセッサ110は、複数の設定用画像22の各々に対して画像処理フローを実行する(ステップS24)。そして、プロセッサ110は、指定された処理項目の前段までの処理項目が実行された複数の処理済画像25を一時的に記憶部20に保存する(ステップS25)。ステップS25の終了後、処理はステップS3(図7参照)に戻る。 When the start instruction is input (YES in step S23), the processor 110 executes the image processing flow for each of the plurality of setting images 22 (step S24). Then, the processor 110 temporarily stores in the storage unit 20 the plurality of processed images 25 in which the processing items up to the steps preceding the designated processing item have been executed (step S25). After step S25 ends, the process returns to step S3 (see FIG. 7).

図9は、図7に示すステップS3のサブルーチンの処理の流れの一例を示すフローチャートである。図9に例示されるフローチャートでは、プロセッサ110は、パラメータが取りうる複数の値の各々について、当該値を用いて、複数の処理済画像25に対して指定された処理項目を実行することにより複数の処理結果をそれぞれ取得する(ステップS31)。 FIG. 9 is a flowchart showing an example of the process flow of the subroutine of step S3 shown in FIG. In the flowchart illustrated in FIG. 9, the processor 110 executes a specified processing item on the plurality of processed images 25 using each of the plurality of values that the parameter can take. (step S31).

次に、プロセッサ110は、複数の処理結果と、複数の設定用画像22に対してそれぞれ予め準備された複数の正解値との差分を示す差分情報を生成する(ステップS32)。プロセッサ110は、記憶部20に保存された管理データ23から、複数の設定用画像22の各々に対して設定された正解値を特定する。 Next, the processor 110 generates difference information indicating the difference between the plurality of processing results and the plurality of correct values prepared in advance for the plurality of setting images 22 (step S32). The processor 110 identifies the correct value set for each of the plurality of setting images 22 from the management data 23 stored in the storage unit 20.

プロセッサ110は、パラメータが取りうる複数の値の各々について、生成した差分情報を表示装置6に表示させる(ステップS33)。プロセッサ110は、入力装置7の入力に応じて、複数の値の中から選択された値をパラメータの値として設定する(ステップS34)。ステップS34の終了後、処理はステップS4(図7参照)に戻る。 The processor 110 causes the display device 6 to display the generated difference information for each of the plurality of values that the parameter can take (step S33). The processor 110 sets the value selected from the plurality of values as the value of the parameter in response to the input from the input device 7 (step S34). After step S34 ends, the process returns to step S4 (see FIG. 7).

図10は、図7に示すステップS3のサブルーチンの処理の流れの別の例を示すフローチャートである。図10に例示されるフローチャートは、図9に例示されるフローチャートと比較して、ステップS33、S34の代わりにステップS35を含む。ステップS35において、プロセッサ110は、複数の値の中から差分が最小となる値を選択し、選択した値をパラメータの値として設定する。図10に例示されるフローチャートによれば、設定部14として動作するプロセッサ110は、複数の処理済画像25に対して指定された処理項目を実行することによりそれぞれ得られる複数の処理結果が、複数の設定用画像22に対してそれぞれ予め設定された複数の正解値に近づくように、パラメータの値を最適化する。 FIG. 10 is a flowchart showing another example of the process flow of the subroutine of step S3 shown in FIG. The flowchart illustrated in FIG. 10 includes step S35 instead of steps S33 and S34, compared to the flowchart illustrated in FIG. In step S35, the processor 110 selects the value with the smallest difference from the plurality of values, and sets the selected value as the value of the parameter. According to the flowchart exemplified in FIG. The parameter values are optimized so as to approach a plurality of correct values set in advance for each of the setting images 22.

<D.動作例1>
次に、画像処理装置1におけるパラメータ設定の動作例について説明する。
<D. Operation example 1>
Next, an example of the operation of parameter setting in the image processing device 1 will be described.

図11は、動作例1においてパラメータ設定の対象となる画像処理フローを示す図である。図11に例示される画像処理フロー30Aは、処理項目31A~39Aを含む。 FIG. 11 is a diagram illustrating an image processing flow for which parameters are set in operation example 1. The image processing flow 30A illustrated in FIG. 11 includes processing items 31A to 39A.

処理項目31Aは、画像処理の対象となる画像を取得するための項目である。処理項目32Aは、処理項目31Aによって取得された画像からワークWの写る領域を検出する項目である。処理項目33Aは、ワークWの写る領域が画像の中央に位置するように画像の座標変換を行なう項目である。 The processing item 31A is an item for acquiring an image to be subjected to image processing. The processing item 32A is an item for detecting the area where the workpiece W is captured from the image acquired by the processing item 31A. The processing item 33A is an item for performing coordinate transformation of the image so that the area in which the workpiece W is captured is located at the center of the image.

処理項目34Aは、ワークWにおける明度の低い第1部分(例えば黒色または茶色の外周部分)に生じ得る欠陥を強調するためのフィルタ処理を行なう項目である。処理項目34Aの実行により、ワークWにおける第1部分に生じる欠陥の形、サイズ、輝度(画素値)が変化する。欠陥の形、サイズおよび画素値の変化の度合いは、処理項目34Aの実行に用いられるパラメータの値に依存する。処理項目35Aは、処理項目34Aが実行された画像を用いて、ワークWにおける第1部分(例えば外周部分)の欠陥の有無を検査する項目である。 The processing item 34A is an item for performing filter processing to emphasize defects that may occur in the first portion of the workpiece W with low brightness (for example, the black or brown peripheral portion). By executing the processing item 34A, the shape, size, and brightness (pixel value) of the defect occurring in the first portion of the workpiece W change. The shape, size, and degree of change in pixel values of the defect depend on the values of the parameters used to perform process item 34A. The processing item 35A is an item for inspecting the presence or absence of defects in the first portion (for example, the outer peripheral portion) of the workpiece W using the image obtained by executing the processing item 34A.

処理項目36Aは、画像を切り替える項目である。図11に例示される画像処理フロー30Aでは、処理項目31A~33Aが実行された画像を出力するように、処理項目36Aが設定される。 The processing item 36A is an item for switching images. In the image processing flow 30A illustrated in FIG. 11, the processing item 36A is set so as to output an image obtained by executing the processing items 31A to 33A.

処理項目37Aは、ワークWにおける明度の高い第2部分(例えば白色の内周部分)に生じ得る欠陥を強調するためのフィルタ処理を行なう項目である。処理項目37Aの実行により、ワークWにおける第2部分に生じる欠陥の形、サイズ、輝度(画素値)が変化する。処理項目38Aは、処理項目37Aが実行された画像を用いて、ワークWにおける第2部分(例えば内周部分)の欠陥の有無を検査する項目である。処理項目39Aは、処理項目35Aの検査結果および処理項目37Aの検査結果に応じた総合判定結果を出力する項目である。 The processing item 37A is an item for performing filter processing for emphasizing defects that may occur in the second portion of the workpiece W having high brightness (for example, the white inner peripheral portion). By executing the processing item 37A, the shape, size, and brightness (pixel value) of the defect occurring in the second portion of the workpiece W change. The processing item 38A is an item for inspecting the presence or absence of defects in the second portion (for example, the inner peripheral portion) of the workpiece W using the image obtained by executing the processing item 37A. The processing item 39A is an item that outputs a comprehensive judgment result according to the test results of the processing item 35A and the test result of the processing item 37A.

以下、画像処理フロー30Aにおける処理項目35Aの実行に用いられるパラメータの設定指示を受けたときの画像処理装置1の動作例について説明する。 Hereinafter, an example of the operation of the image processing apparatus 1 when receiving an instruction to set parameters used for executing the processing item 35A in the image processing flow 30A will be described.

<D-1.パラメータの設定対象となる処理項目>
図12は、動作例1においてパラメータの設定対象となる処理項目35Aの内容を示す図である。処理項目35Aは、予め作成された学習済モデル140を用いて、入力された画像に写るワークWに欠陥が含まれるか否かを判定する項目である。欠陥は、例えば、傷、汚れ、クラック、打痕、バリ、色ムラ、異物混入等であってよい。
<D-1. Processing items for which parameters are set>
FIG. 12 is a diagram showing the contents of the processing item 35A for which parameters are set in the first operation example. The processing item 35A is an item for determining whether or not the workpiece W shown in the input image includes a defect using the learned model 140 created in advance. The defects may be, for example, scratches, dirt, cracks, dents, burrs, color unevenness, foreign matter contamination, and the like.

学習済モデル140は、入力された画像(以下、「入力画像I10」と称する。)を特徴量に変換し、変換により得られた特徴量から、入力画像I10を復元した画像(以下、「復元画像I11」と称する。)を生成するように構成される生成モデルである。 The trained model 140 converts an input image (hereinafter referred to as "input image I10") into a feature amount, and from the feature amount obtained by the conversion, an image in which the input image I10 is restored (hereinafter referred to as "restored image I10"). This is a generative model configured to generate an image I11.

学習済モデル140は、予め準備された複数の良品画像を用いた機械学習によって生成される。学習済モデルの生成方法として、公知の技術が用いられ得る。学習済モデル140は、ニューラルネットワーク、主成分分析により導出される固有ベクトル等によって構成される。ニューラルネットワークとして、例えば、公知のオートエンコーダ、GAN(Generative Adversarial Networks)等が挙げられる。固有ベクトルとして、例えば、公知の部分空間の固有ベクトル等が挙げられる。 The trained model 140 is generated by machine learning using a plurality of images of non-defective products prepared in advance. A known technique can be used as a method for generating a trained model. The trained model 140 is configured by a neural network, eigenvectors derived by principal component analysis, and the like. Examples of neural networks include well-known autoencoders, GANs (Generative Adversarial Networks), and the like. Examples of the eigenvector include eigenvectors of known subspaces.

処理項目35Aの実行時において、プロセッサ110は、入力画像I10と復元画像I11との差分を算出することで、差分画像I12を生成する。入力画像I10と復元画像I11との間で差異が生じている画素ほど差分画像I12においてその画素値が大きくなる。一方、入力画像I10と復元画像I11との間で差異のない画素ほど差分画像I12における画素値は小さくなる。本実施形態では、説明の便宜のため、入力画像I10と復元画像I11との間の差異が大きい画素ほど差分画像I12内の対応画素の実際の画素値も大きくなり、差異が小さい画素ほど差分画像I12内の対応画素の実際の画素値も小さくなると仮定する。ただし、この「画素値が大きい」及び「画素値が小さい」はそれぞれ、入力画像I10と復元画像I11との間の差異との関係を示しており、差分画像I12内の画素の実際の画素値と対応していなくてもよい。例えば、差分画像I12は、差異の大きい画素ほど対応する画素の実際の画素値が小さくなり、差異の小さい画素ほど対応する画素の実際の画素値が大きくなるように算出されてよい。 When executing processing item 35A, processor 110 generates difference image I12 by calculating the difference between input image I10 and restored image I11. A pixel that is different between the input image I10 and the restored image I11 has a larger pixel value in the difference image I12. On the other hand, the pixel value that is less different between the input image I10 and the restored image I11 becomes smaller in the difference image I12. In this embodiment, for convenience of explanation, the larger the difference between a pixel between the input image I10 and the restored image I11, the larger the actual pixel value of the corresponding pixel in the difference image I12, and the smaller the difference is, the larger the actual pixel value of the corresponding pixel in the difference image I12 becomes. Assume that the actual pixel value of the corresponding pixel in I12 is also smaller. However, "the pixel value is large" and "the pixel value is small" each indicate the relationship between the difference between the input image I10 and the restored image I11, and the actual pixel value of the pixel in the difference image I12. It does not have to correspond to For example, the difference image I12 may be calculated such that the larger the difference between pixels, the smaller the actual pixel value of the corresponding pixel, and the smaller the difference between the pixels, the larger the actual pixel value of the corresponding pixel.

図12の例では、入力画像I10と復元画像I11との間で差異が生じている画素ほど差分画像I12において白色になっており、そうではない画素ほど黒色になっている。例えば、各画素の値が256階調で表現される場合、差分画像I12の画素の画素値の最大値が「255」であってよく、最小値が「0」であってよい。この場合、差分画像I12の画素の画素値が大きいほど、入力画像I10と復元画像I11との間で差異が生じていることを示し、差分画像I12の画素の画素値が小さいほど、入力画像I10と復元画像I11との間で差異が生じていないことを示す。ただし、入力画像I10と復元画像I11との間で生じる差異と差分画像I12の画素値との間の関係は、このような例に限定されなくてよい。例えば、入力画像I10及び復元画像I11の間の差異の程度と差分画像I12の画素値との関係は、この反対であってもよい。 In the example of FIG. 12, the pixels that are more different between the input image I10 and the restored image I11 are whiter in the difference image I12, and the pixels that are less white are blacker. For example, when the value of each pixel is expressed in 256 gradations, the maximum value of the pixel value of the pixels of the difference image I12 may be "255", and the minimum value may be "0". In this case, the larger the pixel value of the pixel of the difference image I12, the more the difference occurs between the input image I10 and the restored image I11, and the smaller the pixel value of the pixel of the difference image I12, This shows that there is no difference between the image I11 and the restored image I11. However, the relationship between the difference that occurs between the input image I10 and the restored image I11 and the pixel values of the difference image I12 is not limited to this example. For example, the relationship between the degree of difference between the input image I10 and the restored image I11 and the pixel value of the difference image I12 may be the opposite.

学習済モデル140の機械学習に使用された画像に写っていない又は写る可能性の低い特徴(欠陥8など)が入力画像I10に写っている場合、復元画像I11においてその特徴の再現性が低い。そのため、入力画像I10と復元画像I11との間で比較的に大きな差異が生じ得る。 If a feature (such as defect 8) that does not appear or is unlikely to appear in the image used for machine learning of the learned model 140 appears in the input image I10, the reproducibility of that feature in the restored image I11 is low. Therefore, a relatively large difference may occur between the input image I10 and the restored image I11.

プロセッサ110は、閾値Th1を利用して、差分画像I12の各画素を二値化する。例えば、プロセッサ110は、画素値が閾値Th1以上である画素の画素値を「255」に変換し、画素値が閾値Th1未満である画素の画素値を「0」に変換する。「以上」は、「超える」に置き換えられ、「未満」は、「以下」に置き換えられてよい。以下の説明においても同様である。これにより、プロセッサ110は、二値化画像I13を生成することができる。閾値Th1を適切に設定することで、ノイズに起因する差異等の比較的に程度の低い差異が元の差分画像I12から除外された二値化画像I13を得ることができる。 The processor 110 binarizes each pixel of the difference image I12 using the threshold Th1. For example, the processor 110 converts the pixel value of a pixel whose pixel value is equal to or greater than the threshold value Th1 to "255", and converts the pixel value of a pixel whose pixel value is less than the threshold value Th1 to "0". “More than” may be replaced with “more than” and “less than” may be replaced with “less than”. The same applies to the following description. Thereby, the processor 110 can generate the binarized image I13. By appropriately setting the threshold Th1, it is possible to obtain a binarized image I13 in which relatively low-level differences such as differences due to noise are excluded from the original difference image I12.

二値化画像I13には、主に、欠陥8に起因する差異、及び学習不足に起因する差異が現れ得る。これらの差異を生じさせる原因のうち、欠陥8は、面積、幅、高さ、周囲の長さ、縦横比、円形度等の形状に関する属性を有し得る。つまり、入力画像I10に写るワークWに欠陥8が存在する場合、二値化画像I13の対応する位置に、白色「255」の画素(以下、白色画素とも称する)の集まった領域であって、欠陥8と同等の形状に関する特徴を有する領域が現れる。そこで、形状に関する特徴量(例えば面積)に対して閾値Th2を設定することで、入力画像I10内に欠陥8が写っているか否かを判定することができる。 Differences due to the defect 8 and differences due to insufficient learning may appear in the binarized image I13. Among the causes of these differences, the defect 8 may have attributes related to shape, such as area, width, height, circumference, aspect ratio, and circularity. That is, when the defect 8 exists in the workpiece W shown in the input image I10, the corresponding position in the binarized image I13 is an area where white "255" pixels (hereinafter also referred to as white pixels) are gathered, A region having the same shape-related features as defect 8 appears. Therefore, by setting a threshold value Th2 for a feature amount related to the shape (for example, area), it is possible to determine whether or not the defect 8 is included in the input image I10.

プロセッサ110は、二値化画像I13内の連続する白色画素の領域を一つの領域と認定し、白色画素の各領域が閾値Th2を満たしているか否かを判定する。そして、プロセッサ110は、閾値Th2を満たしている領域をそのままにし、閾値Th2を満たしていない領域内の画素の画素値を「0」に変換する。例えば、閾値Th2が面積に対して設定される場合、プロセッサ110は、白色画素の各領域の面積が閾値Th2以上であるか否かを判定する。そして、プロセッサ110は、面積が閾値Th2未満である領域内の画素の画素値を「0」に変換する。これにより、プロセッサ110は、検出画像I14を生成することができる。閾値Th2を適切に設定することで、欠陥8の属性を満たさない白色領域が二値化画像I13から除外された検出画像I14を得ることができる。 The processor 110 identifies the area of continuous white pixels in the binarized image I13 as one area, and determines whether each area of white pixels satisfies the threshold Th2. Then, the processor 110 leaves the area that satisfies the threshold Th2 as it is, and converts the pixel values of pixels in the area that does not satisfy the threshold Th2 to "0". For example, if the threshold Th2 is set for area, the processor 110 determines whether the area of each region of white pixels is equal to or larger than the threshold Th2. Then, the processor 110 converts the pixel values of pixels within the area whose area is less than the threshold Th2 to "0". Thereby, the processor 110 can generate the detected image I14. By appropriately setting the threshold value Th2, it is possible to obtain a detected image I14 in which a white area that does not satisfy the attributes of the defect 8 is excluded from the binarized image I13.

プロセッサ110は、検出画像I14に白色画素の領域が存在するか否かに応じて、入力画像I10に欠陥8が写っているか否かを判定する。具体的に、検出画像I14において白色画素の領域が存在する場合、プロセッサ110は、入力画像I10の対応する領域に欠陥8が写っていると判定する。一方、検出画像I14において白色画素の領域が存在しない場合、プロセッサ110は、入力画像I10に欠陥8が写っていないと判定する。 The processor 110 determines whether the defect 8 is shown in the input image I10, depending on whether a white pixel area exists in the detected image I14. Specifically, when a region of white pixels exists in the detected image I14, the processor 110 determines that the defect 8 is shown in the corresponding region of the input image I10. On the other hand, if there is no area of white pixels in the detected image I14, the processor 110 determines that the defect 8 is not included in the input image I10.

閾値Th1.Th2は、処理項目35Aの実行に用いられるパラメータである。閾値Th1.Th2が適切に設定されることにより、ワークWの欠陥8の有無が精度良く判定される。 Threshold Th1. Th2 is a parameter used to execute the processing item 35A. Threshold Th1. By appropriately setting Th2, the presence or absence of the defect 8 in the workpiece W can be determined with high accuracy.

処理項目35Aには、処理項目31A~34Aが実行された画像が入力される。上述したように、処理項目34Aが実行された画像に、第1部分に欠陥の生じたワークWが写っている場合、処理項目34Aの実行により、当該欠陥の形、サイズおよび画素値が変化する。当該度合いは、処理項目34Aの実行に用いられるパラメータの値に依存する。閾値Th1,Th2は、処理項目34Aが実行された画像に写り得る、第1部分の欠陥の形、サイズおよび画素値に応じて適切に設定される必要がある。そのため、処理項目34Aの実行に用いられるパラメータの値を変更するたびに、処理項目35Aの実行に用いられるパラメータ(すなわち、閾値Th1,Th2)の値も設定し直す必要がある。 The image on which the processing items 31A to 34A have been executed is input to the processing item 35A. As described above, if the image for which processing item 34A has been executed shows a workpiece W with a defect in the first portion, the shape, size, and pixel value of the defect will change by executing processing item 34A. . The degree depends on the value of the parameter used to execute the processing item 34A. The threshold values Th1 and Th2 need to be appropriately set according to the shape, size, and pixel value of the defect in the first portion that may appear in the image in which the processing item 34A is performed. Therefore, each time the value of the parameter used to execute the process item 34A is changed, it is necessary to reset the value of the parameter (that is, threshold value Th1, Th2) used to execute the process item 35A.

<D-2.設定用画像データの管理>
図13は、動作例1において、設定用画像に対する正解値を設定するときの画面を示す図である。図13に例示される画面60は、表示装置6に表示される。
<D-2. Managing image data for settings>
FIG. 13 is a diagram showing a screen when setting a correct value for a setting image in operation example 1. A screen 60 illustrated in FIG. 13 is displayed on the display device 6.

画面60は、一時的に処理済画像25を保存するフォルダ(以下、「一時保存フォルダ」と称する。)を設定するためのボタン61を含む。ボタン61の操作に応じて、プロセッサ110は、一時保存フォルダの指定を受け付けるための図示しないウィンドウを表示させ、指定に応じて一時保存フォルダを設定する。 The screen 60 includes a button 61 for setting a folder (hereinafter referred to as a "temporary storage folder") in which the processed image 25 is temporarily stored. In response to the operation of the button 61, the processor 110 displays a window (not shown) for accepting the designation of a temporary storage folder, and sets the temporary storage folder according to the designation.

画面60は、設定用画像22に対する正解値を管理するためのタブ80を含む。図13には、タブ80が選択されているときの画面60が示される。 The screen 60 includes a tab 80 for managing correct values for the setting image 22. FIG. 13 shows the screen 60 when the tab 80 is selected.

タブ80が選択されたとき、画面60には、複数の設定用画像22が保存されているフォルダを選択するためのボタン62が表示される。ボタン62の操作に応じて、プロセッサ110は、複数の設定用画像22が保存されているフォルダの指定を受け付けるための図示しないウィンドウを表示させる。プロセッサ110は、指定されたフォルダに保存されている複数の設定用画像22のリスト63を画面60内に表示させる。 When the tab 80 is selected, a button 62 for selecting a folder in which a plurality of setting images 22 are stored is displayed on the screen 60. In response to the operation of the button 62, the processor 110 displays a window (not shown) for accepting the designation of the folder in which the plurality of setting images 22 are saved. The processor 110 causes the screen 60 to display a list 63 of the plurality of setting images 22 stored in the designated folder.

リスト63は、複数の設定用画像22の各々について、ファイル名と、属性と、コメントと、欠陥位置とを含む。属性は、設定用画像22についての正解値を示す。具体的には、属性は、設定用画像22に写るワークWが良品であるか不良品であるかを示す。図13において、「OK」は良品を示し、「NG」は不良品を示す。コメントは、ユーザによって任意に記入される。欠陥位置は、属性が「不良品」である設定用画像22について設定される。 The list 63 includes a file name, an attribute, a comment, and a defect position for each of the plurality of setting images 22. The attribute indicates the correct value for the setting image 22. Specifically, the attribute indicates whether the workpiece W shown in the setting image 22 is a good product or a defective product. In FIG. 13, "OK" indicates a non-defective product, and "NG" indicates a defective product. Comments are arbitrarily entered by the user. The defect position is set for the setting image 22 whose attribute is "defective product".

リスト63には、1つの設定用画像22を選択するためのカーソル63aが表示される。画面60は、画像を表示するための領域64を含む。領域64には、カーソル63aによって選択された設定用画像22が表示される。ユーザは、アイコン群65を操作することにより、領域64に表示される設定用画像22を拡大縮小できる。 A cursor 63a for selecting one setting image 22 is displayed in the list 63. Screen 60 includes an area 64 for displaying images. In the area 64, the setting image 22 selected by the cursor 63a is displayed. By operating the icon group 65, the user can enlarge or reduce the setting image 22 displayed in the area 64.

ユーザは、領域64を確認しながら、属性をリスト63に入力する。ユーザは、必要に応じてコメントをリスト63に入力できる。属性に不良品(「NG」)が入力されると、プロセッサ110は、領域64に枠線64aを表示する。ユーザは、欠陥8を囲むように枠線64aのサイズおよび位置を調整する。ユーザは、調整が完了すると、欠陥位置の設定が完了した旨をリスト63に入力する。このようにして、ユーザは、各設定用画像22について、属性、コメントおよび欠陥位置を入力する。 The user inputs attributes into the list 63 while checking the area 64. The user can input comments into the list 63 if necessary. When a defective product (“NG”) is input as the attribute, the processor 110 displays a frame line 64a in the area 64. The user adjusts the size and position of the frame line 64a so as to surround the defect 8. When the adjustment is completed, the user inputs into the list 63 that the setting of the defect position has been completed. In this way, the user inputs attributes, comments, and defect positions for each setting image 22.

画面60は、リスト63に含まれる2以上の設定用画像22に対して一括入力を行なうためのボタン群66を含む。ユーザは、ボタン群66を操作することにより、2以上の設定用画像22に対して属性およびコメントの一括入力を行うことができる。 The screen 60 includes a button group 66 for collectively inputting two or more setting images 22 included in the list 63. By operating the button group 66, the user can collectively input attributes and comments for two or more setting images 22.

画面60は、管理データ23の作成を指示するためのボタン67を含む。ボタン67の操作に応じて、プロセッサ110は、リスト63への入力と領域64の枠線64aのサイズおよび位置とに基づいて、管理データ23を作成する。動作例1に係る管理データ23は、各設定用画像22について、属性、コメントおよび欠陥位置を示す。 Screen 60 includes a button 67 for instructing creation of management data 23. In response to the operation of button 67, processor 110 creates management data 23 based on the input to list 63 and the size and position of frame line 64a of area 64. Management data 23 according to operation example 1 indicates attributes, comments, and defect positions for each setting image 22.

画面60は、画面60を閉じるためのボタン68を含む。ボタン68が操作されると、プロセッサ110は、設定用画像22に対する正解値の設定処理を終了する。 Screen 60 includes a button 68 for closing screen 60. When the button 68 is operated, the processor 110 ends the process of setting the correct value for the setting image 22.

<D-3.パラメータの設定>
図14は、動作例1においてパラメータを設定するときの画面を示す図である。画面60は、機械学習によって学習済モデル140を生成するためのタブ71と、パラメータを設定するためのタブ69とを含む。図14には、タブ69が選択されたときの画面60が示される。
<D-3. Parameter settings>
FIG. 14 is a diagram showing a screen when setting parameters in operation example 1. Screen 60 includes a tab 71 for generating a trained model 140 by machine learning, and a tab 69 for setting parameters. FIG. 14 shows the screen 60 when the tab 69 is selected.

画面60は、学習済モデル140を読み込むためのボタン70を含む。ボタン70が操作されると、プロセッサ110は、学習済モデル140の指定を受け付けるための図示しないウィンドウを表示させる。プロセッサ110は、指定に応じて、学習済モデル140を読み込む。学習済モデル140は、タブ71の選択に応じて予め生成される。もしくは、学習済モデル140は、通信インターフェイス128(図5参照)を介して外部のPCなどから取得されてもよい。 Screen 60 includes a button 70 for loading trained model 140. When the button 70 is operated, the processor 110 displays a window (not shown) for accepting the designation of the learned model 140. Processor 110 reads trained model 140 according to the specification. The trained model 140 is generated in advance according to the selection of the tab 71. Alternatively, the trained model 140 may be acquired from an external PC or the like via the communication interface 128 (see FIG. 5).

画面60は、処理済画像25の生成と差分情報の生成とを開始するためのボタン72を含む。 Screen 60 includes a button 72 for starting generation of processed image 25 and generation of difference information.

ボタン72が操作されると、生成部13として動作するプロセッサ110は、複数の設定用画像22に対して画像処理フロー30Aを実行し、処理項目35Aの前段までの処理項目31A~34Aが実行された複数の処理済画像25をそれぞれ生成する。プロセッサ110は、ボタン61の操作に応じて設定された一時保存フォルダに、生成した複数の処理済画像25を保存する。 When the button 72 is operated, the processor 110 operating as the generation unit 13 executes the image processing flow 30A on the plurality of setting images 22, and the processing items 31A to 34A up to the stage before the processing item 35A are executed. A plurality of processed images 25 are respectively generated. The processor 110 saves the generated plurality of processed images 25 in a temporary storage folder set according to the operation of the button 61.

複数の処理済画像25が一時保存フォルダに保存されると、設定部14として動作するプロセッサ110は、複数の処理済画像25の各々に対して処理項目35Aを実行し、処理結果を生成する。 When the plurality of processed images 25 are saved in the temporary storage folder, the processor 110 operating as the setting unit 14 executes the processing item 35A on each of the plurality of processed images 25 and generates a processing result.

具体的には、図12に示されるように、プロセッサ110は、複数の処理済画像25の各々に対して学習済モデル140を適用して復元画像を生成する。そして、プロセッサ110は、各処理済画像25と当該処理済画像25の復元画像との差分画像に対して閾値Th1を適用して、二値化画像を生成する。さらに、プロセッサ110は、二値化画像に閾値Th2を適用して、欠陥の有無を判定する。プロセッサ110は、欠陥の有無を示す処理結果を生成する。 Specifically, as shown in FIG. 12, the processor 110 applies the learned model 140 to each of the plurality of processed images 25 to generate a restored image. Then, the processor 110 applies the threshold Th1 to the difference image between each processed image 25 and the restored image of the processed image 25 to generate a binarized image. Furthermore, the processor 110 applies a threshold Th2 to the binarized image to determine the presence or absence of defects. The processor 110 generates a processing result indicating the presence or absence of a defect.

プロセッサ110は、複数の設定用画像22からそれぞれ生成された複数の処理済画像25に対する処理結果と、複数の設定用画像22に対してそれぞれ設定された正解値との差分を示す差分情報を生成する。動作例1では、差分情報は、複数の設定用画像22のうち、処理結果と正解値とが一致する設定用画像22の個数(以下、「正解数」とも称する。)と、処理結果と正解値とが一致しない設定用画像22の個数(以下、「不正解数」とも称する。)とを示す。なお、差分情報は、正解数または不正解数のいずれかのみを示してもよい。あるいは、差分情報は、複数の設定用画像22の全個数に対する正解数の割合、および、全個数に対する不正解数の割合の少なくとも一方を示してもよい。 The processor 110 generates difference information indicating the difference between the processing results for the plurality of processed images 25 each generated from the plurality of setting images 22 and the correct value set for each of the plurality of setting images 22. do. In operation example 1, the difference information includes the number of setting images 22 whose processing results and correct values match among the plurality of setting images 22 (hereinafter also referred to as "number of correct answers"), and the processing results and correct answers. The number of setting images 22 whose values do not match (hereinafter also referred to as "number of incorrect answers") is shown. Note that the difference information may indicate only the number of correct answers or the number of incorrect answers. Alternatively, the difference information may indicate at least one of the ratio of the number of correct answers to the total number of the plurality of setting images 22 and the ratio of the number of incorrect answers to the total number.

プロセッサ110は、処理項目35Aの実行に用いられるパラメータ(閾値Th1および閾値Th2)が取り得る複数の値の各々について、差分情報を生成する。プロセッサ110は、処理項目35Aの実行に用いられるパラメータ(閾値Th1および閾値Th2)が取り得る複数の値の各々と差分情報とを対応付けたテーブル73を画面60内に表示する。ユーザは、正解数が多い値を選択することが好ましい。そのため、プロセッサ110は、差分情報によって示される正解数の多い順に、パラメータ(閾値Th1および閾値Th2)が取り得る複数の値をソートすることが好ましい。 The processor 110 generates difference information for each of a plurality of values that the parameters (threshold Th1 and threshold Th2) used to execute the processing item 35A can take. The processor 110 displays on the screen 60 a table 73 that associates each of a plurality of possible values of the parameters (threshold value Th1 and threshold value Th2) used to execute the processing item 35A with difference information. It is preferable that the user selects a value with a large number of correct answers. Therefore, it is preferable that the processor 110 sorts the possible values of the parameters (threshold Th1 and threshold Th2) in descending order of the number of correct answers indicated by the difference information.

テーブル73には、カーソル73aが表示される。ユーザは、カーソル73aを移動させることにより、テーブル73の中の1つのレコードを選択できる。 A cursor 73a is displayed on the table 73. The user can select one record in the table 73 by moving the cursor 73a.

画面60は、処理結果の詳細情報を確認するためのボタン74を含む。ボタン74の操作に応じて、プロセッサ110は、カーソル73aによって選択されているレコードの処理結果の詳細情報を表示装置6に表示する。 Screen 60 includes a button 74 for checking detailed information on the processing result. In response to the operation of the button 74, the processor 110 displays detailed information on the processing result of the record selected by the cursor 73a on the display device 6.

図15は、動作例1における処理結果の詳細情報を示すウィンドウの一例を示す図である。図15に例示されるウィンドウ75は、画面60のボタン74の操作に応じて表示される。なお、ウィンドウ75は、画面60に重ねて表示されてもよい。 FIG. 15 is a diagram showing an example of a window showing detailed information on processing results in operation example 1. The window 75 illustrated in FIG. 15 is displayed in response to the operation of the button 74 on the screen 60. Note that the window 75 may be displayed overlapping the screen 60.

ウィンドウ75は、領域76,77を含む。領域76には、複数の設定用画像22のうち、属性(正解値)として「OK」が設定された設定用画像22の一覧が表示される。領域76に表示される一覧は、各設定用画像22について、ファイル名と、コメントと、処理結果と正解値とが一致しているか否かを示すフラグ(図中、「見過ぎ」と記されるフラグ)とを含む。領域76において、フラグ「○」は、良品であるワークWの写る設定用画像22に対して欠陥有りと判定されたことを示す。 Window 75 includes regions 76 and 77. In the area 76, a list of setting images 22 for which "OK" is set as an attribute (correct value) among the plurality of setting images 22 is displayed. The list displayed in the area 76 includes, for each setting image 22, a file name, a comment, and a flag indicating whether or not the processing result matches the correct value (marked as "overseen" in the figure). flag). In the area 76, the flag "○" indicates that the setting image 22 in which the workpiece W, which is a non-defective item, is shown is determined to have a defect.

領域77には、複数の設定用画像22のうち、属性(正解値)として「NG」が設定された設定用画像22の一覧が表示される。領域77に表示される一覧は、各設定用画像22について、ファイル名と、コメントと、処理結果と正解値とが一致しているか否かを示すフラグ(図中、「見逃し」と記されるフラグ)とを含む。領域77において、フラグ「○」は、不良品であるワークWの写る設定用画像22に対して欠陥無しと判定されたことを示す。 In the area 77, a list of the setting images 22 for which "NG" is set as the attribute (correct value) among the plurality of setting images 22 is displayed. The list displayed in the area 77 includes, for each setting image 22, a file name, a comment, and a flag indicating whether or not the processing result matches the correct value (marked as "missed" in the figure). flag). In the area 77, the flag “◯” indicates that the setting image 22 showing the defective work W is determined to have no defects.

領域76,77に表示される一覧のコメント欄には、図13に示すリスト63のコメント欄に入力された文字列が表示される。 The character strings input in the comment field of the list 63 shown in FIG. 13 are displayed in the comment fields of the lists displayed in areas 76 and 77.

ウィンドウ75は、ウィンドウ75を閉じるためのボタン78を含む。ボタン78の操作に応じて、プロセッサ110は、ウィンドウ75を閉じ、図14に示す画面60を表示装置6に表示させる。 Window 75 includes a button 78 for closing window 75. In response to the operation of button 78, processor 110 closes window 75 and displays screen 60 shown in FIG. 14 on display device 6.

図14に示されるように、画面60は、処理項目35Aの実行に用いられるパラメータ(閾値Th1および閾値Th2)の値を設定するためのボタン79を含む。ボタン79の操作に応じて、プロセッサ110は、テーブル73においてカーソル73aによって選択されているレコードに含まれるパラメータの値を、処理項目35Aの実行時に用いる値として設定する。すなわち、プロセッサ110は、カーソル73aによって選択されているレコードに含まれるパラメータの値を示す設定データ24を生成し、生成した設定データ24を記憶部20に保存する。 As shown in FIG. 14, the screen 60 includes buttons 79 for setting values of parameters (threshold Th1 and threshold Th2) used to execute the processing item 35A. In response to the operation of the button 79, the processor 110 sets the value of the parameter included in the record selected by the cursor 73a in the table 73 as the value to be used when executing the processing item 35A. That is, the processor 110 generates setting data 24 indicating the value of the parameter included in the record selected by the cursor 73a, and stores the generated setting data 24 in the storage unit 20.

以上のように、複数の設定用画像22に対して処理項目31A~34Aを実行することにより複数の処理済画像25が自動的に生成され、複数の処理済画像25を用いて、処理項目35Aの実行に用いられる閾値Th1および閾値Th2が設定される。これにより、閾値Th1および閾値Th2を適切に設定できる。なお、パラメータの設定対象となる処理項目35Aの前段の処理項目は、図11に示す処理項目31A~34Aに限定されない。例えば、上述した幾何学処理が処理項目35Aの前段までの処理項目として配置されてもよい。この場合、幾何学処理が実行された複数の処理済画像25を用いて、処理項目35Aの実行に用いられる閾値Th1および閾値Th2が設定される。 As described above, a plurality of processed images 25 are automatically generated by executing the processing items 31A to 34A on the plurality of setting images 22, and the processing item 35A is automatically generated using the plurality of processed images 25. Threshold value Th1 and threshold value Th2 used for execution are set. Thereby, the threshold Th1 and the threshold Th2 can be appropriately set. Note that the processing items preceding the processing item 35A for which parameters are set are not limited to the processing items 31A to 34A shown in FIG. 11. For example, the above-mentioned geometric processing may be arranged as a processing item preceding the processing item 35A. In this case, the threshold Th1 and the threshold Th2 used to execute the processing item 35A are set using the plurality of processed images 25 on which the geometric processing has been performed.

上記の動作例は、処理項目38Aの実行に用いられるパラメータの設定指示を受けたときにも適用される。なお、内周部分に欠陥がないものの外周部分に欠陥がある設定用画像22もあれば、外周部分に欠陥がないものの内周部分に欠陥がある設定用画像22もある。そのため、処理項目38A用に管理データ23が作成される。 The above operation example is also applied when receiving an instruction to set parameters used to execute the processing item 38A. Note that there are setting images 22 that have no defects on the inner periphery but have defects on the outer periphery, and there are also setting images 22 that have no defects on the outer periphery but have defects on the inner periphery. Therefore, the management data 23 is created for the processing item 38A.

また、複数の処理済画像25を用いて、処理項目35Aの実行に用いられる学習済モデル140を定義付けるパラメータが設定されてもよい。すなわち、図14に示すタブ71が選択されたとき、複数の処理済画像25のうち、属性(正解値)として「OK」が設定された設定用画像22から生成された1以上の処理済画像25(良品画像)を用いた機械学習によって、学習済モデル140が生成される。パラメータは、学習済モデル140を構成するニューラルネットワークまたは固有ベクトルを定義付ける。 Further, parameters may be set using a plurality of processed images 25 to define the trained model 140 used to execute the processing item 35A. That is, when the tab 71 shown in FIG. 14 is selected, one or more processed images generated from the setting image 22 for which "OK" is set as the attribute (correct value) among the plurality of processed images 25 are selected. A learned model 140 is generated by machine learning using 25 (good product images). The parameters define the neural network or eigenvectors that make up the trained model 140.

画像が複数のパッチ画像に分割され、パッチ画像ごとに学習済モデル140が生成されてもよい。例えば、画像は、N個のパッチ画像に分割される。この場合、プロセッサ110は、複数の処理済画像25の各々から取得されたk番目のパッチ画像を用いた機械学習により、k番目のパッチ画像に対応する学習済モデル140を生成すればよい。ただし、プロセッサ110は、k番目のパッチ画像の位置と管理データ23によって示される欠陥位置とが重なる設定用画像22に対応する処理済画像25から取得されたパッチ画像を機械学習用の画像から除外する。 The image may be divided into a plurality of patch images, and the trained model 140 may be generated for each patch image. For example, an image is divided into N patch images. In this case, the processor 110 may generate the learned model 140 corresponding to the k-th patch image by machine learning using the k-th patch image acquired from each of the plurality of processed images 25. However, the processor 110 excludes from the machine learning images the patch images acquired from the processed image 25 corresponding to the setting image 22 in which the position of the k-th patch image and the defect position indicated by the management data 23 overlap. do.

<E.動作例2>
図16は、動作例2におけるワークWを示す図である。図16に示されるように、ワークWは、平面視略矩形状である。ワークWの上面には、マーク150が印字されている。ワークWは、4つのピン4a~4dを有するXYステージ4上に、ピン4a~4dに囲まれるように載置される。
<E. Operation example 2>
FIG. 16 is a diagram showing the workpiece W in operation example 2. As shown in FIG. 16, the workpiece W has a substantially rectangular shape in plan view. A mark 150 is printed on the upper surface of the workpiece W. The workpiece W is placed on an XY stage 4 having four pins 4a to 4d so as to be surrounded by the pins 4a to 4d.

図17は、動作例2においてパラメータ設定の対象となる画像処理フローを示す図である。図17に例示される画像処理フロー30Bは、処理項目31B~36Bを含む。 FIG. 17 is a diagram illustrating an image processing flow for which parameters are set in operation example 2. The image processing flow 30B illustrated in FIG. 17 includes processing items 31B to 36B.

処理項目31Bは、画像処理の対象となる画像を取得するための項目である。処理項目32Bは、処理項目31Bによって取得された画像に対して、エッジを構成する画素を抽出するフィルタを適用する項目である。処理項目32Bの実行により、マーク150のエッジの形、サイズ、輝度(画素値)が変化する。マーク150のエッジの形、サイズおよび画素値の変化の度合いは、処理項目32Bの実行に用いられるパラメータの値に依存する。 The processing item 31B is an item for acquiring an image to be subjected to image processing. The processing item 32B is an item for applying a filter for extracting pixels forming an edge to the image acquired by the processing item 31B. By executing processing item 32B, the shape, size, and brightness (pixel value) of the edge of mark 150 change. The shape and size of the edge of mark 150 and the degree of change in pixel value depend on the values of the parameters used to execute processing item 32B.

処理項目33Bは、処理項目32Bが実行された画像に対してモデル画像を用いたパターンマッチングを行なうことにより、マーク150の位置を検出する項目である。処理項目34Bは、XYステージ4に関するデータを設定および保持する項目である。処理項目35Bは、処理項目33Bの実行によって得られたマーク150の位置と目標位置とに基づいて、マーク150を目標位置に移動させるために必要なXYステージ4の移動量を算出する項目である。処理項目36Bは、処理項目35Bの実行によって得られた移動量を出力する項目である。 The processing item 33B is an item for detecting the position of the mark 150 by performing pattern matching using a model image on the image on which the processing item 32B has been executed. The processing item 34B is an item for setting and holding data regarding the XY stage 4. The processing item 35B is an item for calculating the amount of movement of the XY stage 4 required to move the mark 150 to the target position based on the position of the mark 150 obtained by executing the processing item 33B and the target position. . The processing item 36B is an item that outputs the amount of movement obtained by executing the processing item 35B.

以下、画像処理フロー30Aにおける処理項目33Bの実行に用いられるパラメータの設定指示を受けたときの画像処理装置1の動作例について説明する。 Hereinafter, an example of the operation of the image processing apparatus 1 when receiving an instruction to set parameters used to execute the processing item 33B in the image processing flow 30A will be described.

<E-1.パラメータの設定対象となる処理項目>
図18は、動作例2においてパラメータの設定対象となる処理項目の内容を示す図である。図18に示されるように、処理項目33Bは、ステップS101~ステップS106の処理を含む。なお、各ステップは、例えば特開2011-191928号公報に開示されているような公知の技術が用いられ得る。
<E-1. Processing items for which parameters are set>
FIG. 18 is a diagram showing the contents of processing items for which parameters are set in operation example 2. As shown in FIG. 18, the processing item 33B includes the processing of steps S101 to S106. Note that each step may use a known technique such as that disclosed in Japanese Patent Laid-Open No. 2011-191928, for example.

ステップS101は、予め準備されたモデル画像に含まれる画像情報をモデル情報として登録する処理である。モデル画像として、ワークW上のマーク150の写る画像が準備される。モデル情報には、モデル画像における各エッジ点の座標位置とエッジにおける濃淡の変化方向を示すエッジコードとを対応付けたエッジコード画像と、当該エッジコード画像におけるエッジコードの頻度を示すエッジコードヒストグラムとが含まれる。 Step S101 is a process of registering image information included in a model image prepared in advance as model information. An image showing the mark 150 on the workpiece W is prepared as a model image. The model information includes an edge code image that associates the coordinate position of each edge point in the model image with an edge code that indicates the direction of change in density at the edge, and an edge code histogram that indicates the frequency of edge codes in the edge code image. is included.

ステップS102は、入力された画像(すなわち、前段の処理項目32Bから出力された画像)からエッジコード画像とエッジコードヒストグラムとを生成する処理である。 Step S102 is a process of generating an edge code image and an edge code histogram from the input image (that is, the image output from the preceding processing item 32B).

ステップS103は、エッジコードヒストグラムを用いて、入力された画像内にモデル画像と一致する可能性がある領域(以下、「候補点」とも称する。)を特定する粗サーチ処理である。具体的には、入力された画像の注目領域にモデル画像を重ねたときの、入力された画像から生成されたエッジコードヒストグラムとモデル画像から生成されたエッジコードヒストグラムとの一致度が、閾値Th3と比較される。一致度が閾値Th3を超えることに応じて、注目領域の位置が候補点として抽出される。この処理を注目領域の位置をシフトさせながら実行することにより、1以上の候補点が抽出される。 Step S103 is a rough search process that uses an edge code histogram to identify a region (hereinafter also referred to as "candidate point") that may match the model image within the input image. Specifically, when the model image is superimposed on the region of interest of the input image, the degree of matching between the edge code histogram generated from the input image and the edge code histogram generated from the model image is determined by the threshold Th3. compared to When the degree of matching exceeds the threshold Th3, the position of the region of interest is extracted as a candidate point. By executing this process while shifting the position of the region of interest, one or more candidate points are extracted.

ステップS104は、ステップS103により抽出された各候補点について、当該候補点を含む注目領域において、当該注目領域のエッジコード画像とモデル画像から生成されたエッジコード画像との一致度に基づいて、マーク150の位置を計測する処理である。 Step S104 marks each candidate point extracted in step S103 in the region of interest including the candidate point based on the degree of matching between the edge code image of the region of interest and the edge code image generated from the model image. This is a process of measuring the position of 150.

ステップS104は、複数の段階に分けて実行され得る。例えば、第1段において、予め設定された間隔で注目領域を移動させていくことで一致度が順次評価され、最も一致度の高い注目領域の位置が特定される。その後、前段において最も一致度の高い位置の周辺に複数の注目領域が設定され、当該複数の注目領域の中から最も一致度の高い位置(座標)が特定される。複数の注目領域の間隔は、前段における複数の注目領域の間隔よりも小さく設定される。このようにして、入力された画像において、モデル画像との一致度の最も高い位置(計測座標)が計測される。 Step S104 may be performed in multiple stages. For example, in the first stage, the degree of matching is sequentially evaluated by moving the region of interest at preset intervals, and the position of the region of interest with the highest degree of matching is identified. After that, a plurality of regions of interest are set around the position with the highest degree of coincidence in the previous stage, and a position (coordinates) with the highest degree of coincidence is specified from among the plurality of attention regions. The interval between the plurality of attention areas is set smaller than the interval between the plurality of attention areas in the previous stage. In this way, in the input image, the position (measurement coordinates) with the highest degree of matching with the model image is measured.

なお、最終段において、最も高い一致度を示す注目領域およびその周辺の注目領域における一致度の変化特性を補間して、そのピーク位置を特定することで、予め設定された移動間隔より小さい間隔(高い精度)でモデル画像と一致する領域の位置を特定できる。これにより、1画素より小さいサブピクセルの単位で計測座標を算出することができる。 In addition, in the final step, by interpolating the change characteristics of the degree of coincidence in the region of interest showing the highest degree of coincidence and the surrounding regions of interest, and specifying the peak position, the interval smaller than the preset movement interval ( The location of the region that matches the model image can be identified with high accuracy. Thereby, measurement coordinates can be calculated in units of subpixels smaller than one pixel.

ステップS105は、上述の処理によって取得された計測結果(計測座標)のうち、重複したものを削除するための近接点除去処理である。この近接点除去処理においては、上述のステップS104において特定されたモデル画像と一致する位置のうち、互いに近接する(すなわち、重複する)位置の一方を除去する。ステップS106は、取得した計測座標を出力するための出力処理である。 Step S105 is an adjacent point removal process for deleting duplicates among the measurement results (measurement coordinates) obtained by the above-described process. In this proximity point removal process, one of the positions that are close to each other (that is, overlap) among the positions that match the model image identified in step S104 described above is removed. Step S106 is an output process for outputting the acquired measurement coordinates.

モデル画像、ステップS103,S104におけるエッジ情報の量(例えばエッジ点の個数)、閾値Th3、サブピクセル単位での計測の有無は、処理項目33Bの実行に用いられるパラメータである。これらのパラメータは、マーク150の位置の計測精度と、計測時間とに関係する。 The model image, the amount of edge information (for example, the number of edge points) in steps S103 and S104, the threshold Th3, and the presence or absence of measurement in subpixel units are parameters used to execute the processing item 33B. These parameters are related to the measurement accuracy of the position of the mark 150 and the measurement time.

処理項目33Bには、処理項目31B,32Bが実行された画像が入力される。上述したように、処理項目32Bの実行により、マーク150のエッジの形、サイズおよび画素値が変化する。これらの変化の度合いは、処理項目32Bの実行に用いられるパラメータの値に依存する。処理項目33Bの実行に用いられるパラメータは、入力される画像の状態に応じて適切に設定される必要がある。そのため、処理項目32Bの実行に用いられるパラメータの値を変更するたびに、処理項目33Bの実行に用いられるパラメータの値も設定し直す必要がある。 The image on which the processing items 31B and 32B have been executed is input to the processing item 33B. As described above, the shape, size, and pixel value of the edge of the mark 150 change by executing the processing item 32B. The degree of these changes depends on the values of the parameters used to execute the processing item 32B. The parameters used to execute the processing item 33B need to be appropriately set according to the state of the input image. Therefore, each time the value of the parameter used to execute the process item 32B is changed, it is necessary to reset the value of the parameter used to execute the process item 33B.

<E-2.設定用画像の管理>
図19は、動作例2において準備される設定用画像の例を示す図である。マーク150が画像の中心(座標(1000,1000))に位置するように、手動でXYステージ4を調整する。図19(a)には、この状態(以下、「基準状態」と称する。)で撮像された基準画像160が示される。基準画像160においてマーク150の写る領域170は、モデル画像として使用されてもよい。
<E-2. Managing images for settings>
FIG. 19 is a diagram illustrating an example of a setting image prepared in operation example 2. The XY stage 4 is manually adjusted so that the mark 150 is located at the center of the image (coordinates (1000, 1000)). FIG. 19A shows a reference image 160 captured in this state (hereinafter referred to as "reference state"). An area 170 in which the mark 150 appears in the reference image 160 may be used as a model image.

次に、基準状態からXYステージ4をX方向に1cmだけ移動させたときに撮像された設定用画像22a(図19(b)参照)が予め準備される。同様にして、基準状態からXYステージ4を-X方向に1cmだけ移動させたときに撮像された設定用画像22b(図19(c)参照)と、基準状態からXYステージ4をY方向に1cmだけ移動させたときに撮像された設定用画像22c(図19(d)参照)と、基準状態からXYステージ4を-Y方向に1cmだけ移動させたときに撮像された設定用画像22d(図19(e)参照)とが予め準備される。 Next, a setting image 22a (see FIG. 19(b)) is prepared in advance, which is captured when the XY stage 4 is moved by 1 cm in the X direction from the reference state. Similarly, the setting image 22b (see FIG. 19(c)) taken when the XY stage 4 was moved 1 cm in the -X direction from the reference state, and the setting image 22b taken when the XY stage 4 was moved 1 cm in the Y direction from the reference state. The setting image 22c captured when the XY stage 4 was moved by 1 cm from the reference state in the −Y direction (see FIG. 19(e)) are prepared in advance.

図20は、動作例2において、設定用画像に対する正解値を設定するときの画面を示す図である。図20に例示される画面60Aは、表示装置6に表示される。 FIG. 20 is a diagram showing a screen when setting a correct value for a setting image in operation example 2. A screen 60A illustrated in FIG. 20 is displayed on the display device 6.

画面60Aは、動作例1の画面60(図13参照)と同様に、一時保存フォルダを設定するためのボタン61を含む。ボタン61の操作に応じて、プロセッサ110は、一時保存フォルダを設定する。 The screen 60A includes a button 61 for setting a temporary storage folder, similar to the screen 60 of operation example 1 (see FIG. 13). In response to the operation of button 61, processor 110 sets a temporary storage folder.

画面60Aは、動作例1の画面60(図13参照)と同様に、設定用画像に対する正解値を管理するためのタブ80を含む。図20には、タブ80が選択されているときの画面60Aが示される。 The screen 60A includes a tab 80 for managing the correct value for the setting image, similar to the screen 60 of the first operation example (see FIG. 13). FIG. 20 shows the screen 60A when the tab 80 is selected.

画面60Aは、動作例1の画面60(図13参照)と同様に、設定用画像が保存されているフォルダを選択するためのボタン62を含む。ボタン62の操作に応じて、プロセッサ110は、設定用画像22a~22d(図19参照)のリスト81を画面60A内に表示させる。 The screen 60A includes a button 62 for selecting the folder in which the setting image is saved, similar to the screen 60 of operation example 1 (see FIG. 13). In response to the operation of the button 62, the processor 110 displays a list 81 of setting images 22a to 22d (see FIG. 19) on the screen 60A.

リスト81は、設定用画像22a~22dの各々について、ファイル名と、マーク位置とを含む。マーク位置は、各設定用画像についての正解値を示す。 The list 81 includes a file name and a mark position for each of the setting images 22a to 22d. The mark position indicates the correct value for each setting image.

リスト81には、1つの設定用画像を選択するためのカーソル81aが表示される。画面60Aは、動作例1の画面60(図13参照)と同様に、画像を表示するための領域64を含む。領域64には、カーソル81aによって選択された設定用画像が表示される。ユーザは、領域64を確認しながら、マーク位置をリスト81に入力すればよい。上述したように、設定用画像22a,22b,22c,22dは、基準状態からX方向,-X方向,Y方向,-Y方向にそれぞれ1cmだけ移動させたときの画像である。マーク150の実際の移動量と、画像上のマークの150の移動画素数との関係は、予めキャリブレーションによって求められている。そのため、ユーザは、当該関係に応じて、各設定用画像に写るマーク150の座標をリスト81に入力すればよい。例えば、実際の移動量1cmが100画素(ピクセル)に対応する場合、設定用画像22a,22b,22c,22dにおけるマーク位置は、それぞれ(1100,1000),(900,1000),(1000,1100),(1000,900)となる。 The list 81 displays a cursor 81a for selecting one setting image. The screen 60A includes an area 64 for displaying images, similar to the screen 60 of Operation Example 1 (see FIG. 13). The setting image selected by the cursor 81a is displayed in the area 64. The user only has to input the mark position into the list 81 while checking the area 64. As described above, the setting images 22a, 22b, 22c, and 22d are images obtained by moving 1 cm from the reference state in the X direction, -X direction, Y direction, and -Y direction, respectively. The relationship between the actual amount of movement of the mark 150 and the number of 150 pixels of movement of the mark on the image is determined in advance by calibration. Therefore, the user only has to input the coordinates of the mark 150 appearing in each setting image into the list 81 according to the relationship. For example, if 1 cm of actual movement corresponds to 100 pixels, the mark positions in the setting images 22a, 22b, 22c, and 22d are (1100, 1000), (900, 1000), and (1000, 1100), respectively. ), (1000,900).

画面60Aは、動作例1の画面60(図13参照)と同様に、管理データ23の作成を指示するためのボタン67を含む。ボタン67の操作に応じて、プロセッサ110は、リスト81への入力に基づいて、管理データ23を作成する。動作例2に係る管理データ23は、各設定用画像について、マーク位置を示す。 The screen 60A includes a button 67 for instructing the creation of the management data 23, similar to the screen 60 of the first operation example (see FIG. 13). In response to the operation of button 67, processor 110 creates management data 23 based on the input to list 81. The management data 23 according to operation example 2 indicates the mark position for each setting image.

<E-3.パラメータの設定>
図21は、動作例2においてパラメータを設定するときの画面を示す図である。画面60Aは、動作例1の画面60(図14参照)と同様に、パラメータを設定するためのタブ69とを含む。図21には、タブ69が選択されたときの画面60Aが示される。
<E-3. Parameter settings>
FIG. 21 is a diagram showing a screen when setting parameters in operation example 2. The screen 60A includes a tab 69 for setting parameters, similar to the screen 60 of operation example 1 (see FIG. 14). FIG. 21 shows the screen 60A when the tab 69 is selected.

画面60Aは、動作例1の画面60(図14参照)と同様に、処理済画像の生成と差分情報の生成とを開始するためのボタン72を含む。 The screen 60A includes a button 72 for starting generation of a processed image and generation of difference information, similar to the screen 60 of operation example 1 (see FIG. 14).

ボタン72に操作に応じて、プロセッサ110は、4つの設定用画像22a~22dに対して画像処理フロー30Bを実行し、処理項目33Bの前段までの処理項目31B,32Bが実行された4つの処理済画像25をそれぞれ生成する。プロセッサ110は、生成した4つの処理済画像25を一時保存フォルダに保存する。 In response to the operation of the button 72, the processor 110 executes the image processing flow 30B on the four setting images 22a to 22d, and processes the four processes in which the processing items 31B and 32B up to the stage before the processing item 33B are executed. The completed images 25 are respectively generated. The processor 110 saves the generated four processed images 25 in a temporary storage folder.

4つの処理済画像25が一時保存フォルダに保存されると、プロセッサ110は、4つの処理済画像25の各々に対して処理項目33Bを実行し、処理結果を生成する。 When the four processed images 25 are saved in the temporary storage folder, the processor 110 executes the processing item 33B on each of the four processed images 25 and generates a processing result.

具体的には、プロセッサ110は、図18に示すステップS101~ステップS106を実行し、4つの処理済画像25の各々に対して処理結果(計測座標)を出力する。 Specifically, the processor 110 executes steps S101 to S106 shown in FIG. 18, and outputs processing results (measured coordinates) for each of the four processed images 25.

プロセッサ110は、4つの設定用画像22a~22dからそれぞれ生成された4つの処理済画像25に対する計測座標と、管理データ23によって示される正解値(マーク位置)との差分を示す差分情報を生成する。動作例2では、差分情報は、4つの設定用画像22a~22dに対する、計測座標で示される位置とマーク位置とのユークリッド距離の最大値(以下、単に「誤差」と称する。)を示す。 The processor 110 generates difference information indicating the difference between the measurement coordinates for the four processed images 25 generated from the four setting images 22a to 22d and the correct value (mark position) indicated by the management data 23. . In operation example 2, the difference information indicates the maximum value of the Euclidean distance between the position indicated by the measurement coordinates and the mark position (hereinafter simply referred to as "error") for the four setting images 22a to 22d.

プロセッサ110は、処理項目33Bの実行に用いられるパラメータ(モデル画像、ステップS103,S104におけるエッジ情報の量(例えばエッジ点の個数)、閾値Th3、サブピクセル単位での計測の有無)が取り得る複数の値の各々について、差分情報を生成する。プロセッサ110は、処理項目33Bの実行に用いられるパラメータが取り得る複数の値の各々と、差分情報とを対応付けたテーブル82を画面60A内に表示する。ユーザは、誤差が最も小さい値を選択することが好ましい。そのため、プロセッサ110は、誤差の小さい順に、パラメータが取り得る複数の値をソートすることが好ましい。 The processor 110 uses a plurality of parameters (model image, amount of edge information in steps S103 and S104 (for example, number of edge points), threshold Th3, presence or absence of measurement in subpixel units) used to execute the processing item 33B. Difference information is generated for each value of . The processor 110 displays on the screen 60A a table 82 in which each of a plurality of possible values of the parameter used to execute the processing item 33B is associated with the difference information. Preferably, the user selects the value with the smallest error. Therefore, it is preferable that the processor 110 sorts the possible values of the parameter in descending order of error.

テーブル82には、カーソル82aが表示される。ユーザは、カーソル82aを移動させることにより、テーブル82の中の1つのレコードを選択できる。 A cursor 82a is displayed on the table 82. A user can select one record in table 82 by moving cursor 82a.

画面60Aは、動作例1の画面60(図14参照)と同様に、処理結果の詳細情報を確認するためのボタン74を含む。ボタン74の操作に応じて、プロセッサ110は、カーソル82aによって選択されているレコードの処理結果の詳細情報を表示装置6に表示する。 The screen 60A includes a button 74 for checking detailed information on the processing result, similar to the screen 60 of operation example 1 (see FIG. 14). In response to the operation of the button 74, the processor 110 displays detailed information on the processing result of the record selected by the cursor 82a on the display device 6.

図22は、動作例2における処理結果の詳細情報を示すウィンドウの一例を示す図である。図22に例示されるウィンドウ75Aは、画面60Aのボタン74の操作に応じて表示される。なお、ウィンドウ75Aは、画面60Aに重ねて表示されてもよい。 FIG. 22 is a diagram illustrating an example of a window showing detailed information on processing results in operation example 2. Window 75A illustrated in FIG. 22 is displayed in response to operation of button 74 on screen 60A. Note that the window 75A may be displayed overlapping the screen 60A.

ウィンドウ75Aは、領域83,84,85を含む。領域83には、カーソル82aによって選択されているレコードに対応するパラメータの値が示される。 Window 75A includes areas 83, 84, and 85. In the area 83, the value of the parameter corresponding to the record selected by the cursor 82a is shown.

図22において、「モデル画像パス」は、少なくとも1つの画像が保存されているフォルダ、または画像ファイルを示す。「モデル画像パス」が1つの画像ファイルを示す場合、「モデル画像」には「単体画像」が表示される。「モデル画像パス」がフォルダを示す場合、「モデル画像」の表示は、当該フォルダに保存されている画像数に応じて切り替えられる。「モデル画像」には、フォルダに保存されている画像数が1つの場合に「単体画像」が示され、フォルダに保存されている画像数が複数の場合に「平均画像」が示される。「モデル画像」が「単体画像」を表している場合、「モデル画像パス」によって特定される1つの画像がモデル画像として設定される。「モデル画像」が「平均画像」を表している場合、「モデル画像パス」によって示されるフォルダに保存されている複数の画像の平均画像がモデル画像として設定される。 In FIG. 22, "model image path" indicates a folder or image file in which at least one image is saved. When the "model image path" indicates one image file, the "single image" is displayed in the "model image". When the "model image path" indicates a folder, the display of the "model images" is switched according to the number of images stored in the folder. The "model image" indicates a "single image" when the number of images stored in the folder is one, and indicates "average image" when the number of images stored in the folder is multiple. If the "model image" represents a "single image", one image specified by the "model image path" is set as the model image. If the "model image" represents an "average image", the average image of the plurality of images stored in the folder indicated by the "model image path" is set as the model image.

「安定度」は、粗サーチ処理(図18のステップS103)におけるエッジ情報の量(例えばエッジ点の個数)を示す。「精度」は、詳細サーチ処理(図18のステップS104)におけるエッジ情報の量を示す。「サブピクセル処理」は、サブピクセル単位での計測の有無を示す。「候補点レベル」は、閾値Th3を示す。 "Stability" indicates the amount of edge information (for example, the number of edge points) in the rough search process (step S103 in FIG. 18). "Accuracy" indicates the amount of edge information in the detailed search process (step S104 in FIG. 18). “Sub-pixel processing” indicates whether or not measurement is performed in sub-pixel units. "Candidate point level" indicates threshold Th3.

領域84には、カーソル82aによって選択されているレコードに対応するパラメータの値のときの誤差が示される。 The area 84 shows the error in the value of the parameter corresponding to the record selected by the cursor 82a.

領域85には、カーソル82aによって選択されているレコードに対応するパラメータの値のときの処理結果の詳細が示される。具体的には、領域85には、4つの設定用画像22a~22dの各々のファイル名85aと、各設定用画像に対応する正解値座標85bと、計測座標85cと、座標差85dとが表示される。正解値座標85bは、設定用画像におけるマーク150の位置座標を示す。 The area 85 shows details of the processing result for the value of the parameter corresponding to the record selected by the cursor 82a. Specifically, the area 85 displays the file name 85a of each of the four setting images 22a to 22d, the correct value coordinates 85b corresponding to each setting image, the measured coordinates 85c, and the coordinate difference 85d. be done. The correct value coordinates 85b indicate the position coordinates of the mark 150 in the setting image.

ウィンドウ75Aは、正解値座標85bと計測座標85cとの位置関係を表示するためのボタン86を含む。ボタン86の操作に応じて、プロセッサ110は、4つの設定用画像22a~22dに対する正解値座標85bと計測座標85cとの位置関係を示すウィンドウを表示装置6に表示させる。 The window 75A includes a button 86 for displaying the positional relationship between the correct value coordinates 85b and the measurement coordinates 85c. In response to the operation of the button 86, the processor 110 causes the display device 6 to display a window showing the positional relationship between the correct value coordinates 85b and the measurement coordinates 85c for the four setting images 22a to 22d.

図23は、図22に示すボタン86の操作に応じて表示されるウィンドウを示す。図23に例示されるウィンドウ87には、正解値座標85bを示す白丸と、計測座標85cを示す黒丸とがプロットされた画像座標系のグラフが示される。ユーザは、ウィンドウ87を確認することにより、4つの設定用画像22a~22dに対する正解値座標85bと計測座標85cとのずれの大きさを視覚的に認識できる。 FIG. 23 shows a window displayed in response to the operation of button 86 shown in FIG. 22. The window 87 illustrated in FIG. 23 shows a graph of the image coordinate system in which a white circle indicating the correct value coordinate 85b and a black circle indicating the measurement coordinate 85c are plotted. By checking the window 87, the user can visually recognize the magnitude of the deviation between the correct value coordinates 85b and the measured coordinates 85c for the four setting images 22a to 22d.

ウィンドウ87は、ウィンドウ87を閉じるためのボタン88を含む。ボタン88の操作に応じて、プロセッサ110は、ウィンドウ87を閉じ、図22に示すウィンドウ75Aを表示装置6に表示させる。 Window 87 includes a button 88 for closing window 87. In response to the operation of button 88, processor 110 closes window 87 and displays window 75A shown in FIG. 22 on display device 6.

図22に例示されるウィンドウ75Aは、動作例1のウィンドウ75(図15参照)と同様に、ウィンドウ75Aを閉じるためのボタン78を含む。ボタン78の操作に応じて、プロセッサ110は、ウィンドウ75Aを閉じ、図21に示す画面60Aを表示装置6に表示させる。 The window 75A illustrated in FIG. 22 includes a button 78 for closing the window 75A, similar to the window 75 of Operation Example 1 (see FIG. 15). In response to the operation of button 78, processor 110 closes window 75A and displays screen 60A shown in FIG. 21 on display device 6.

ユーザは、図21に示すテーブル82のカーソル82aを移動させながらウィンドウ75A,87を確認することにより、テーブル82の中から適切なレコードを選択する。 The user selects an appropriate record from the table 82 by checking the windows 75A, 87 while moving the cursor 82a of the table 82 shown in FIG.

図21に示されるように、画面60Aは、動作例1の画面60(図14参照)と同様に、処理項目33Bの実行に用いられるパラメータの値を設定するためのボタン79を含む。ボタン79の操作に応じて、プロセッサ110は、テーブル82においてカーソル82aによって選択されているレコードに含まれるパラメータの値を、処理項目33Bの実行時に用いる値として設定する。すなわち、プロセッサ110は、カーソル82aによって選択されているレコードに含まれるパラメータの値を示す設定データ24を生成し、生成した設定データ24を記憶部20に保存する。 As shown in FIG. 21, the screen 60A includes a button 79 for setting the value of the parameter used to execute the processing item 33B, similar to the screen 60 of the first operation example (see FIG. 14). In response to the operation of the button 79, the processor 110 sets the value of the parameter included in the record selected by the cursor 82a in the table 82 as the value to be used when executing the processing item 33B. That is, the processor 110 generates setting data 24 indicating the value of the parameter included in the record selected by the cursor 82a, and stores the generated setting data 24 in the storage unit 20.

以上のように、複数の設定用画像22に対して処理項目31B~32Bを実行することにより複数の処理済画像25が自動的に生成され、複数の処理済画像25を用いて、処理項目33Bの実行に用いられるパラメータの値が設定される。これにより、処理項目33Bの実行に用いられるパラメータの値を適切に設定できる。 As described above, a plurality of processed images 25 are automatically generated by executing processing items 31B to 32B on a plurality of setting images 22, and processing item 33B is automatically generated using a plurality of processed images 25. Parameter values used for execution are set. Thereby, the values of the parameters used to execute the processing item 33B can be appropriately set.

なお、処理項目33Cは、マーク150の面積も考慮して、マーク150を検出する項目であってもよい。この場合、パラメータの設定対象となる処理項目33Bの前段の処理項目には、例えば上述したラベリングが含まれる。そして、ラベリングが実行された複数の処理済画像25を用いて、処理項目33Cの実行に用いられるパラメータが設定される。このように、処理項目33Cの前段までの処理項目は、図17に示すものに限定されない。 Note that the processing item 33C may be an item for detecting the mark 150, also taking into consideration the area of the mark 150. In this case, the processing items preceding the processing item 33B for which parameters are set include, for example, the above-mentioned labeling. Then, the parameters used to execute the processing item 33C are set using the plurality of processed images 25 on which labeling has been performed. In this way, the processing items up to the stage before the processing item 33C are not limited to those shown in FIG. 17.

<F.動作例3>
図24は、動作例3においてパラメータ設定の対象となる画像処理フローを示す図である。図24に例示される画像処理フロー30Cは、処理項目31C~36Cを含む。
<F. Operation example 3>
FIG. 24 is a diagram showing an image processing flow for which parameters are set in operation example 3. The image processing flow 30C illustrated in FIG. 24 includes processing items 31C to 36C.

処理項目31Cは、画像処理の対象となる画像を取得するための項目である。処理項目32Cは、処理項目31Cによって取得された画像から、検査対象となる領域を検出する項目である。動作例3では、ワークW中のテキストが印字された平面視矩形の面(以下、「印字面」と称する。)が検査対象として検出される。処理項目32Cでは、例えば、処理項目32Bと同様に、印字面に対応するモデア画像を用いたパターンマッチングを行なうことにより、印字面が検出される。処理項目33Cは、印字面が画像の中央に位置するように画像の座標変換を行なう項目である。 The processing item 31C is an item for acquiring an image to be subjected to image processing. The processing item 32C is an item for detecting an area to be inspected from the image acquired by the processing item 31C. In operation example 3, a rectangular surface in a plan view (hereinafter referred to as a "printed surface") on which text is printed on the workpiece W is detected as an inspection target. In the processing item 32C, for example, similarly to the processing item 32B, the printed surface is detected by performing pattern matching using a moder image corresponding to the printed surface. Processing item 33C is an item for performing coordinate transformation of the image so that the printed surface is located at the center of the image.

処理項目34Cは、印字面の歪みを補正する項目である。印字面の法線方向とカメラ3の光軸方向とがすれている場合、画像中における印字面は台形に歪む。この歪み量は、印字面の法線方向とカメラ3の光軸方向とのなす角度に依存する。処理項目34Cの実行により、このような台形歪みが補正される。 The processing item 34C is an item for correcting distortion of the printed surface. If the normal direction of the printed surface and the optical axis direction of the camera 3 are misaligned, the printed surface in the image will be distorted into a trapezoid. The amount of distortion depends on the angle between the normal direction of the printed surface and the optical axis direction of the camera 3. By executing processing item 34C, such trapezoidal distortion is corrected.

図25は、図24に示す処理項目34Cの処理例を示す図である。図25には、ワークWにおける印字面180が示される。図25(a)には、処理項目34Cの実行前の印字面180が示され、図25(b)には、処理項目34Cの実行後の印字面180が示される。図25に示されるように、処理項目34Cの実行により、印字面180の台形歪みが補正される。台形歪みの補正の度合いは、処理項目34Cの実行に用いられるパラメータの値に依存する。 FIG. 25 is a diagram showing a processing example of the processing item 34C shown in FIG. 24. FIG. 25 shows a printing surface 180 on the workpiece W. As shown in FIG. FIG. 25(a) shows the printed surface 180 before the processing item 34C is executed, and FIG. 25(b) shows the printed surface 180 after the processing item 34C is executed. As shown in FIG. 25, the trapezoidal distortion of the printing surface 180 is corrected by executing the processing item 34C. The degree of correction of trapezoidal distortion depends on the value of the parameter used to execute the processing item 34C.

処理項目35Cは、処理項目34Cが実行された画像に対して文字認識を行なう項目である。処理項目36Cは、処理項目35Cの実行によって認識されたテキストを出力する項目である。 The processing item 35C is an item for performing character recognition on the image for which the processing item 34C has been executed. The processing item 36C is an item that outputs the text recognized by executing the processing item 35C.

以下、画像処理フロー30Cにおける処理項目35Cの実行に用いられるパラメータの設定指示を受けたときの画像処理装置1の動作例について説明する。 Hereinafter, an example of the operation of the image processing apparatus 1 when receiving an instruction to set parameters used to execute the processing item 35C in the image processing flow 30C will be described.

<F-1.パラメータの設定対象となる処理項目>
処理項目35Cでは、公知の技術を用いて、入力された画像(すなわち、前段の処理項目31C~34Cが実行された画像)に対して文字認識が行なわれる。認識対象となるテキストの文字幅を制限しない場合、処理項目35Cの実行に要する時間が長くなる。そのため、認識対象となるテキストが取り得る最大文字幅を設定し、当該最大文字幅以下のテキストのみを文字認識することが好ましい。これにより、処理項目35Cの実行に要する時間を短縮化できる。この最大文字幅は、処理項目35Cの実行に用いられるパラメータである。
<F-1. Processing items for which parameters are set>
In the processing item 35C, character recognition is performed on the input image (ie, the image on which the previous processing items 31C to 34C have been executed) using a known technique. If the character width of the text to be recognized is not limited, the time required to execute process item 35C will be longer. Therefore, it is preferable to set the maximum character width that the text to be recognized can have, and to recognize only the text that is less than or equal to the maximum character width. Thereby, the time required to execute the processing item 35C can be shortened. This maximum character width is a parameter used to execute process item 35C.

処理項目35Cには、処理項目34Cが実行された画像が入力される。上述したように、処理項目34Cの実行により、印字面180の台形歪みが補正される。ただし、補正の程度は、処理項目34Cの実行に用いられるパラメータの値に依存する。台形歪みの補正の程度に応じて、認識対象となるテキストが取り得る最大文字幅が変化し得る。そのため、処理項目34Cの実行に用いられるパラメータの値を変更するたびに、処理項目35Cの実行に用いられるパラメータの値も設定し直す必要がある。 An image on which the processing item 34C has been executed is input to the processing item 35C. As described above, the trapezoidal distortion of the printing surface 180 is corrected by executing the processing item 34C. However, the degree of correction depends on the value of the parameter used to execute the processing item 34C. Depending on the degree of correction of trapezoidal distortion, the maximum character width that can be taken by the text to be recognized may change. Therefore, each time the value of the parameter used to execute the process item 34C is changed, it is necessary to reset the value of the parameter used to execute the process item 35C.

<F-2.設定用画像の管理>
図26は、動作例3において、設定用画像に対する正解値を設定するときの画面を示す図である。図26に例示される画面60Bは、表示装置6に表示される。
<F-2. Managing images for settings>
FIG. 26 is a diagram showing a screen when setting a correct value for a setting image in operation example 3. A screen 60B illustrated in FIG. 26 is displayed on the display device 6.

画面60Bは、動作例1の画面60(図13参照)と同様に、一時保存フォルダを設定するためのボタン61を含む。ボタン61の操作に応じて、プロセッサ110は、一時保存フォルダを設定する。 Screen 60B includes a button 61 for setting a temporary storage folder, similar to screen 60 of Operation Example 1 (see FIG. 13). In response to the operation of button 61, processor 110 sets a temporary storage folder.

画面60Bは、動作例1の画面60(図13参照)と同様に、設定用画像に対する正解値を管理するためのタブ80を含む。図26には、タブ80が選択されているときの画面60Aが示される。 The screen 60B includes a tab 80 for managing the correct value for the setting image, similar to the screen 60 of the first operation example (see FIG. 13). FIG. 26 shows the screen 60A when the tab 80 is selected.

画面60Bは、動作例1の画面60(図13参照)と同様に、複数の設定用画像22が保存されているフォルダを選択するためのボタン62を含む。ボタン62の操作に応じて、プロセッサ110は、複数の設定用画像22のリスト91を画面60B内に表示させる。 Screen 60B includes a button 62 for selecting a folder in which a plurality of setting images 22 are saved, similar to screen 60 of Operation Example 1 (see FIG. 13). In response to the operation of the button 62, the processor 110 displays a list 91 of the plurality of setting images 22 on the screen 60B.

リスト91は、複数の設定用画像22の各々について、ファイル名と、設定用画像22に写る印字面180(図25参照)に印字されたテキストとを含む。テキストは、各設定用画像についての正解値である。 The list 91 includes, for each of the plurality of setting images 22, the file name and the text printed on the print surface 180 (see FIG. 25) that appears in the setting image 22. The text is the correct value for each setting image.

リスト91には、1つの設定用画像22を選択するためのカーソル91aが表示される。画面60Bは、動作例1の画面60(図13参照)と同様に、画像を表示するための領域64を含む。領域64には、カーソル91aによって選択された設定用画像22が表示される。ユーザは、領域64を確認しながら、テキストをリスト91に入力すればよい。 A cursor 91a for selecting one setting image 22 is displayed in the list 91. Screen 60B includes an area 64 for displaying images, similar to screen 60 of Operation Example 1 (see FIG. 13). In the area 64, the setting image 22 selected by the cursor 91a is displayed. The user only needs to input text into the list 91 while checking the area 64.

画面60Bは、動作例1の画面60(図13参照)と同様に、管理データ23の作成を指示するためのボタン67を含む。ボタン67の操作に応じて、プロセッサ110は、リスト91への入力に基づいて、管理データ23を作成する。動作例3に係る管理データ23は、各設定用画像22について、当該設定用画像22に写る印字面180上のテキストを示す。 Screen 60B includes a button 67 for instructing creation of management data 23, similar to screen 60 of operation example 1 (see FIG. 13). In response to the operation of button 67, processor 110 creates management data 23 based on the input to list 91. The management data 23 according to operation example 3 indicates, for each setting image 22, the text on the print surface 180 that appears in the setting image 22.

<F-3.パラメータの設定>
図27は、動作例3においてパラメータを設定するときの画面を示す図である。画面60Bは、動作例1の画面60(図14参照)と同様に、パラメータを設定するためのタブ69とを含む。図27には、タブ69が選択されたときの画面60Bが示される。
<F-3. Parameter settings>
FIG. 27 is a diagram showing a screen when setting parameters in operation example 3. Screen 60B includes a tab 69 for setting parameters, similar to screen 60 of operation example 1 (see FIG. 14). FIG. 27 shows a screen 60B when tab 69 is selected.

画面60Bは、動作例1の画面60(図14参照)と同様に、処理済画像の生成と差分情報の生成とを開始するためのボタン72を含む。 Screen 60B includes a button 72 for starting generation of a processed image and generation of difference information, similar to screen 60 of Operation Example 1 (see FIG. 14).

ボタン72に操作に応じて、プロセッサ110は、複数の設定用画像22に対して画像処理フローを実行し、処理項目35Cの前段までの処理項目31C~34Cがそれぞれ実行された複数の処理済画像25を生成する。プロセッサ110は、ボタン61の操作に応じて設定された一時保存フォルダに、生成した複数の処理済画像25を保存する。 In response to the operation of the button 72, the processor 110 executes the image processing flow on the plurality of setting images 22, and generates a plurality of processed images in which the processing items 31C to 34C up to the stage before the processing item 35C have been respectively executed. Generate 25. The processor 110 saves the generated plurality of processed images 25 in a temporary storage folder set according to the operation of the button 61.

複数の処理済画像25が一時保存フォルダに保存されると、プロセッサ110は、複数の処理済画像25の各々に対して処理項目35Cを実行し、処理結果を生成する。 When the plurality of processed images 25 are saved in the temporary storage folder, the processor 110 executes the processing item 35C on each of the plurality of processed images 25 and generates a processing result.

具体的には、プロセッサ110は、複数の処理済画像25の各々に対して文字認識を行ない、認識されたテキストを処理結果として生成する。 Specifically, processor 110 performs character recognition on each of the plurality of processed images 25, and generates recognized text as a processing result.

プロセッサ110は、複数の設定用画像22の各々について、当該設定用画像から生成された処理済画像25から認識されたテキストと、管理データ23によって示される正解値(テキスト)との差分を示す差分情報を生成する。動作例3では、差分情報は、複数の設定用画像22のうち、処理結果と正解値とが一致する設定用画像22の個数(以下、「正解数」とも称する。)と、処理結果と正解値とが一致しない設定用画像22の個数(以下、「不正解数」とも称する。)とを示す。 For each of the plurality of setting images 22, the processor 110 generates a difference indicating the difference between the text recognized from the processed image 25 generated from the setting image and the correct value (text) indicated by the management data 23. Generate information. In operation example 3, the difference information includes the number of setting images 22 whose processing results and correct values match among the plurality of setting images 22 (hereinafter also referred to as "number of correct answers"), and the processing results and correct answers. The number of setting images 22 whose values do not match (hereinafter also referred to as "number of incorrect answers") is shown.

プロセッサ110は、処理項目35Cの実行に用いられるパラメータ(最大文字幅)が取り得る複数の値の各々について、差分情報を生成する。プロセッサ110は、パラメータ(最大文字幅)が取り得る複数の値のうち、不正解数が0となる最小値を特定し、特定した値と差分情報とを対応付けた最適情報94を画面60B内に表示する。 Processor 110 generates difference information for each of a plurality of possible values of the parameter (maximum character width) used to execute process item 35C. The processor 110 identifies the minimum value for which the number of incorrect answers is 0 among the multiple values that the parameter (maximum character width) can take, and displays optimal information 94 in which the identified value is associated with the difference information on the screen 60B. to be displayed.

画面60Bは、動作例1の画面60(図14参照)と同様に、処理結果の詳細情報を確認するためのボタン74を含む。ボタン74の操作に応じて、プロセッサ110は、最適情報94によって示されるパラメータ(最大文字幅)の値のときの処理結果の詳細情報を表示装置6に表示する。 The screen 60B includes a button 74 for checking detailed information on the processing result, similar to the screen 60 of the first operation example (see FIG. 14). In response to the operation of the button 74, the processor 110 displays detailed information on the processing result for the value of the parameter (maximum character width) indicated by the optimum information 94 on the display device 6.

図28は、動作例3における処理結果の詳細情報を示すウィンドウの一例を示す図である。図28に例示されるウィンドウ75Bは、画面60Bのボタン74の操作に応じて表示される。なお、ウィンドウ75Bは、画面60Bに重ねて表示されてもよい。 FIG. 28 is a diagram showing an example of a window showing detailed information on processing results in operation example 3. Window 75B illustrated in FIG. 28 is displayed in response to operation of button 74 on screen 60B. Note that the window 75B may be displayed overlapping the screen 60B.

ウィンドウ75Bは、領域95,96,97を含む。領域95には、最適情報94によって示されるパラメータ(最大文字幅)の値が表示される。領域96には、最適情報94によって示される正解数および不正解数が表示される。 Window 75B includes areas 95, 96, and 97. In the area 95, the value of the parameter (maximum character width) indicated by the optimum information 94 is displayed. In the area 96, the number of correct answers and the number of incorrect answers indicated by the optimal information 94 are displayed.

領域97には、複数の設定用画像22の各々のファイル名97aと、各設定用画像に対応する正解文字97bと、認識文字97cと、判定結果97dとが表示される。 In the area 97, a file name 97a of each of the plurality of setting images 22, a correct character 97b corresponding to each setting image, a recognized character 97c, and a determination result 97d are displayed.

ウィンドウ75Bは、動作例1のウィンドウ75(図15参照)と同様に、ウィンドウ75Bを閉じるためのボタン78を含む。ボタン78の操作に応じて、プロセッサ110は、ウィンドウ75Bを閉じ、図27に示す画面60Bを表示装置6に表示させる。 Window 75B includes a button 78 for closing window 75B, similar to window 75 of Operation Example 1 (see FIG. 15). In response to the operation of button 78, processor 110 closes window 75B and displays screen 60B shown in FIG. 27 on display device 6.

図27に示されるように、画面60Bは、動作例1の画面60(図14参照)と同様に、処理項目35Cの実行に用いられるパラメータの値を設定するためのボタン79を含む。ボタン79の操作に応じて、プロセッサ110は、最適情報94で示されるパラメータ(最大文字幅)の値を、処理項目35Cの実行時に用いる値として設定する。すなわち、プロセッサ110は、最適情報94によって示されるパラメータ(最大文字幅)の値を示す設定データ24を生成し、生成した設定データ24を記憶部20に保存する。 As shown in FIG. 27, the screen 60B includes a button 79 for setting the value of the parameter used to execute the processing item 35C, similar to the screen 60 of the operation example 1 (see FIG. 14). In response to the operation of the button 79, the processor 110 sets the value of the parameter (maximum character width) indicated by the optimum information 94 as the value to be used when executing the processing item 35C. That is, the processor 110 generates setting data 24 indicating the value of the parameter (maximum character width) indicated by the optimum information 94, and stores the generated setting data 24 in the storage unit 20.

比較的簡単な画像処理フローに対する動作例1~3について説明したが、画像処理フローは、処理項目群に含まれる様々な処理項目から適宜選択された複数の処理項目を含み得る。画像処理フローを構成する処理項目の種類にかかわらず、画像処理フローを構成する1つの処理項目の実行に用いられるパラメータの値は、当該処理項目の前段までの処理項目が実行された複数の処理済画像25を用いて設定される。例えば、パラメータの設定対象となる処理項目の前段までに、上述した3D画像化、幾何学変換、セマンティックセグメンテーションが含まれる場合、3D画像化、幾何学変換、セマンティックセグメンテーションが実行された複数の処理済画像25を用いて当該処理項目の実行に用いられるパラメータの値が設定される。 Although operation examples 1 to 3 for a relatively simple image processing flow have been described, the image processing flow may include a plurality of processing items appropriately selected from various processing items included in the processing item group. Regardless of the type of processing item that makes up the image processing flow, the value of the parameter used to execute one processing item that makes up the image processing flow is the same as the value of the parameter used to execute the processing item that makes up the image processing flow The settings are made using the completed image 25. For example, if the processing items for which parameters are set include the above-mentioned 3D imaging, geometric transformation, and semantic segmentation, multiple processed items that have undergone 3D imaging, geometric transformation, and semantic segmentation The image 25 is used to set the values of parameters used to execute the processing item.

<G.変形例>
複数の処理済画像25に対して処理項目を実行することにより生成される処理結果は、欠陥の有無、計測座標、認識されたテキストに限定されない。処理結果は、例えば画像データであってもよい。そして、複数の設定用画像22の各々に対する正解値として、画像データ(以下、「正解画像データ」と称する。)が設定されてもよい。この場合、複数の処理済画像25に対する処理結果と、複数の設定用画像22に対してそれぞれ設定された正解値との差分を示す差分情報として、例えば、画像差分総和が生成されてもよい。画像差分総和は、ノルムとも呼ばれ、画素ごとの輝度差の総和である。あるいは、差分情報として、輝度差が所定値よりも大きい画素数が生成されてもよい。プロセッサ110は、差分情報で示される差分が小さくなるように、パラメータを最適化する。
<G. Modified example>
The processing results generated by executing processing items on the plurality of processed images 25 are not limited to the presence or absence of defects, measured coordinates, and recognized text. The processing result may be, for example, image data. Then, image data (hereinafter referred to as "correct image data") may be set as the correct value for each of the plurality of setting images 22. In this case, for example, a sum total of image differences may be generated as difference information indicating the difference between the processing results for the plurality of processed images 25 and the correct values set for the plurality of setting images 22, respectively. The sum of image differences is also called norm, and is the sum of brightness differences for each pixel. Alternatively, the number of pixels with a luminance difference greater than a predetermined value may be generated as the difference information. The processor 110 optimizes the parameters so that the difference indicated by the difference information becomes small.

上記の説明では、設定用画像22に対して正解値が設定されるものとした。しかしながら、設定用画像22に対して正解値が設定されなくてもよい。例えば、設定部14として動作するプロセッサ110は、複数の処理結果から得られる特徴量が予め設定された基準値に近づくように、パラメータの値を最適化してもよい。 In the above description, it is assumed that the correct value is set for the setting image 22. However, the correct value may not be set for the setting image 22. For example, the processor 110 operating as the setting unit 14 may optimize the values of the parameters so that the feature amount obtained from the plurality of processing results approaches a preset reference value.

例えば、マーク150が定位置になるように配置されたワークWの写る複数の設定用画像22が予め準備される。そして、動作例2と同様に、マーク150の位置を検出する処理項目33Bの実行に用いられるパラメータが設定される。プロセッサ110は、複数の設定用画像22に対して画像処理フローを実行することにより得られた複数の処理済画像25の各々に対して処理項目33Bを実行し、処理結果(計測座標)を生成する。プロセッサ110は、複数の処理済画像25からそれぞれ生成された複数の計測座標の分散が0に近づくように、処理項目33Bのパラメータを最適化すればよい。すなわち、プロセッサ110は、パラメータが取りうる複数の値の中から、分散が0に最も近い値を選択し、選択された値をパラメータの値として設定すればよい。 For example, a plurality of setting images 22 showing the workpiece W arranged so that the mark 150 is in a fixed position are prepared in advance. Then, as in the second operation example, parameters used to execute the processing item 33B for detecting the position of the mark 150 are set. The processor 110 executes the processing item 33B on each of the plurality of processed images 25 obtained by executing the image processing flow on the plurality of setting images 22, and generates a processing result (measurement coordinates). do. The processor 110 may optimize the parameters of the processing item 33B so that the variance of the plurality of measurement coordinates generated from the plurality of processed images 25 approaches zero. That is, the processor 110 may select the value whose variance is closest to 0 from among the plurality of values that the parameter can take, and set the selected value as the value of the parameter.

また、ワークWを一定間隔で移動させながら撮像することにより、複数の設定用画像22が準備されてもよい。そして、動作例2と同様に、ワークWの位置を検出する処理項目33Bの実行に用いられるパラメータが設定される。プロセッサ110は、複数の設定用画像22に対して画像処理フローを実行することにより得られた複数の処理済画像25の各々に対して処理項目33Bを実行し、処理結果(計測座標)を生成する。プロセッサ110は、複数の処理済画像25からそれぞれ生成された複数の計測座標の間隔のばらつきを示す指標値(例えば分散)が0に近づくように、処理項目33Bのパラメータを最適化すればよい。すなわち、プロセッサ110は、パラメータが取りうる複数の値の中から、ばらつきの最も小さい値を選択し、選択された値をパラメータの値として設定すればよい。 Alternatively, a plurality of setting images 22 may be prepared by capturing images while moving the workpiece W at regular intervals. Then, as in the second operation example, parameters used to execute the processing item 33B for detecting the position of the workpiece W are set. The processor 110 executes the processing item 33B on each of the plurality of processed images 25 obtained by executing the image processing flow on the plurality of setting images 22, and generates a processing result (measurement coordinates). do. The processor 110 may optimize the parameters of the processing item 33B so that the index value (for example, variance) indicating the dispersion of the intervals between the plurality of measurement coordinates generated from the plurality of processed images 25 approaches zero. That is, the processor 110 may select the value with the smallest variation from among a plurality of values that the parameter can take, and set the selected value as the value of the parameter.

<H.作用・効果>
以上のように、本実施の形態の画像処理装置1は、複数の処理項目が実行順序に従って並べられた画像処理フローを実行する。画像処理装置1は、生成部13と、設定部14とを備える。生成部13は、複数の処理項目のうち指定された処理項目の実行に用いられるパラメータの設定指示の入力に応じて、複数の設定用画像22に対して画像処理フローの一部または全部を実行することにより、指定された処理項目の前段までの処理項目が実行された複数の処理済画像25をそれぞれ生成する。設定部14は、複数の処理済画像25を用いてパラメータの値を設定する。
<H. Action/Effect>
As described above, the image processing apparatus 1 according to the present embodiment executes an image processing flow in which a plurality of processing items are arranged in the order of execution. The image processing device 1 includes a generation section 13 and a setting section 14. The generation unit 13 executes part or all of the image processing flow on the plurality of setting images 22 in response to input of an instruction to set parameters used to execute a specified processing item among the plurality of processing items. By doing so, a plurality of processed images 25 are respectively generated in which the processing items up to the stage preceding the designated processing item have been executed. The setting unit 14 uses the plurality of processed images 25 to set parameter values.

上記の構成によれば、パラメータの設定指示の入力に応じて、指定された処理項目の前段までの処理項目が実行された複数の処理済画像25が自動的に生成される。さらに、生成された複数の処理済画像25を用いてパラメータの値が設定される。これにより、複数の処理済画像25を生成するために、図2に例示されるような画像収集用フロー40を作成する必要や、図3に例示されるような、分岐ポイント51を含む画像処理フロー50を作成する必要がない。その結果、複数の処理済画像25を収集するための手間が削減される。 According to the above configuration, in response to input of a parameter setting instruction, a plurality of processed images 25 are automatically generated in which processing items up to a specified processing item have been executed. Further, parameter values are set using the plurality of generated processed images 25. This eliminates the need to create an image collection flow 40 as illustrated in FIG. 2 in order to generate a plurality of processed images 25, and image processing including a branch point 51 as illustrated in FIG. There is no need to create the flow 50. As a result, the effort required to collect a plurality of processed images 25 is reduced.

さらに、画像処理フローにおける前段の処理項目の実行に用いられるパラメータの値を変更した場合、あるいは、前段の処理項目を別の処理項目に変更した場合であっても、指定された処理項目の実行に用いられるパラメータの設定指示の入力することにより、複数の処理済画像25が自動的に収集される。そのため、ユーザは、複数の処理済画像25の収集のための作業を別途行なう必要がない。 Furthermore, even if you change the value of the parameter used to execute the previous processing item in the image processing flow, or change the previous processing item to another processing item, the specified processing item will be executed. A plurality of processed images 25 are automatically collected by inputting instructions for setting parameters used in the process. Therefore, the user does not need to perform a separate operation to collect the plurality of processed images 25.

このように、本実施の形態によれば、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間を削減できる。 In this way, according to the present embodiment, it is possible to reduce the effort required to set parameters used to execute processing items that constitute an image processing flow.

設定部14は、パラメータが取りうる複数の値の各々について、当該値を用いて、複数の処理済画像25に対して指定された処理項目を実行することにより複数の処理結果をそれぞれ取得する。設定部14は、複数の値の中から複数の処理結果に基づいて選択された値をパラメータの値として設定する。 The setting unit 14 acquires a plurality of processing results by executing specified processing items on the plurality of processed images 25 using each of the plurality of values that the parameter can take. The setting unit 14 sets a value selected from a plurality of values based on a plurality of processing results as a value of a parameter.

上記の構成によれば、複数の処理結果を参考にしながら、パラメータが取りうる複数の値の中から適切な値が選択される。 According to the above configuration, an appropriate value is selected from a plurality of possible values of the parameter while referring to a plurality of processing results.

設定部14は、複数の処理結果と、複数の設定用画像22に対してそれぞれ予め設定された複数の正解値との差分を示す差分情報を生成する。設定部14は、複数の値の各々と差分情報との対応関係を表示装置6に表示させる。設定部14は、複数の値の中から選択指示を受けた値を、パラメータの値として設定してもよい。 The setting unit 14 generates difference information indicating the difference between the plurality of processing results and the plurality of correct values set in advance for the plurality of setting images 22, respectively. The setting unit 14 causes the display device 6 to display the correspondence between each of the plurality of values and the difference information. The setting unit 14 may set a value for which a selection instruction has been received from among a plurality of values as the value of the parameter.

上記の構成によれば、ユーザは、表示装置6に表示された、複数の値の各々と差分情報との対応関係を見ながら、最適な値を選択できる。 According to the above configuration, the user can select the optimal value while viewing the correspondence between each of the plurality of values and the difference information displayed on the display device 6.

あるいは、設定部14は、複数の処理済画像25に対して指定された処理項目を実行することによりそれぞれ得られる複数の処理結果が、複数の設定用画像22に対してそれぞれ予め設定された複数の正解値に近づくように、パラメータの値を最適化してもよい。 Alternatively, the setting unit 14 may set a plurality of processing results each obtained by executing a specified processing item on a plurality of processed images 25 to a plurality of processing results set in advance for each of the plurality of setting images 22. The parameter values may be optimized so that they approach the correct value.

上記の構成によれば、指定された処理項目の処理結果が正解値に近づくように、パラメータの値が自動的に設定される。これにより、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間をさらに削減できる。 According to the above configuration, the value of the parameter is automatically set so that the processing result of the specified processing item approaches the correct value. This can further reduce the effort required to set parameters used to execute the processing items that make up the image processing flow.

設定部14は、複数の処理結果から得られる特徴量が予め設定された基準値に近づくように、パラメータの値を最適化してもよい。上記の構成によれば、複数の処理結果から得られる特徴量が基準値に近づくように、パラメータの値が自動的に設定される。これにより、画像処理フローを構成する処理項目の実行に用いられるパラメータの設定の手間をさらに削減できる。 The setting unit 14 may optimize the parameter values so that the feature amounts obtained from the plurality of processing results approach a preset reference value. According to the above configuration, the value of the parameter is automatically set so that the feature amount obtained from the plurality of processing results approaches the reference value. This can further reduce the effort required to set parameters used to execute the processing items that make up the image processing flow.

複数の設定用画像22の各々にはワークWが写る。指定された処理項目は、例えば、前段の処理項目から出力された画像に写るワークWの属性(例えば、ワークWの種別や良否)を判定する項目である。複数の正解値は、複数の設定用画像22に写るワークWの属性をそれぞれ示す。 The workpiece W is shown in each of the plurality of setting images 22. The specified processing item is, for example, an item for determining the attributes of the workpiece W (for example, the type and quality of the workpiece W) appearing in the image output from the preceding processing item. The plurality of correct values each indicate the attributes of the workpiece W shown in the plurality of setting images 22.

例えば、指定された処理項目は、前段の処理項目から出力された画像から演算される特徴量とパラメータの値との比較結果に基づいて、ワークWの属性を判定する項目である。 For example, the designated processing item is an item for determining the attributes of the workpiece W based on the comparison result between the feature amount calculated from the image output from the previous processing item and the value of the parameter.

上記の構成によれば、ワークWの属性を判定する処理項目の実行に用いられるパラメータを容易に設定できる。 According to the above configuration, it is possible to easily set the parameters used to execute the processing item for determining the attributes of the workpiece W.

指定された処理項目は、複数の処理済画像25を用いた機械学習を行なうことにより生成される学習済モデル140を用いてワークWの属性を判定する項目であってもよい。そして、上記のパラメータは、学習済モデル140を定義する。 The specified processing item may be an item for determining the attributes of the workpiece W using a learned model 140 generated by performing machine learning using a plurality of processed images 25. The above parameters then define the trained model 140.

上記の構成によれば、ワークWの属性を判定するのに適した学習済モデル140を容易に生成することができる。 According to the above configuration, the trained model 140 suitable for determining the attributes of the workpiece W can be easily generated.

複数の設定用画像22の各々には、特徴部分(例えばマーク150)を含むワークWが写る。指定された処理項目は、特徴部分の写るモデル画像を用いて、前段の処理項目から出力された画像に写る特徴部分の位置を検出する項目である。複数の正解値は、複数の設定用画像22に写る特徴部分の座標(正解値座標)をそれぞれ示す。 Each of the plurality of setting images 22 shows a workpiece W including a characteristic portion (for example, a mark 150). The specified processing item is an item for detecting the position of the characteristic portion appearing in the image output from the previous processing item using a model image in which the characteristic portion appears. The plurality of correct values each indicate the coordinates (correct value coordinates) of the characteristic portion appearing in the plurality of setting images 22.

上記の構成によれば、特徴部分の位置を検出する処理項目の実行に用いられるパラメータを容易に設定できる。 According to the above configuration, it is possible to easily set the parameters used to execute the processing item for detecting the position of the characteristic portion.

複数の設定用画像22の各々にはテキストが写る。指定された処理項目は、前段の処理項目から出力された画像に写るテキストの文字認識を行なう項目である。複数の正解値は、複数の設定用画像22に写るテキストをそれぞれ示す。 Text appears in each of the plurality of setting images 22. The specified processing item is an item that performs character recognition of the text appearing in the image output from the previous processing item. The plurality of correct answer values each indicate the text appearing in the plurality of setting images 22.

上記の構成によれば、文字認識を行なう処理項目の実行に用いられるパラメータを容易に設定できる。 According to the above configuration, it is possible to easily set parameters used to execute a processing item for character recognition.

§3 付記
以上のように、本実施の形態は以下のような開示を含む。
§3 Supplementary notes As described above, this embodiment includes the following disclosures.

(構成1)
複数の処理項目(31~36)が実行順序に従って並べられた画像処理フロー(30)を実行する画像処理装置(1)であって、
前記複数の処理項目(31~36)のうち指定された処理項目の実行に用いられるパラメータの設定指示の入力に応じて、複数の設定用画像(22)に対して前記画像処理フロー(30)の一部または全部を実行することにより、前記指定された処理項目の前段までの処理項目が実行された複数の処理済画像(25)をそれぞれ生成する生成部(13,110)と、
前記複数の処理済画像(25)を用いて前記パラメータの値を設定する設定部(14,110)とを備える、画像処理装置(1)。
(Configuration 1)
An image processing apparatus (1) that executes an image processing flow (30) in which a plurality of processing items (31 to 36) are arranged in an execution order,
The image processing flow (30) is applied to a plurality of setting images (22) in response to an input of a parameter setting instruction used for executing a specified processing item among the plurality of processing items (31 to 36). a generating unit (13, 110) that generates a plurality of processed images (25) in which processing items up to the preceding stage of the specified processing item have been executed by executing part or all of the processing item;
An image processing device (1) comprising: a setting section (14, 110) that sets the value of the parameter using the plurality of processed images (25).

(構成2)
前記設定部(14,110)は、
前記パラメータが取りうる複数の値の各々について、当該値を用いて、前記複数の処理済画像(25)に対して前記指定された処理項目を実行することにより複数の処理結果をそれぞれ取得し、
前記複数の処理結果に基づいて前記複数の値の中から選択された値を前記パラメータの値として設定する、構成1に記載の画像処理装置(1)。
(Configuration 2)
The setting section (14, 110) includes:
For each of the plurality of values that the parameter can take, each of the plurality of processing results is obtained by executing the specified processing item on the plurality of processed images (25) using the value,
The image processing device (1) according to configuration 1, wherein a value selected from the plurality of values based on the plurality of processing results is set as the value of the parameter.

(構成3)
前記設定部(14,110)は、
前記複数の処理結果と、前記複数の設定用画像(22)に対してそれぞれ予め設定された複数の正解値との差分を示す差分情報を生成し、
前記複数の値の各々と前記差分情報との対応関係を表示装置に表示させ、
前記複数の値の中から選択指示を受けた値を、前記パラメータの値として設定する、構成2に記載の画像処理装置(1)。
(Configuration 3)
The setting section (14, 110) includes:
generating difference information indicating a difference between the plurality of processing results and a plurality of correct answer values respectively set in advance for the plurality of setting images (22);
displaying a correspondence relationship between each of the plurality of values and the difference information on a display device;
The image processing device (1) according to configuration 2, wherein a value for which a selection instruction has been received from among the plurality of values is set as the value of the parameter.

(構成4)
前記設定部(14,110)は、前記複数の処理結果が、前記複数の設定用画像に対してそれぞれ予め設定された複数の正解値に近づくように、前記パラメータの値を最適化する、構成2に記載の画像処理装置(1)。
(Configuration 4)
The setting unit (14, 110) is configured to optimize the values of the parameters so that the plurality of processing results approach a plurality of correct values respectively set in advance for the plurality of setting images. The image processing device (1) according to 2.

(構成5)
前記設定部(14,110)は、前記複数の処理結果から得られる特徴量が予め設定された基準値に近づくように、前記パラメータの値を最適化する、構成2に記載の画像処理装置(1)。
(Configuration 5)
The image processing apparatus according to configuration 2, wherein the setting unit (14, 110) optimizes the value of the parameter so that the feature amount obtained from the plurality of processing results approaches a preset reference value. 1).

(構成6)
前記複数の設定用画像(22)の各々には対象物(W)が写り、
前記指定された処理項目は、前段の処理項目から出力された画像に写る前記対象物(W)の属性を判定する項目であり、
前記複数の正解値は、前記複数の設定用画像(22)に写る前記対象物(W)の属性をそれぞれ示す、構成3または4に記載の画像処理装置(1)。
(Configuration 6)
A target object (W) is reflected in each of the plurality of setting images (22),
The specified processing item is an item for determining the attribute of the object (W) appearing in the image output from the previous processing item,
The image processing device (1) according to configuration 3 or 4, wherein the plurality of correct answer values each indicate an attribute of the object (W) shown in the plurality of setting images (22).

(構成7)
前記指定された処理項目は、前段の処理項目から出力された画像から演算される特徴量と前記パラメータの値との比較結果に基づいて、前記対象物の属性を判定する項目である、構成6に記載の画像処理装置(1)。
(Configuration 7)
Configuration 6, wherein the designated processing item is an item for determining an attribute of the object based on a comparison result between a feature amount calculated from an image output from a previous processing item and a value of the parameter. The image processing device (1) described in (1).

(構成8)
前記指定された処理項目は、前記複数の処理済画像(25)を用いた機械学習を行なうことにより生成される学習済モデル(140)を用いて前記対象物(W)の属性を判定する項目であり、
前記パラメータは、前記学習済モデル(140)を定義する、構成6に記載の画像処理装置(1)。
(Configuration 8)
The specified processing item is an item for determining attributes of the object (W) using a learned model (140) generated by performing machine learning using the plurality of processed images (25). and
The image processing device (1) according to configuration 6, wherein the parameters define the learned model (140).

(構成9)
前記複数の設定用画像(22)の各々には、特徴部分(150)を含む対象物(W)が写り、
前記指定された処理項目は、前記特徴部分(150)の写るモデル画像を用いて、前段の処理項目から出力された画像に写る前記特徴部分(150)の位置を検出する項目であり、
前記複数の正解値は、前記複数の設定用画像(22)に写る前記特徴部分(150)の座標をそれぞれ示す、構成3または4に記載の画像処理装置(1)。
(Configuration 9)
Each of the plurality of setting images (22) shows an object (W) including a characteristic part (150),
The specified processing item is an item for detecting the position of the characteristic portion (150) in the image output from the previous processing item using a model image in which the characteristic portion (150) is reflected;
The image processing device (1) according to configuration 3 or 4, wherein the plurality of correct answer values each indicate the coordinates of the characteristic portion (150) shown in the plurality of setting images (22).

(構成10)
前記複数の設定用画像(22)の各々にはテキストが写り、
前記指定された処理項目は、前段の処理項目から出力された画像に写る前記テキストの文字認識を行なう項目であり、
前記複数の正解値は、前記複数の設定用画像(22)に写る前記テキストをそれぞれ示す、構成3または4に記載の画像処理装置(1)。
(Configuration 10)
Text appears in each of the plurality of setting images (22),
The specified processing item is an item for character recognition of the text appearing in the image output from the previous processing item,
The image processing device (1) according to configuration 3 or 4, wherein the plurality of correct answer values each indicate the text appearing in the plurality of setting images (22).

(構成11)
複数の処理項目(31~36)が実行順序に従って並べられた画像処理フロー(30)を実行する画像処理装置(1)の制御方法であって、
前記複数の処理項目(31~36)のうち指定された処理項目の実行に用いられるパラメータの値の設定指示の入力に応じて、複数の設定用画像(22)に対して前記画像処理フローの一部または全部を実行することにより、前記指定された処理項目の前段までの処理項目が実行された複数の処理済画像(25)をそれぞれ生成するステップと、
前記複数の処理済画像を用いて前記パラメータの値を設定するステップとを備える、制御方法。
(Configuration 11)
A method for controlling an image processing device (1) that executes an image processing flow (30) in which a plurality of processing items (31 to 36) are arranged in an execution order, the method comprising:
The image processing flow is applied to the plurality of setting images (22) in response to the input of an instruction to set the value of a parameter used to execute a specified processing item among the plurality of processing items (31 to 36). generating each of a plurality of processed images (25) in which processing items up to the stage preceding the specified processing item have been executed by executing some or all of them;
and setting a value of the parameter using the plurality of processed images.

(構成12)
構成11に記載の制御方法をコンピュータに実行させるプログラム(121)。
(Configuration 12)
A program (121) that causes a computer to execute the control method described in Configuration 11.

本発明の実施の形態について説明したが、今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 Although the embodiments of the present invention have been described, the embodiments disclosed this time should be considered to be illustrative in all respects and not restrictive. The scope of the present invention is indicated by the claims, and it is intended that all changes within the meaning and range equivalent to the claims are included.

1 画像処理装置、2 外部ストレージ、3 カメラ、4 XYステージ、6 表示装置、7 入力装置、8 欠陥、11 フロー作成部、12 管理部、13 生成部、14 設定部、16 フロー実行部、20 記憶部、21 フローデータ、22,22a~22d 設定用画像、23 管理データ、24 設定データ、25 処理済画像、30,30A~30C,50 画像処理フロー、31~36,31A~31C,32A~32C,33A~33C,34A~34C,35A~35C,36A~36C,37A~39A,41 処理項目、40 画像収集用フロー、51 分岐ポイント、60,60A,60B 画面、61,62,67,68,70,72,74,78,79,86,88 ボタン、63,81,91 リスト、63a,73a,81a,82a,91a カーソル、64,76,77,83,84,85,95~97,170 領域、64a 枠線、65 アイコン群、66 ボタン群、69,71,80 タブ、73,82 テーブル、75,75A,75B,87 ウィンドウ、94 最適情報、106 メモリカード、110 プロセッサ、112 RAM、114 表示コントローラ、116 システムコントローラ、118 I/Oコントローラ、120 ハードディスク、121 制御プログラム、122 カメラインターフェイス、124 入力インターフェイス、126 PLCインターフェイス、128 通信インターフェイス、130 メモリカードインターフェイス、140 学習済モデル、150 マーク、160 基準画像、180 印字面、SYS 画像処理システム、W ワーク。 1 Image processing device, 2 External storage, 3 Camera, 4 XY stage, 6 Display device, 7 Input device, 8 Defect, 11 Flow creation section, 12 Management section, 13 Generation section, 14 Setting section, 16 Flow execution section, 20 Storage unit, 21 Flow data, 22, 22a to 22d Setting image, 23 Management data, 24 Setting data, 25 Processed image, 30, 30A to 30C, 50 Image processing flow, 31 to 36, 31A to 31C, 32A to 32C, 33A to 33C, 34A to 34C, 35A to 35C, 36A to 36C, 37A to 39A, 41 Processing item, 40 Image collection flow, 51 Branch point, 60, 60A, 60B Screen, 61, 62, 67, 68 , 70, 72, 74, 78, 79, 86, 88 Button, 63, 81, 91 List, 63a, 73a, 81a, 82a, 91a Cursor, 64, 76, 77, 83, 84, 85, 95-97, 170 area, 64a frame line, 65 icon group, 66 button group, 69, 71, 80 tab, 73, 82 table, 75, 75A, 75B, 87 window, 94 optimal information, 106 memory card, 110 processor, 112 RAM, 114 display controller, 116 system controller, 118 I/O controller, 120 hard disk, 121 control program, 122 camera interface, 124 input interface, 126 PLC interface, 128 communication interface, 130 memory card interface, 140 learned model, 150 mark, 160 reference image, 180 printing surface, SYS image processing system, W work.

Claims (12)

複数の処理項目が実行順序に従って並べられた画像処理フローを実行する画像処理装置であって、
前記複数の処理項目のうち指定された処理項目の実行に用いられるパラメータの設定指示の入力に応じて、複数の設定用画像に対して前記画像処理フローの一部または全部を実行することにより、前記指定された処理項目の前段までの処理項目が実行された複数の処理済画像をそれぞれ生成する生成部と、
前記複数の処理済画像を用いて前記パラメータの値を設定する設定部とを備える、画像処理装置。
An image processing apparatus that executes an image processing flow in which a plurality of processing items are arranged in an execution order,
By executing part or all of the image processing flow on a plurality of setting images in response to an input of a parameter setting instruction used for executing a specified processing item among the plurality of processing items, a generation unit that generates each of a plurality of processed images in which processing items up to the stage preceding the specified processing item are executed;
An image processing apparatus, comprising: a setting section that sets values of the parameters using the plurality of processed images.
前記設定部は、
前記パラメータが取りうる複数の値の各々について、当該値を用いて、前記複数の処理済画像に対して前記指定された処理項目を実行することにより複数の処理結果をそれぞれ取得し、
前記複数の処理結果に基づいて前記複数の値の中から選択された値を前記パラメータの値として設定する、請求項1に記載の画像処理装置。
The setting section includes:
For each of the plurality of values that the parameter can take, each of the plurality of processing results is obtained by executing the specified processing item on the plurality of processed images using the value,
The image processing apparatus according to claim 1, wherein a value selected from the plurality of values based on the plurality of processing results is set as the value of the parameter.
前記設定部は、
前記複数の処理結果と、前記複数の設定用画像に対してそれぞれ予め設定された複数の正解値との差分を示す差分情報を生成し、
前記複数の値の各々と前記差分情報との対応関係を表示装置に表示させ、
前記複数の値の中から選択指示を受けた値を、前記パラメータの値として設定する、請求項2に記載の画像処理装置。
The setting section includes:
generating difference information indicating a difference between the plurality of processing results and a plurality of correct answer values respectively set in advance for the plurality of setting images;
displaying a correspondence relationship between each of the plurality of values and the difference information on a display device;
3. The image processing apparatus according to claim 2, wherein a value selected from among the plurality of values is set as the value of the parameter.
前記設定部は、前記複数の処理結果が、前記複数の設定用画像に対してそれぞれ予め設定された複数の正解値に近づくように、前記パラメータの値を最適化する、請求項2に記載の画像処理装置。 The setting unit optimizes the values of the parameters so that the plurality of processing results approach a plurality of correct values respectively set in advance for the plurality of setting images. Image processing device. 前記設定部は、前記複数の処理結果から得られる特徴量が予め設定された基準値に近づくように、前記パラメータの値を最適化する、請求項2に記載の画像処理装置。 The image processing apparatus according to claim 2, wherein the setting unit optimizes the value of the parameter so that the feature amount obtained from the plurality of processing results approaches a preset reference value. 前記複数の設定用画像の各々には対象物が写り、
前記指定された処理項目は、前段の処理項目から出力された画像に写る前記対象物の属性を判定する項目であり、
前記複数の正解値は、前記複数の設定用画像に写る前記対象物の属性をそれぞれ示す、請求項3または4に記載の画像処理装置。
Each of the plurality of setting images includes a target object;
The specified processing item is an item for determining the attribute of the object appearing in the image output from the previous processing item,
The image processing device according to claim 3 or 4, wherein the plurality of correct values each indicate an attribute of the object appearing in the plurality of setting images.
前記指定された処理項目は、前段の処理項目から出力された画像から演算される特徴量と前記パラメータの値との比較結果に基づいて、前記対象物の属性を判定する項目である、請求項6に記載の画像処理装置。 The specified processing item is an item for determining an attribute of the object based on a comparison result between a feature amount calculated from an image output from a previous processing item and a value of the parameter. 6. The image processing device according to 6. 前記指定された処理項目は、前記複数の処理済画像を用いた機械学習を行なうことにより生成される学習済モデルを用いて前記対象物の属性を判定する項目であり、
前記パラメータは、前記学習済モデルを定義する、請求項6に記載の画像処理装置。
The specified processing item is an item for determining an attribute of the object using a learned model generated by performing machine learning using the plurality of processed images,
The image processing device according to claim 6, wherein the parameters define the learned model.
前記複数の設定用画像の各々には、特徴部分を含む対象物が写り、
前記指定された処理項目は、前記特徴部分の写るモデル画像を用いて、前段の処理項目から出力された画像に写る前記特徴部分の位置を検出する項目であり、
前記複数の正解値は、前記複数の設定用画像に写る前記特徴部分の座標をそれぞれ示す、請求項3または4に記載の画像処理装置。
Each of the plurality of setting images depicts an object including a characteristic part,
The specified processing item is an item for detecting the position of the characteristic portion appearing in the image output from the previous processing item using a model image in which the characteristic portion is reflected;
5. The image processing apparatus according to claim 3, wherein the plurality of correct values each indicate coordinates of the characteristic portion shown in the plurality of setting images.
前記複数の設定用画像の各々にはテキストが写り、
前記指定された処理項目は、前段の処理項目から出力された画像に写る前記テキストの文字認識を行なう項目であり、
前記複数の正解値は、前記複数の設定用画像に写る前記テキストをそれぞれ示す、請求項3または4に記載の画像処理装置。
Each of the plurality of setting images includes text;
The specified processing item is an item for character recognition of the text appearing in the image output from the previous processing item,
The image processing apparatus according to claim 3 , wherein the plurality of correct answer values each indicate the text appearing in the plurality of setting images.
複数の処理項目が実行順序に従って並べられた画像処理フローを実行する画像処理装置の制御方法であって、
前記複数の処理項目のうち指定された処理項目の実行に用いられるパラメータの値の設定指示の入力に応じて、複数の設定用画像に対して前記画像処理フローの一部または全部を実行することにより、前記指定された処理項目の前段までの処理項目が実行された複数の処理済画像をそれぞれ生成するステップと、
前記複数の処理済画像を用いて前記パラメータの値を設定するステップとを備える、制御方法。
A method for controlling an image processing apparatus that executes an image processing flow in which a plurality of processing items are arranged in an execution order, the method comprising:
Executing part or all of the image processing flow on the plurality of setting images in response to input of a setting instruction for a value of a parameter used to execute a specified processing item among the plurality of processing items. generating a plurality of processed images in which processing items up to the stage preceding the specified processing item have been executed, respectively;
and setting a value of the parameter using the plurality of processed images.
請求項11に記載の制御方法をコンピュータに実行させるプログラム。 A program that causes a computer to execute the control method according to claim 11.
JP2020035235A 2020-03-02 2020-03-02 Image processing device, control method and program for the image processing device Active JP7380332B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020035235A JP7380332B2 (en) 2020-03-02 2020-03-02 Image processing device, control method and program for the image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020035235A JP7380332B2 (en) 2020-03-02 2020-03-02 Image processing device, control method and program for the image processing device

Publications (2)

Publication Number Publication Date
JP2021140270A JP2021140270A (en) 2021-09-16
JP7380332B2 true JP7380332B2 (en) 2023-11-15

Family

ID=77668596

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020035235A Active JP7380332B2 (en) 2020-03-02 2020-03-02 Image processing device, control method and program for the image processing device

Country Status (1)

Country Link
JP (1) JP7380332B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2024000600A (en) * 2022-06-21 2024-01-09 株式会社日立ハイテク Discriminator generation apparatus and image diagnosis support apparatus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010191939A (en) 2009-01-21 2010-09-02 Omron Corp Apparatus and program for parameter decision support
JP2010205007A (en) 2009-03-04 2010-09-16 Omron Corp Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010191939A (en) 2009-01-21 2010-09-02 Omron Corp Apparatus and program for parameter decision support
JP2010205007A (en) 2009-03-04 2010-09-16 Omron Corp Model image acquisition support apparatus, model image acquisition support method, and model image acquisition support program

Also Published As

Publication number Publication date
JP2021140270A (en) 2021-09-16

Similar Documents

Publication Publication Date Title
JP5228490B2 (en) Defect inspection equipment that performs defect inspection by image analysis
JP6745173B2 (en) Image inspection apparatus, image inspection method, image inspection program, computer-readable recording medium, and recorded device
TWI787296B (en) Optical inspection method, optical inspection device and optical inspection system
JP3834041B2 (en) Learning type classification apparatus and learning type classification method
US7409081B2 (en) Apparatus and computer-readable medium for assisting image classification
JP4616120B2 (en) Image processing apparatus and inspection apparatus
JP2000057349A (en) Method for sorting defect, device therefor and method for generating data for instruction
JP3660763B2 (en) Inspection pattern inspection method, manufacturing process diagnosis method, and semiconductor substrate manufacturing method
JP6287248B2 (en) Appearance inspection apparatus, appearance inspection method, and program
JP4442119B2 (en) Image recognition apparatus and image recognition method, and teaching apparatus and teaching method of image recognition apparatus
JP2007285754A (en) Flaw detection method and flaw detector
US6718074B1 (en) Method and apparatus for inspection for under-resolved features in digital images
CN104103069B (en) Image processing apparatus, image processing method and recording medium
JP2010071951A (en) Visual inspection device and visual inspection method
JP7380332B2 (en) Image processing device, control method and program for the image processing device
WO2014208193A1 (en) Wafer appearance inspection device
JP2010133744A (en) Defect detection method, and visual inspection device using the same
WO2021192376A1 (en) Visual inspection system and computer program
US8358831B2 (en) Probe mark inspection
JP6049052B2 (en) Wafer visual inspection apparatus and sensitivity threshold setting method in wafer visual inspection apparatus
JP4247993B2 (en) Image inspection apparatus, image inspection method, control program, and readable storage medium
US20080240545A1 (en) Inspection Assistance System, Data Processing Equipment, and Data Processing Method
JP5934516B2 (en) Inspection area display device and inspection area display method
JP2006145228A (en) Unevenness defect detecting method and unevenness defect detector
JP6965693B2 (en) Image processing equipment, image processing methods, and image processing programs

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230111

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230914

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231016

R150 Certificate of patent or registration of utility model

Ref document number: 7380332

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150